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

Last change on this file since 2523 was 2520, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.5 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")
39{
40 fName = "MReportTrigger";
41}
42
43Bool_t MReportTrigger::InterpreteBody(TString &str)
44{
45 str = str.Strip(TString::kLeading);
46 Int_t pos = str.First(' ');
47 if (pos<=0)
48 {
49 *fLog << err << "ERROR - Cannot determin name of trigger table." << endl;
50 return kFALSE;
51 }
52
53 TString tablename = str(0, pos);
54 str.Remove(0, pos);
55
56 Int_t len, n;
57
58 pos = 0;
59 for (int i=0; i<19; i++)
60 {
61 n = sscanf(str.Data()+pos, " %f %n", &fScalerRate[i], &len);
62 if (n!=1)
63 {
64 *fLog << err << "ERROR - Scaler Value #" << i << " missing." << endl;
65 return kFALSE;
66 }
67 pos += len;
68 }
69 n = sscanf(str.Data()+pos, " %f %f %n", &fL1TriggerRate,
70 &fL2TriggerRate, &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 n = sscanf(str.Data()+pos, " %f %n", &fRates[i], &len);
80 if (n!=1)
81 {
82 *fLog << err << "ERROR - Rate #" << i << " missing." << endl;
83 return kFALSE;
84 }
85 pos += len;
86 }
87 str.Remove(0, pos);
88 str.Strip(TString::kBoth);
89
90 *fLog << "T" << flush;
91
92 return str==(TString)"OVER";
93}
Note: See TracBrowser for help on using the repository browser.