AliRoot Core  edcc906 (edcc906)
AliEMCALDigit.h
Go to the documentation of this file.
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 
21 
22 // --- ROOT system ---
23 #include "TObject.h"
24 
25 // --- AliRoot header files ---
26 #include "AliDigitNew.h"
27 
28 using std::ostream;
29 
30 class AliEMCALDigit : public AliDigitNew
31 {
32 
33  friend ostream& operator << ( ostream& , const AliEMCALDigit&) ;
34 
35  public:
36 
37  AliEMCALDigit() ;
38  AliEMCALDigit(Int_t primary, Int_t iparent, Int_t id, Float_t digEnergy,
39  Float_t time, Int_t type,Int_t index = -1,
40  Float_t chi2=0, Int_t ndf=0, Float_t dE = 0) ;
41 
42  AliEMCALDigit(const AliEMCALDigit & digit) ;
43 
44  virtual ~AliEMCALDigit() ;
45 
46  Bool_t operator==(const AliEMCALDigit &rValue) const;
47  AliEMCALDigit operator+(const AliEMCALDigit &rValue) ;
48  AliEMCALDigit operator*(Float_t factor) ;
49  AliEMCALDigit& operator = (const AliEMCALDigit & digit) ;
50 
51  enum digitType{kUnknown=-1, kHG=0, kLG=1, kLGnoHG=2, kTrigger=3, kEmbedded = 4};
52 
53  void Clear(Option_t*) ;
54  Int_t Compare(const TObject * obj) const ;
55  Float_t GetAmplitude() const { if(!fAmp)return fAmpFloat ; else return fAmp ;}//Keep backward compatibility.
56  Float_t GetEta() const ;
57  Int_t GetNprimary() const { return fNprimary ;}
58  Int_t GetPrimary(Int_t index) const ;
59  Float_t GetDEPrimary(Int_t index) const ;
60  Int_t GetNiparent() const { return fNiparent ;}
61  Int_t GetIparent(Int_t index) const ;
62  Float_t GetDEParent(Int_t index) const ;
63  Float_t GetPhi() const ;
64  Float_t GetTime(void) const { return fTime ;}
65  Float_t GetTimeR(void) const { return fTimeR ;}
66  Float_t GetChi2(void) const { return fChi2 ;}
67  Int_t GetNDF(void) const { return fNDF ;}
68  Bool_t IsSortable() const { return kTRUE ;}
69  Int_t GetType() const { return fDigitType ;}
70 
71  void SetAmp(Int_t amp) { fAmp = amp ; } //old
72  void SetAmplitude(Float_t amp) { fAmpFloat = amp ; }
73  void SetId(Int_t idt) { fId = idt ; }
74  void SetTime(Float_t time) { fTime = time ; }
75  void SetTimeR(Float_t time) { fTimeR = time ; }
76  void SetChi2(Float_t chi) { fChi2 = chi ; }
77  void SetNDF(Int_t ndf) { fNDF = ndf ; }
78  void SetType(Int_t t) { fDigitType = t ; }
79  void ShiftPrimary(Int_t shift); // shift to separate different TreeK in merging
80 
81  //
82  // Raw time sample
83  //
84 
85  // ALTRO
86  Int_t GetNALTROSamplesLG() const {if(fDigitType==kLG) return fNSamples; else return 0 ; }
87  Bool_t GetALTROSampleLG(const Int_t iSample, Int_t& timeBin, Int_t& amp) const;
88  Int_t GetNALTROSamplesHG() const {if(fDigitType==kHG) return fNSamplesHG; else return 0 ; }
89  Bool_t GetALTROSampleHG(const Int_t iSample, Int_t& timeBin, Int_t& amp) const;
90 
91  // FALTRO, trigger. Same data members as Low Gain
92  Int_t GetNFALTROSamples() const {if(fDigitType==kTrigger) return fNSamples; else return 0 ; }
93  Bool_t GetFALTROSample(const Int_t iSample, Int_t& timeBin, Int_t& amp) const ;
94 
95  void SetALTROSamplesHG (const Int_t nSamplesHG, Int_t *samplesHG);
96  void SetALTROSamplesLG (const Int_t nSamplesLG, Int_t *samplesLG);
97  void SetFALTROSamples (const Int_t nSamples, Int_t *samples)
98  { if(fDigitType==kTrigger) SetALTROSamplesLG(nSamples, samples) ; }
99 
100  //
101  // Primary/Parents array creation
102  // Used at analysis level while reclusterizing
103  //
104  void SetListOfPrimaries(Int_t npri, Int_t * prilist, Float_t * edepList) ;
105  void SetListOfParents (Int_t npar, Int_t * parlist, Float_t * edepList) ;
106 
107  //
108  // Other
109  //
110  void SetCalibAmp(Float_t amp) { fAmpCalib = amp ; }
111  Double_t GetCalibAmp() const { return fAmpCalib ; }
112 
113  void Print(const Option_t* /*opt*/) const;
114 
115  private:
116 
117  Float_t fAmpFloat;
118 
119  Int_t fNSamples;
120 
122  Int_t *fSamples; //[fNSamples]
123 
124  Int_t fNSamplesHG;
125 
127  Int_t *fSamplesHG; //[fNSamples]
128 
129  Int_t fNprimary ;
130 
131  Int_t fNMaxPrimary ;
132 
134  Int_t *fPrimary ; //[fNMaxPrimary]
135 
137  Float_t *fDEPrimary ; //[fNMaxPrimary]
138 
139  Int_t fNiparent ;
140 
141  Int_t fNMaxiparent ;
142 
144  Int_t *fIparent ; //[fNMaxiparent]
145 
147  Float_t *fDEParent; //[fNMaxiparent]
148 
149  Int_t fMaxIter ;
150 
151  Float_t fTime ;
152 
153  Float_t fTimeR ;
154 
155  Float_t fChi2;
156 
157  Int_t fNDF;
158 
159  Int_t fDigitType;
160 
161  Float_t fAmpCalib;
162 
164  ClassDef(AliEMCALDigit,7) ;
166 
167 } ;
168 
169 // inline definitions
170 
174 //____________________________________________________________________________
175 inline Int_t AliEMCALDigit::Compare(const TObject * obj) const
176 {
177  AliEMCALDigit * digit = (AliEMCALDigit *)obj ;
178 
179  Int_t iddiff = fId - digit->GetId() ;
180 
181  if ( iddiff > 0 )
182  return 1 ;
183  else if ( iddiff < 0 )
184  return -1 ;
185  else
186  return 0 ;
187 }
188 
189 #endif // ALIEMCALDIGIT_H
Float_t GetPhi() const
void Clear(Option_t *)
Float_t GetDEParent(Int_t index) const
Int_t fNprimary
Number of primaries.
void SetType(Int_t t)
Definition: AliEMCALDigit.h:78
Float_t * fDEParent
Array of parent energy contributions.
AliEMCALDigit operator+(const AliEMCALDigit &rValue)
Int_t * fPrimary
Array of primary labels.
Float_t GetTime(void) const
Definition: AliEMCALDigit.h:64
void SetFALTROSamples(const Int_t nSamples, Int_t *samples)
Definition: AliEMCALDigit.h:97
AliEMCALDigit()
Default Constructor.
void SetCalibAmp(Float_t amp)
Int_t * fSamples
List of time bin constents, Low Gain for ALTRO, used also for FALTRO.
Int_t Compare(const TObject *obj) const
Float_t fAmpFloat
Cell amplitude, float.
void SetId(Int_t idt)
Definition: AliEMCALDigit.h:73
Float_t GetEta() const
Float_t fChi2
Fit quality parameter, chi square.
Int_t fMaxIter
Number to Increment Maxiparent, and MaxPrimary if default is not sufficient.
Float_t GetChi2(void) const
Definition: AliEMCALDigit.h:66
Int_t * fSamplesHG
List of time bin constents, High Gain for ALTRO, used also for FALTRO.
Float_t fTime
Calculated time.
void SetNDF(Int_t ndf)
Definition: AliEMCALDigit.h:77
void SetChi2(Float_t chi)
Definition: AliEMCALDigit.h:76
AliEMCALDigit operator*(Float_t factor)
Multiplies the amplitude by a factor.
EMCal digits object.
Definition: AliEMCALDigit.h:30
Int_t GetIparent(Int_t index) const
Int_t GetNALTROSamplesHG() const
Definition: AliEMCALDigit.h:88
Int_t GetNALTROSamplesLG() const
Definition: AliEMCALDigit.h:86
virtual ~AliEMCALDigit()
void SetTime(Float_t time)
Definition: AliEMCALDigit.h:74
Bool_t operator==(const AliEMCALDigit &rValue) const
Two digits are equal if they have the same Id.
Float_t * fDEPrimary
Array of primary energy contributions.
Double_t chi2
Definition: AnalyzeLaser.C:7
Bool_t GetALTROSampleHG(const Int_t iSample, Int_t &timeBin, Int_t &amp) const
Int_t fDigitType
This is a trigger digit(0), HG (1) or LG (3)
Int_t GetNprimary() const
Definition: AliEMCALDigit.h:57
Float_t GetDEPrimary(Int_t index) const
friend ostream & operator<<(ostream &, const AliEMCALDigit &)
Prints the data of the digit.
void SetAmp(Int_t amp)
Definition: AliEMCALDigit.h:71
Int_t GetNFALTROSamples() const
Definition: AliEMCALDigit.h:92
Float_t fAmpCalib
Calibrated energy.
Float_t GetTimeR(void) const
Definition: AliEMCALDigit.h:65
Int_t fNDF
Fit quality parameter, number of Degrees of Freedom.
Bool_t GetALTROSampleLG(const Int_t iSample, Int_t &timeBin, Int_t &amp) const
void ShiftPrimary(Int_t shift)
Shifts primary number to BIG offset, to separate primary in different TreeK.
void SetListOfPrimaries(Int_t npri, Int_t *prilist, Float_t *edepList)
Bool_t GetFALTROSample(const Int_t iSample, Int_t &timeBin, Int_t &amp) const
Int_t GetType() const
Definition: AliEMCALDigit.h:69
Double_t GetCalibAmp() const
Int_t fNMaxPrimary
Max Number of primaries.
void SetALTROSamplesHG(const Int_t nSamplesHG, Int_t *samplesHG)
Set array of ALTRO samples, High Gain.
void SetTimeR(Float_t time)
Definition: AliEMCALDigit.h:75
Int_t fNiparent
Number of initial parents.
Int_t * fIparent
Array of parents labels.
Int_t GetPrimary(Int_t index) const
Float_t fTimeR
Earliest time: to be used by Digits2Raw.
Int_t GetNDF(void) const
Definition: AliEMCALDigit.h:67
Int_t GetId() const
Definition: AliDigitNew.h:23
Int_t fNMaxiparent
Max Number of parents.
void Print(const Option_t *) const
Dump digit info.
Int_t GetNiparent() const
Definition: AliEMCALDigit.h:60
Int_t fNSamples
Number of time samples, Low Gain for ALTRO, used also for FALTRO.
void SetALTROSamplesLG(const Int_t nSamplesLG, Int_t *samplesLG)
Set array of ALTRO samples, Low Gain or FALTRO.
void SetListOfParents(Int_t npar, Int_t *parlist, Float_t *edepList)
Float_t GetAmplitude() const
Definition: AliEMCALDigit.h:55
Int_t fNSamplesHG
Number of time samples, High Gain for ALTRO.
AliEMCALDigit & operator=(const AliEMCALDigit &digit)
Assignment operator.
Int_t fAmp
Definition: AliDigitNew.h:29
Bool_t IsSortable() const
Definition: AliEMCALDigit.h:68
void SetAmplitude(Float_t amp)
Definition: AliEMCALDigit.h:72