source: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h@ 5633

Last change on this file since 5633 was 5593, checked in by gaug, 20 years ago
*** empty log message ***
File size: 3.8 KB
Line 
1#ifndef MARS_MExtractTimeAndChargeSpline
2#define MARS_MExtractTimeAndChargeSpline
3
4#ifndef MARS_MExtractTimeAndCharge
5#include "MExtractTimeAndCharge.h"
6#endif
7
8#ifndef MARS_MArrayF
9#include "MArrayF.h"
10#endif
11
12class MPedestalPix;
13class MExtractTimeAndChargeSpline : public MExtractTimeAndCharge
14{
15
16private:
17
18 static const Byte_t fgHiGainFirst; //! Default for fHiGainFirst (now set to: 2)
19 static const Byte_t fgHiGainLast; //! Default for fHiGainLast (now set to: 14)
20 static const Byte_t fgLoGainFirst; //! Default for fLoGainFirst (now set to: 2)
21 static const Byte_t fgLoGainLast; //! Default for fLoGainLast (now set to: 14)
22 static const Float_t fgResolution; //! Default for fResolution (now set to: 0.003)
23 static const Float_t fgRiseTime; //! Default for fRiseTime (now set to: 1.5)
24 static const Float_t fgFallTime; //! Default for fFallTime (now set to: 4.5)
25
26 MArrayF fHiGainSignal; //! Need fast access to the signals in a float way
27 MArrayF fLoGainSignal; //! Store them in separate arrays
28 MArrayF fHiGainFirstDeriv; //! High-gain discretized first derivatives
29 MArrayF fLoGainFirstDeriv; //! Low-gain discretized first derivatives
30 MArrayF fHiGainSecondDeriv; //! High-gain discretized second derivatives
31 MArrayF fLoGainSecondDeriv; //! Low-gain discretized second derivatives
32
33 Float_t fAbMax; //! Current maximum of the spline
34 Float_t fAbMaxPos; //! Current position of the maximum of the spline
35 Float_t fHalfMax; //! Current half maximum of the spline
36
37 Float_t fResolution; // The time resolution in FADC units
38 Float_t fRiseTime; // The usual rise time of the pulse
39 Float_t fFallTime; // The usual fall time of the pulse
40
41 Int_t fRandomIter; // Counter used to randomize weights for noise calculation
42
43 Byte_t fFlags; // Bit-field to hold the time extraction types
44
45 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
46
47 Bool_t InitArrays();
48
49 void CalcIntegralHiGain(Float_t &sum, Float_t start, Float_t last);
50 void CalcIntegralLoGain(Float_t &sum, Float_t start, Float_t last);
51
52public:
53
54 enum ExtractionType_t { kMaximum, kHalfMaximum,
55 kAmplitude, kIntegral }; //! Possible time and charge extraction types
56
57private:
58
59 Bool_t IsExtractionType ( ExtractionType_t typ ) { return TESTBIT(fFlags, typ); }
60
61public:
62
63 MExtractTimeAndChargeSpline(const char *name=NULL, const char *title=NULL);
64 ~MExtractTimeAndChargeSpline() {}
65
66 Float_t GetRiseTime() const { return fRiseTime; }
67 Float_t GetFallTime() const { return fFallTime; }
68
69 void SetRange ( Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0 );
70 void SetResolution ( const Float_t f=fgResolution ) { fResolution = f; }
71 void SetRiseTime ( const Float_t f=fgRiseTime ) { fRiseTime = f; }
72 void SetFallTime ( const Float_t f=fgFallTime ) { fFallTime = f; }
73
74 void SetTimeType ( const ExtractionType_t typ=kMaximum );
75 void SetChargeType ( const ExtractionType_t typ=kAmplitude);
76
77 void FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum,
78 Float_t &time, Float_t &dtime,
79 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
80 void FindTimeAndChargeLoGain(Byte_t *first, Float_t &sum, Float_t &dsum,
81 Float_t &time, Float_t &dtime,
82 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
83
84 ClassDef(MExtractTimeAndChargeSpline, 1) // Task to Extract Arrival Times and Charges using a Fast Cubic Spline
85};
86
87#endif
88
89
90
Note: See TracBrowser for help on using the repository browser.