]>
Commit | Line | Data |
---|---|---|
8a8d023f | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
5e319bd5 | 16 | /* $Id: AliESD.cxx 54579 2012-02-14 12:22:34Z shahoian $ */ |
8a8d023f | 17 | |
ae982df3 | 18 | //----------------------------------------------------------------- |
19 | // Implementation of the ESD class | |
20 | // This is the class to deal with during the phisical analysis of data | |
af7ba10c | 21 | // This class is generated directly by the reconstruction methods |
ae982df3 | 22 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch |
23 | //----------------------------------------------------------------- | |
8a8d023f | 24 | |
b545009a | 25 | #include "AliESD.h" |
26 | #include "AliESDfriend.h" | |
53203d32 | 27 | |
28 | ClassImp(AliESD) | |
29 | ||
30 | //______________________________________________________________________________ | |
31 | AliESD::AliESD(): | |
af885e0f | 32 | fEventNumberInFile(0), |
33 | fBunchCrossNumber(0), | |
34 | fOrbitNumber(0), | |
35 | fPeriodNumber(0), | |
36 | fRunNumber(0), | |
37 | fTimeStamp(0), | |
38 | fEventType(0), | |
39 | fTriggerMask(0), | |
35a702f0 | 40 | fTriggerMaskNext50(0), |
af885e0f | 41 | fTriggerCluster(0), |
42 | fRecoVersion(0), | |
43 | fMagneticField(0), | |
44 | fZDCN1Energy(0), | |
45 | fZDCP1Energy(0), | |
46 | fZDCN2Energy(0), | |
47 | fZDCP2Energy(0), | |
48 | fZDCEMEnergy(0), | |
49 | fZDCParticipants(0), | |
50 | fT0zVertex(0), | |
51 | fSPDVertex(), | |
52 | fPrimaryVertex(), | |
53 | fSPDMult(), | |
0f0c06de | 54 | fT0clock(0), |
adf36b9d | 55 | fT0timeStart(0), |
56 | fT0trig(0), | |
af885e0f | 57 | fTracks("AliESDtrack",15000), |
58 | fHLTConfMapTracks("AliESDHLTtrack",25000), | |
59 | fHLTHoughTracks("AliESDHLTtrack",15000), | |
60 | fMuonTracks("AliESDMuonTrack",30), | |
61 | fPmdTracks("AliESDPmdTrack",3000), | |
62 | fTrdTracks("AliESDTrdTrack",300), | |
63 | fV0s("AliESDv0",200), | |
64 | fCascades("AliESDcascade",20), | |
65 | fKinks("AliESDkink",4000), | |
66 | fCaloClusters("AliESDCaloCluster",10000), | |
85c60a8e | 67 | fEMCALClusters(0), |
68 | fFirstEMCALCluster(-1), | |
af885e0f | 69 | fEMCALTriggerPosition(0x0), |
70 | fEMCALTriggerAmplitudes(0x0), | |
85c60a8e | 71 | fPHOSClusters(0), |
af885e0f | 72 | fFirstPHOSCluster(-1), |
73 | fPHOSTriggerPosition(0x0), | |
74 | fPHOSTriggerAmplitudes(0x0), | |
75 | fESDFMD(0x0), | |
76 | fESDVZERO(0x0), | |
bd95bae7 | 77 | fESDACORDE(0x0), |
5e319bd5 | 78 | fESDAD(0x0), |
af885e0f | 79 | fErrorLogs("AliRawDataErrorLog",5) |
9da38871 | 80 | { |
6989bff3 | 81 | // |
82 | // Standar constructor | |
83 | // | |
84 | ||
adf36b9d | 85 | for (Int_t i=0; i<3; i++) fT0TOF[i] = 0; |
86 | for (Int_t i=0; i<24; i++) { | |
af885e0f | 87 | fT0time[i] = 0; |
88 | fT0amplitude[i] = 0; | |
89 | } | |
90 | for (Int_t i=0; i<2; i++) fDiamondXY[i]=0.; | |
91 | for (Int_t i=0; i<3; i++) fDiamondCovXY[i]=0.; | |
873f1f73 | 92 | } |
e149da78 | 93 | |
c028b974 | 94 | //______________________________________________________________________________ |
95 | AliESD::AliESD(const AliESD& esd): | |
96 | TObject(esd), | |
af885e0f | 97 | fEventNumberInFile(esd.fEventNumberInFile), |
98 | fBunchCrossNumber(esd.fBunchCrossNumber), | |
99 | fOrbitNumber(esd.fOrbitNumber), | |
100 | fPeriodNumber(esd.fPeriodNumber), | |
101 | fRunNumber(esd.fRunNumber), | |
102 | fTimeStamp(esd.fTimeStamp), | |
103 | fEventType(esd.fEventType), | |
104 | fTriggerMask(esd.fTriggerMask), | |
35a702f0 | 105 | fTriggerMaskNext50(esd.fTriggerMaskNext50), |
af885e0f | 106 | fTriggerCluster(esd.fTriggerCluster), |
107 | fRecoVersion(esd.fRecoVersion), | |
108 | fMagneticField(esd.fMagneticField), | |
109 | fZDCN1Energy(esd.fZDCN1Energy), | |
110 | fZDCP1Energy(esd.fZDCP1Energy), | |
111 | fZDCN2Energy(esd.fZDCN2Energy), | |
112 | fZDCP2Energy(esd.fZDCP2Energy), | |
113 | fZDCEMEnergy(esd.fZDCEMEnergy), | |
114 | fZDCParticipants(esd.fZDCParticipants), | |
115 | fT0zVertex(esd.fT0zVertex), | |
116 | fSPDVertex(esd.fSPDVertex), | |
117 | fPrimaryVertex(esd.fPrimaryVertex), | |
118 | fSPDMult(esd.fSPDMult), | |
0f0c06de | 119 | fT0clock(esd.fT0clock), |
d999f2e6 | 120 | fT0timeStart(esd.fT0timeStart), |
adf36b9d | 121 | fT0trig(esd.fT0trig), |
af885e0f | 122 | fTracks(*((TClonesArray*)esd.fTracks.Clone())), |
123 | fHLTConfMapTracks(*((TClonesArray*)esd.fHLTConfMapTracks.Clone())), | |
124 | fHLTHoughTracks(*((TClonesArray*)esd.fHLTHoughTracks.Clone())), | |
125 | fMuonTracks(*((TClonesArray*)esd.fMuonTracks.Clone())), | |
126 | fPmdTracks(*((TClonesArray*)esd.fPmdTracks.Clone())), | |
127 | fTrdTracks(*((TClonesArray*)esd.fTrdTracks.Clone())), | |
128 | fV0s(*((TClonesArray*)esd.fV0s.Clone())), | |
129 | fCascades(*((TClonesArray*)esd.fCascades.Clone())), | |
130 | fKinks(*((TClonesArray*)esd.fKinks.Clone())), | |
131 | fCaloClusters(*((TClonesArray*)esd.fCaloClusters.Clone())), | |
c028b974 | 132 | fEMCALClusters(esd.fEMCALClusters), |
133 | fFirstEMCALCluster(esd.fFirstEMCALCluster), | |
af885e0f | 134 | fEMCALTriggerPosition(esd. fEMCALTriggerPosition), |
135 | fEMCALTriggerAmplitudes(esd.fEMCALTriggerAmplitudes), | |
c028b974 | 136 | fPHOSClusters(esd.fPHOSClusters), |
af885e0f | 137 | fFirstPHOSCluster(esd.fFirstPHOSCluster), |
138 | fPHOSTriggerPosition(esd.fPHOSTriggerPosition), | |
139 | fPHOSTriggerAmplitudes(esd.fPHOSTriggerAmplitudes), | |
140 | fESDFMD(esd.fESDFMD), | |
141 | fESDVZERO(esd.fESDVZERO), | |
bd95bae7 | 142 | fESDACORDE(esd.fESDACORDE), |
5e319bd5 | 143 | fESDAD(esd.fESDAD), |
af885e0f | 144 | fErrorLogs(*((TClonesArray*)esd.fErrorLogs.Clone())) |
c028b974 | 145 | { |
6989bff3 | 146 | // |
147 | // copy constructor | |
148 | // | |
adf36b9d | 149 | for (Int_t i=0; i<3; i++)fT0TOF[i] = esd.fT0TOF[i]; |
af885e0f | 150 | for (Int_t i=0; i<24; i++) { |
151 | fT0time[i] = esd.fT0time[i]; | |
152 | fT0amplitude[i] = esd.fT0amplitude[i]; | |
153 | } | |
154 | for (Int_t i=0; i<2; i++) fDiamondXY[i]=esd.fDiamondXY[i]; | |
155 | for (Int_t i=0; i<3; i++) fDiamondCovXY[i]=esd.fDiamondCovXY[i]; | |
c028b974 | 156 | } |
157 | ||
af7ba10c | 158 | //______________________________________________________________________________ |
159 | AliESD::~AliESD() | |
160 | { | |
161 | // | |
162 | // Standard destructor | |
163 | // | |
af885e0f | 164 | fTracks.Delete(); |
8bbc564d | 165 | fHLTConfMapTracks.Delete(); |
166 | fHLTHoughTracks.Delete(); | |
af885e0f | 167 | fMuonTracks.Delete(); |
af7ba10c | 168 | fPmdTracks.Delete(); |
0ee00e25 | 169 | fTrdTracks.Delete(); |
af7ba10c | 170 | fV0s.Delete(); |
171 | fCascades.Delete(); | |
51ad6848 | 172 | fKinks.Delete(); |
85c60a8e | 173 | fCaloClusters.Delete(); |
af885e0f | 174 | delete fESDFMD; |
175 | delete fESDVZERO; | |
6989bff3 | 176 | delete fEMCALTriggerPosition; |
177 | delete fEMCALTriggerAmplitudes; | |
178 | delete fPHOSTriggerPosition; | |
179 | delete fPHOSTriggerAmplitudes; | |
bd95bae7 | 180 | delete fESDACORDE; |
5e319bd5 | 181 | delete fESDAD; |
af885e0f | 182 | fErrorLogs.Delete(); |
64df000d | 183 | |
51ad6848 | 184 | } |
185 | ||
bf25155c | 186 | //______________________________________________________________________________ |
187 | void AliESD::Reset() | |
188 | { | |
6989bff3 | 189 | // |
190 | // Reset the contents and delete the entries in TClonesArrays | |
191 | // | |
192 | ||
af885e0f | 193 | fEventNumberInFile=0; |
194 | fBunchCrossNumber=0; | |
195 | fOrbitNumber=0; | |
196 | fPeriodNumber=0; | |
197 | fRunNumber=0; | |
198 | fTimeStamp = 0; | |
199 | fEventType = 0; | |
200 | fTriggerMask=0; | |
35a702f0 | 201 | fTriggerMaskNext50=0; |
af885e0f | 202 | fTriggerCluster=0; |
203 | fRecoVersion=0; | |
204 | fMagneticField=0; | |
205 | fZDCN1Energy=0; | |
206 | fZDCP1Energy=0; | |
207 | fZDCN2Energy=0; | |
208 | fZDCP2Energy=0; | |
209 | fZDCEMEnergy=0; | |
210 | fZDCParticipants=0; | |
211 | fT0zVertex=0; | |
5a2b4ee8 | 212 | |
6989bff3 | 213 | for (Int_t i=0; i<2; i++) fDiamondXY[i]=0.; |
214 | for (Int_t i=0; i<3; i++) fDiamondCovXY[i]=0.; | |
5a2b4ee8 | 215 | |
6989bff3 | 216 | for (Int_t i=0; i<24; i++) { |
217 | fT0time[i] = 0; | |
218 | fT0amplitude[i] = 0; | |
219 | } | |
220 | fT0timeStart = 0; | |
0f0c06de | 221 | fT0clock = 0; |
adf36b9d | 222 | for (Int_t i=0; i<3; i++) fT0TOF[i] = 0; |
5a2b4ee8 | 223 | // |
224 | fSPDMult.~AliMultiplicity(); | |
225 | new (&fSPDMult) AliMultiplicity(); | |
226 | fSPDVertex.~AliESDVertex(); | |
227 | new (&fSPDVertex) AliESDVertex(); | |
228 | fPrimaryVertex.~AliESDVertex(); | |
229 | new (&fPrimaryVertex) AliESDVertex(); | |
230 | // | |
6989bff3 | 231 | fTracks.Delete(); |
232 | fHLTConfMapTracks.Delete(); | |
233 | fHLTHoughTracks.Delete(); | |
234 | fMuonTracks.Delete(); | |
235 | fPmdTracks.Delete(); | |
236 | fTrdTracks.Delete(); | |
237 | fV0s.Delete(); | |
238 | fCascades.Delete(); | |
5a2b4ee8 | 239 | fKinks.Delete(); |
6989bff3 | 240 | fCaloClusters.Delete(); |
5a2b4ee8 | 241 | // |
85c60a8e | 242 | fEMCALClusters=0; |
243 | fFirstEMCALCluster=-1; | |
244 | fPHOSClusters=0; | |
245 | fFirstPHOSCluster=-1; | |
5a2b4ee8 | 246 | // |
247 | if (fEMCALTriggerPosition) fEMCALTriggerPosition ->Reset(); | |
248 | if (fEMCALTriggerAmplitudes) fEMCALTriggerAmplitudes->Reset(); | |
249 | if (fPHOSTriggerPosition) fPHOSTriggerPosition ->Reset(); | |
250 | if (fPHOSTriggerAmplitudes) fPHOSTriggerAmplitudes ->Reset(); | |
251 | // | |
af885e0f | 252 | if (fESDFMD) fESDFMD->Clear(); |
5a2b4ee8 | 253 | // |
6989bff3 | 254 | if (fESDVZERO){ |
5a2b4ee8 | 255 | fESDVZERO->~AliESDVZERO(); |
256 | new (fESDVZERO) AliESDVZERO(); | |
6989bff3 | 257 | } |
bd95bae7 | 258 | // |
259 | if (fESDACORDE){ | |
260 | fESDACORDE->~AliESDACORDE(); | |
261 | new (fESDACORDE) AliESDACORDE(); | |
820b4d9e | 262 | } |
5e319bd5 | 263 | |
264 | if (fESDAD){ | |
265 | fESDAD->~AliESDAD(); | |
266 | new (fESDAD) AliESDAD(); | |
267 | } | |
268 | ||
820b4d9e | 269 | // |
5a2b4ee8 | 270 | // |
6989bff3 | 271 | fErrorLogs.Delete(); |
bf25155c | 272 | } |
af7ba10c | 273 | |
a023d8d8 | 274 | |
275 | Bool_t AliESD::RemoveKink(Int_t rm) { | |
276 | // --------------------------------------------------------- | |
277 | // Remove a kink candidate and references to it from ESD, | |
278 | // if this candidate does not come from a reconstructed decay | |
279 | // Not yet implemented... | |
280 | // --------------------------------------------------------- | |
281 | Int_t last=GetNumberOfKinks()-1; | |
282 | if ((rm<0)||(rm>last)) return kFALSE; | |
283 | ||
284 | return kTRUE; | |
285 | } | |
286 | ||
287 | Bool_t AliESD::RemoveV0(Int_t rm) { | |
288 | // --------------------------------------------------------- | |
289 | // Remove a V0 candidate and references to it from ESD, | |
290 | // if this candidate does not come from a reconstructed decay | |
291 | // --------------------------------------------------------- | |
292 | Int_t last=GetNumberOfV0s()-1; | |
293 | if ((rm<0)||(rm>last)) return kFALSE; | |
294 | ||
295 | AliESDv0 *v0=GetV0(rm); | |
296 | Int_t idxP=v0->GetPindex(), idxN=v0->GetNindex(); | |
297 | ||
298 | v0=GetV0(last); | |
299 | Int_t lastIdxP=v0->GetPindex(), lastIdxN=v0->GetNindex(); | |
300 | ||
301 | Int_t used=0; | |
302 | ||
303 | // Check if this V0 comes from a reconstructed decay | |
304 | Int_t ncs=GetNumberOfCascades(); | |
305 | for (Int_t n=0; n<ncs; n++) { | |
306 | AliESDcascade *cs=GetCascade(n); | |
307 | ||
308 | Int_t csIdxP=cs->GetPindex(); | |
309 | Int_t csIdxN=cs->GetNindex(); | |
310 | ||
311 | if (idxP==csIdxP) | |
312 | if (idxN==csIdxN) return kFALSE; | |
313 | ||
314 | if (csIdxP==lastIdxP) | |
315 | if (csIdxN==lastIdxN) used++; | |
316 | } | |
317 | ||
318 | //Replace the removed V0 with the last V0 | |
319 | TClonesArray &a=fV0s; | |
320 | delete a.RemoveAt(rm); | |
321 | ||
322 | if (rm==last) return kTRUE; | |
323 | ||
324 | //v0 is pointing to the last V0 candidate... | |
325 | new (a[rm]) AliESDv0(*v0); | |
326 | delete a.RemoveAt(last); | |
327 | ||
328 | if (!used) return kTRUE; | |
329 | ||
330 | ||
331 | // Remap the indices of the daughters of reconstructed decays | |
332 | for (Int_t n=0; n<ncs; n++) { | |
333 | AliESDcascade *cs=GetCascade(n); | |
334 | ||
335 | ||
336 | Int_t csIdxP=cs->GetPindex(); | |
337 | Int_t csIdxN=cs->GetNindex(); | |
338 | ||
339 | if (csIdxP==lastIdxP) | |
340 | if (csIdxN==lastIdxN) { | |
341 | cs->AliESDv0::SetIndex(1,idxP); | |
342 | cs->AliESDv0::SetIndex(0,idxN); | |
343 | used--; | |
344 | if (!used) return kTRUE; | |
345 | } | |
346 | } | |
347 | ||
348 | return kTRUE; | |
349 | } | |
350 | ||
7f68891d | 351 | Bool_t AliESD::RemoveTrack(Int_t rm) { |
d64bd07d | 352 | // --------------------------------------------------------- |
7f68891d | 353 | // Remove a track and references to it from ESD, |
354 | // if this track does not come from a reconstructed decay | |
d64bd07d | 355 | // --------------------------------------------------------- |
7f68891d | 356 | Int_t last=GetNumberOfTracks()-1; |
357 | if ((rm<0)||(rm>last)) return kFALSE; | |
358 | ||
359 | Int_t used=0; | |
d64bd07d | 360 | |
6fca035d | 361 | // Check if this track comes from the reconstructed primary vertex |
362 | if (fPrimaryVertex.GetStatus()) { | |
363 | UShort_t *primIdx=fPrimaryVertex.GetIndices(); | |
364 | Int_t n=fPrimaryVertex.GetNIndices(); | |
365 | while (n--) { | |
366 | Int_t idx=Int_t(primIdx[n]); | |
367 | if (rm==idx) return kFALSE; | |
368 | if (idx==last) used++; | |
369 | } | |
370 | } | |
371 | ||
d64bd07d | 372 | // Check if this track comes from a reconstructed decay |
7f68891d | 373 | Int_t nv0=GetNumberOfV0s(); |
374 | for (Int_t n=0; n<nv0; n++) { | |
375 | AliESDv0 *v0=GetV0(n); | |
376 | ||
377 | Int_t idx=v0->GetNindex(); | |
378 | if (rm==idx) return kFALSE; | |
379 | if (idx==last) used++; | |
380 | ||
381 | idx=v0->GetPindex(); | |
382 | if (rm==idx) return kFALSE; | |
383 | if (idx==last) used++; | |
384 | } | |
d64bd07d | 385 | |
7f68891d | 386 | Int_t ncs=GetNumberOfCascades(); |
387 | for (Int_t n=0; n<ncs; n++) { | |
388 | AliESDcascade *cs=GetCascade(n); | |
d64bd07d | 389 | |
7f68891d | 390 | Int_t idx=cs->GetIndex(); |
391 | if (rm==idx) return kFALSE; | |
392 | if (idx==last) used++; | |
393 | } | |
394 | ||
395 | Int_t nkn=GetNumberOfKinks(); | |
396 | for (Int_t n=0; n<nkn; n++) { | |
397 | AliESDkink *kn=GetKink(n); | |
d64bd07d | 398 | |
7f68891d | 399 | Int_t idx=kn->GetIndex(0); |
400 | if (rm==idx) return kFALSE; | |
401 | if (idx==last) used++; | |
402 | ||
403 | idx=kn->GetIndex(1); | |
404 | if (rm==idx) return kFALSE; | |
405 | if (idx==last) used++; | |
406 | } | |
407 | ||
408 | ||
409 | //Replace the removed track with the last track | |
410 | TClonesArray &a=fTracks; | |
411 | delete a.RemoveAt(rm); | |
412 | ||
413 | if (rm==last) return kTRUE; | |
414 | ||
415 | AliESDtrack *t=GetTrack(last); | |
5297d75d | 416 | if (!t) {AliFatal(Form("NULL pointer for ESD track %d",last)); return kFALSE;} |
7f68891d | 417 | t->SetID(rm); |
ddfbc51a | 418 | new (a[rm]) AliESDtrack(*t); |
7f68891d | 419 | delete a.RemoveAt(last); |
420 | ||
6fca035d | 421 | |
7f68891d | 422 | if (!used) return kTRUE; |
7f68891d | 423 | |
a023d8d8 | 424 | |
6fca035d | 425 | // Remap the indices of the tracks used for the primary vertex reconstruction |
426 | if (fPrimaryVertex.GetStatus()) { | |
427 | UShort_t *primIdx=fPrimaryVertex.GetIndices(); | |
428 | Int_t n=fPrimaryVertex.GetNIndices(); | |
429 | while (n--) { | |
430 | Int_t idx=Int_t(primIdx[n]); | |
431 | if (idx==last) { | |
432 | primIdx[n]=Short_t(rm); | |
433 | used--; | |
434 | if (!used) return kTRUE; | |
435 | } | |
436 | } | |
437 | } | |
438 | ||
7f68891d | 439 | // Remap the indices of the daughters of reconstructed decays |
440 | for (Int_t n=0; n<nv0; n++) { | |
441 | AliESDv0 *v0=GetV0(n); | |
442 | if (v0->GetIndex(0)==last) { | |
443 | v0->SetIndex(0,rm); | |
444 | used--; | |
445 | if (!used) return kTRUE; | |
446 | } | |
447 | if (v0->GetIndex(1)==last) { | |
448 | v0->SetIndex(1,rm); | |
449 | used--; | |
450 | if (!used) return kTRUE; | |
451 | } | |
452 | } | |
453 | ||
454 | for (Int_t n=0; n<ncs; n++) { | |
455 | AliESDcascade *cs=GetCascade(n); | |
456 | if (cs->GetIndex()==last) { | |
457 | cs->SetIndex(rm); | |
458 | used--; | |
459 | if (!used) return kTRUE; | |
460 | } | |
461 | } | |
462 | ||
463 | for (Int_t n=0; n<nkn; n++) { | |
464 | AliESDkink *kn=GetKink(n); | |
465 | if (kn->GetIndex(0)==last) { | |
466 | kn->SetIndex(rm,0); | |
467 | used--; | |
468 | if (!used) return kTRUE; | |
469 | } | |
470 | if (kn->GetIndex(1)==last) { | |
471 | kn->SetIndex(rm,1); | |
472 | used--; | |
473 | if (!used) return kTRUE; | |
474 | } | |
475 | } | |
d64bd07d | 476 | |
477 | return kTRUE; | |
478 | } | |
479 | ||
a023d8d8 | 480 | |
7f68891d | 481 | Bool_t AliESD::Clean(Float_t *cleanPars) { |
482 | // | |
483 | // Remove the data which are not needed for the physics analysis. | |
484 | // | |
a023d8d8 | 485 | // 1) Cleaning the V0 candidates |
486 | // --------------------------- | |
487 | // If the cosine of the V0 pointing angle "csp" and | |
488 | // the DCA between the daughter tracks "dca" does not satisfy | |
489 | // the conditions | |
490 | // | |
491 | // csp > cleanPars[1] + dca/cleanPars[0]*(1.- cleanPars[1]) | |
492 | // | |
493 | // an attempt to remove this V0 candidate from ESD is made. | |
494 | // | |
495 | // The V0 candidate gets removed if it does not belong to any | |
496 | // recosntructed cascade decay | |
497 | // | |
498 | // 12.11.2007, optimal values: cleanPars[0]=0.5, cleanPars[1]=0.999 | |
499 | // | |
500 | // 2) Cleaning the tracks | |
501 | // ---------------------- | |
502 | // If track's transverse parameter is larger than cleanPars[2] | |
7f68891d | 503 | // OR |
a023d8d8 | 504 | // track's longitudinal parameter is larger than cleanPars[3] |
505 | // an attempt to remove this track from ESD is made. | |
7f68891d | 506 | // |
a023d8d8 | 507 | // The track gets removed if it does not come |
508 | // from a reconstructed decay | |
7f68891d | 509 | // |
a023d8d8 | 510 | Bool_t rc=kFALSE; |
511 | ||
512 | Float_t dcaMax=cleanPars[0]; | |
513 | Float_t cspMin=cleanPars[1]; | |
514 | ||
515 | Int_t nV0s=GetNumberOfV0s(); | |
516 | for (Int_t i=nV0s-1; i>=0; i--) { | |
517 | AliESDv0 *v0=GetV0(i); | |
518 | ||
519 | Float_t dca=v0->GetDcaV0Daughters(); | |
520 | Float_t csp=v0->GetV0CosineOfPointingAngle(); | |
521 | Float_t cspcut=cspMin + dca/dcaMax*(1.-cspMin); | |
522 | if (csp > cspcut) continue; | |
523 | ||
524 | if (RemoveV0(i)) rc=kTRUE; | |
525 | } | |
526 | ||
7f68891d | 527 | |
a023d8d8 | 528 | Float_t dmax=cleanPars[2], zmax=cleanPars[3]; |
7f68891d | 529 | |
530 | const AliESDVertex *vertex=GetVertex(); | |
a023d8d8 | 531 | Bool_t vtxOK=vertex->GetStatus(); |
7f68891d | 532 | |
533 | Int_t nTracks=GetNumberOfTracks(); | |
534 | for (Int_t i=nTracks-1; i>=0; i--) { | |
535 | AliESDtrack *track=GetTrack(i); | |
5297d75d | 536 | if (!track) {AliFatal(Form("NULL pointer for ESD track %d",i)); return kFALSE;} |
7f68891d | 537 | Float_t xy,z; track->GetImpactParameters(xy,z); |
538 | if ((TMath::Abs(xy) > dmax) || (vtxOK && (TMath::Abs(z) > zmax))) { | |
539 | if (RemoveTrack(i)) rc=kTRUE; | |
540 | } | |
541 | } | |
542 | ||
543 | return rc; | |
544 | } | |
545 | ||
d6a49f20 | 546 | Int_t AliESD::AddV0(const AliESDv0 *v) { |
547 | // | |
548 | // Add V0 | |
549 | // | |
af885e0f | 550 | Int_t idx=fV0s.GetEntriesFast(); |
551 | new(fV0s[idx]) AliESDv0(*v); | |
552 | return idx; | |
d6a49f20 | 553 | } |
554 | ||
af7ba10c | 555 | //______________________________________________________________________________ |
556 | void AliESD::Print(Option_t *) const | |
557 | { | |
558 | // | |
559 | // Print header information of the event | |
560 | // | |
5f7789fc | 561 | printf("ESD run information\n"); |
35a702f0 | 562 | printf("Event # in file %d Bunch crossing # %d Orbit # %d Period # %d Run # %d Trigger %lld %lld Magnetic field %f \n", |
31fd97b2 | 563 | GetEventNumberInFile(), |
564 | GetBunchCrossNumber(), | |
565 | GetOrbitNumber(), | |
4d422cad | 566 | GetPeriodNumber(), |
ef278eae | 567 | GetRunNumber(), |
b647652d | 568 | GetTriggerMask(), |
35a702f0 | 569 | GetTriggerMaskNext50(), |
ef278eae | 570 | GetMagneticField() ); |
af885e0f | 571 | printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n", |
e690d4d0 | 572 | fPrimaryVertex.GetX(), fPrimaryVertex.GetXRes(), |
573 | fPrimaryVertex.GetY(), fPrimaryVertex.GetYRes(), | |
574 | fPrimaryVertex.GetZ(), fPrimaryVertex.GetZRes()); | |
9f57c1aa | 575 | printf("Mean vertex in RUN: X=%.4f Y=%.4f cm\n", |
576 | GetDiamondX(),GetDiamondY()); | |
32e449be | 577 | printf("SPD Multiplicity. Number of tracklets %d \n", |
af885e0f | 578 | fSPDMult.GetNumberOfTracklets()); |
579 | printf("Event from reconstruction version %d \n",fRecoVersion); | |
ef278eae | 580 | printf("Number of tracks: \n"); |
85c60a8e | 581 | printf(" charged %d\n", GetNumberOfTracks()); |
af885e0f | 582 | printf(" hlt CF %d\n", GetNumberOfHLTConfMapTracks()); |
583 | printf(" hlt HT %d\n", GetNumberOfHLTHoughTracks()); | |
ef278eae | 584 | printf(" muon %d\n", GetNumberOfMuonTracks()); |
a2882fb4 | 585 | printf(" pmd %d\n", GetNumberOfPmdTracks()); |
0ee00e25 | 586 | printf(" trd %d\n", GetNumberOfTrdTracks()); |
ef278eae | 587 | printf(" v0 %d\n", GetNumberOfV0s()); |
667ee8bf | 588 | printf(" cascades %d\n", GetNumberOfCascades()); |
589 | printf(" kinks %d\n", GetNumberOfKinks()); | |
667ee8bf | 590 | printf(" CaloClusters %d\n", GetNumberOfCaloClusters()); |
591 | printf(" phos %d\n", GetNumberOfPHOSClusters()); | |
592 | printf(" emcal %d\n", GetNumberOfEMCALClusters()); | |
593 | printf(" FMD %s\n", (fESDFMD ? "yes" : "no")); | |
dd735cf0 | 594 | printf(" VZERO %s\n", (fESDVZERO ? "yes" : "no")); |
ef278eae | 595 | } |
d75007f6 | 596 | |
597 | void AliESD::SetESDfriend(const AliESDfriend *ev) { | |
598 | // | |
599 | // Attaches the complementary info to the ESD | |
600 | // | |
601 | if (!ev) return; | |
602 | ||
603 | Int_t ntrk=ev->GetNumberOfTracks(); | |
af885e0f | 604 | |
d75007f6 | 605 | for (Int_t i=0; i<ntrk; i++) { |
606 | const AliESDfriendTrack *f=ev->GetTrack(i); | |
a6c3743e | 607 | if (!f) {AliFatal(Form("NULL pointer for ESD track %d",i));} |
d75007f6 | 608 | GetTrack(i)->SetFriendTrack(f); |
609 | } | |
610 | } | |
611 | ||
612 | void AliESD::GetESDfriend(AliESDfriend *ev) const { | |
613 | // | |
614 | // Extracts the complementary info from the ESD | |
615 | // | |
616 | if (!ev) return; | |
617 | ||
618 | Int_t ntrk=GetNumberOfTracks(); | |
619 | ||
620 | for (Int_t i=0; i<ntrk; i++) { | |
80799a5f | 621 | AliESDtrack *t=GetTrack(i); |
a6c3743e | 622 | if (!t) {AliFatal(Form("NULL pointer for ESD track %d",i));} |
ddfbc51a | 623 | const AliESDfriendTrack *f=t->GetFriendTrack(); |
624 | ev->AddTrack(f); | |
625 | ||
626 | t->ReleaseESDfriendTrack();// Not to have two copies of "friendTrack" | |
627 | ||
d75007f6 | 628 | } |
629 | } | |
6989bff3 | 630 | |
631 | void AliESD::SetDiamond(const AliESDVertex *vertex) | |
632 | { | |
633 | // | |
634 | // Set the interaction diamond | |
635 | // | |
e690d4d0 | 636 | fDiamondXY[0]=vertex->GetX(); |
637 | fDiamondXY[1]=vertex->GetY(); | |
6989bff3 | 638 | Double_t cov[6]; |
639 | vertex->GetCovMatrix(cov); | |
640 | fDiamondCovXY[0]=cov[0]; | |
641 | fDiamondCovXY[1]=cov[1]; | |
642 | fDiamondCovXY[2]=cov[2]; | |
643 | } |