MUON + CheckCompiler
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALRecPoint.h
CommitLineData
ab48128d 1#ifndef ALIEMCALRECPOINT_H
2#define ALIEMCALRECPOINT_H
801f6c04 3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
ab48128d 4 * See cxx source for full Copyright notice */
5//_________________________________________________________________________
6// Base Class for EMCAL Reconstructed Points
40164976 7// A recpoint being equivalent to a cluster in EMCAL terminology
8//
9//
d64c959b 10//*-- Author: Yves Schutz (SUBATECH)
70a93198 11//*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
12//*-- Author: Heather Gray (LBL): merged AliEMCALRecPoint and AliEMCALTowerRecPoint 02/04
ab48128d 13
14// --- ROOT system ---
9aa6a5f6 15#include <TVector3.h>
37890aaf 16class TGeoManager;
17class TGeoPhysicalNode;
18class TPad;
19class TPaveText;
20class TGraph;
21class Riostream;
ab48128d 22// --- Standard library ---
23
24// --- AliRoot header files ---
25
9aa6a5f6 26#include "AliCluster.h"
1d59832c 27class AliEMCALDigit;
9aa6a5f6 28class AliDigitNew;
a5c60732 29class AliEMCALGeometry;
40164976 30class AliEMCALHit;
31class AliCaloCalibPedestal;
a5c60732 32
9aa6a5f6 33class AliEMCALRecPoint : public AliCluster {
ab48128d 34
35 public:
36
37 typedef TObjArray RecPointsList ;
38
39 AliEMCALRecPoint() ; // ctor
40 AliEMCALRecPoint(const char * opt) ; // ctor
0a4cb131 41 AliEMCALRecPoint(const AliEMCALRecPoint & rp);
9aa6a5f6 42
43 AliEMCALRecPoint& operator= (const AliEMCALRecPoint &rp);
44
70a93198 45 virtual ~AliEMCALRecPoint();
9aa6a5f6 46
783153ff 47 virtual void AddDigit(AliEMCALDigit & digit, const Float_t energy, const Bool_t shared);
25bb3dcb 48 virtual Int_t Compare(const TObject * obj) const;
ab48128d 49 virtual void Draw(Option_t * option="") ;
70a93198 50
783153ff 51 virtual void SetClusterType(Int_t ver) { fClusterType = ver ; }
52 virtual Int_t GetClusterType() const { return fClusterType; }
85c60a8e 53
783153ff 54 virtual void EvalAll (Float_t logWeight, TClonesArray * digits, const Bool_t justClusters);
25bb3dcb 55 virtual void EvalLocalPosition (Float_t logWeight, TClonesArray * digits);
56 virtual void EvalGlobalPosition(Float_t logWeight, TClonesArray * digits);
57
70a93198 58 virtual void EvalPrimaries(TClonesArray * digits) ;
783153ff 59 virtual void EvalParents (TClonesArray * digits) ;
70a93198 60
783153ff 61 void EvalLocal2TrackingCSTransform();
62 void EvalLocalPositionFit(Double_t deff, Double_t w0, Double_t phiSlope,TClonesArray * digits);
63 Bool_t EvalLocalPosition2(TClonesArray *digits, TArrayD &ed);
64 Bool_t EvalLocalPositionFromDigits(const Double_t esum, const Double_t deff, const Double_t w0,
1ae500a2 65 TClonesArray *digits, TArrayD &ed, TVector3 &locPos);
783153ff 66 Bool_t EvalLocalPositionFromDigits(TClonesArray *digits, TArrayD &ed, TVector3 &locPos);
1ae500a2 67 static void GetDeffW0(const Double_t esum, Double_t &deff, Double_t &w0);
68
70a93198 69 virtual void GetGlobalPosition(TVector3 & gpos) const; // return global position (x, y, z) in ALICE
783153ff 70 virtual void GetLocalPosition (TVector3 & lpos) const; // return local position (x, y, z) in EMCAL SM
71
72 virtual Int_t * GetPrimaries(Int_t & number) const { number = fMulTrack ;
73 return fTracksList ; }
74 virtual Int_t * GetParents (Int_t & number) const { number = fMulParent ;
75 return fParentsList ; }
4a12dfb7 76 virtual void SetParents (Int_t nParents, Int_t* parents) { // Needed in particular case in tender
77 fMulParent = nParents;
78 if(fParentsList) delete [] fParentsList ;
79 fParentsList = parents ; }
80
783153ff 81 virtual Int_t GetDigitsMultiplicity(void) const { return fMulDigit ; }
25bb3dcb 82 Int_t GetIndexInList() const { return fIndexInList ; }
783153ff 83 virtual int * GetDigitsList(void) const { return fDigitsList ; }
84 virtual Float_t GetEnergy() const { return fAmp ; }
85 Float_t GetCoreEnergy() const { return fCoreEnergy ; }
86 virtual Float_t GetDispersion() const { return fDispersion ; }
87 virtual void GetElipsAxis(Float_t * lambda) const {lambda[0] = fLambda[0]; lambda[1] = fLambda[1];};
88 Float_t * GetEnergiesList() const { return fEnergyList ; } // gets the list of energies making this recpoint
89 Double_t GetPointEnergy() const; // gets point energy (sum of energy list)
783153ff 90 Float_t GetMaximalEnergy(void) const ; // get the highest energy in the cluster
91 Int_t GetMaximalEnergyIndex(void) const ; // get the index of highest energy digit
92 Int_t GetMaximumMultiplicity() const { return fMaxDigit ; } // gets the maximum number of digits allowed
93 Int_t GetMultiplicity(void) const { return fMulDigit ; } // gets the number of digits making this recpoint
94 Int_t GetMultiplicityAtLevel(Float_t level) const ; // computes multiplicity of digits with
95 Int_t * GetAbsId() const { return fAbsIdList ; }
96 Int_t GetAbsId(Int_t i) const { if(i>=0 && i<fMulDigit)
97 return fAbsIdList[i];
98 else return -1 ; }
99 Int_t GetAbsIdMaxDigit() const { return GetAbsId(fDigitIndMax) ; }
100 Int_t GetIndMaxDigit() const { return fDigitIndMax ; }
101 void SetIndMaxDigit(const Int_t ind) { fDigitIndMax = ind ; }
102 void SetIndexInList(Int_t val) { fIndexInList = val ; }
103
104 virtual Int_t GetSuperModuleNumber(void) const { return fSuperModuleNumber;}
9aa6a5f6 105
e52475ed 106 // energy above relative level
783153ff 107 virtual Int_t GetNumberOfLocalMax(AliEMCALDigit ** maxAt, Float_t * maxAtEnergy,
108 Float_t locMaxCut,TClonesArray * digits ) const ;
70a93198 109 // searches for the local maxima
225cd96d 110 // Number of local maxima found in cluster in unfolding:
111 // 0: no unfolding
112 //-1: unfolding failed
783153ff 113 Short_t GetNExMax(void) const { return fNExMax ; } // Number of maxima found in cluster in unfolding
114 void SetNExMax(Int_t nmax=1) { fNExMax = static_cast<Short_t>(nmax) ;}
25bb3dcb 115
783153ff 116 Int_t GetPrimaryIndex() const ;
25bb3dcb 117
783153ff 118 Float_t GetTime(void) const { return fTime ; }
25bb3dcb 119
783153ff 120 Bool_t SharedCluster(void) const { return fSharedCluster ; }
121 void SetSharedCluster(Bool_t s) { fSharedCluster = s ; }
25bb3dcb 122
783153ff 123 virtual Bool_t IsEmc(void) const { return kTRUE ; }
124 virtual Bool_t IsSortable() const { return kTRUE ; }
ab48128d 125 virtual void Paint(Option_t * option="");
5dee926e 126 virtual void Print(Option_t * option="") const ;
7ee5c5be 127
783153ff 128 Double_t TmaxInCm(const Double_t e=0.0, const Int_t key=0);
ab48128d 129
783153ff 130 Float_t GetDistanceToBadTower() const {return fDistToBadTower;}
131 void EvalDistanceToBadChannels(AliCaloCalibPedestal* caloped);
40164976 132
ab48128d 133protected:
783153ff 134 void EvalCoreEnergy(Float_t logWeight, TClonesArray * digits) ;
135 virtual void EvalDispersion(Float_t logWeight, TClonesArray * digits) ; // computes the dispersion of the shower
136 virtual void EvalElipsAxis (Float_t logWeight, TClonesArray * digits ); // computes the axis of shower ellipsoide
137 void EvalTime( TClonesArray * digits );
70a93198 138 virtual Bool_t AreNeighbours(AliEMCALDigit * digit1, AliEMCALDigit * digit2 ) const;
783153ff 139 Float_t ThetaToEta(Float_t arg) const; //Converts Theta (Radians) to Eta(Radians)
140 Float_t EtaToTheta(Float_t arg) const; //Converts Eta (Radians) to Theta(Radians)
70a93198 141
85c60a8e 142private:
9aa6a5f6 143
40164976 144 AliEMCALGeometry* fGeomPtr; //! Pointer to geometry for utilities
145
783153ff 146 Float_t fAmp ; // summed amplitude of digits
147 Int_t fIndexInList ; // the index of this RecPoint in the
148 // list stored in TreeR (to be set by analysis)
149 TVector3 fGlobPos ; // global position
150 TVector3 fLocPos ; // local position in the sub-detector coordinate
151 Int_t fMaxDigit ; //! max initial size of digits array (not saved)
152 Int_t fMulDigit ; // total multiplicity of digits
153 Int_t fMaxTrack ; //! max initial size of tracks array (not saved)
154 Int_t fMulTrack ; // total multiplicity of tracks
155 Int_t *fDigitsList ; //[fMulDigit] list of digit's indexes from which the point was reconstructed
156 Int_t *fTracksList ; //[fMulTrack] list of tracks to which the point was assigned
157
158 Int_t fClusterType; // type of cluster stored: v1
159 Float_t fCoreEnergy ; // energy in a shower core
160 Float_t fLambda[2] ; // shower ellipse axes
161 Float_t fDispersion ; // shower dispersion
162 Float_t *fEnergyList ; //[fMulDigit] energy of digits
783153ff 163 Int_t *fAbsIdList; //[fMulDigit] absId of digits
164 Float_t fTime ; // Time of the digit with maximal energy deposition
165 Short_t fNExMax ; // number of (Ex-)maxima before unfolding
166 Float_t fCoreRadius; // The radius in which the core energy is evaluated
167 Float_t *fDETracksList ; //[fMulTrack] list of tracks to which the point was assigned
168 Int_t fMulParent; // Multiplicity of the parents
169 Int_t fMaxParent; // Maximum number of parents allowed
170 Int_t *fParentsList; // [fMulParent] list of the parents of the digits
171 Float_t *fDEParentsList; // [fMulParent] list of the parents of the digits
172 Int_t fSuperModuleNumber; // number identifying supermodule containing recpoint, reference is cell with maximum energy.
173 Int_t fDigitIndMax; // Index of digit with max energy in array fAbsIdList
174 Float_t fDistToBadTower; // Distance to nearest bad tower
175 Bool_t fSharedCluster; // States if cluster is shared by 2 SuperModules in same phi rack (0,1), (2,3) ... (10,11).
25bb3dcb 176
0be5fefb 177 ClassDef(AliEMCALRecPoint,13) // RecPoint for EMCAL (Base Class)
ab48128d 178
179};
180
181#endif // AliEMCALRECPOINT_H