1 | #ifndef MARS_MExtractTimeAndChargeSpline
|
---|
2 | #define MARS_MExtractTimeAndChargeSpline
|
---|
3 |
|
---|
4 | #ifndef MARS_MExtractTimeAndCharge
|
---|
5 | #include "MExtractTimeAndCharge.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class MPedestalPix;
|
---|
9 | class MExtractTimeAndChargeSpline : public MExtractTimeAndCharge
|
---|
10 | {
|
---|
11 |
|
---|
12 | private:
|
---|
13 |
|
---|
14 | static const Byte_t fgHiGainFirst; //! Default for fHiGainFirst (now set to: 2)
|
---|
15 | static const Byte_t fgHiGainLast; //! Default for fHiGainLast (now set to: 14)
|
---|
16 | static const Byte_t fgLoGainFirst; //! Default for fLoGainFirst (now set to: 2)
|
---|
17 | static const Byte_t fgLoGainLast; //! Default for fLoGainLast (now set to: 14)
|
---|
18 | static const Float_t fgResolution; //! Default for fResolution (now set to: 0.003)
|
---|
19 | static const Float_t fgRiseTime; //! Default for fRiseTime (now set to: 1.5)
|
---|
20 | static const Float_t fgFallTime; //! Default for fFallTime (now set to: 4.5)
|
---|
21 |
|
---|
22 | Float_t *fHiGainSignal; //! Need fast access to the signals in a float way
|
---|
23 | Float_t *fLoGainSignal; //! Store them in separate arrays
|
---|
24 | Float_t *fHiGainFirstDeriv; //!
|
---|
25 | Float_t *fLoGainFirstDeriv; //!
|
---|
26 | Float_t *fHiGainSecondDeriv; //!
|
---|
27 | Float_t *fLoGainSecondDeriv; //!
|
---|
28 |
|
---|
29 | Float_t fAbMax; //! Current maximum of the spline
|
---|
30 | Float_t fAbMaxPos; //! Current position of the maximum of the spline
|
---|
31 | Float_t fHalfMax; //! Current half maximum of the spline
|
---|
32 |
|
---|
33 | Float_t fResolution; // The time resolution in FADC units
|
---|
34 | Float_t fRiseTime; // The usual rise time of the pulse
|
---|
35 | Float_t fFallTime; // The usual fall time of the pulse
|
---|
36 |
|
---|
37 | Byte_t fFlags; // Bit-field to hold the time extraction types
|
---|
38 |
|
---|
39 | Bool_t ReInit( MParList *pList );
|
---|
40 |
|
---|
41 | void FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum,
|
---|
42 | Float_t &time, Float_t &dtime,
|
---|
43 | Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
|
---|
44 | void FindTimeAndChargeLoGain(Byte_t *first, Float_t &sum, Float_t &dsum,
|
---|
45 | Float_t &time, Float_t &dtime,
|
---|
46 | Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
|
---|
47 |
|
---|
48 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | enum ExtractionType_t { kMaximum, kHalfMaximum,
|
---|
53 | kAmplitude, kIntegral }; //! Possible time and charge extraction types
|
---|
54 |
|
---|
55 | private:
|
---|
56 |
|
---|
57 | Bool_t IsExtractionType ( ExtractionType_t typ ) { return TESTBIT(fFlags, typ); }
|
---|
58 |
|
---|
59 | public:
|
---|
60 |
|
---|
61 | MExtractTimeAndChargeSpline(const char *name=NULL, const char *title=NULL);
|
---|
62 | ~MExtractTimeAndChargeSpline();
|
---|
63 |
|
---|
64 | void SetRange ( Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0 );
|
---|
65 | void SetResolution ( Float_t f=fgResolution ) { fResolution = f; }
|
---|
66 | void SetRiseTime ( Float_t f=fgRiseTime ) { fRiseTime = f; }
|
---|
67 | void SetFallTime ( Float_t f=fgFallTime ) { fFallTime = f; }
|
---|
68 |
|
---|
69 | void SetTimeType ( ExtractionType_t typ=kMaximum );
|
---|
70 | void SetChargeType ( ExtractionType_t typ=kAmplitude);
|
---|
71 |
|
---|
72 | ClassDef(MExtractTimeAndChargeSpline, 0) // Task to Extract Arrival Times and Charges using a Fast Cubic Spline
|
---|
73 | };
|
---|
74 |
|
---|
75 | #endif
|
---|
76 |
|
---|
77 |
|
---|
78 |
|
---|