1 #ifndef ALIEMCALRAWUTILS_H
2 #define ALIEMCALRAWUTILS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
7 /* History of cvs commits:
10 * Revision 1.3 2007/10/31 17:15:24 mvl
11 * Fixed bug in raw data unpacking; Added pedestal to signal fit; Added logic to deal with high/low gain
13 * Revision 1.2 2007/09/03 20:55:35 jklay
14 * EMCAL e-by-e reconstruction methods from Cvetan
16 * Revision 1.1 2007/03/17 19:56:38 mvl
17 * Moved signal shape routines from AliEMCAL to separate class AliEMCALRawUtils to streamline raw data reconstruction code.
21 //_________________________________________________________________________
22 // Utility Class for handling Raw data
23 // Does all transitions from Digits to Raw and vice versa,
24 // for simu and reconstruction
26 // Note: the current version is still simplified. Only
27 // one raw signal per digit is generated; either high-gain or low-gain
28 // Need to add concurrent high and low-gain info in the future
29 // No pedestal is added to the raw signal.
31 //*-- Author: Marco van Leeuwen (LBL)
33 #include "TObject.h" // for ROOT types
35 #include "AliCaloRawStream.h"
41 class AliEMCALRawUtils : public TObject {
44 virtual ~AliEMCALRawUtils();
46 void Digits2Raw(AliAltroMapping **mapping = NULL);
47 void Raw2Digits(AliRawReader *reader,TClonesArray *digitsArr, AliAltroMapping **mapping = NULL);
48 void AddDigit(TClonesArray *digitsArr, Int_t id, Int_t lowGain, Int_t amp, Float_t time);
50 // Signal shape parameters
51 Double_t GetRawFormatHighLowGainFactor() const {return fHighLowGainFactor ;}
52 static Int_t GetRawFormatOrder() { return fgOrder ; }
53 static Int_t GetRawFormatTimeBins() { return fgkTimeBins ; }
54 static Double_t GetRawFormatTimeMax() { return fgkTimeBins*fgTimeBinWidth; }
55 static Double_t GetRawFormatTimeBinWidth() { return fgTimeBinWidth; }
56 Double_t GetRawFormatTau() const { return fgTau ; }
57 Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
58 Int_t GetRawFormatThreshold() const { return fgThreshold ; }
59 Int_t GetRawFormatDDLPerSuperModule() const { return fgDDLPerSuperModule ; }
61 virtual Option_t* GetOption() const { return fOption.Data(); }
62 void SetOption(Option_t* opt) { fOption = opt; }
64 // Signal shape functions
65 void FitRaw(TGraph * gSig, TF1* signalF, Float_t & amp, Float_t & time);
66 static Double_t RawResponseFunction(Double_t *x, Double_t *par);
67 Bool_t RawSampledResponse(Double_t dtime, Double_t damp, Int_t * adcH, Int_t * adcL) const;
69 ClassDef(AliEMCALRawUtils,1)
72 Double_t fHighLowGainFactor ; // high to low gain factor for the raw RO signal
73 static Int_t fgOrder ; // order of the gamma function for the RO signal
74 static Double_t fgTau ; // tau parameter of gamma function for the RO signal
75 static Double_t fgTimeTrigger ; // time of the trigger for the RO signal
77 static const Int_t fgkTimeBins = 256 ; // number of sampling bins of the raw RO signal
78 static Double_t fgTimeBinWidth; // maximum sampled time of the raw RO signal
79 static Int_t fgThreshold; // threshold
80 static Int_t fgDDLPerSuperModule; // number of DDL per SuperModule
82 TString fOption; //! option passed from Reconstructor