source: trunk/MagicSoft/Mars/mreport/MReportTrigger.cc@ 2709

Last change on this file since 2709 was 2593, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.7 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, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24
25//////////////////////////////////////////////////////////////////////////////
26//
27// MReportTrigger
28//
29// This is the class interpreting and storing the TRIGGER-REPORT information.
30//
31//////////////////////////////////////////////////////////////////////////////
32#include "MReportTrigger.h"
33
34#include "MLogManip.h"
35
36ClassImp(MReportTrigger);
37
38using namespace std;
39
40MReportTrigger::MReportTrigger() : MReport("TRIGGER-REPORT"), fPrescalerRates(19)
41{
42 fName = "MReportTrigger";
43 fTitle = "Class for TRIGGER-REPORT information";
44}
45
46Bool_t MReportTrigger::InterpreteBody(TString &str)
47{
48 str = str.Strip(TString::kLeading);
49
50 const Int_t ws = str.First(' ');
51 if (ws<=0)
52 {
53 *fLog << err << "ERROR - Cannot determin name of trigger table." << endl;
54 return kFALSE;
55 }
56
57 TString tablename = str(0, ws);
58 str.Remove(0, ws);
59
60 Int_t len, n;
61
62 const char *pos = str.Data();
63 for (int i=0; i<19; i++)
64 {
65 n = sscanf(pos, " %f %n", &fPrescalerRates[i], &len);
66 if (n!=1)
67 {
68 *fLog << err << "ERROR - Scaler Value #" << i << " missing." << endl;
69 return kFALSE;
70 }
71 pos += len;
72 }
73 n = sscanf(pos, " %f %f %n", &fL2BeforePrescaler, &fL2AfterPrescaler, &len);
74 if (n!=2)
75 {
76 *fLog << err << "ERROR - Couldn't read Trigger rates." << endl;
77 return kFALSE;
78 }
79 pos += len;
80 for (int i=0; i<11; i++)
81 {
82 Float_t dummy;
83 n = sscanf(pos, " %f %n", &dummy/*fRates[i]*/, &len);
84 if (n!=1)
85 {
86 *fLog << err << "ERROR - Rate #" << i << " missing." << endl;
87 return kFALSE;
88 }
89 pos += len;
90 }
91 str.Remove(0, pos-str.Data());
92 str.Strip(TString::kBoth);
93
94 return str==(TString)"OVER";
95}
Note: See TracBrowser for help on using the repository browser.