source: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h@ 5232

Last change on this file since 5232 was 5162, checked in by gaug, 20 years ago
*** empty log message ***
File size: 3.1 KB
Line 
1#ifndef MARS_MExtractTimeAndChargeDigitalFilter
2#define MARS_MExtractTimeAndChargeDigitalFilter
3
4#ifndef MARS_MExtractTimeAndCharge
5#include "MExtractTimeAndCharge.h"
6#endif
7
8#ifndef MARS_MArrayF
9#include "MArrayF.h"
10#endif
11
12class TH1F;
13class TH2F;
14class MPedestalPix;
15class MExtractTimeAndChargeDigitalFilter : public MExtractTimeAndCharge
16{
17private:
18
19 static const Byte_t fgHiGainFirst;
20 static const Byte_t fgHiGainLast;
21 static const Byte_t fgLoGainFirst;
22 static const Byte_t fgLoGainLast;
23 static const Int_t fgWindowSizeHiGain;
24 static const Int_t fgWindowSizeLoGain;
25 static const Int_t fgBinningResolutionHiGain;
26 static const Int_t fgBinningResolutionLoGain;
27 static const Int_t fgSignalStartBinHiGain;
28 static const Int_t fgSignalStartBinLoGain;
29
30 MArrayF fHiGainSignal; //! Need fast access to the signals in a float way
31 MArrayF fLoGainSignal; //! Store them in separate arrays
32
33 Float_t fTimeShiftHiGain;
34 Float_t fTimeShiftLoGain;
35
36 Int_t fSignalStartBinHiGain;
37 Int_t fSignalStartBinLoGain;
38
39 Int_t fWindowSizeHiGain;
40 Int_t fWindowSizeLoGain;
41
42 Int_t fBinningResolutionHiGain;
43 Int_t fBinningResolutionHalfHiGain;
44 Int_t fBinningResolutionLoGain;
45 Int_t fBinningResolutionHalfLoGain;
46
47 MArrayF fAmpWeightsHiGain;
48 MArrayF fTimeWeightsHiGain;
49 MArrayF fAmpWeightsLoGain;
50 MArrayF fTimeWeightsLoGain;
51
52 Bool_t ReInit( MParList *pList );
53 Int_t PostProcess();
54
55 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
56
57protected:
58
59 virtual void FindTimeAndChargeHiGain(Byte_t *firstused, Byte_t *logain, Float_t &sum, Float_t &dsum,
60 Float_t &time, Float_t &dtime,
61 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
62 virtual void FindTimeAndChargeLoGain(Byte_t *firstused, Float_t &sum, Float_t &dsum,
63 Float_t &time, Float_t &dtime,
64 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
65
66public:
67
68 MExtractTimeAndChargeDigitalFilter(const char *name=NULL, const char *title=NULL);
69
70 Bool_t WriteWeightsFile(TString filename,
71 TH1F *shapehi, TH2F *autocorrhi,
72 TH1F *shapelo=NULL, TH2F *autocorrlo=NULL );
73
74 Bool_t ReadWeightsFile(TString filename="cosmic_weights.dat");
75 void SetWindowSize(Int_t windowh=fgWindowSizeHiGain,
76 Int_t windowl=fgWindowSizeLoGain);
77
78 void SetBinningResolution(const Int_t rh=fgBinningResolutionHiGain, const Int_t rl=fgBinningResolutionLoGain) {
79 fBinningResolutionHiGain = rh & ~1;
80 fBinningResolutionHalfHiGain = fBinningResolutionHiGain/2;
81 fBinningResolutionLoGain = rl & ~1;
82 fBinningResolutionHalfLoGain = fBinningResolutionLoGain/2;
83 }
84
85
86 void SetSignalStartBin( const Int_t sh=fgSignalStartBinHiGain, const Int_t sl=fgSignalStartBinLoGain) {
87 fSignalStartBinHiGain = sh;
88 fSignalStartBinLoGain = sl;
89 }
90
91 ClassDef(MExtractTimeAndChargeDigitalFilter, 0) // Hendrik's digital filter
92};
93
94#endif
95
96
97
Note: See TracBrowser for help on using the repository browser.