1 | #ifndef MARS_MPedCalcFromLoGain
|
---|
2 | #define MARS_MPedCalcFromLoGain
|
---|
3 |
|
---|
4 | #ifndef MARS_MExtractor
|
---|
5 | #include "MExtractor.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TArrayD
|
---|
9 | #include <TArrayD.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #ifndef ROOT_TArrayI
|
---|
13 | #include <TArrayI.h>
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | class MGeomCam;
|
---|
17 | class MBadPixelsCam;
|
---|
18 | class MRawEvtPixelIter;
|
---|
19 |
|
---|
20 | class MPedCalcFromLoGain : public MExtractor
|
---|
21 | {
|
---|
22 | static const Int_t fgCheckWinFirst; // First FADC slice to check for signal (currently set to: 0)
|
---|
23 | static const Int_t fgCheckWinLast; // Last FADC slice to check for signal (currently set to: 29)
|
---|
24 | static const Int_t fgExtractWinFirst; // First FADC slice to use for pedestal calculation (currently set to: 15)
|
---|
25 | static const Int_t fgExtractWinSize; // number of successive slices used to calculate pedestal (currently set to: 6)
|
---|
26 | static const Int_t fgMaxSignalVar; // The maximum difference between the highest and lowest slice
|
---|
27 |
|
---|
28 | Int_t fNumEventsDump; // Number of event after which MPedestalCam gets updated
|
---|
29 |
|
---|
30 | Int_t fMaxSignalVar;
|
---|
31 | Int_t fCheckWinFirst;
|
---|
32 | Int_t fCheckWinLast;
|
---|
33 | Int_t fExtractWinSize; // Number of slices to calculate the pedestal from
|
---|
34 | Int_t fExtractWinFirst;
|
---|
35 | Int_t fExtractWinLast;
|
---|
36 |
|
---|
37 | Bool_t fPedestalUpdate;
|
---|
38 |
|
---|
39 | MGeomCam *fGeom; // Camera geometry
|
---|
40 | TString fPedContainerName; // name of the 'MPedestalCam' container
|
---|
41 |
|
---|
42 | TArrayI fNumEventsUsed; // Number of events used for pedestal calc for each pixel
|
---|
43 | TArrayI fTotalCounter; // Counter for dumping values to Pedestal Container
|
---|
44 | TArrayD fSumx; // sum of values
|
---|
45 | TArrayD fSumx2; // sum of squared values
|
---|
46 | TArrayD fSumAB0; // sum of ABFlag=0 slices
|
---|
47 | TArrayD fSumAB1; // sum of ABFlag=1 slices
|
---|
48 |
|
---|
49 | // MParContainer
|
---|
50 | Int_t PreProcess (MParList *pList);
|
---|
51 | Bool_t ReInit (MParList *pList);
|
---|
52 | Int_t Process ();
|
---|
53 | Int_t PostProcess();
|
---|
54 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
55 |
|
---|
56 | // Calculation
|
---|
57 | void Calc(ULong_t n, UInt_t idx);
|
---|
58 |
|
---|
59 | //Helper function to extract slice values by slice number
|
---|
60 | UInt_t GetSlice(MRawEvtPixelIter *pixel, UInt_t slice);
|
---|
61 |
|
---|
62 | public:
|
---|
63 | MPedCalcFromLoGain(const char *name=NULL, const char *title=NULL);
|
---|
64 |
|
---|
65 | // TObject
|
---|
66 | void Clear(const Option_t *o="");
|
---|
67 |
|
---|
68 | // Setter
|
---|
69 | void SetCheckRange(Int_t checkfirst=0, Int_t checklast=29);
|
---|
70 | void SetExtractWindow(Int_t extractfirst=15, Int_t windowsize=6);
|
---|
71 | void SetMaxSignalVar(Int_t maxvar=0);
|
---|
72 | void SetNumEventsDump(UInt_t dumpevents = 0) {fNumEventsDump = dumpevents;}
|
---|
73 | void SetPedestalUpdate(Bool_t pedupdate) {fPedestalUpdate = pedupdate;}
|
---|
74 |
|
---|
75 | void SetPedContainerName(const char *name) { fPedContainerName = name; }
|
---|
76 |
|
---|
77 | // Getter
|
---|
78 | TArrayI *GetNumEventsUsed() { return &fNumEventsUsed; }
|
---|
79 |
|
---|
80 | ClassDef(MPedCalcFromLoGain, 0) // Task to calculate pedestals from pedestal runs raw data
|
---|
81 | };
|
---|
82 |
|
---|
83 | #endif
|
---|