source: trunk/MagicSoft/Mars/mreport/MReportRun.cc@ 3378

Last change on this file since 3378 was 2892, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.3 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 12/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24
25//////////////////////////////////////////////////////////////////////////////
26//
27// MReportRun
28//
29// This is the class interpreting and storing the RUN-REPORT information.
30//
31// PRELIMINARY!
32//
33//////////////////////////////////////////////////////////////////////////////
34#include "MReportRun.h"
35
36#include "MLogManip.h"
37
38#include "MAstro.h"
39
40ClassImp(MReportRun);
41
42using namespace std;
43
44// --------------------------------------------------------------------------
45//
46// Default construtor. Initialize identifier to "RUN-REPORT" No subsystem
47// is expected.
48//
49MReportRun::MReportRun() : MReport("RUN-REPORT", kFALSE), fRunNumber(0)
50{
51 fName = "MReportRun";
52 fTitle = "Class for RUN-REPORT information";
53}
54
55// --------------------------------------------------------------------------
56//
57// Interprete the body of the RUN-REPORT string
58//
59Int_t MReportRun::InterpreteBody(TString &str)
60{
61 Int_t len;
62 const Int_t n=sscanf(str.Data(), "%d %n", &fRunNumber, &len);
63 if (n!=1)
64 {
65 *fLog << warn << "WARNING - Wrong number of arguments." << endl;
66 return kCONTINUE;
67 }
68 str.Remove(0, len);
69
70 if (str.BeginsWith("END"))
71 fRunNumber = -1;
72
73 str.Remove(0, 6);
74 str = str.Strip(TString::kBoth);
75 Ssiz_t pos = str.First(' ');
76 if (pos<0)
77 pos = str.Length();
78 fSourceName = str(0, pos+1);
79
80 return kTRUE;
81}
Note: See TracBrowser for help on using the repository browser.