Line data Source code
1 : // $Id$
2 : /**************************************************************************
3 : * This file is property of and copyright by the ALICE HLT Project *
4 : * All rights reserved. *
5 : * *
6 : * Primary Authors: Oystein Djuvsland *
7 : * *
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 : **************************************************************************/
16 :
17 : #ifndef ALIHLTCALOCLUSTERDATASTRUCT_H
18 : #define ALIHLTCALOCLUSTERDATASTRUCT_H
19 :
20 : /**
21 : * Calo cluster struct for HLT
22 : *
23 : * @file AliHLTCaloClusterDataStruct.h
24 : * @author Oystein Djuvsland
25 : * @date
26 : * @brief Calo cluster struct for HLT
27 : */
28 :
29 : // see below for class documentation
30 : // or
31 : // refer to README to build package
32 : // or
33 : // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
34 :
35 : #include "AliPID.h"
36 : #include "TArrayI.h"
37 : #include "Rtypes.h"
38 :
39 : /**
40 : * @struct AliHLTCaloClusterHeaderStruct
41 : * Calorimeter cluster header describing the number of
42 : * clusters in the following block
43 : *
44 : * @ingroup alihlt_phos
45 : */
46 :
47 :
48 : enum ESDClu_t { kUndef = -2,
49 : kPHOSCluster,
50 : kEMCALPseudoCluster,
51 : kEMCALClusterv1
52 : };
53 :
54 : struct AliHLTCaloClusterHeaderStruct
55 : {
56 : Short_t fNClusters;
57 : Short_t fNDigits;
58 : };
59 :
60 : struct AliHLTCaloCellDataStruct
61 : {
62 : Short_t fCellsAbsId;
63 : Float_t fCellsAmpFraction;
64 : };
65 :
66 :
67 : /**
68 : * @struct AliHLTCaloClusterDataStruct
69 : * Calorimeter cluster data struct for HLT
70 : * Similar to the AliESDCaloCluster class
71 : * @ingroup alihlt_phos
72 : */
73 :
74 : struct AliHLTCaloClusterDataStruct
75 : {
76 :
77 : /** Set the ID */
78 : void SetID(Int_t id) {fID = id;} //COMMENT
79 :
80 : /** Get the ID */
81 : Int_t GetID() const {return fID;} //COMMENT
82 :
83 : /** Get the cluster type */
84 : void SetClusterType(Int_t type) { fClusterType = type; } //COMMENT
85 :
86 : /** Set the cluster type */
87 : Char_t GetClusterType() const {return fClusterType; } //COMMENT
88 :
89 : /** Is it an EMCAL cluster? */
90 : Bool_t IsEMCAL() const {return (fClusterType == kEMCALClusterv1);} //COMMENT
91 :
92 : /** Is it a PHOS cluster */
93 : Bool_t IsPHOS() const {return (fClusterType == kPHOSCluster);} //COMMENT
94 :
95 : /** Set the global postion */
96 : void SetPosition(const Float_t *pos) {
97 : fGlobalPos[0] = pos[0]; fGlobalPos[1] = pos[1]; fGlobalPos[2] = pos[2];
98 : }
99 :
100 : /** Get the global position */
101 : void GetPosition(Float_t *pos) const {
102 : pos[0] = fGlobalPos[0]; pos[1] = fGlobalPos[1]; pos[2] = fGlobalPos[2];
103 : }
104 : /** Set the energy */
105 : void SetE(Float_t ene) { fEnergy = ene;} //COMMENT
106 :
107 : /** Get the energy */
108 : Double_t E() const { return fEnergy;} //COMMENT
109 :
110 : /** Set the cluster dispersion */
111 : void SetClusterDisp(Float_t disp) { fDispersion = disp; } //COMMENT
112 :
113 : /** Get the cluster dispersion */
114 : Double_t GetClusterDisp() const { return fDispersion; } //COMMENT
115 :
116 : /** Set the cluster chi2 */
117 : void SetClusterChi2(Float_t chi2) { fChi2 = chi2; } //COMMENT
118 :
119 : /** Get the cluster chi2 */
120 : Double_t GetClusterChi2() const { return fChi2; } //COMMENT
121 :
122 : /** Set the PID data */
123 : void SetPid(const Float_t *p)
124 : {
125 : // Sets the probability of each particle type
126 : // Copied from AliESDCaloCluster
127 : // This function copies "n" PID weights from "scr" to "dest"
128 : // and normalizes their sum to 1 thus producing conditional
129 : // probabilities.
130 : // The negative weights are set to 0.
131 : // In case all the weights are non-positive they are replaced by
132 : // uniform probabilities
133 :
134 : Int_t n = AliPID::kSPECIESCN;
135 :
136 : Float_t uniform = 1./(Float_t)n;
137 :
138 : Float_t sum = 0;
139 : for (Int_t i=0; i<n; i++)
140 : if (p[i]>=0) {
141 : sum+=p[i];
142 : fPID[i] = p[i];
143 : }
144 : else {
145 : fPID[i] = 0;
146 : }
147 :
148 : if(sum>0)
149 : for (Int_t i=0; i<n; i++) fPID[i] /= sum;
150 : else
151 : for (Int_t i=0; i<n; i++) fPID[i] = uniform;
152 :
153 : }
154 :
155 : /** Get the PID */
156 : Float_t *GetPid() {return fPID;} //COMMENT
157 :
158 : /** Set the M20 */
159 : void SetM20(Float_t m20) { fM20 = m20; } //COMMENT
160 :
161 : /** Get the M20 */
162 : Double_t GetM20() const { return fM20; } //COMMENT
163 :
164 : /** Set the the M02 */
165 : void SetM02(Float_t m02) { fM02 = m02; } //COMMENT
166 :
167 : /** Get the M02 */
168 : Double_t GetM02() const { return fM02; } //COMMENT
169 :
170 : /** Set number of ex-maxima */
171 : void SetNExMax(UChar_t nExMax) { fNExMax = nExMax; } //COMMENT
172 :
173 : /** Get the number of ex maxima */
174 : UChar_t GetNExMax() const { return fNExMax; } //COMMENT
175 :
176 : /** Set the EMC CPV distance */
177 : void SetEmcCpvDistance(Float_t dEmcCpv) { fEmcCpvDistance = dEmcCpv; } //COMMENT
178 :
179 : /** Get the EMC CPV distance */
180 : Double_t GetEmcCpvDistance() const { return fEmcCpvDistance; } //COMMENT
181 :
182 : /** Set the distance to track in x and z dimensions */
183 : void SetTrackDistance(Double_t dx, Double_t dz){fTrackDx=dx; fTrackDz=dz;}
184 :
185 : /** Get the distance to track in x */
186 : Double_t GetTrackDx(void)const {return fTrackDx;} //COMMENT
187 :
188 : /** Get the distance to track in z */
189 : Double_t GetTrackDz(void)const {return fTrackDz;} //COMMENT
190 :
191 : /** Set the distance to closest bad channel */
192 : void SetDistanceToBadChannel(Float_t dist) {fDistToBadChannel=dist;}
193 :
194 : /** Get the distance to closest bad channel */
195 : Double_t GetDistanceToBadChannel() const {return fDistToBadChannel;}
196 :
197 : /** Set the TOF */
198 : void SetTOF(Double_t tof) { fTOF = tof; } //COMMENT
199 :
200 : /** Geth the TOF */
201 : Double_t GetTOF() const { return fTOF; } //COMMENT
202 :
203 : /** Add an array of tracks */
204 : void AddTracksMatched(TArrayI & array)
205 : {
206 : fNTracksMatched = array.GetSize();
207 : for(Int_t t = 0; (t < fNTracksMatched) && (t < 10); t++) //TODO: remove hard coded 10
208 : {
209 : fTracksMatched[t] = array[t];
210 : }
211 : }
212 :
213 : /**
214 : * Get the array of the matched tracks
215 : */
216 : Int_t * GetTracksMatched()
217 : {
218 : return fTracksMatched;
219 : }
220 :
221 : /** Get the best match */
222 : Int_t GetTrackMatched() const
223 : {
224 : if( fTracksMatched[0] >0) return fTracksMatched[0];
225 : else return -1;
226 : } //Most likely the track associated to the cluster
227 :
228 : /** Get the number of tracks matched */
229 : Int_t GetNTracksMatched() const
230 : {
231 0 : for(int i = 0; i < 10; i++)
232 : {
233 0 : if (fTracksMatched[i] < 0)
234 : {
235 0 : return i;
236 : }
237 : }
238 0 : return 10;
239 0 : }
240 :
241 : Int_t GetNCells() const
242 : {
243 : return ( Int_t ) (fNCells);
244 : }
245 :
246 : /** Number of cells in the cluster */
247 : UInt_t fNCells; //COMMENT
248 :
249 : /** Global position */
250 : Float_t fGlobalPos[3]; //COMMENT
251 :
252 : /** The total energy of the cell */
253 : Float_t fEnergy; //COMMENT
254 :
255 : /** The time of flight */
256 : Float_t fTOF; //COMMENT
257 :
258 : /** Dispersion */
259 : Float_t fDispersion; //COMMENT
260 :
261 : /** Chi2 */
262 : Float_t fChi2; //COMMENT
263 :
264 : /** Quality of cluster fit */
265 : Float_t fFitQuality; //COMMENT
266 :
267 : /** Second moment along the main eigen axis */
268 : Float_t fM20; //COMMENT
269 :
270 : /** Second moment along the second eigen axis */
271 : Float_t fM02; //COMMENT
272 :
273 : /** Distance to closest CPV rec point */
274 : Float_t fEmcCpvDistance; //COMMENT
275 :
276 : /** Distance to nearest bad channel */
277 : Float_t fDistToBadChannel; //COMMENT
278 :
279 : /** Distance to closest track in x direction */
280 : Float_t fTrackDx; //COMMENT
281 :
282 : /** Distance to closest track in z direction */
283 : Float_t fTrackDz; //COMMENT
284 :
285 : /** PID */
286 : Float_t fPID[AliPID::kSPECIESCN]; //COMMENT
287 :
288 : /** Unique ID of the cluster*/
289 : Int_t fID; //COMMENT
290 :
291 : /** Number of (Ex) Maxima */
292 : UChar_t fNExMax; //COMMENT
293 :
294 : /** Flag for differtent cluster type/versions */
295 : Char_t fClusterType; //COMMENT
296 :
297 : /** Distance to nearest bad channel */
298 : Float_t fDistanceToBadChannel; //COMMENT
299 :
300 : /** Number of matched tracks */
301 : Int_t fNTracksMatched; //COMMENT Obsolete?
302 :
303 : /** the matced tracks */
304 : Int_t fTracksMatched[10]; //COMMENT TODO: remove hardcoded 10
305 :
306 : /** The module */
307 : Int_t fModule; //COMMENT
308 :
309 : /** Struct containing cell ID and amplitude fraction for the cells */
310 : AliHLTCaloCellDataStruct fCaloCells; //COMMENT
311 :
312 : };
313 :
314 :
315 : #endif
|