X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliCaloRawAnalyzer.h;h=474571849f8c0e60281d345e0f587dd2dd3daa76;hb=ea12701f2f35e3e60c95a672542f2de4ada91bc3;hp=0bc471a2b2b7a1b7580119fb318a46608e1ace61;hpb=4074cc419fd7918640e44c1108b369da6db26bc4;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliCaloRawAnalyzer.h b/EMCAL/AliCaloRawAnalyzer.h index 0bc471a2b2b..474571849f8 100644 --- a/EMCAL/AliCaloRawAnalyzer.h +++ b/EMCAL/AliCaloRawAnalyzer.h @@ -40,59 +40,76 @@ class AliCaloRawAnalyzer : public TObject { public: AliCaloRawAnalyzer(const char *name="AliCaloRawAnalyzer", const char *nameshort="RawAna"); - virtual ~AliCaloRawAnalyzer(); + virtual ~AliCaloRawAnalyzer() { ; } virtual AliCaloFitResults Evaluate( const std::vector &/*bunchvector*/, - const UInt_t /*altrocfg1*/, const UInt_t /*altrocfg2*/ ) = 0; + UInt_t /*altrocfg1*/, UInt_t /*altrocfg2*/ ) = 0; - void PrintBunches( const std::vector &bunchvector ) const; - void PrintBunch( const AliCaloBunchInfo &bunch ) const ; + static void PrintBunches( const std::vector &bunchvector ); + static void PrintBunch ( const AliCaloBunchInfo &bunch ); int PreFitEvaluateSamples( const std::vector &bunchvector, - const UInt_t altrocfg1, const UInt_t altrocfg2, Int_t & index, - Float_t & maxf, short & maxamp, short & maxampindex, - Float_t & ped, int & first, int & last, const int acut); + UInt_t altrocfg1, UInt_t altrocfg2, Int_t & index, + Float_t & maxf, short & maxamp, short & maxampindex, + Float_t & ped, int & first, int & last, int acut); - void SetTimeConstraint(const int min, const int max ); - void SetVerbose(bool verbose = true){ fVerbose = verbose; }; - void SetIsZeroSuppressed(const bool iszs = true) { fIsZerosupressed = iszs; } ; - void SetAmpCut(const Float_t cut) { fAmpCut = cut ; } ; - void SetFitArrayCut(const Int_t cut) { fFitArrayCut = cut ; } ; - void SetNsampleCut(const Int_t cut) { fNsampleCut = cut ; } ; - void SetOverflowCut(const Int_t cut) { fOverflowCut = cut ; } ; - void SetNsamplePed(const Int_t i) { fNsamplePed = i ; } ; + void SetTimeConstraint (int min, int max ); + void SetVerbose (bool verbose = true){ fVerbose = verbose; } + void SetIsZeroSuppressed(bool iszs = true) { fIsZerosupressed = iszs ; } + void SetAmpCut (Float_t cut) { fAmpCut = cut ; } + void SetFitArrayCut(Int_t cut) { fFitArrayCut = cut ; } + void SetNsampleCut (Int_t cut) { fNsampleCut = cut ; } + void SetOverflowCut(Int_t cut) { fOverflowCut = cut ; } + void SetNsamplePed (Int_t i) { fNsamplePed = i ; } + void SetL1Phase (Double_t phase) { fL1Phase = phase ; } - bool GetIsZeroSuppressed() const { return fIsZerosupressed;} ; - Float_t GetAmpCut() const { return fAmpCut; } ; - Int_t GetFitArrayCut() const { return fFitArrayCut; } ; - Int_t GetNsampleCut() const { return fNsampleCut; } ; - Int_t GetOverflowCut() const { return fOverflowCut; } ; - Int_t GetNsamplePed() const { return fNsamplePed; } ; + bool GetIsZeroSuppressed() const { return fIsZerosupressed;} + Float_t GetAmpCut() const { return fAmpCut ; } + Int_t GetFitArrayCut() const { return fFitArrayCut ; } + Int_t GetNsampleCut() const { return fNsampleCut ; } + Int_t GetOverflowCut() const { return fOverflowCut ; } + Int_t GetNsamplePed() const { return fNsamplePed ; } // access to array info Double_t GetReversed(const int i) const { return fReversed[i]; } - const char * GetAlgoName() const { return fName; }; - const char * GetAlgoAbbr() const { return fNameShort; }; - Algo::fitAlgorithm GetAlgo() const { return fAlgo; }; + const char * GetAlgoName() const { return fName ; } + const char * GetAlgoAbbr() const { return fNameShort ; } + Algo::fitAlgorithm GetAlgo() const { return fAlgo ; } Double_t CalculateChi2(const Double_t amp, const Double_t time, - const Int_t first, const Int_t last, - const Double_t adcErr=1, - const Double_t tau=2.35) const; + const Int_t first, const Int_t last, + const Double_t adcErr=1, + const Double_t tau=2.35) const; + void CalculateMeanAndRMS(const Int_t first, const Int_t last, - Double_t & mean, Double_t & rms); - void SetL1Phase(const Double_t phase) {fL1Phase = phase;}; - short Max( const AliCaloBunchInfo *const bunch, int *const maxindex) const; + Double_t & mean, Double_t & rms); + + short Max( const AliCaloBunchInfo *const bunch, int * maxindex) const; + UShort_t Max(const UShort_t *data, const int length ) const; + bool CheckBunchEdgesForMax( const AliCaloBunchInfo *const bunch) const; + bool IsInTimeRange( const int maxindex, const int maxtime, const int mintime ) const; - Float_t ReverseAndSubtractPed( const AliCaloBunchInfo *bunch, const UInt_t altrocfg1, const UInt_t altrocfg2, double *outarray ) const; - int SelectBunch( const std::vector &bunchvector, short *const maxampbin, short *const maxamplitude ); - void SelectSubarray( const Double_t *date, const int length, const short maxindex, int *const first, int *const last, const int cut) const; + + Float_t ReverseAndSubtractPed( const AliCaloBunchInfo *bunch, + UInt_t altrocfg1, UInt_t altrocfg2, + double * outarray ) const; + + int SelectBunch( const std::vector &bunchvector, + short * maxampbin, short * maxamplitude ); + + void SelectSubarray( const Double_t *date, int length, short maxindex, + int * first, int * last, int cut) const; + Float_t EvaluatePedestal(const UShort_t * const data, const int length ) const; - Float_t GetTau() const { return fTau;}; - void SetTau( const Float_t tau ) { fTau =tau ;}; + // Used in AliCaloRawAnalyzerFitter + Float_t GetTau() const { return fTau ; } + void SetTau (Float_t tau) { fTau = tau ; } + Bool_t GetFixTau() const { return fFixTau ; } + void SetFixTau(Bool_t b) { fFixTau = b ; } + protected: Double_t fReversed[ALTROMAXSAMPLES]; //Reversed sequence of samples (pedestalsubtracted) int fMinTimeIndex; //The timebin of the max signal value must be between fMinTimeIndex and fMaxTimeIndex @@ -103,15 +120,20 @@ protected: int fOverflowCut; // value when ADC starts to saturate int fNsamplePed; //Number of samples used for pedestal calculation (first in bunch) bool fIsZerosupressed; //Wether or not the data is zeros supressed, by default its assumed that the baseline is also subtracted if set to true + bool fVerbose; //Print debug information to std out if set to true char fName[256]; // Name of the algorithm char fNameShort[256]; // Abbrevation for the name + Algo::fitAlgorithm fAlgo; // Which algorithm to use + Double_t fL1Phase; // Phase of the ADC sampling clock relative to the LHC clock - Double_t fAmp; // The amplitude in entities of ADC counts - Double_t fTof; // The amplitude in entities of ADC counts - Float_t fTau; // Rise time of the signal (peak position = t0 +tau), by defauly it is 235 ns - ClassDef(AliCaloRawAnalyzer, 2) + Double_t fAmp; // The amplitude in entities of ADC counts + Double_t fTof; // The amplitude in entities of ADC counts + Float_t fTau; // Rise time of the signal (peak position = t0 +tau), by defauly it is 235 ns + Bool_t fFixTau; // Fixed fit parameter or not, used in AliCaloRawAnalyzerFitter + + ClassDef(AliCaloRawAnalyzer, 3) };