1 |
kusanagi |
2.4 |
/** @file |
2 |
kusanagi |
1.2 |
* $Source: /home/cvsmanager/yoda/event/EventCounter.h,v $ |
3 |
kusanagi |
2.5 |
* $Id: EventCounter.h,v 2.4 2004/12/16 17:32:46 kusanagi Exp $ |
4 |
kusanagi |
1.2 |
* $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 |
1.1 |
#include "PscuHeader.h" |
14 |
|
|
|
15 |
|
|
namespace pamela { |
16 |
|
|
/** |
17 |
|
|
* Event counter. Contains the event numbers of the last read event of |
18 |
|
|
* each event type. |
19 |
|
|
*/ |
20 |
|
|
class EventCounter : public TObject { |
21 |
|
|
private: |
22 |
|
|
int RunNumber; /**< Run number */ |
23 |
kusanagi |
1.5 |
|
24 |
kusanagi |
1.1 |
int Pscu; |
25 |
kusanagi |
1.5 |
int PhysEndRun; |
26 |
|
|
int CalibCalPulse1; |
27 |
|
|
int CalibCalPulse2; |
28 |
kusanagi |
1.1 |
int Physics; |
29 |
kusanagi |
1.5 |
int CalibTrkBoth; |
30 |
kusanagi |
2.5 |
int CalibTrk1; |
31 |
|
|
int CalibTrk2; |
32 |
|
|
int CalibCal; |
33 |
|
|
int CalibTrd; |
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 |
|
|
int EventTrk; |
48 |
|
|
int TestTrk; |
49 |
kusanagi |
1.6 |
int TestTof; |
50 |
kusanagi |
1.1 |
int Log; |
51 |
|
|
int VarDump; |
52 |
|
|
int ArrDump; |
53 |
|
|
int TabDump; |
54 |
|
|
int Tmtc; |
55 |
|
|
int Mcmd; |
56 |
kusanagi |
1.5 |
int ForcedFECmd; |
57 |
kusanagi |
2.4 |
int Ac1Init; |
58 |
kusanagi |
1.5 |
int CalInit; |
59 |
|
|
int TrkInit; |
60 |
|
|
int TofInit; |
61 |
|
|
int TrgInit; |
62 |
kusanagi |
2.1 |
int NdInit; |
63 |
kusanagi |
2.3 |
int S4Init; |
64 |
kusanagi |
2.4 |
int Ac2Init; |
65 |
kusanagi |
1.6 |
int CalAlarm; |
66 |
|
|
int AcAlarm; |
67 |
|
|
int TrkAlarm; |
68 |
|
|
int TrgAlarm; |
69 |
|
|
int TofAlarm; |
70 |
kusanagi |
2.3 |
int S4Alarm; |
71 |
kusanagi |
1.1 |
|
72 |
|
|
typedef std::map<const pamela::PacketType *, int *> CounterMap; |
73 |
|
|
CounterMap CMap; //! |
74 |
kusanagi |
1.6 |
|
75 |
kusanagi |
1.1 |
public: |
76 |
|
|
EventCounter(int = 0); |
77 |
|
|
/** Get the run number for the last read event of this type. */ |
78 |
kusanagi |
1.6 |
int getPscu() const { return Pscu; }; |
79 |
|
|
/** Get the run number for the last read event of this type. */ |
80 |
kusanagi |
2.2 |
int Get(pamela::PacketType const *) const throw (NotExistingCounterException); |
81 |
kusanagi |
1.1 |
/** Get the run number for the next event of this type. */ |
82 |
kusanagi |
2.2 |
int Next(pamela::PacketType const *) const throw (NotExistingCounterException); |
83 |
kusanagi |
1.1 |
int GetRunNumber(void) const { return RunNumber; } |
84 |
kusanagi |
2.2 |
void Increment(pamela::PacketType const *) throw (NotExistingCounterException); |
85 |
kusanagi |
1.1 |
void PrintCounters() const ; |
86 |
kusanagi |
2.5 |
ClassDef(EventCounter, 2) |
87 |
kusanagi |
1.1 |
}; |
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
#endif /* EVENTCOUNTER_H */ |
91 |
kusanagi |
2.3 |
|
92 |
|
|
|