/[PAMELA software]/chewbacca/event/EventCounter.h
ViewVC logotype

Annotation of /chewbacca/event/EventCounter.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Mon Jan 19 12:34:17 2015 UTC (9 years, 10 months ago) by mocchiut
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +8 -5 lines
File MIME type: text/plain
Memory leak fixed in pamela::mapval, pamela::mappa, pamela::EventCounter, new IGRF12 parameters added in DB

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.6 * $Id: EventCounter.h,v 1.5 2010/02/11 09:02:15 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 mocchiut 1.6 void Clear(Option_t *t="") { name.Clear(); name.Resize(0); count=0;};
30 mocchiut 1.4 mapval* GetMapVal(){return this;};
31 mocchiut 1.6 ClassDef(mapval, 1);
32 mocchiut 1.4 };
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 mocchiut 1.6 ~mappa(){this->Clear();};
43 mocchiut 1.4 void Clear(Option_t *t="");
44     void Delete(Option_t *t="");
45     //
46     int GetEntries(){ return val->GetEntries();};
47     void Insert(TString, Int_t *);
48     mapval* Find(TString);
49     mapval* Get(Int_t i){ return ((mapval*)val->At(i));};
50     Bool_t end(){ return fend;};
51     void Set();
52 mocchiut 1.6 ClassDef(mappa, 2);
53 mocchiut 1.4 };
54    
55    
56 mocchiut 1.1 /**
57     * Event counter. Contains the event numbers of the last read event of
58     * each event type.
59     */
60     class EventCounter : public TObject {
61     private:
62 mocchiut 1.2
63 mocchiut 1.3 int RunNumber; /**< Run number */
64 mocchiut 1.1 int Pscu;
65     int PhysEndRun;
66     int CalibCalPulse1;
67     int CalibCalPulse2;
68     int Physics;
69     int CalibTrkBoth;
70     int CalibTrk1;
71     int CalibTrk2;
72     int CalibCal;
73     int CalibTof;
74     int CalibS4;
75     int CalibCalPed;
76     int Calib1_Ac1;
77     int Calib1_Ac2;
78     int Calib2_Ac1;
79     int Calib2_Ac2;
80     int RunHeader;
81     int RunTrailer;
82     int CalibHeader;
83     int CalibTrailer;
84     int InitHeader;
85     int InitTrailer;
86     int EventTrk;
87     int Log;
88     int VarDump;
89     int ArrDump;
90     int TabDump;
91     int Tmtc;
92     int Mcmd;
93     int ForcedFECmd;
94     int Ac1Init;
95     int CalInit;
96     int TrkInit;
97     int TofInit;
98     int TrgInit;
99     int NdInit;
100     int S4Init;
101     int Ac2Init;
102     int CalAlarm;
103     int Ac1Alarm;
104     int TrkAlarm;
105     int TrgAlarm;
106     int TofAlarm;
107     int S4Alarm;
108     int Ac2Alarm;
109     int TsbT;
110     int TsbB;
111    
112 mocchiut 1.4 mappa CMap;
113    
114 mocchiut 1.1 public:
115     EventCounter(int = 0);
116 mocchiut 1.6 ~EventCounter(){this->Clear();};
117 mocchiut 1.1 /** Get the run number for the last read event of this type. */
118     int getPscu() const { return Pscu; };
119     /** Get the run number for the last read event of this type. */
120 mocchiut 1.4 int Get(pamela::PacketType const *) throw (NotExistingCounterException);
121 mocchiut 1.1 /** Get the run number for the next event of this type. */
122 mocchiut 1.4 int Next(pamela::PacketType const *) throw (NotExistingCounterException);
123 mocchiut 1.1 int GetRunNumber(void) const { return RunNumber; }
124     void Increment(pamela::PacketType const *) throw (NotExistingCounterException);
125 mocchiut 1.4 void PrintCounters();
126 mocchiut 1.6 void Clear(Option_t *t=""){CMap.Clear();};
127     ClassDef(EventCounter, 10)
128 mocchiut 1.1 };
129     }
130    
131     #endif /* EVENTCOUNTER_H */
132    
133    

  ViewVC Help
Powered by ViewVC 1.1.23