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