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 */
8 //_________________________________________________________________________
11 // A Digit is the sum of energy in a Tower (Hit sum) and stores information, about primaries
12 // and entering particle contributing to a Digit
14 //*-- Author: Sahal Yacoob (LBL)
15 // based on : AliPHOSDigit
16 //___________________________________________________________________________
18 // --- ROOT system ---
22 // --- Standard library ---
24 // --- AliRoot header files ---
25 #include "AliDigitNew.h"
27 class AliEMCALDigit : public AliDigitNew {
29 friend ostream& operator << ( ostream& , const AliEMCALDigit&) ;
34 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) ;
35 AliEMCALDigit(const AliEMCALDigit & digit) ;
36 virtual ~AliEMCALDigit() ;
38 Bool_t operator==(const AliEMCALDigit &rValue) const;
39 AliEMCALDigit operator+(const AliEMCALDigit &rValue) ;
40 AliEMCALDigit operator*(Float_t factor) ;
41 AliEMCALDigit& operator = (const AliEMCALDigit & digit) ;
43 enum digitType{kUnknown=-1, kHG=0, kLG=1, kLGnoHG=2, kTrigger=3, kEmbedded = 4};
45 void Clear(const Option_t*) ;
46 Int_t Compare(const TObject * obj) const ;
47 Float_t GetAmplitude() const { if(!fAmp)return fAmpFloat ; else return fAmp ;}//Keep backward compatibility.
48 Float_t GetEta() const ;
49 Int_t GetNprimary() const { return fNprimary ;}
50 Int_t GetPrimary(Int_t index) const ;
51 Float_t GetDEPrimary(Int_t index) const ;
52 Int_t GetNiparent() const { return fNiparent ;}
53 Int_t GetIparent(Int_t index) const ;
54 Float_t GetDEParent(Int_t index) const ;
55 Float_t GetPhi() const ;
56 Float_t GetTime(void) const { return fTime ;}
57 Float_t GetTimeR(void) const { return fTimeR ;}
58 Float_t GetChi2(void) const { return fChi2 ;}
59 Int_t GetNDF(void) const { return fNDF ;}
60 Bool_t IsSortable() const { return kTRUE ;}
61 Int_t GetType() const { return fDigitType ;}
63 void SetAmp(Int_t amp) { fAmp = amp ; } //old
64 void SetAmplitude(Float_t amp) { fAmpFloat = amp ; }
65 void SetId(Int_t idt) { fId = idt ; }
66 void SetTime(Float_t time) { fTime = time ; }
67 void SetTimeR(Float_t time) { fTimeR = time ; }
68 void SetChi2(Float_t chi) { fChi2 = chi ; }
69 void SetNDF(Int_t ndf) { fNDF = ndf ; }
70 void SetType(Int_t t) { fDigitType = t ; }
71 void ShiftPrimary(Int_t shift); // shift to separate different TreeK in merging
75 Int_t GetNALTROSamplesLG() const {if(fDigitType==kLG) return fNSamples; else return 0 ; }
76 Bool_t GetALTROSampleLG(const Int_t iSample, Int_t& timeBin, Int_t& amp) const;
77 Int_t GetNALTROSamplesHG() const {if(fDigitType==kHG) return fNSamplesHG; else return 0 ; }
78 Bool_t GetALTROSampleHG(const Int_t iSample, Int_t& timeBin, Int_t& amp) const;
79 //FALTRO, trigger. Same data members as Low Gain
80 Int_t GetNFALTROSamples() const {if(fDigitType==kTrigger) return fNSamples; else return 0 ; }
81 Bool_t GetFALTROSample(const Int_t iSample, Int_t& timeBin, Int_t& amp) const ;
83 void SetALTROSamplesHG (const Int_t nSamplesHG, Int_t *samplesHG);
84 void SetALTROSamplesLG (const Int_t nSamplesLG, Int_t *samplesLG);
85 void SetFALTROSamples (const Int_t nSamples, Int_t *samples)
86 { if(fDigitType==kTrigger) SetALTROSamplesLG(nSamples, samples) ; }
88 void SetCalibAmp(Float_t amp) { fAmpCalib = amp ; }
89 Double_t GetCalibAmp() const { return fAmpCalib ; }
91 void Print(const Option_t* /*opt*/) const;
95 Float_t fAmpFloat; // Cell amplitude, float
96 Int_t fNSamples; // Number of time samples, Low Gain for ALTRO, used also for FALTRO
97 Int_t *fSamples; //[fNSamples], list of time bin constents, Low Gain for ALTRO, used also for FALTRO
98 Int_t fNSamplesHG; // Number of time samples, High Gain for ALTRO
99 Int_t *fSamplesHG; //[fNSamples], list of time bin constents, High Gain for ALTRO, used also for FALTRO
101 Int_t fNprimary ; // Number of primaries
102 Int_t fNMaxPrimary ; // Max Number of primaries
103 Int_t *fPrimary ; //[fNMaxPrimary] Array of primaries
104 Float_t *fDEPrimary ; //[fNMaxPrimary] Array of primary energy contributions
106 Int_t fNiparent ; // Number of initial parents
107 Int_t fNMaxiparent ; // Max Number of parents
108 Int_t *fIparent ; //[fNMaxiparent] Array of parents
109 Float_t *fDEParent; //[fNMaxiparent] Array of parent energy contributions
110 Int_t fMaxIter ; // Number to Increment Maxiparent, and MaxPrimary if default is not sufficient
111 Float_t fTime ; // Calculated time
112 Float_t fTimeR ; // Earliest time: to be used by Digits2Raw
113 //Fit quality parameters
114 Float_t fChi2; // Fit Chi aquare
115 Int_t fNDF; // Fit Number of Degrees of Freedom
117 Int_t fDigitType; // This is a trigger digit(0), HG (1) or LG (3)
118 Float_t fAmpCalib; //! Calibrated energy
120 ClassDef(AliEMCALDigit,6) // Digit in EMCAL
123 #endif // ALIEMCALDIGIT_H