2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * All rights reserved. *
6 * Primary Authors: Oystein Djuvsland *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 #ifndef ALIHLTCALOCLUSTERDATASTRUCT_H
18 #define ALIHLTCALOCLUSTERDATASTRUCT_H
21 * Calo cluster struct for HLT
23 * @file AliHLTCaloClusterDataStruct.h
24 * @author Oystein Djuvsland
26 * @brief Calo cluster struct for HLT
29 // see below for class documentation
31 // refer to README to build package
33 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
40 * @struct AliHLTCaloClusterHeaderStruct
41 * Calorimeter cluster header describing the number of
42 * clusters in the following block
44 * @ingroup alihlt_phos
48 enum ESDClu_t { kUndef,
54 struct AliHLTCaloClusterHeaderStruct
61 * @struct AliHLTCaloClusterDataStruct
62 * Calorimeter cluster data struct for HLT
63 * Similar to the AliESDCaloCluster class
64 * @ingroup alihlt_phos
67 struct AliHLTCaloClusterDataStruct
71 void SetID(Int_t id) {fID = id;} //COMMENT
74 Int_t GetID() const {return fID;} //COMMENT
76 /** Get the cluster type */
77 void SetClusterType(Int_t type) { fClusterType = type; } //COMMENT
79 /** Set the cluster type */
80 Char_t GetClusterType() const {return fClusterType; } //COMMENT
82 /** Is it an EMCAL cluster? */
83 Bool_t IsEMCAL() const {return (fClusterType == kEMCALClusterv1);} //COMMENT
85 /** Is it a PHOS cluster */
86 Bool_t IsPHOS() const {return (fClusterType == kPHOSCluster);} //COMMENT
88 /** Set the global postion */
89 void SetPosition(const Float_t *pos) {
90 fGlobalPos[0] = pos[0]; fGlobalPos[1] = pos[1]; fGlobalPos[2] = pos[2];
93 /** Get the global position */
94 void GetPosition(Float_t *pos) const {
95 pos[0] = fGlobalPos[0]; pos[1] = fGlobalPos[1]; pos[2] = fGlobalPos[2];
98 void SetE(Float_t ene) { fEnergy = ene;} //COMMENT
100 /** Get the energy */
101 Double_t E() const { return fEnergy;} //COMMENT
103 /** Set the cluster dispersion */
104 void SetClusterDisp(Float_t disp) { fDispersion = disp; } //COMMENT
106 /** Get the cluster dispersion */
107 Double_t GetClusterDisp() const { return fDispersion; } //COMMENT
109 /** Set the cluster chi2 */
110 void SetClusterChi2(Float_t chi2) { fChi2 = chi2; } //COMMENT
112 /** Get the cluster chi2 */
113 Double_t GetClusterChi2() const { return fChi2; } //COMMENT
115 /** Set the PID data */
116 void SetPid(const Float_t *p)
118 // Sets the probability of each particle type
119 // Copied from AliESDCaloCluster
120 // This function copies "n" PID weights from "scr" to "dest"
121 // and normalizes their sum to 1 thus producing conditional
123 // The negative weights are set to 0.
124 // In case all the weights are non-positive they are replaced by
125 // uniform probabilities
127 Int_t n = AliPID::kSPECIESN;
129 Float_t uniform = 1./(Float_t)n;
132 for (Int_t i=0; i<n; i++)
142 for (Int_t i=0; i<n; i++) fPID[i] /= sum;
144 for (Int_t i=0; i<n; i++) fPID[i] = uniform;
149 Float_t *GetPid() {return fPID;} //COMMENT
152 void SetM20(Float_t m20) { fM20 = m20; } //COMMENT
155 Double_t GetM20() const { return fM20; } //COMMENT
157 /** Set the the M02 */
158 void SetM02(Float_t m02) { fM02 = m02; } //COMMENT
161 Double_t GetM02() const { return fM02; } //COMMENT
163 /** Set number of ex-maxima */
164 void SetNExMax(UChar_t nExMax) { fNExMax = nExMax; } //COMMENT
166 /** Get the number of ex maxima */
167 UChar_t GetNExMax() const { return fNExMax; } //COMMENT
169 /** Set the EMC CPV distance */
170 void SetEmcCpvDistance(Float_t dEmcCpv) { fEmcCpvDistance = dEmcCpv; } //COMMENT
172 /** Get the EMC CPV distance */
173 Double_t GetEmcCpvDistance() const { return fEmcCpvDistance; } //COMMENT
175 /** Set the distance to track in x and z dimensions */
176 void SetTrackDistance(Double_t dx, Double_t dz){fTrackDx=dx; fTrackDz=dz;}
178 /** Get the distance to track in x */
179 Double_t GetTrackDx(void)const {return fTrackDx;} //COMMENT
181 /** Get the distance to track in z */
182 Double_t GetTrackDz(void)const {return fTrackDz;} //COMMENT
184 /** Set the distance to closest bad channel */
185 void SetDistanceToBadChannel(Float_t dist) {fDistToBadChannel=dist;}
187 /** Get the distance to closest bad channel */
188 Double_t GetDistanceToBadChannel() const {return fDistToBadChannel;}
191 void SetTOF(Double_t tof) { fTOF = tof; } //COMMENT
194 Double_t GetTOF() const { return fTOF; } //COMMENT
196 /** Add an array of tracks */
197 void AddTracksMatched(TArrayI & array)
199 fNTracksMatched = array.GetSize();
200 for(Int_t t = 0; (t < fNTracksMatched) && (t < 10); t++) //TODO: remove hard coded 10
202 fTracksMatched[t] = array[t];
207 * Get the array of the matched tracks
209 const Int_t * GetTracksMatched() const
211 return fTracksMatched;
214 /** Get the best match */
215 Int_t GetTrackMatched() const
217 if( fTracksMatched[0] >0) return fTracksMatched[0];
219 } //Most likely the track associated to the cluster
221 /** Get the number of tracks matched */
222 Int_t GetNTracksMatched() const
224 for(int i = 0; i < 10; i++)
226 if (fTracksMatched[i] < 0)
234 /** Number of cells in the cluster */
235 UInt_t fNCells; //COMMENT
237 /** Global position */
238 Float_t fGlobalPos[3]; //COMMENT
240 /** The total energy of the cell */
241 Float_t fEnergy; //COMMENT
243 /** The time of flight */
244 Float_t fTOF; //COMMENT
247 Float_t fDispersion; //COMMENT
250 Float_t fChi2; //COMMENT
252 /** Quality of cluster fit */
253 Float_t fFitQuality; //COMMENT
255 /** Second moment along the main eigen axis */
256 Float_t fM20; //COMMENT
258 /** Second moment along the second eigen axis */
259 Float_t fM02; //COMMENT
261 /** Distance to closest CPV rec point */
262 Float_t fEmcCpvDistance; //COMMENT
264 /** Distance to nearest bad channel */
265 Float_t fDistToBadChannel; //COMMENT
267 /** Distance to closest track in x direction */
268 Float_t fTrackDx; //COMMENT
270 /** Distance to closest track in z direction */
271 Float_t fTrackDz; //COMMENT
274 Float_t fPID[AliPID::kSPECIESN]; //COMMENT
276 /** Unique ID of the cluster*/
279 /** Number of (Ex) Maxima */
280 UChar_t fNExMax; //COMMENT
282 /** Flag for differtent cluster type/versions */
283 Char_t fClusterType; //COMMENT
285 /** Distance to nearest bad channel */
286 Float_t fDistanceToBadChannel; //COMMENT
288 /** Number of matched tracks */
289 Int_t fNTracksMatched; //COMMENT Obsolete?
291 /** the matced tracks */
292 Int_t fTracksMatched[10]; //COMMENT TODO: remove hardcoded 10
294 /** The absolute IDs of the cells*/
295 UShort_t fCellsAbsId; //COMMENT
298 Float_t fCellsAmpFraction; //COMMENT