1 | #ifndef MARS_MExtractor
|
---|
2 | #define MARS_MExtractor
|
---|
3 |
|
---|
4 | /////////////////////////////////////////////////////////////////////////////
|
---|
5 | // //
|
---|
6 | // MExtractor //
|
---|
7 | // //
|
---|
8 | // Base class for the signal extractors //
|
---|
9 | // //
|
---|
10 | /////////////////////////////////////////////////////////////////////////////
|
---|
11 |
|
---|
12 | #ifndef MARS_MTask
|
---|
13 | #include "MTask.h"
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | class MRawEvtData;
|
---|
17 | class MRawRunHeader;
|
---|
18 |
|
---|
19 | class MPedestalCam;
|
---|
20 | class MPedestalSubtractedEvt;
|
---|
21 | class MExtractedSignalCam;
|
---|
22 |
|
---|
23 | class MExtractor : public MTask
|
---|
24 | {
|
---|
25 | private:
|
---|
26 | static const Float_t fgOffsetLoGain; //! Default for fOffsetLoGain (now set to 1.51 (= 5ns)
|
---|
27 |
|
---|
28 | Bool_t fNoiseCalculation; //! Flag if extractor determines noise contribution from pedestal file.
|
---|
29 |
|
---|
30 | Float_t fResolutionPerPheHiGain; // Extractor-dependent charge resolution per phe for high-gain (see TDAS-0502).
|
---|
31 | Float_t fResolutionPerPheLoGain; // Extractor-dependent charge resolution per phe for low-gain (see TDAS-0502).
|
---|
32 |
|
---|
33 | protected:
|
---|
34 | static const UInt_t fgSaturationLimit; //! Default for fSaturationLimit (now set to: 254)
|
---|
35 | static const TString fgNamePedestalCam; //! "MPedestalCam"
|
---|
36 | static const TString fgNameSignalCam; //! "MExtractedSignalCam"
|
---|
37 |
|
---|
38 | Float_t fOffsetLoGain; // Offset of the low-gain signal w.r.t. the High-Gain slices
|
---|
39 |
|
---|
40 | MPedestalCam *fPedestals; //! Pedestals of all pixels in the camera
|
---|
41 | MExtractedSignalCam *fSignals; //! Extracted signal of all pixels in the camera
|
---|
42 |
|
---|
43 | MRawEvtData *fRawEvt; //! Raw event data (time slices)
|
---|
44 | MRawRunHeader *fRunHeader; //! RunHeader information
|
---|
45 |
|
---|
46 | MPedestalSubtractedEvt *fSignal; //!
|
---|
47 |
|
---|
48 | Byte_t fHiGainFirst; // First FADC slice nr. to extract the High Gain signal
|
---|
49 | Byte_t fHiGainLast; // Last FADC slice nr. to extract the High Gain signal
|
---|
50 | Int_t fLoGainFirst; // First FADC slice nr. to extract the Low Gain signal
|
---|
51 | Byte_t fLoGainLast; // Last FADC slice nr. to extract the Low Gain signal
|
---|
52 |
|
---|
53 | // Byte_t fHiLoLast; // Number of slices in fLoGainSamples counted for the High-Gain signal
|
---|
54 |
|
---|
55 | Float_t fNumHiGainSamples; // Number High Gain FADC slices used to extract the signal
|
---|
56 | Float_t fNumLoGainSamples; // Number Low Gain FADC slices used to extract the signal
|
---|
57 |
|
---|
58 | Float_t fSqrtHiGainSamples; // Sqrt. nr. High Gain FADC slices used to extract the signal
|
---|
59 | Float_t fSqrtLoGainSamples; // Sqrt. nr. Low Gain FADC slices used to extract the signal
|
---|
60 |
|
---|
61 | UInt_t fSaturationLimit; // Highest FADC slice value until being declared saturated
|
---|
62 |
|
---|
63 | TString fNamePedestalCam; // Name of the 'MPedestalCam' container
|
---|
64 | TString fNameSignalCam; // Name of the 'MExtractedSignalCam' container
|
---|
65 |
|
---|
66 | // MExtractor
|
---|
67 | virtual void FindSignalHiGain(Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat) const { }
|
---|
68 | virtual void FindSignalLoGain(Byte_t *firstused, Float_t &sum, Byte_t &sat) const { }
|
---|
69 |
|
---|
70 | void SetResolutionPerPheHiGain(Float_t f) { fResolutionPerPheHiGain=f; }
|
---|
71 | void SetResolutionPerPheLoGain(Float_t f) { fResolutionPerPheLoGain=f; }
|
---|
72 |
|
---|
73 | Int_t PreProcessStd(MParList *pList);
|
---|
74 |
|
---|
75 | // MTask
|
---|
76 | Int_t PreProcess( MParList *pList );
|
---|
77 | Bool_t ReInit ( MParList *pList );
|
---|
78 | Int_t Process ();
|
---|
79 | void StreamPrimitive(ostream &out) const;
|
---|
80 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
81 |
|
---|
82 |
|
---|
83 | public:
|
---|
84 | MExtractor(const char *name=NULL, const char *title=NULL);
|
---|
85 |
|
---|
86 | // getter
|
---|
87 | Byte_t GetHiGainFirst() const { return fHiGainFirst; }
|
---|
88 | Byte_t GetHiGainLast () const { return fHiGainLast ; }
|
---|
89 | Int_t GetLoGainFirst() const { return fLoGainFirst; }
|
---|
90 | Byte_t GetLoGainLast () const { return fLoGainLast ; }
|
---|
91 | Float_t GetNumHiGainSamples() const { return fNumHiGainSamples; }
|
---|
92 | Float_t GetNumLoGainSamples() const { return fNumLoGainSamples; }
|
---|
93 | Float_t GetOffsetLoGain() const { return fOffsetLoGain; }
|
---|
94 | Float_t GetResolutionPerPheHiGain() const { return fResolutionPerPheHiGain; }
|
---|
95 | Float_t GetResolutionPerPheLoGain() const { return fResolutionPerPheLoGain; }
|
---|
96 | UInt_t GetSaturationLimit() const { return fSaturationLimit; }
|
---|
97 |
|
---|
98 | Bool_t HasLoGain() const { return fLoGainFirst>0 || fLoGainLast>0; }
|
---|
99 | Bool_t IsNoiseCalculation () const { return fNoiseCalculation; }
|
---|
100 |
|
---|
101 | // Setter
|
---|
102 | Float_t SetResolutionPerPheHiGain() const { return fResolutionPerPheHiGain; }
|
---|
103 | Float_t SetResolutionPerPheLoGain() const { return fResolutionPerPheLoGain; }
|
---|
104 |
|
---|
105 | virtual void SetRange(Byte_t hifirst=0, Byte_t hilast=0, Int_t lofirst=0, Byte_t lolast=0);
|
---|
106 |
|
---|
107 | void SetOffsetLoGain ( const Float_t f=fgOffsetLoGain ) { fOffsetLoGain = f; }
|
---|
108 | void SetSaturationLimit ( const UInt_t lim=fgSaturationLimit ) { fSaturationLimit = lim; }
|
---|
109 | void SetNamePedestalCam ( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; }
|
---|
110 | void SetNameSignalCam ( const char *name=fgNameSignalCam.Data() ) { fNameSignalCam = name; }
|
---|
111 | void SetNoiseCalculation( const Bool_t b=kTRUE ) { fNoiseCalculation = b; }
|
---|
112 |
|
---|
113 | void SetPedestals (MPedestalCam *pedcam) { fPedestals = pedcam; }
|
---|
114 | MPedestalCam *GetPedestals() { return fPedestals; }
|
---|
115 |
|
---|
116 | // TObject
|
---|
117 | void Clear(Option_t *o="")
|
---|
118 | {
|
---|
119 | fHiGainFirst = fHiGainLast = fLoGainFirst = fLoGainLast = /*fHiLoLast =*/ 0;
|
---|
120 | }
|
---|
121 |
|
---|
122 | void Print(Option_t *o="") const; //*MENU*
|
---|
123 |
|
---|
124 | ClassDef(MExtractor, 8) // Signal Extractor Base Class
|
---|
125 | };
|
---|
126 |
|
---|
127 | #endif
|
---|