| 1 | kusanagi | 1.1 | /** @file | 
| 2 | kusanagi | 1.2 | * $Source: /home/cvsmanager/yoda/event/EventCounter.h,v $ | 
| 3 | kusanagi | 1.5 | * $Id: EventCounter.h,v 1.4 2004/07/08 12:31:22 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 |  |  | //#include <root/TObject.h> | 
| 13 |  |  | #include <TObject.h> //Substituted by Maurizio 05 Feb 2004 | 
| 14 |  |  |  | 
| 15 |  |  | #include "PscuHeader.h" | 
| 16 |  |  |  | 
| 17 |  |  | namespace pamela { | 
| 18 |  |  | /** | 
| 19 |  |  | * Event counter. Contains the event numbers of the last read event of | 
| 20 |  |  | * each event type. | 
| 21 |  |  | */ | 
| 22 |  |  | class EventCounter : public TObject { | 
| 23 |  |  | private: | 
| 24 |  |  | int RunNumber;    /**< Run number */ | 
| 25 | kusanagi | 1.5 |  | 
| 26 | kusanagi | 1.1 | int Pscu; | 
| 27 | kusanagi | 1.5 | int PhysEndRun; | 
| 28 |  |  | int CalibCalPulse1; | 
| 29 |  |  | int CalibCalPulse2; | 
| 30 | kusanagi | 1.1 | int Physics; | 
| 31 | kusanagi | 1.5 | int CalibTrkBoth; | 
| 32 | kusanagi | 1.2 | int Calib_Trk1; | 
| 33 |  |  | int Calib_Trk2; | 
| 34 | kusanagi | 1.1 | int Calib_Cal; | 
| 35 |  |  | int Calib_Trd; | 
| 36 |  |  | int Calib_Tof; | 
| 37 |  |  | int Calib_S4; | 
| 38 | kusanagi | 1.5 | int Calib_CalPed; | 
| 39 |  |  | int Calib_Ac; | 
| 40 | kusanagi | 1.1 | int Run_Header; | 
| 41 |  |  | int Run_Trailer; | 
| 42 | kusanagi | 1.5 | int CalibHeader; | 
| 43 |  |  | int CalibTrailer; | 
| 44 |  |  | int InitHeader; | 
| 45 |  |  | int InitTrailer; | 
| 46 |  |  | int EventTrk; | 
| 47 |  |  | int TestTrk; | 
| 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 |  |  | int AcInit; | 
| 56 |  |  | int CalInit; | 
| 57 |  |  | int TrkInit; | 
| 58 |  |  | int TofInit; | 
| 59 |  |  | int TrgInit; | 
| 60 | kusanagi | 1.1 |  | 
| 61 |  |  | typedef std::map<const pamela::PacketType *, int *> CounterMap; | 
| 62 |  |  | CounterMap CMap; //! | 
| 63 |  |  | public: | 
| 64 |  |  | EventCounter(int = 0); | 
| 65 |  |  | /** Get the run number for the last read event of this type. */ | 
| 66 |  |  | int Get(pamela::PacketType const *) const; | 
| 67 |  |  | /** Get the run number for the next event of this type. */ | 
| 68 |  |  | int Next(pamela::PacketType const *) const; | 
| 69 |  |  | int GetRunNumber(void) const { return RunNumber; } | 
| 70 |  |  | void Increment(pamela::PacketType const *); | 
| 71 |  |  | void PrintCounters() const ; | 
| 72 |  |  | ClassDef(EventCounter, 1) | 
| 73 |  |  | }; | 
| 74 |  |  | } | 
| 75 |  |  |  | 
| 76 |  |  | #endif /* EVENTCOUNTER_H */ |