1 | #ifndef MARS_MEventRateCalc
|
---|
2 | #define MARS_MEventRateCalc
|
---|
3 |
|
---|
4 | #ifndef MARS_MTask
|
---|
5 | #include "MTask.h"
|
---|
6 | #endif
|
---|
7 | #ifndef ROOT_TArrayD
|
---|
8 | #include <TArrayD.h>
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | class MTime;
|
---|
12 | class MEventRate;
|
---|
13 | class MParameterD;
|
---|
14 |
|
---|
15 | class MEventRateCalc : public MTask
|
---|
16 | {
|
---|
17 | private:
|
---|
18 | static const TString gsDefName; //! Default name of container
|
---|
19 | static const TString gsDefTitle; //! Default title of container
|
---|
20 |
|
---|
21 | static const TString gsNameTime; //! Default name of time container
|
---|
22 | static const TString gsNameEventRate; //! default name of rate container
|
---|
23 | static const TString gsNameTimeDiff; //! default name of time-diff container
|
---|
24 |
|
---|
25 | static const Int_t gsNumEvents; //! Default number of events
|
---|
26 |
|
---|
27 |
|
---|
28 | MTime *fTime; //! pointer to event time
|
---|
29 | MEventRate *fRate; //! pointer to rate storage container
|
---|
30 | MParameterD *fTimeDiff; //! Difference of time between two consecutive events
|
---|
31 |
|
---|
32 | TString fNameTime; // name of time container
|
---|
33 | TString fNameEventRate; // name of event rate container
|
---|
34 | TString fNameTimeDiff; // name of time-diff container
|
---|
35 |
|
---|
36 | TArrayD fTimes; //! internal array to store the last n event times
|
---|
37 |
|
---|
38 |
|
---|
39 | Int_t PreProcess(MParList *pList);
|
---|
40 | Int_t Process();
|
---|
41 |
|
---|
42 | void StreamPrimitive(ofstream &out) const;
|
---|
43 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
44 |
|
---|
45 | public:
|
---|
46 | MEventRateCalc(const char *name=NULL, const char *title=NULL);
|
---|
47 |
|
---|
48 | void SetNumEvents(ULong_t num) { fTimes.Set(num); }
|
---|
49 |
|
---|
50 | void SetNameTime(const char *name) { fNameTime = name; }
|
---|
51 | void SetNameEventRate(const char *name) { fNameEventRate = name; }
|
---|
52 | void SetNameTimeDiff(const char *name) { fNameTimeDiff = name; }
|
---|
53 |
|
---|
54 | ClassDef(MEventRateCalc, 1)// Task to calculate event rates
|
---|
55 | };
|
---|
56 |
|
---|
57 |
|
---|
58 | #endif
|
---|