StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Stl3CounterMaker.h
1 //
2 // $Id: Stl3CounterMaker.h,v 1.5 2014/08/06 11:44:00 jeromel Exp $
3 //
4 // $Log: Stl3CounterMaker.h,v $
5 // Revision 1.5 2014/08/06 11:44:00 jeromel
6 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
7 //
8 // Revision 1.4 2003/09/10 19:47:55 perev
9 // ansi corrs
10 //
11 // Revision 1.3 2002/03/07 22:03:41 struck
12 // major update: using new NotifyMe() to get input filename, allows to run on
13 // more than one input file in a chain, two output tables separated into two files
14 // and put into dedicated dir StarDb/RunLog_l3
15 //
16 // Revision 1.2 2002/02/20 22:09:49 struck
17 // added some debugging info
18 //
19 // Revision 1.1 2002/02/13 22:36:31 struck
20 // major code clean-up for Stl3RawReaderMaker, first version of Stl3CounterMaker
21 //
22 //
23 
24 
25 #ifndef STAR_Stl3CounterMaker
26 #define STAR_Stl3CounterMaker
27 
29 // //
30 // Stl3CounterMaker //
31 // //
32 // calculates trigger counters //
33 // - nProcessed //
34 // - nAccepted //
35 // - nBuild //
36 // for each l3 algorithm switched on for the given run //
37 // and the global counters //
38 // - nProcessed //
39 // - nReconstructed //
40 // and writes this to the database on a daq-file basis //
41 // //
43 
44 
45 #ifndef StMaker_H
46 #include "StMaker.h"
47 #endif
48 
49 #include "StDAQMaker/StDAQReader.h"
50 #include "TString.h"
51 
52 
53 // global upper limits
54 // correct numbers should come from the database
55 #define MaxNumberOfGl3Nodes 10
56 #define MaxNumberOfAlgorithms 20
57 
58 #define IntParameterSize 5
59 #define FloatParameterSize 5
60 
61 // some foreward declaration since includes don't work
62 // in these cases
63 class St_l3GlobalCounter;
64 class St_l3AlgorithmCount;
65 
66 
67 // ol' fashioned structs for counter bookkeeping
69  int algId;
70  int nProcessed;
71  int nAccept;
72  int nBuild;
73 };
74 
75 struct GlobalCounter {
76  int nProcessed;
77  int nReconstructed;
78 };
79 
80 
81 class Stl3CounterMaker : public StMaker {
82 
83  private:
84  // General stuff
85  TDataSet* DAQReaderSet;
86  StL3Reader* ml3reader;
87  TString mDaqFileName;
88  TString* mDbTableFileName;
89  int mDaqFileSequenceNumber;
90  int mRunNumber;
91 
92 
93  // Database
94  TDataSet* mDbSet;
95  St_l3GlobalCounter* mGlobalCounterTable;
96  St_l3AlgorithmCount* mAlgorithmCounterTable;
97 
98  // switches
99  bool mL3On;
100  bool mStoreDbTables;
101 
102  // counter
103  GlobalCounter mGlobalCounter[MaxNumberOfGl3Nodes];
104  AlgorithmCounter mAlgorithmCounter[MaxNumberOfGl3Nodes][MaxNumberOfAlgorithms];
105 
106  int mNumberOfGl3Nodes;
107  int mNumberOfAlgorithms;
108  int mEventCounter;
109 
110  public:
111  Stl3CounterMaker(const char *name="l3Counter");
112  virtual ~Stl3CounterMaker();
113  virtual Int_t Init();
114  virtual Int_t Make();
115  virtual void NotifyMe(const char *about, const void *info);
116  virtual Int_t GetCounters();
117  virtual Int_t WriteTable();
118  virtual Int_t InitTable();
119  virtual Int_t Finish();
120 
121  virtual const char *GetCVS() const
122  {static const char cvs[]="Tag $Name: $ $Id: Stl3CounterMaker.h,v 1.5 2014/08/06 11:44:00 jeromel Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
123 
124  ClassDef(Stl3CounterMaker,0) //StAF chain virtual base class for Makers
125 };
126 
127 #endif
virtual Int_t Finish()
virtual Int_t Make()