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 MExtractedSignalCam;
|
---|
21 |
|
---|
22 | class MExtractor : public MTask
|
---|
23 | {
|
---|
24 | private:
|
---|
25 |
|
---|
26 | static const Float_t fgOffsetLoGain; //! Default for fOffsetLoGain (now set to 1.51 (= 5ns)
|
---|
27 |
|
---|
28 | protected:
|
---|
29 |
|
---|
30 | static const Byte_t fgSaturationLimit; //! Default for fSaturationLimit (now set to: 254)
|
---|
31 | static const TString fgNamePedestalCam; //! "MPedestalCam"
|
---|
32 |
|
---|
33 | Float_t fOffsetLoGain; // Offset of the low-gain signal w.r.t. the High-Gain slices
|
---|
34 |
|
---|
35 | MPedestalCam *fPedestals; //! Pedestals of all pixels in the camera
|
---|
36 | MExtractedSignalCam *fSignals; //! Extracted signal of all pixels in the camera
|
---|
37 |
|
---|
38 | MRawEvtData *fRawEvt; //! Raw event data (time slices)
|
---|
39 | MRawRunHeader *fRunHeader; //! RunHeader information
|
---|
40 |
|
---|
41 | Byte_t fHiGainFirst; // First FADC slice nr. to extract the High Gain signal
|
---|
42 | Byte_t fHiGainLast; // Last FADC slice nr. to extract the High Gain signal
|
---|
43 | Byte_t fLoGainFirst; // First FADC slice nr. to extract the Low Gain signal
|
---|
44 | Byte_t fLoGainLast; // Last FADC slice nr. to extract the Low Gain signal
|
---|
45 |
|
---|
46 | Byte_t fHiLoLast; // Number of slices in fLoGainSamples counted for the High-Gain signal
|
---|
47 |
|
---|
48 | Float_t fNumHiGainSamples; // Number High Gain FADC slices used to extract the signal
|
---|
49 | Float_t fNumLoGainSamples; // Number Low Gain FADC slices used to extract the signal
|
---|
50 |
|
---|
51 | Float_t fSqrtHiGainSamples; // Sqrt. nr. High Gain FADC slices used to extract the signal
|
---|
52 | Float_t fSqrtLoGainSamples; // Sqrt. nr. Low Gain FADC slices used to extract the signal
|
---|
53 |
|
---|
54 | Byte_t fSaturationLimit; // Highest FADC slice value until being declared saturated
|
---|
55 | TString fNamePedestalCam; // Name of the 'MPedestalCam' container
|
---|
56 |
|
---|
57 | virtual void FindSignalHiGain(Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat) const { }
|
---|
58 | virtual void FindSignalLoGain(Byte_t *firstused, Float_t &sum, Byte_t &sat) const { }
|
---|
59 |
|
---|
60 | Int_t PreProcess(MParList *pList);
|
---|
61 | Bool_t ReInit(MParList *pList);
|
---|
62 | Int_t Process();
|
---|
63 | void StreamPrimitive(ofstream &out) const;
|
---|
64 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
65 |
|
---|
66 | public:
|
---|
67 | MExtractor(const char *name=NULL, const char *title=NULL);
|
---|
68 |
|
---|
69 | Byte_t GetHiGainFirst() const { return fHiGainFirst; }
|
---|
70 | Byte_t GetHiGainLast () const { return fHiGainLast ; }
|
---|
71 | Byte_t GetLoGainFirst() const { return fLoGainFirst; }
|
---|
72 | Byte_t GetLoGainLast () const { return fLoGainLast ; }
|
---|
73 | Float_t GetNumHiGainSamples() const { return fNumHiGainSamples; }
|
---|
74 | Float_t GetNumLoGainSamples() const { return fNumLoGainSamples; }
|
---|
75 |
|
---|
76 | virtual void SetRange ( Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0 );
|
---|
77 |
|
---|
78 | void SetOffsetLoGain ( const Float_t f=fgOffsetLoGain) { fOffsetLoGain = f; }
|
---|
79 | void SetSaturationLimit ( Byte_t lim=fgSaturationLimit ) { fSaturationLimit = lim; }
|
---|
80 | void SetNamePedestalCam ( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; }
|
---|
81 |
|
---|
82 | void Print(Option_t *o="") const;
|
---|
83 |
|
---|
84 | ClassDef(MExtractor, 1) // Signal Extractor Base Class
|
---|
85 | };
|
---|
86 |
|
---|
87 | #endif
|
---|