2 #ifndef ALIEMCALRAWUTILS_H
3 #define ALIEMCALRAWUTILS_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 //_________________________________________________________________________
11 // Utility Class for handling Raw data
12 // Does all transitions from Digits to Raw and vice versa,
13 // for simu and reconstruction
15 // Note: the current version is still simplified. Only
16 // one raw signal per digit is generated; either high-gain or low-gain
17 // Need to add concurrent high and low-gain info in the future
18 // No pedestal is added to the raw signal.
20 //*-- Author: Marco van Leeuwen (LBL)
22 #include "TObject.h" // for ROOT types
26 class AliAnalysisManager;
27 class AliCaloRawStreamV3;
28 class AliAltroMapping;
31 class AliEMCALGeometry;
32 class AliCaloCalibPedestal;
33 class AliCaloRawAnalyzer;
34 class AliCaloRawAnalyzerLMSOffline;
35 class AliEMCALTriggerRawDigitMaker;
36 class AliEMCALTriggerData;
38 #include "AliCaloConstants.h"
41 class AliEMCALRawUtils : public TObject {
43 AliEMCALRawUtils(Algo::fitAlgorithm fitAlgo = Algo::kStandard);
44 AliEMCALRawUtils(AliEMCALGeometry *pGeometry, Algo::fitAlgorithm fitAlgo = Algo::kStandard);
45 virtual ~AliEMCALRawUtils();
47 // void FitRaw(const Int_t firstTimeBin, const Int_t lastTimeBin, Float_t & amp, Float_t & time, Float_t & chi2, Bool_t & fitDone) const ;
48 // void FitParabola(const TGraph *gSig, Float_t & amp) const ;
51 void Raw2Digits(AliRawReader *reader, TClonesArray *digitsArr, const AliCaloCalibPedestal* pedbadmap,
52 TClonesArray *digitsTRG=0x0, AliEMCALTriggerData* trgData = 0x0);
53 static Double_t RawResponseFunctionLog(Double_t *x, Double_t *par);
54 void AddDigit(TClonesArray *digitsArr, Int_t id, Int_t lowGain, Float_t amp, Float_t time, Float_t chi2, Int_t ndf);
55 void TrimDigits(TClonesArray *digitsArr);
56 Int_t GetNoiseThreshold() const { return fNoiseThreshold; }
57 Int_t GetNPedSamples() const { return fNPedSamples; }
58 Int_t GetPedestalValue() const {return fgPedestalValue;}
59 Double_t GetFEENoise() const {return fgFEENoise;}
60 Bool_t GetRemoveBadChannels() const {return fRemoveBadChannels;}
61 Int_t GetFittingAlgorithm() const {return fFittingAlgorithm; }
62 Float_t GetTimeMax() const {return fTimeMax ;}
63 Float_t GetTimeMin() const {return fTimeMin ;}
64 Bool_t UseFALTRO() const {return fUseFALTRO; }
65 void SetNoiseThreshold(Int_t val) {fNoiseThreshold=val; }
66 void SetNPedSamples(Int_t val) {fNPedSamples=val; }
67 void SetRemoveBadChannels(Bool_t val) {fRemoveBadChannels=val; }
68 void SetFittingAlgorithm(Int_t val) ;
69 void SetTimeMin(Float_t t) {fTimeMin = t ;}
70 void SetTimeMax(Float_t t) {fTimeMax = t ;}
71 void SetFALTROUsage(Bool_t val) {fUseFALTRO=val; }
72 void SetFEENoise(Double_t val) {fgFEENoise = val;}
73 void SetPedestalValue(Int_t val) {fgPedestalValue = val;}
74 Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
75 Int_t GetRawFormatThreshold() const { return fgThreshold ; }
76 AliCaloRawAnalyzer *GetRawAnalyzer() const { return fRawAnalyzer;}
77 virtual Option_t* GetOption() const { return fOption.Data(); }
78 void SetOption(const Option_t* opt) { fOption = opt; }
79 static Double_t RawResponseFunction(Double_t *x, Double_t *par);
80 Bool_t RawSampledResponse(Double_t dtime, Double_t damp, Int_t * adcH, Int_t * adcL, const Int_t keyErr=0) const;
83 AliEMCALRawUtils(const AliEMCALRawUtils& rawUtils); //copy ctor
84 AliEMCALRawUtils& operator =(const AliEMCALRawUtils& rawUtils);
85 Int_t fNoiseThreshold; // threshold to consider signal or noise
86 Int_t fNPedSamples; // number of samples to use in pedestal calculation
87 static Double_t fgTimeTrigger ; // time of the trigger for the RO signal
88 static Int_t fgThreshold; // threshold
89 static Int_t fgPedestalValue; // pedestal value for Digits2Raw
90 static Double_t fgFEENoise; // electronics noise in ADC units
91 AliEMCALGeometry* fGeom; // geometry
92 AliAltroMapping* fMapping[4]; // only two for now
93 TString fOption; // option passed from Reconstructor
94 Bool_t fRemoveBadChannels; // select if bad channels are removed before fitting
95 Int_t fFittingAlgorithm; // select the fitting algorithm
96 Float_t fTimeMin; // minimum threshold for the time of the signal
97 Float_t fTimeMax; // maximum threshold for the time of the signal
98 Bool_t fUseFALTRO; // use FALTRO and pass it to the digits
99 AliCaloRawAnalyzer *fRawAnalyzer; // e.g. for sample selection for fits
100 AliEMCALTriggerRawDigitMaker* fTriggerRawDigitMaker;
102 ClassDef(AliEMCALRawUtils,7) // utilities for raw signal fitting