1 | #ifndef MARS_MPedCalcFromLoGain
|
---|
2 | #define MARS_MPedCalcFromLoGain
|
---|
3 |
|
---|
4 | #ifndef MARS_MExtractPedestal
|
---|
5 | #include "MExtractPedestal.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TArrayI
|
---|
9 | #include <TArrayI.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #ifndef ROOT_MArrayB
|
---|
13 | #include "MArrayB.h"
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | //class MRawEvtPixelIter;
|
---|
17 | class MPedestalPix;
|
---|
18 |
|
---|
19 | class MPedCalcFromLoGain : public MExtractPedestal
|
---|
20 | {
|
---|
21 | private:
|
---|
22 | static const UShort_t fgExtractWinFirst; // First FADC slice to use for pedestal calculation (currently set to: 15)
|
---|
23 | static const UShort_t fgExtractWinSize; // number of successive slices used to calculate pedestal (currently set to: 6)
|
---|
24 | static const UInt_t fgNumDump; //!
|
---|
25 |
|
---|
26 | UInt_t fNumEventsDump; // Number of event after which MPedestalCam gets updated
|
---|
27 | UInt_t fNumAreasDump; // Number of events after which averaged areas gets updated
|
---|
28 | UInt_t fNumSectorsDump; // Number of events after which averaged sectors gets updated
|
---|
29 |
|
---|
30 | TArrayI fNumEventsUsed; //! Number of events used for pedestal calc for each pixel
|
---|
31 | TArrayI fTotalCounter; //! Counter for dumping values to Pedestal Container
|
---|
32 |
|
---|
33 | Bool_t fPedestalUpdate; // Flag if the pedestal shall be updated after every fNumEventsDump
|
---|
34 |
|
---|
35 | // MParContainer
|
---|
36 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
37 |
|
---|
38 | // MTask
|
---|
39 | Bool_t ReInit(MParList *pList);
|
---|
40 | Int_t PostProcess();
|
---|
41 |
|
---|
42 | // MExtractPedestal
|
---|
43 | Int_t Calc();
|
---|
44 |
|
---|
45 | //Helper function to extract slice values by slice number
|
---|
46 | //void CalcExtractor(const MRawEvtPixelIter &pixel, Float_t &sum, MPedestalPix &ped);
|
---|
47 | void ResetArrays();
|
---|
48 |
|
---|
49 | void CalcSectorResult();
|
---|
50 | void CalcAreaResult();
|
---|
51 |
|
---|
52 | public:
|
---|
53 | MPedCalcFromLoGain(const char *name=NULL, const char *title=NULL);
|
---|
54 |
|
---|
55 | // Getters
|
---|
56 | TArrayI *GetNumEventsUsed() { return &fNumEventsUsed; }
|
---|
57 |
|
---|
58 | void SetNumEventsDump (UInt_t dumpevents=fgNumDump) { fNumEventsDump = dumpevents; }
|
---|
59 | void SetNumAreasDump (UInt_t dumpevents=fgNumDump) { fNumAreasDump = dumpevents; }
|
---|
60 | void SetNumSectorsDump(UInt_t dumpevents=fgNumDump) { fNumSectorsDump = dumpevents; }
|
---|
61 | void SetNumDump (UInt_t n=fgNumDump) { fNumEventsDump=n; fNumAreasDump=n; fNumSectorsDump=n; }
|
---|
62 |
|
---|
63 | void SetPedestalUpdate(Bool_t b=kTRUE) { fPedestalUpdate = b; }
|
---|
64 |
|
---|
65 | void Print(Option_t *o="") const;
|
---|
66 |
|
---|
67 | ClassDef(MPedCalcFromLoGain, 1) // Task to calculate pedestals from data runs
|
---|
68 | };
|
---|
69 |
|
---|
70 | #endif
|
---|