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