]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - STEER/AliESDCaloCluster.h
Fix for Savannah bug report 59287
[u/mrichter/AliRoot.git] / STEER / AliESDCaloCluster.h
... / ...
CommitLineData
1#ifndef ALIESDCALOCLUSTER_H
2#define ALIESDCALOCLUSTER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5/* $Id$ */
6/* $Log $ */
7
8//-------------------------------------------------------------------------
9// Class AliESDCaloCluster
10// This is the class to deal with during the physics analysis of data
11//
12// New container for calorimeter clusters, which are the effective
13// "tracks" for calorimeter detectors. Can be used by PHOS and EMCAL
14//
15// J.L. Klay (LLNL)
16//-------------------------------------------------------------------------
17
18#include <TObject.h>
19#include "AliPID.h"
20#include "TArrayS.h"
21#include "TArrayI.h"
22
23class TLorentzVector;
24
25class AliESDCaloCluster : public TObject
26{
27
28public:
29
30 AliESDCaloCluster();
31 AliESDCaloCluster(const AliESDCaloCluster& clus);
32 AliESDCaloCluster & operator=(const AliESDCaloCluster& source);
33 virtual ~AliESDCaloCluster();
34 virtual void Copy(TObject &) const;
35
36 void SetID(Int_t id) {fID = id;}
37 Int_t GetID() const {return fID;}
38
39 //similar to AliAODCluster but offset by one for
40 // backward comp. -1 was undefined, which only applied
41 // for PHOS clusters before
42 enum ESDClu_t {kUndef = -2,
43 kPHOSCluster,
44 kEMCALPseudoCluster, //Not any more in use, keep for backward comp.
45 kEMCALClusterv1};
46
47 void SetClusterType(Int_t type) { fClusterType = type; }
48 Char_t GetClusterType() const {return fClusterType; }
49
50 Bool_t IsEMCAL() const {return (fClusterType == kEMCALClusterv1);}
51 Bool_t IsPHOS() const {return (fClusterType == kPHOSCluster);}
52
53 void SetPosition(const Float_t *pos) {
54 fGlobalPos[0] = pos[0]; fGlobalPos[1] = pos[1]; fGlobalPos[2] = pos[2];
55 }
56 void GetPosition(Float_t *pos) const {
57 pos[0] = fGlobalPos[0]; pos[1] = fGlobalPos[1]; pos[2] = fGlobalPos[2];
58 }
59
60 void SetE(Float_t ene) { fEnergy = ene;}
61 Double_t E() const { return fEnergy;}
62
63 void SetClusterDisp(Float_t disp) { fDispersion = disp; }
64 Double_t GetClusterDisp() const { return fDispersion; }
65
66 void SetClusterChi2(Float_t chi2) { fChi2 = chi2; }
67 Double_t GetClusterChi2() const { return fChi2; }
68
69 void SetPid(const Float_t *p);
70 Double_t *GetPid() {return fPID;}
71
72 void SetM20(Float_t m20) { fM20 = m20; }
73 Double_t GetM20() const { return fM20; }
74
75 void SetM02(Float_t m02) { fM02 = m02; }
76 Double_t GetM02() const { return fM02; }
77
78 void SetNExMax(UChar_t nExMax) { fNExMax = nExMax; }
79 UChar_t GetNExMax() const { return fNExMax; }
80
81 void SetEmcCpvDistance(Float_t dEmcCpv) { fEmcCpvDistance = dEmcCpv; }
82 Double_t GetEmcCpvDistance() const { return fEmcCpvDistance; }
83
84 void SetDistanceToBadChannel(Float_t dist) {fDistToBadChannel=dist;}
85 Double_t GetDistanceToBadChannel() const {return fDistToBadChannel;}
86
87 void SetTOF(Double_t tof) { fTOF = tof; }
88 Double_t GetTOF() const { return fTOF; }
89
90 void AddTracksMatched(TArrayI & array) {
91 if(!fTracksMatched)fTracksMatched = new TArrayI(array);
92 else *fTracksMatched = array;
93 }
94 void AddLabels(TArrayI & array) {
95 if(!fLabels)fLabels = new TArrayI(array) ;
96 else *fLabels = array;
97}
98
99 TArrayI * GetTracksMatched() const {return fTracksMatched;}
100 TArrayI * GetLabels() const {return fLabels;}
101
102 Int_t GetTrackMatched() const
103 {if( fTracksMatched && fTracksMatched->GetSize() >0) return fTracksMatched->At(0);
104 else return -1;} //Most likely the track associated to the cluster
105 Int_t GetLabel() const
106 {if( fLabels && fLabels->GetSize() >0) return fLabels->At(0);
107 else return -1;} //Most likely the track associated to the cluster
108
109 Int_t GetNTracksMatched() const {if (fTracksMatched) return fTracksMatched->GetSize();
110 else return -1;}
111 Int_t GetNLabels() const { if (fLabels) return fLabels->GetSize();
112 else return -1;}
113
114 void GetMomentum(TLorentzVector& p, Double_t * vertexPosition );
115
116 // --- NEW ---
117 void SetNCells(Int_t n) { fNCells = n;}
118 Int_t GetNCells() const { return fNCells;}
119
120 void SetCellsAbsId(UShort_t *array) ;
121 UShort_t *GetCellsAbsId() {return fCellsAbsId;}
122
123 void SetCellsAmplitudeFraction(Double32_t *array) ;
124 Double32_t *GetCellsAmplitudeFraction() {return fCellsAmpFraction;}
125
126 Int_t GetCellAbsId(Int_t i) const {
127 if (fCellsAbsId && i >=0 && i < fNCells ) return fCellsAbsId[i];
128 else return -1;}
129
130 Double_t GetCellAmplitudeFraction(Int_t i) const {
131 if (fCellsAmpFraction && i >=0 && i < fNCells ) return fCellsAmpFraction[i];
132 else return -1;}
133
134 //_____________________________________________________
135 //Not used anymore, kept to avoid backward incompatibility
136 void AddDigitIndex(TArrayS & array) { fDigitIndex = new TArrayS(array) ; Warning("AddDigitAmplitude","This method is no more in use") ;}
137 void AddDigitAmplitude(TArrayS & array) { fDigitAmplitude = new TArrayS(array) ; Warning("AddDigitAmplitude","This method is no more in use") ;}
138 void AddDigitTime(TArrayS & array) { fDigitTime = new TArrayS(array) ;Warning("AddDigitTime","This method is no more in use") ;}
139 TArrayS * GetDigitAmplitude() const {return fDigitAmplitude;}
140 TArrayS * GetDigitTime() const {return fDigitTime;}
141 TArrayS * GetDigitIndex() const {return fDigitIndex;}
142 Int_t GetNumberOfDigits() const { return -1;}
143 //_____________________________________________________
144
145protected:
146
147 TArrayI * fTracksMatched; //Index of tracks close to cluster. First entry is the most likely match.
148 TArrayI * fLabels; //list of primaries that generated the cluster, ordered in deposited energy.
149
150 //NEW
151 Int_t fNCells ;
152 UShort_t *fCellsAbsId; //[fNCells] array of cell absId numbers
153 Double32_t *fCellsAmpFraction; //[fNCells][0.,1.,16] array with cell amplitudes fraction.
154
155 //__________________________________________________________
156 //Not in use
157 TArrayS * fDigitAmplitude; //digit energy (integer units)
158 TArrayS * fDigitTime; //time of this digit (integer units)
159 TArrayS * fDigitIndex; //calorimeter digit index
160 //_________________________________________________________
161
162 Double32_t fGlobalPos[3]; // position in global coordinate systemD
163 Double32_t fEnergy; // energy measured by calorimeter
164 Double32_t fDispersion; // cluster dispersion, for shape analysis
165 Double32_t fChi2; // chi2 of cluster fi
166 Double32_t fM20; // 2-nd moment along the main eigen axis
167 Double32_t fM02; // 2-nd moment along the second eigen axis
168
169 Double32_t fEmcCpvDistance; // the distance from PHOS EMC rec.point to the closest CPV rec.point
170 Double32_t fDistToBadChannel; // Distance to nearest bad channel
171 Double32_t fPID[AliPID::kSPECIESN]; //[0,1,8]"detector response probabilities" (for the PID)
172 Int_t fID; // Unique Id of the cluster
173 UChar_t fNExMax ; // number of (Ex-)maxima before unfolding
174 Char_t fClusterType; // Flag for different cluster type/versions
175 Double32_t fTOF; //[0,0,12] time-of-flight
176
177 ClassDef(AliESDCaloCluster,8) //ESDCaloCluster
178};
179
180#endif
181