Line data Source code
1 : #ifndef ALIEMCALDIGIT_H
2 : #define ALIEMCALDIGIT_H
3 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : //_________________________________________________________________________
7 : // EMCAL digit:
8 : // A Digit is the sum of the energy lost in an EMCAL Tower
9 : // It also stores information on Primary, and enterring particle
10 : // tracknumbers Digits are created using AliEMCALSDigitizer, followed
11 : // by AliEMCALDigitizer
12 : //
13 : //*-- Author: Sahal Yacoob (LBL)
14 : // based on : AliPHOSDigit
15 : //__________________________________________________________________________
16 :
17 : // --- ROOT system ---
18 :
19 : #include "TObject.h"
20 :
21 : // --- Standard library ---
22 :
23 : // --- AliRoot header files ---
24 : #include "AliDigitNew.h"
25 :
26 : using std::ostream;
27 :
28 : class AliEMCALDigit : public AliDigitNew {
29 :
30 : friend ostream& operator << ( ostream& , const AliEMCALDigit&) ;
31 :
32 : public:
33 :
34 : AliEMCALDigit() ;
35 : AliEMCALDigit(Int_t primary, Int_t iparent, Int_t id, Float_t digEnergy, Float_t time, Int_t type,Int_t index = -1, Float_t chi2=0, Int_t ndf=0, Float_t dE = 0) ;
36 : AliEMCALDigit(const AliEMCALDigit & digit) ;
37 : virtual ~AliEMCALDigit() ;
38 :
39 : Bool_t operator==(const AliEMCALDigit &rValue) const;
40 : AliEMCALDigit operator+(const AliEMCALDigit &rValue) ;
41 : AliEMCALDigit operator*(Float_t factor) ;
42 : AliEMCALDigit& operator = (const AliEMCALDigit & digit) ;
43 :
44 : enum digitType{kUnknown=-1, kHG=0, kLG=1, kLGnoHG=2, kTrigger=3, kEmbedded = 4};
45 :
46 : void Clear(const Option_t*) ;
47 : Int_t Compare(const TObject * obj) const ;
48 288296 : Float_t GetAmplitude() const { if(!fAmp)return fAmpFloat ; else return fAmp ;}//Keep backward compatibility.
49 : Float_t GetEta() const ;
50 578 : Int_t GetNprimary() const { return fNprimary ;}
51 : Int_t GetPrimary(Int_t index) const ;
52 : Float_t GetDEPrimary(Int_t index) const ;
53 518 : Int_t GetNiparent() const { return fNiparent ;}
54 : Int_t GetIparent(Int_t index) const ;
55 : Float_t GetDEParent(Int_t index) const ;
56 : Float_t GetPhi() const ;
57 427494 : Float_t GetTime(void) const { return fTime ;}
58 232 : Float_t GetTimeR(void) const { return fTimeR ;}
59 114 : Float_t GetChi2(void) const { return fChi2 ;}
60 0 : Int_t GetNDF(void) const { return fNDF ;}
61 1152 : Bool_t IsSortable() const { return kTRUE ;}
62 340 : Int_t GetType() const { return fDigitType ;}
63 :
64 0 : void SetAmp(Int_t amp) { fAmp = amp ; } //old
65 141430 : void SetAmplitude(Float_t amp) { fAmpFloat = amp ; }
66 316 : void SetId(Int_t idt) { fId = idt ; }
67 283508 : void SetTime(Float_t time) { fTime = time ; }
68 0 : void SetTimeR(Float_t time) { fTimeR = time ; }
69 0 : void SetChi2(Float_t chi) { fChi2 = chi ; }
70 0 : void SetNDF(Int_t ndf) { fNDF = ndf ; }
71 2 : void SetType(Int_t t) { fDigitType = t ; }
72 : void ShiftPrimary(Int_t shift); // shift to separate different TreeK in merging
73 :
74 : //
75 : // Raw time sample
76 : //
77 :
78 : // ALTRO
79 0 : Int_t GetNALTROSamplesLG() const {if(fDigitType==kLG) return fNSamples; else return 0 ; }
80 : Bool_t GetALTROSampleLG(const Int_t iSample, Int_t& timeBin, Int_t& amp) const;
81 0 : Int_t GetNALTROSamplesHG() const {if(fDigitType==kHG) return fNSamplesHG; else return 0 ; }
82 : Bool_t GetALTROSampleHG(const Int_t iSample, Int_t& timeBin, Int_t& amp) const;
83 :
84 : // FALTRO, trigger. Same data members as Low Gain
85 0 : Int_t GetNFALTROSamples() const {if(fDigitType==kTrigger) return fNSamples; else return 0 ; }
86 : Bool_t GetFALTROSample(const Int_t iSample, Int_t& timeBin, Int_t& amp) const ;
87 :
88 : void SetALTROSamplesHG (const Int_t nSamplesHG, Int_t *samplesHG);
89 : void SetALTROSamplesLG (const Int_t nSamplesLG, Int_t *samplesLG);
90 : void SetFALTROSamples (const Int_t nSamples, Int_t *samples)
91 0 : { if(fDigitType==kTrigger) SetALTROSamplesLG(nSamples, samples) ; }
92 :
93 : //
94 : // Primary/Parents array creation
95 : // Used at analysis level while reclusterizing
96 : //
97 : void SetListOfPrimaries(Int_t npri, Int_t * prilist, Float_t * edepList) ;
98 : void SetListOfParents (Int_t npar, Int_t * parlist, Float_t * edepList) ;
99 :
100 : //
101 : // Other
102 : //
103 230 : void SetCalibAmp(Float_t amp) { fAmpCalib = amp ; }
104 316 : Double_t GetCalibAmp() const { return fAmpCalib ; }
105 :
106 : void Print(const Option_t* /*opt*/) const;
107 :
108 : private:
109 :
110 : Float_t fAmpFloat; // Cell amplitude, float
111 : Int_t fNSamples; // Number of time samples, Low Gain for ALTRO, used also for FALTRO
112 : Int_t *fSamples; //[fNSamples], list of time bin constents, Low Gain for ALTRO, used also for FALTRO
113 : Int_t fNSamplesHG; // Number of time samples, High Gain for ALTRO
114 : Int_t *fSamplesHG; //[fNSamples], list of time bin constents, High Gain for ALTRO, used also for FALTRO
115 :
116 : Int_t fNprimary ; // Number of primaries
117 : Int_t fNMaxPrimary ; // Max Number of primaries
118 : Int_t *fPrimary ; //[fNMaxPrimary] Array of primaries
119 : Float_t *fDEPrimary ; //[fNMaxPrimary] Array of primary energy contributions
120 :
121 : Int_t fNiparent ; // Number of initial parents
122 : Int_t fNMaxiparent ; // Max Number of parents
123 : Int_t *fIparent ; //[fNMaxiparent] Array of parents
124 : Float_t *fDEParent; //[fNMaxiparent] Array of parent energy contributions
125 : Int_t fMaxIter ; // Number to Increment Maxiparent, and MaxPrimary if default is not sufficient
126 : Float_t fTime ; // Calculated time
127 : Float_t fTimeR ; // Earliest time: to be used by Digits2Raw
128 :
129 : //Fit quality parameters
130 : Float_t fChi2; // Fit Chi square
131 : Int_t fNDF; // Fit Number of Degrees of Freedom
132 :
133 : Int_t fDigitType; // This is a trigger digit(0), HG (1) or LG (3)
134 : Float_t fAmpCalib; //! Calibrated energy
135 :
136 1120 : ClassDef(AliEMCALDigit,7) // Digit in EMCAL
137 : } ;
138 :
139 : #endif // ALIEMCALDIGIT_H
|