]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/ESD/AliESDCaloCluster.h
Updates in event mixing code for low-pt code
[u/mrichter/AliRoot.git] / STEER / ESD / AliESDCaloCluster.h
CommitLineData
85c60a8e 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 */
85c60a8e 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
c8fe2783 18#include <AliVCluster.h>
85c60a8e 19#include "AliPID.h"
5efdec54 20#include "TArrayS.h"
4dd59c4a 21#include "TArrayI.h"
c8fe2783 22#include "AliLog.h"
85c60a8e 23
bab0b5f0 24class TLorentzVector;
85c60a8e 25
c8fe2783 26class AliESDCaloCluster : public AliVCluster
e649177a 27{
c8fe2783 28
29 public:
30
85c60a8e 31 AliESDCaloCluster();
32 AliESDCaloCluster(const AliESDCaloCluster& clus);
fe12e09c 33 AliESDCaloCluster & operator=(const AliESDCaloCluster& source);
85c60a8e 34 virtual ~AliESDCaloCluster();
732a24fe 35 virtual void Copy(TObject &) const;
8dd6eba0 36 void Clear(const Option_t*);
37
c8fe2783 38 void SetID(Int_t id) {fID = id;}
85c60a8e 39 Int_t GetID() const {return fID;}
c8fe2783 40
41 void SetType(Char_t type) { fClusterType = type; }
42 Char_t GetType() const {return fClusterType; }
43
44 Bool_t IsEMCAL() const {if(fClusterType == kEMCALClusterv1) return kTRUE; else return kFALSE;}
45 Bool_t IsPHOS() const {if(fClusterType == kPHOSNeutral || fClusterType == kPHOSCharged) return kTRUE;
46 else return kFALSE;}
47
48 void GetPosition (Float_t *x) const {
49 x[0]=fGlobalPos[0]; x[1]=fGlobalPos[1]; x[2]=fGlobalPos[2];}
50 void SetPosition (Float_t *x);
51 void SetPositionAt(Float_t pos, Int_t ipos) {if(ipos>=0 && ipos<3) fGlobalPos[ipos] = pos ;
52 else AliInfo(Form("Bad index for position array, i = %d\n",ipos));}
53
54 void SetE(Double_t ene) { fEnergy = ene;}
55 Double_t E() const { return fEnergy;}
56
57 void SetDispersion(Double_t disp) { fDispersion = disp; }
58 Double_t GetDispersion() const { return fDispersion; }
59
60 void SetChi2(Double_t chi2) { fChi2 = chi2; }
61 Double_t Chi2() const { return fChi2; }
62
63 const Double_t *GetPID() const { return fPID; }
00a38d07 64 //for(Int_t i=0; i<AliPID::kSPECIESCN; ++i) pid[i]=fPID[i];}
c8fe2783 65 void SetPID (const Float_t *pid) ;
00a38d07 66 void SetPIDAt(Float_t p, Int_t i) {if(i>=0 && i<AliPID::kSPECIESCN) fPID[i] = p ;
c8fe2783 67 else AliInfo(Form("Bad index for PID array, i = %d \n",i));}
68
69 void SetM20(Double_t m20) { fM20 = m20; }
70 Double_t GetM20() const { return fM20; }
71
72 void SetM02(Double_t m02) { fM02 = m02; }
73 Double_t GetM02() const { return fM02; }
74
75 void SetNExMax(UChar_t nExMax) { fNExMax = nExMax; }
76 UChar_t GetNExMax() const { return fNExMax; }
77
78 void SetEmcCpvDistance(Double_t dEmcCpv) { fEmcCpvDistance = dEmcCpv; }
8ada0ffe 79 Double_t GetEmcCpvDistance() const { return fEmcCpvDistance; }
f1cedef3 80 void SetTrackDistance(Double_t dx, Double_t dz){fTrackDx=dx; fTrackDz=dz;}
81 Double_t GetTrackDx(void)const {return fTrackDx;}
82 Double_t GetTrackDz(void)const {return fTrackDz;}
c8fe2783 83
84 void SetDistanceToBadChannel(Double_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; }
78902954 89
85005d58 90 void AddTracksMatched(TArrayI & array) {
91 if(!fTracksMatched)fTracksMatched = new TArrayI(array);
92 else *fTracksMatched = array;
93 }
94 void AddLabels(TArrayI & array) {
a2c30af1 95 if(!fLabels)fLabels = new TArrayI(array) ;
85005d58 96 else *fLabels = array;
c8fe2783 97 }
78902954 98
a2c30af1 99 void SetLabel(Int_t *array, UInt_t size)
100 {
101 if(fLabels) delete fLabels ;
102 fLabels = new TArrayI(size,array);
103 }
104
4dd59c4a 105 TArrayI * GetTracksMatched() const {return fTracksMatched;}
c8fe2783 106 TArrayI * GetLabelsArray() const {return fLabels;}
bd255bf3 107 Int_t * GetLabels() const {if (fLabels) return fLabels->GetArray(); else return 0;}
c8fe2783 108
109 Int_t GetTrackMatchedIndex() const
5efdec54 110 {if( fTracksMatched && fTracksMatched->GetSize() >0) return fTracksMatched->At(0);
111 else return -1;} //Most likely the track associated to the cluster
c8fe2783 112
113 Int_t GetLabel() const {
114 if( fLabels && fLabels->GetSize() >0) return fLabels->At(0);
5efdec54 115 else return -1;} //Most likely the track associated to the cluster
c8fe2783 116 Int_t GetLabelAt(UInt_t i) const {
117 if (fLabels && i < (UInt_t)fLabels->GetSize()) return fLabels->At(i);
118 else return -999; }
78902954 119
c8fe2783 120 Int_t GetNTracksMatched() const { if (fTracksMatched) return fTracksMatched->GetSize();
5efdec54 121 else return -1;}
c8fe2783 122 UInt_t GetNLabels() const { if (fLabels) return fLabels->GetSize();
6bebe8ac 123 else return (0);}
c8fe2783 124
38dbf8ce 125 void GetMomentum(TLorentzVector& p, Double_t * vertexPosition ) const;
c8fe2783 126
127 void SetNCells(Int_t n) { fNCells = n;}
0fdeb120 128 Int_t GetNCells() const { return fNCells;}
e649177a 129
c8fe2783 130 void SetCellsAbsId(UShort_t *array) ;
e649177a 131 UShort_t *GetCellsAbsId() {return fCellsAbsId;}
132
c8fe2783 133 void SetCellsAmplitudeFraction(Double32_t *array) ;
e649177a 134 Double32_t *GetCellsAmplitudeFraction() {return fCellsAmpFraction;}
135
136 Int_t GetCellAbsId(Int_t i) const {
137 if (fCellsAbsId && i >=0 && i < fNCells ) return fCellsAbsId[i];
138 else return -1;}
139
140 Double_t GetCellAmplitudeFraction(Int_t i) const {
141 if (fCellsAmpFraction && i >=0 && i < fNCells ) return fCellsAmpFraction[i];
142 else return -1;}
7eff06f2 143
144 Double_t GetMCEnergyFraction() const { return fMCEnergyFraction ; }
145 void SetMCEnergyFraction(Double_t e) { fMCEnergyFraction = e ; }
619b4b09 146
147 virtual Double_t GetCoreEnergy() const {return fCoreEnergy ; }
148 virtual void SetCoreEnergy(Double_t e) { fCoreEnergy=e; }
c8fe2783 149
150 protected:
151
4dd59c4a 152 TArrayI * fTracksMatched; //Index of tracks close to cluster. First entry is the most likely match.
c8fe2783 153 TArrayI * fLabels; //list of primaries that generated the cluster, ordered in deposited energy.
154
155 Int_t fNCells ;
156 UShort_t * fCellsAbsId; //[fNCells] array of cell absId numbers
157 Double32_t * fCellsAmpFraction; //[fNCells][0.,1.,16] array with cell amplitudes fraction.
158
8ada0ffe 159 Double32_t fGlobalPos[3]; // position in global coordinate systemD
160 Double32_t fEnergy; // energy measured by calorimeter
161 Double32_t fDispersion; // cluster dispersion, for shape analysis
162 Double32_t fChi2; // chi2 of cluster fi
163 Double32_t fM20; // 2-nd moment along the main eigen axis
164 Double32_t fM02; // 2-nd moment along the second eigen axis
c8fe2783 165
8ada0ffe 166 Double32_t fEmcCpvDistance; // the distance from PHOS EMC rec.point to the closest CPV rec.point
f1cedef3 167 Double32_t fTrackDx ; // Distance to closest track in phi
168 Double32_t fTrackDz ; // Distance to closest track in z
c8fe2783 169
8ada0ffe 170 Double32_t fDistToBadChannel; // Distance to nearest bad channel
00a38d07 171 Double32_t fPID[AliPID::kSPECIESCN]; //[0,1,8]"detector response probabilities" (for the PID)
c8fe2783 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 Double_t fTOF; //[0,0,12] time-of-flight
176
7eff06f2 177 Double_t fMCEnergyFraction; //!MC energy (embedding)
619b4b09 178 Double32_t fCoreEnergy; // energy of the core of cluster
c8fe2783 179
619b4b09 180 ClassDef(AliESDCaloCluster,12) //ESDCaloCluster
8ada0ffe 181
c8fe2783 182 };
85c60a8e 183
184#endif
185
c8fe2783 186