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