source: trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.h@ 5502

Last change on this file since 5502 was 5474, checked in by gaug, 20 years ago
*** empty log message ***
File size: 4.1 KB
Line 
1#ifndef MARS_MExtractPedestal
2#define MARS_MExtractPedestal
3
4#ifndef MARS_MTask
5#include "MTask.h"
6#endif
7
8#ifndef MARS_MArrayD
9#include <MArrayD.h>
10#endif
11
12#ifndef MARS_MArrayI
13#include <MArrayI.h>
14#endif
15
16#ifndef ROOT_TString
17#include "TString.h"
18#endif
19
20class MGeomCam;
21class MPedestalCam;
22class MRawEvtData;
23class MRawRunHeader;
24class MRawEvtHeader;
25class MExtractTimeAndCharge;
26class MExtractPedestal : public MTask
27{
28private:
29
30 static const TString fgNamePedestalCam; //! "MPedestalCam"
31
32protected:
33
34 MGeomCam *fGeom; //! Camera geometry
35 MPedestalCam *fPedestalsIn; //! Pedestals of all pixels in the camera
36 MPedestalCam *fPedestalsOut; //! Pedestals of all pixels in the camera
37 MRawEvtData *fRawEvt; //! Raw event data (time slices)
38 MRawRunHeader *fRunHeader; //! RunHeader information
39 MRawEvtHeader *fEvtHeader; //! EvtHeader information
40 MExtractTimeAndCharge *fExtractor; // Possible Extractor used
41
42 UShort_t fExtractWinFirst; // First FADC slice to extract pedestal from
43 UShort_t fExtractWinSize; // Number of slices to calculate the pedestal from
44 UShort_t fExtractWinLast; // Last FADC slice to extract pedestal from
45
46 TString fNamePedestalCamIn; // name of the incoming 'MPedestalCam' container
47 TString fNamePedestalCamOut; // name of the outgoing 'MPedestalCam' container
48
49 UInt_t fNumEventsDump; // Number of event after which MPedestalCam gets updated
50 UInt_t fNumAreasDump; // Number of events after which averaged areas gets updated
51 UInt_t fNumSectorsDump; // Number of events after which averaged sectors gets updated
52
53 Bool_t fPedestalUpdate; // Flag if the pedestal shall be updated after every fNumEventsDump
54
55 MArrayD fSumx; // sum of values
56 MArrayD fSumx2; // sum of squared values
57 MArrayD fSumAB0; // sum of ABFlag=0 slices
58 MArrayD fSumAB1; // sum of ABFlag=1 slices
59 MArrayD fAreaSumx; // averaged sum of values per area idx
60 MArrayD fAreaSumx2; // averaged sum of squared values per area idx
61 MArrayD fAreaSumAB0; // averaged sum of ABFlag=0 slices per area idx
62 MArrayD fAreaSumAB1; // averaged sum of ABFlag=1 slices per area idx
63 MArrayI fAreaFilled; // number of valid entries with area idx
64 MArrayI fAreaValid; // number of valid pixels within area idx
65 MArrayD fSectorSumx; // averaged sum of values per sector
66 MArrayD fSectorSumx2; // averaged sum of squared values per sector
67 MArrayD fSectorSumAB0; // averaged sum of ABFlag=0 slices per sector
68 MArrayD fSectorSumAB1; // averaged sum of ABFlag=1 slices per sector
69 MArrayI fSectorFilled; // number of valid entries with sector idx
70 MArrayI fSectorValid; // number of valid pixels within sector idx
71
72 Int_t PreProcess (MParList *pList);
73 Bool_t ReInit (MParList *pList);
74 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
75
76 virtual void ResetArrays();
77 void CalcPixResults ( const UInt_t nevts, const UInt_t pixid );
78 void CalcAreaResults ( const UInt_t nevts, const UInt_t napix, const UInt_t aidx );
79 void CalcSectorResults( const UInt_t nevts, const UInt_t nspix, const UInt_t sector );
80
81public:
82
83 MExtractPedestal(const char *name=NULL, const char *title=NULL);
84
85 void Clear(const Option_t *o="");
86 void Print(const Option_t *o="") const;
87
88 Bool_t SetExtractWindow(UShort_t first, UShort_t size);
89 void SetNumEventsDump ( UInt_t dumpevents = 500 ) { fNumEventsDump = dumpevents; }
90 void SetNumAreasDump ( UInt_t dumpevents = 500 ) { fNumAreasDump = dumpevents; }
91 void SetNumSectorsDump ( UInt_t dumpevents = 500 ) { fNumSectorsDump = dumpevents; }
92 void SetPedestalUpdate ( Bool_t pedupdate ) { fPedestalUpdate = pedupdate; }
93 void SetNamePedestalCamIn( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCamIn = name; }
94 void SetNamePedestalCamOut( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCamOut = name; }
95 void SetExtractor ( MExtractTimeAndCharge *e ) { fExtractor = e; }
96
97 ClassDef(MExtractPedestal, 0) // Base class for pedestal extractors
98};
99
100#endif
Note: See TracBrowser for help on using the repository browser.