source: branches/Mars_McMismatchStudy/msignal/MExtractTimeAndChargeSpline.h@ 17984

Last change on this file since 17984 was 13003, checked in by tbretz, 13 years ago
Improved the possible combinations of how to extract the leading edge or position of maximum and the intgeral or amplitude.
File size: 5.1 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_MExtralgoSpline
9#include "MExtralgoSpline.h"
10#endif
11
12#ifndef MARS_MArrayF
13#include "MArrayF.h"
14#endif
15
16class MPedestalPix;
17
18class MExtractTimeAndChargeSpline : public MExtractTimeAndCharge
19{
20private:
21 static const Byte_t fgHiGainFirst; //! Default for fHiGainFirst (now set to: 2)
22 static const Byte_t fgHiGainLast; //! Default for fHiGainLast (now set to: 14)
23 static const Int_t fgLoGainFirst; //! Default for fLoGainFirst (now set to: 2)
24 static const Byte_t fgLoGainLast; //! Default for fLoGainLast (now set to: 14)
25 static const Float_t fgResolution; //! Default for fResolution (now set to: 0.003)
26 static const Float_t fgRiseTimeHiGain; //! Default for fRiseTime (now set to: 1.5)
27 static const Float_t fgFallTimeHiGain; //! Default for fFallTime (now set to: 4.5)
28 static const Float_t fgLoGainStretch; //! Default for fLoGainStretch (now set to: 1.5)
29 static const Float_t fgOffsetLoGain; //! Default for fOffsetLoGain (now set to 1.7)
30// static const Float_t fgLoGainStartShift; //! Default for fLoGainStartShift (now set to -1.6)
31
32// MArrayF fHiGainSignal; //! Need fast access to the signals in a float way
33// MArrayF fLoGainSignal; //! Store them in separate arrays
34 MArrayF fHiGainFirstDeriv; //! High-gain discretized first derivatives
35 MArrayF fLoGainFirstDeriv; //! Low-gain discretized first derivatives
36 MArrayF fHiGainSecondDeriv; //! High-gain discretized second derivatives
37 MArrayF fLoGainSecondDeriv; //! Low-gain discretized second derivatives
38
39 Float_t fResolution; // The time resolution in FADC units
40
41 Float_t fRiseTimeHiGain; // The usual rise time of the pulse in the high-gain
42 Float_t fFallTimeHiGain; // The usual fall time of the pulse in the high-gain
43 Float_t fRiseTimeLoGain; // The usual rise time of the pulse in the low-gain
44 Float_t fFallTimeLoGain; // The usual fall time of the pulse in the low-gain
45
46 Float_t fLoGainStretch; // The stretch of the low-gain w.r.t. the high-gain pulse
47 Float_t fHeightTm;
48
49// Int_t fRandomIter; //! Counter used to randomize weights for noise calculation
50
51 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
52 Bool_t InitArrays(Int_t n);
53
54private:
55 MExtralgoSpline::ExtractionType_t fExtractionType;
56
57public:
58 MExtractTimeAndChargeSpline(const char *name=NULL, const char *title=NULL);
59
60 Float_t GetRiseTimeHiGain() const { return fRiseTimeHiGain; }
61 Float_t GetFallTimeHiGain() const { return fFallTimeHiGain; }
62
63 void SetRange(UShort_t hifirst=0, UShort_t hilast=0, Int_t lofirst=0, Byte_t lolast=0 );
64
65 void SetResolution(const Float_t f=fgResolution) { fResolution = f; }
66
67 void SetRiseTimeHiGain(const Float_t f=fgRiseTimeHiGain)
68 {
69 fRiseTimeHiGain = f;
70 fRiseTimeLoGain = f*fLoGainStretch;
71 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples);
72 fWindowSizeHiGain = TMath::Nint(fRiseTimeHiGain + fFallTimeHiGain);
73 }
74 void SetFallTimeHiGain(const Float_t f=fgFallTimeHiGain)
75 {
76 fFallTimeHiGain = f;
77 fFallTimeLoGain = f*fLoGainStretch;
78 fNumHiGainSamples = fRiseTimeHiGain + fFallTimeHiGain;
79 fNumLoGainSamples = fLoGainLast ? fRiseTimeLoGain + fFallTimeLoGain : 0.;
80 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples);
81 fWindowSizeLoGain = TMath::Nint(fRiseTimeLoGain + fFallTimeLoGain);
82 }
83
84 void SetHeightTm(const Double_t h) { fHeightTm = h; }
85
86 void SetLoGainStretch(const Float_t f=fgLoGainStretch) { fLoGainStretch = f; }
87
88 void SetChargeType(const MExtralgoSpline::ExtractionType_t typ=MExtralgoSpline::kIntegralRel);
89/*
90 void FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum,
91 Float_t &time, Float_t &dtime,
92 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
93 void FindTimeAndChargeLoGain(Byte_t *first, Float_t &sum, Float_t &dsum,
94 Float_t &time, Float_t &dtime,
95 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
96*/
97 void FindTimeAndChargeHiGain2(const Float_t *firstused, Int_t num, Float_t &sum, Float_t &dsum,
98 Float_t &time, Float_t &dtime,
99 Byte_t sat, Int_t maxpos) const;
100
101 void FindTimeAndChargeLoGain2(const Float_t *firstused, Int_t num, Float_t &sum, Float_t &dsum,
102 Float_t &time, Float_t &dtime,
103 Byte_t sat, Int_t maxpos) const;
104
105 ClassDef(MExtractTimeAndChargeSpline, 5) // Task to Extract Arrival Times and Charges using a Cubic Spline
106};
107
108#endif
Note: See TracBrowser for help on using the repository browser.