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 |
|
---|
40 | ClassImp(MReportRun);
|
---|
41 |
|
---|
42 | using namespace std;
|
---|
43 |
|
---|
44 | MReportRun::MReportRun() : MReport("RUN-REPORT", kFALSE), fRunNumber(0)
|
---|
45 | {
|
---|
46 | fName = "MReportRun";
|
---|
47 | fTitle = "Class for RUN-REPORT information";
|
---|
48 | }
|
---|
49 |
|
---|
50 | Bool_t MReportRun::InterpreteBody(TString &str)
|
---|
51 | {
|
---|
52 | // Remove the 30 tokens of the subsystem status
|
---|
53 | // table 12.1 p59
|
---|
54 | for (int i=0; i<30; i++)
|
---|
55 | str.Remove(0, str.First(' ')+1);
|
---|
56 |
|
---|
57 | Int_t len;
|
---|
58 | const Int_t n=sscanf(str.Data(), "%d %n", &fRunNumber, &len);
|
---|
59 | if (n!=1)
|
---|
60 | {
|
---|
61 | *fLog << err << "ERROR - Wrong number of arguments." << endl;
|
---|
62 | return kFALSE;
|
---|
63 | }
|
---|
64 | str.Remove(0, len);
|
---|
65 |
|
---|
66 | if (str.BeginsWith("END"))
|
---|
67 | fRunNumber = -1;
|
---|
68 |
|
---|
69 | str.Remove(0, 6);
|
---|
70 | str = str.Strip(TString::kBoth);
|
---|
71 | fSourceName = str(0, str.First(' ')+1);
|
---|
72 |
|
---|
73 | return kTRUE;
|
---|
74 | }
|
---|