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

Last change on this file since 2592 was 2592, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.6 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}
44
45Bool_t MReportTrigger::InterpreteBody(TString &str)
46{
47 str = str.Strip(TString::kLeading);
48
49 const Int_t ws = str.First(' ');
50 if (ws<=0)
51 {
52 *fLog << err << "ERROR - Cannot determin name of trigger table." << endl;
53 return kFALSE;
54 }
55
56 TString tablename = str(0, ws);
57 str.Remove(0, ws);
58
59 Int_t len, n;
60
61 const char *pos = str.Data();
62 for (int i=0; i<19; i++)
63 {
64 n = sscanf(pos, " %f %n", &fPrescalerRates[i], &len);
65 if (n!=1)
66 {
67 *fLog << err << "ERROR - Scaler Value #" << i << " missing." << endl;
68 return kFALSE;
69 }
70 pos += len;
71 }
72 n = sscanf(pos, " %f %f %n", &fL2BeforePrescaler, &fL2AfterPrescaler, &len);
73 if (n!=2)
74 {
75 *fLog << err << "ERROR - Couldn't read Trigger rates." << endl;
76 return kFALSE;
77 }
78 pos += len;
79 for (int i=0; i<11; i++)
80 {
81 Float_t dummy;
82 n = sscanf(pos, " %f %n", &dummy/*fRates[i]*/, &len);
83 if (n!=1)
84 {
85 *fLog << err << "ERROR - Rate #" << i << " missing." << endl;
86 return kFALSE;
87 }
88 pos += len;
89 }
90 str.Remove(0, pos-str.Data());
91 str.Strip(TString::kBoth);
92
93 return str==(TString)"OVER";
94}
Note: See TracBrowser for help on using the repository browser.