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

Last change on this file since 2591 was 2556, 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//////////////////////////////////////////////////////////////////////////////
30#include "MReportTrigger.h"
31
32#include "MLogManip.h"
33
34ClassImp(MReportTrigger);
35
36using namespace std;
37
38MReportTrigger::MReportTrigger() : MReport("TRIGGER-REPORT"), fPrescalerRates(19)//, fRates(11)
39{
40 fName = "MReportTrigger";
41}
42
43Bool_t MReportTrigger::InterpreteBody(TString &str)
44{
45 str = str.Strip(TString::kLeading);
46
47 const Int_t ws = str.First(' ');
48 if (ws<=0)
49 {
50 *fLog << err << "ERROR - Cannot determin name of trigger table." << endl;
51 return kFALSE;
52 }
53
54 TString tablename = str(0, ws);
55 str.Remove(0, ws);
56
57 Int_t len, n;
58
59 const char *pos = str.Data();
60 for (int i=0; i<19; i++)
61 {
62 n = sscanf(pos, " %f %n", &fPrescalerRates[i], &len);
63 if (n!=1)
64 {
65 *fLog << err << "ERROR - Scaler Value #" << i << " missing." << endl;
66 return kFALSE;
67 }
68 pos += len;
69 }
70 n = sscanf(pos, " %f %f %n", &fL2BeforePrescaler, &fL2AfterPrescaler, &len);
71 if (n!=2)
72 {
73 *fLog << err << "ERROR - Couldn't read Trigger rates." << endl;
74 return kFALSE;
75 }
76 pos += len;
77 for (int i=0; i<11; i++)
78 {
79 Float_t dummy;
80 n = sscanf(pos, " %f %n", &dummy/*fRates[i]*/, &len);
81 if (n!=1)
82 {
83 *fLog << err << "ERROR - Rate #" << i << " missing." << endl;
84 return kFALSE;
85 }
86 pos += len;
87 }
88 str.Remove(0, pos-str.Data());
89 str.Strip(TString::kBoth);
90
91 return str==(TString)"OVER";
92}
Note: See TracBrowser for help on using the repository browser.