| 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 |
|
|---|
| 12 | class TH1F;
|
|---|
| 13 | class TH2F;
|
|---|
| 14 | class MPedestalPix;
|
|---|
| 15 | class MExtractTimeAndChargeDigitalFilter : public MExtractTimeAndCharge
|
|---|
| 16 | {
|
|---|
| 17 | private:
|
|---|
| 18 | static const Byte_t fgHiGainFirst;
|
|---|
| 19 | static const Byte_t fgHiGainLast;
|
|---|
| 20 | static const Byte_t fgLoGainFirst;
|
|---|
| 21 | static const Byte_t fgLoGainLast;
|
|---|
| 22 | static const Int_t fgWindowSizeHiGain;
|
|---|
| 23 | static const Int_t fgWindowSizeLoGain;
|
|---|
| 24 | static const Int_t fgBinningResolutionHiGain;
|
|---|
| 25 | static const Int_t fgBinningResolutionLoGain;
|
|---|
| 26 | static const Int_t fgSignalStartBinHiGain;
|
|---|
| 27 | static const Int_t fgSignalStartBinLoGain;
|
|---|
| 28 |
|
|---|
| 29 | MArrayF fHiGainSignal; //! Need fast access to the signals in a float way
|
|---|
| 30 | MArrayF fLoGainSignal; //! Store them in separate arrays
|
|---|
| 31 |
|
|---|
| 32 | Float_t fTimeShiftHiGain;
|
|---|
| 33 | Float_t fTimeShiftLoGain;
|
|---|
| 34 |
|
|---|
| 35 | Int_t fSignalStartBinHiGain; //!
|
|---|
| 36 | Int_t fSignalStartBinLoGain; //!
|
|---|
| 37 |
|
|---|
| 38 | Int_t fWindowSizeHiGain;
|
|---|
| 39 | Int_t fWindowSizeLoGain;
|
|---|
| 40 |
|
|---|
| 41 | Int_t fBinningResolutionHiGain;
|
|---|
| 42 | Int_t fBinningResolutionHalfHiGain;
|
|---|
| 43 | Int_t fBinningResolutionLoGain;
|
|---|
| 44 | Int_t fBinningResolutionHalfLoGain;
|
|---|
| 45 |
|
|---|
| 46 | MArrayF fAmpWeightsHiGain; //!
|
|---|
| 47 | MArrayF fTimeWeightsHiGain; //!
|
|---|
| 48 | MArrayF fAmpWeightsLoGain; //!
|
|---|
| 49 | MArrayF fTimeWeightsLoGain; //!
|
|---|
| 50 |
|
|---|
| 51 | Bool_t ReInit(MParList *pList);
|
|---|
| 52 | Int_t PreProcess(MParList *pList);
|
|---|
| 53 |
|
|---|
| 54 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
|---|
| 55 |
|
|---|
| 56 | protected:
|
|---|
| 57 | virtual void FindTimeAndChargeHiGain(Byte_t *firstused, Byte_t *logain, Float_t &sum, Float_t &dsum,
|
|---|
| 58 | Float_t &time, Float_t &dtime,
|
|---|
| 59 | Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
|
|---|
| 60 | virtual void FindTimeAndChargeLoGain(Byte_t *firstused, Float_t &sum, Float_t &dsum,
|
|---|
| 61 | Float_t &time, Float_t &dtime,
|
|---|
| 62 | Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag);
|
|---|
| 63 |
|
|---|
| 64 | public:
|
|---|
| 65 |
|
|---|
| 66 | MExtractTimeAndChargeDigitalFilter(const char *name=NULL, const char *title=NULL);
|
|---|
| 67 |
|
|---|
| 68 | Bool_t WriteWeightsFile(TString filename,
|
|---|
| 69 | TH1F *shapehi, TH2F *autocorrhi,
|
|---|
| 70 | TH1F *shapelo=NULL, TH2F *autocorrlo=NULL );
|
|---|
| 71 |
|
|---|
| 72 | Bool_t ReadWeightsFile(TString filename="cosmic_weights.dat");
|
|---|
| 73 | void SetWindowSize(Int_t windowh=fgWindowSizeHiGain,
|
|---|
| 74 | Int_t windowl=fgWindowSizeLoGain);
|
|---|
| 75 |
|
|---|
| 76 | void SetBinningResolution(const Int_t rh=fgBinningResolutionHiGain, const Int_t rl=fgBinningResolutionLoGain) {
|
|---|
| 77 | fBinningResolutionHiGain = rh & ~1;
|
|---|
| 78 | fBinningResolutionHalfHiGain = fBinningResolutionHiGain/2;
|
|---|
| 79 | fBinningResolutionLoGain = rl & ~1;
|
|---|
| 80 | fBinningResolutionHalfLoGain = fBinningResolutionLoGain/2;
|
|---|
| 81 | }
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 | void SetSignalStartBin( const Int_t sh=fgSignalStartBinHiGain, const Int_t sl=fgSignalStartBinLoGain) {
|
|---|
| 85 | fSignalStartBinHiGain = sh;
|
|---|
| 86 | fSignalStartBinLoGain = sl;
|
|---|
| 87 | }
|
|---|
| 88 |
|
|---|
| 89 | void Print(Option_t *o) const;
|
|---|
| 90 |
|
|---|
| 91 | ClassDef(MExtractTimeAndChargeDigitalFilter, 1) // Hendrik's digital filter
|
|---|
| 92 | };
|
|---|
| 93 |
|
|---|
| 94 | #endif
|
|---|