1 |
kusanagi |
2.4 |
/** @file |
2 |
kusanagi |
1.2 |
* $Source: /home/cvsmanager/yoda/event/EventCounter.h,v $ |
3 |
kusanagi |
6.2 |
* $Id: EventCounter.h,v 6.1 2006/02/15 15:47:14 kusanagi Exp $ |
4 |
kusanagi |
6.0 |
* $Author: kusanagi $ |
5 |
kusanagi |
1.1 |
* |
6 |
|
|
* Header file for the EventCounter class. |
7 |
|
|
*/ |
8 |
|
|
#ifndef EVENTCOUNTER_H |
9 |
|
|
#define EVENTCOUNTER_H |
10 |
|
|
|
11 |
|
|
#include <map> |
12 |
kusanagi |
2.2 |
#include "Exception.h" |
13 |
kusanagi |
5.1 |
#include "PacketType.h" |
14 |
|
|
#include <TObject.h> |
15 |
kusanagi |
1.1 |
|
16 |
|
|
namespace pamela { |
17 |
|
|
/** |
18 |
|
|
* Event counter. Contains the event numbers of the last read event of |
19 |
|
|
* each event type. |
20 |
|
|
*/ |
21 |
|
|
class EventCounter : public TObject { |
22 |
|
|
private: |
23 |
|
|
int RunNumber; /**< Run number */ |
24 |
kusanagi |
1.5 |
|
25 |
kusanagi |
1.1 |
int Pscu; |
26 |
kusanagi |
1.5 |
int PhysEndRun; |
27 |
|
|
int CalibCalPulse1; |
28 |
|
|
int CalibCalPulse2; |
29 |
kusanagi |
1.1 |
int Physics; |
30 |
kusanagi |
6.2 |
int CalibTrkBoth; |
31 |
kusanagi |
2.5 |
int CalibTrk1; |
32 |
|
|
int CalibTrk2; |
33 |
|
|
int CalibCal; |
34 |
|
|
int CalibTof; |
35 |
|
|
int CalibS4; |
36 |
|
|
int CalibCalPed; |
37 |
kusanagi |
2.4 |
int Calib1_Ac1; |
38 |
|
|
int Calib1_Ac2; |
39 |
|
|
int Calib2_Ac1; |
40 |
|
|
int Calib2_Ac2; |
41 |
kusanagi |
2.5 |
int RunHeader; |
42 |
|
|
int RunTrailer; |
43 |
kusanagi |
1.5 |
int CalibHeader; |
44 |
|
|
int CalibTrailer; |
45 |
|
|
int InitHeader; |
46 |
|
|
int InitTrailer; |
47 |
kusanagi |
6.1 |
int EventTrk; |
48 |
kusanagi |
1.1 |
int Log; |
49 |
|
|
int VarDump; |
50 |
|
|
int ArrDump; |
51 |
|
|
int TabDump; |
52 |
|
|
int Tmtc; |
53 |
|
|
int Mcmd; |
54 |
kusanagi |
1.5 |
int ForcedFECmd; |
55 |
kusanagi |
2.4 |
int Ac1Init; |
56 |
kusanagi |
1.5 |
int CalInit; |
57 |
|
|
int TrkInit; |
58 |
|
|
int TofInit; |
59 |
|
|
int TrgInit; |
60 |
kusanagi |
2.1 |
int NdInit; |
61 |
kusanagi |
2.3 |
int S4Init; |
62 |
kusanagi |
2.4 |
int Ac2Init; |
63 |
kusanagi |
1.6 |
int CalAlarm; |
64 |
kusanagi |
6.2 |
int Ac1Alarm; |
65 |
kusanagi |
1.6 |
int TrkAlarm; |
66 |
|
|
int TrgAlarm; |
67 |
|
|
int TofAlarm; |
68 |
kusanagi |
2.3 |
int S4Alarm; |
69 |
kusanagi |
6.2 |
int Ac2Alarm; |
70 |
kusanagi |
2.6 |
int TsbT; |
71 |
|
|
int TsbB; |
72 |
kusanagi |
1.1 |
|
73 |
|
|
typedef std::map<const pamela::PacketType *, int *> CounterMap; |
74 |
|
|
CounterMap CMap; //! |
75 |
kusanagi |
1.6 |
|
76 |
kusanagi |
1.1 |
public: |
77 |
|
|
EventCounter(int = 0); |
78 |
|
|
/** Get the run number for the last read event of this type. */ |
79 |
kusanagi |
1.6 |
int getPscu() const { return Pscu; }; |
80 |
|
|
/** Get the run number for the last read event of this type. */ |
81 |
kusanagi |
2.2 |
int Get(pamela::PacketType const *) const throw (NotExistingCounterException); |
82 |
kusanagi |
1.1 |
/** Get the run number for the next event of this type. */ |
83 |
kusanagi |
2.2 |
int Next(pamela::PacketType const *) const throw (NotExistingCounterException); |
84 |
kusanagi |
1.1 |
int GetRunNumber(void) const { return RunNumber; } |
85 |
kusanagi |
2.2 |
void Increment(pamela::PacketType const *) throw (NotExistingCounterException); |
86 |
kusanagi |
1.1 |
void PrintCounters() const ; |
87 |
kusanagi |
6.2 |
ClassDef(EventCounter, 7) |
88 |
kusanagi |
1.1 |
}; |
89 |
|
|
} |
90 |
|
|
|
91 |
|
|
#endif /* EVENTCOUNTER_H */ |
92 |
kusanagi |
2.3 |
|
93 |
|
|
|