1 |
mocchiut |
1.1 |
/** @file |
2 |
mocchiut |
1.2 |
* $Source: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/event/EventCounter.h,v $ |
3 |
mocchiut |
1.5 |
* $Id: EventCounter.h,v 1.4 2009/08/04 13:58:16 mocchiut Exp $ |
4 |
mocchiut |
1.2 |
* $Author: mocchiut $ |
5 |
mocchiut |
1.1 |
* |
6 |
|
|
* Header file for the EventCounter class. |
7 |
|
|
*/ |
8 |
|
|
#ifndef EVENTCOUNTER_H |
9 |
|
|
#define EVENTCOUNTER_H |
10 |
|
|
|
11 |
|
|
#include "Exception.h" |
12 |
|
|
#include "PacketType.h" |
13 |
|
|
#include <TObject.h> |
14 |
mocchiut |
1.4 |
#include <TClonesArray.h> |
15 |
mocchiut |
1.1 |
|
16 |
|
|
namespace pamela { |
17 |
mocchiut |
1.4 |
|
18 |
|
|
class mapval: public TObject { |
19 |
|
|
private: |
20 |
|
|
|
21 |
|
|
public: |
22 |
|
|
mapval(); |
23 |
mocchiut |
1.5 |
~mapval(){this->Clear();}; |
24 |
mocchiut |
1.4 |
mapval(TString n, Int_t *i); |
25 |
|
|
mapval(const mapval &val); |
26 |
|
|
// Int_t fN; // |
27 |
|
|
Int_t *count; //! |
28 |
|
|
TString name; //! |
29 |
|
|
void Clear(Option_t *t="") { t="";}; |
30 |
|
|
mapval* GetMapVal(){return this;}; |
31 |
|
|
ClassDef(mapval, 0); |
32 |
|
|
}; |
33 |
|
|
|
34 |
|
|
class mappa: public TObject { |
35 |
|
|
private: |
36 |
|
|
Bool_t fend; |
37 |
|
|
Int_t entries; |
38 |
|
|
TClonesArray *val; |
39 |
|
|
|
40 |
|
|
public: |
41 |
|
|
mappa(); |
42 |
|
|
void Clear(Option_t *t=""); |
43 |
|
|
void Delete(Option_t *t=""); |
44 |
|
|
// |
45 |
|
|
int GetEntries(){ return val->GetEntries();}; |
46 |
|
|
void Insert(TString, Int_t *); |
47 |
|
|
mapval* Find(TString); |
48 |
|
|
mapval* Get(Int_t i){ return ((mapval*)val->At(i));}; |
49 |
|
|
Bool_t end(){ return fend;}; |
50 |
|
|
void Set(); |
51 |
|
|
ClassDef(mappa, 1); |
52 |
|
|
}; |
53 |
|
|
|
54 |
|
|
|
55 |
mocchiut |
1.1 |
/** |
56 |
|
|
* Event counter. Contains the event numbers of the last read event of |
57 |
|
|
* each event type. |
58 |
|
|
*/ |
59 |
|
|
class EventCounter : public TObject { |
60 |
|
|
private: |
61 |
mocchiut |
1.2 |
|
62 |
mocchiut |
1.3 |
int RunNumber; /**< Run number */ |
63 |
mocchiut |
1.1 |
int Pscu; |
64 |
|
|
int PhysEndRun; |
65 |
|
|
int CalibCalPulse1; |
66 |
|
|
int CalibCalPulse2; |
67 |
|
|
int Physics; |
68 |
|
|
int CalibTrkBoth; |
69 |
|
|
int CalibTrk1; |
70 |
|
|
int CalibTrk2; |
71 |
|
|
int CalibCal; |
72 |
|
|
int CalibTof; |
73 |
|
|
int CalibS4; |
74 |
|
|
int CalibCalPed; |
75 |
|
|
int Calib1_Ac1; |
76 |
|
|
int Calib1_Ac2; |
77 |
|
|
int Calib2_Ac1; |
78 |
|
|
int Calib2_Ac2; |
79 |
|
|
int RunHeader; |
80 |
|
|
int RunTrailer; |
81 |
|
|
int CalibHeader; |
82 |
|
|
int CalibTrailer; |
83 |
|
|
int InitHeader; |
84 |
|
|
int InitTrailer; |
85 |
|
|
int EventTrk; |
86 |
|
|
int Log; |
87 |
|
|
int VarDump; |
88 |
|
|
int ArrDump; |
89 |
|
|
int TabDump; |
90 |
|
|
int Tmtc; |
91 |
|
|
int Mcmd; |
92 |
|
|
int ForcedFECmd; |
93 |
|
|
int Ac1Init; |
94 |
|
|
int CalInit; |
95 |
|
|
int TrkInit; |
96 |
|
|
int TofInit; |
97 |
|
|
int TrgInit; |
98 |
|
|
int NdInit; |
99 |
|
|
int S4Init; |
100 |
|
|
int Ac2Init; |
101 |
|
|
int CalAlarm; |
102 |
|
|
int Ac1Alarm; |
103 |
|
|
int TrkAlarm; |
104 |
|
|
int TrgAlarm; |
105 |
|
|
int TofAlarm; |
106 |
|
|
int S4Alarm; |
107 |
|
|
int Ac2Alarm; |
108 |
|
|
int TsbT; |
109 |
|
|
int TsbB; |
110 |
|
|
|
111 |
mocchiut |
1.4 |
mappa CMap; |
112 |
|
|
|
113 |
mocchiut |
1.1 |
public: |
114 |
|
|
EventCounter(int = 0); |
115 |
|
|
/** Get the run number for the last read event of this type. */ |
116 |
|
|
int getPscu() const { return Pscu; }; |
117 |
|
|
/** Get the run number for the last read event of this type. */ |
118 |
mocchiut |
1.4 |
int Get(pamela::PacketType const *) throw (NotExistingCounterException); |
119 |
mocchiut |
1.1 |
/** Get the run number for the next event of this type. */ |
120 |
mocchiut |
1.4 |
int Next(pamela::PacketType const *) throw (NotExistingCounterException); |
121 |
mocchiut |
1.1 |
int GetRunNumber(void) const { return RunNumber; } |
122 |
|
|
void Increment(pamela::PacketType const *) throw (NotExistingCounterException); |
123 |
mocchiut |
1.4 |
void PrintCounters(); |
124 |
|
|
ClassDef(EventCounter, 9) |
125 |
mocchiut |
1.1 |
}; |
126 |
|
|
} |
127 |
|
|
|
128 |
|
|
#endif /* EVENTCOUNTER_H */ |
129 |
|
|
|
130 |
|
|
|