]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/ESD/AliESD.cxx
Geometry for run3 implemented with updated TDI
[u/mrichter/AliRoot.git] / STEER / ESD / AliESD.cxx
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
16 /* $Id: AliESD.cxx 54579 2012-02-14 12:22:34Z shahoian $ */
17
18 //-----------------------------------------------------------------
19 //           Implementation of the ESD class
20 //   This is the class to deal with during the phisical analysis of data
21 //   This class is generated directly by the reconstruction methods
22 //      Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
23 //-----------------------------------------------------------------
24
25 #include "AliESD.h"
26 #include "AliESDfriend.h"
27
28 ClassImp(AliESD)
29
30 //______________________________________________________________________________
31 AliESD::AliESD():
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   fTriggerMaskNext50(0),
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(),
54   fT0clock(0),
55   fT0timeStart(0),
56   fT0trig(0),
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),
67   fEMCALClusters(0), 
68   fFirstEMCALCluster(-1),
69   fEMCALTriggerPosition(0x0),
70   fEMCALTriggerAmplitudes(0x0),
71   fPHOSClusters(0), 
72   fFirstPHOSCluster(-1),
73   fPHOSTriggerPosition(0x0),
74   fPHOSTriggerAmplitudes(0x0),
75   fESDFMD(0x0),
76   fESDVZERO(0x0),
77   fESDACORDE(0x0),
78   fESDAD(0x0),
79   fErrorLogs("AliRawDataErrorLog",5)
80 {
81   // 
82   // Standar constructor
83   //
84
85    for (Int_t i=0; i<3; i++) fT0TOF[i] = 0;
86  for (Int_t i=0; i<24; i++) {
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.;
92 }
93
94 //______________________________________________________________________________
95 AliESD::AliESD(const AliESD& esd):
96   TObject(esd),
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),
105   fTriggerMaskNext50(esd.fTriggerMaskNext50),
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),
119   fT0clock(esd.fT0clock),
120   fT0timeStart(esd.fT0timeStart),
121   fT0trig(esd.fT0trig),
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())),
132   fEMCALClusters(esd.fEMCALClusters), 
133   fFirstEMCALCluster(esd.fFirstEMCALCluster),
134   fEMCALTriggerPosition(esd. fEMCALTriggerPosition),
135   fEMCALTriggerAmplitudes(esd.fEMCALTriggerAmplitudes),
136   fPHOSClusters(esd.fPHOSClusters), 
137   fFirstPHOSCluster(esd.fFirstPHOSCluster),
138   fPHOSTriggerPosition(esd.fPHOSTriggerPosition),
139   fPHOSTriggerAmplitudes(esd.fPHOSTriggerAmplitudes),
140   fESDFMD(esd.fESDFMD),
141   fESDVZERO(esd.fESDVZERO),
142   fESDACORDE(esd.fESDACORDE),
143   fESDAD(esd.fESDAD),
144   fErrorLogs(*((TClonesArray*)esd.fErrorLogs.Clone()))
145 {
146   // 
147   // copy constructor
148   //
149   for (Int_t i=0; i<3; i++)fT0TOF[i] = esd.fT0TOF[i];
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];
156 }
157
158 //______________________________________________________________________________
159 AliESD::~AliESD()
160 {
161   //
162   // Standard destructor
163   //
164   fTracks.Delete();
165   fHLTConfMapTracks.Delete();
166   fHLTHoughTracks.Delete();
167   fMuonTracks.Delete();
168   fPmdTracks.Delete();
169   fTrdTracks.Delete();
170   fV0s.Delete();
171   fCascades.Delete();
172   fKinks.Delete();
173   fCaloClusters.Delete();
174   delete fESDFMD;
175   delete fESDVZERO;
176   delete fEMCALTriggerPosition;
177   delete fEMCALTriggerAmplitudes;
178   delete fPHOSTriggerPosition;
179   delete fPHOSTriggerAmplitudes;
180   delete fESDACORDE;
181   delete fESDAD;
182   fErrorLogs.Delete();
183
184 }
185
186 //______________________________________________________________________________
187 void AliESD::Reset()
188 {
189   // 
190   // Reset the contents and delete the entries in TClonesArrays
191   //
192
193   fEventNumberInFile=0;
194   fBunchCrossNumber=0;
195   fOrbitNumber=0;
196   fPeriodNumber=0;
197   fRunNumber=0;
198   fTimeStamp = 0;
199   fEventType = 0;
200   fTriggerMask=0;
201   fTriggerMaskNext50=0;
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;
212   
213   for (Int_t i=0; i<2; i++) fDiamondXY[i]=0.;
214   for (Int_t i=0; i<3; i++) fDiamondCovXY[i]=0.;
215
216   for (Int_t i=0; i<24; i++) {
217     fT0time[i] = 0;
218     fT0amplitude[i] = 0;
219   }
220   fT0timeStart = 0;
221   fT0clock = 0;
222   for (Int_t i=0; i<3; i++) fT0TOF[i] = 0;
223 //
224   fSPDMult.~AliMultiplicity();
225   new (&fSPDMult) AliMultiplicity();
226   fSPDVertex.~AliESDVertex();
227   new (&fSPDVertex) AliESDVertex();
228   fPrimaryVertex.~AliESDVertex();
229   new (&fPrimaryVertex) AliESDVertex();
230 //
231   fTracks.Delete();
232   fHLTConfMapTracks.Delete();
233   fHLTHoughTracks.Delete();
234   fMuonTracks.Delete();
235   fPmdTracks.Delete();
236   fTrdTracks.Delete();
237   fV0s.Delete();
238   fCascades.Delete();
239   fKinks.Delete();
240   fCaloClusters.Delete();
241 //
242   fEMCALClusters=0; 
243   fFirstEMCALCluster=-1; 
244   fPHOSClusters=0; 
245   fFirstPHOSCluster=-1; 
246 //
247   if (fEMCALTriggerPosition)   fEMCALTriggerPosition  ->Reset();
248   if (fEMCALTriggerAmplitudes) fEMCALTriggerAmplitudes->Reset();
249   if (fPHOSTriggerPosition)    fPHOSTriggerPosition   ->Reset();
250   if (fPHOSTriggerAmplitudes)  fPHOSTriggerAmplitudes ->Reset();
251 //
252   if (fESDFMD) fESDFMD->Clear();
253 //
254   if (fESDVZERO){
255       fESDVZERO->~AliESDVZERO();
256       new (fESDVZERO) AliESDVZERO();
257   } 
258 //
259   if (fESDACORDE){
260       fESDACORDE->~AliESDACORDE();
261       new (fESDACORDE) AliESDACORDE();  
262   }     
263
264  if (fESDAD){
265       fESDAD->~AliESDAD();
266       new (fESDAD) AliESDAD();  
267   }     
268
269 //
270 //
271   fErrorLogs.Delete();
272 }
273
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
351 Bool_t  AliESD::RemoveTrack(Int_t rm) {
352   // ---------------------------------------------------------
353   // Remove a track and references to it from ESD,
354   // if this track does not come from a reconstructed decay
355   // ---------------------------------------------------------
356   Int_t last=GetNumberOfTracks()-1;
357   if ((rm<0)||(rm>last)) return kFALSE;
358
359   Int_t used=0;
360
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   
372   // Check if this track comes from a reconstructed decay
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   }
385
386   Int_t ncs=GetNumberOfCascades();
387   for (Int_t n=0; n<ncs; n++) {
388     AliESDcascade *cs=GetCascade(n);
389
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);
398
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);
416   if (!t) {AliFatal(Form("NULL pointer for ESD track %d",last)); return kFALSE;}
417   t->SetID(rm);
418   new (a[rm]) AliESDtrack(*t);
419   delete a.RemoveAt(last);
420
421
422   if (!used) return kTRUE;
423   
424
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   
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   }
476
477   return kTRUE;
478 }
479
480
481 Bool_t AliESD::Clean(Float_t *cleanPars) {
482   //
483   // Remove the data which are not needed for the physics analysis.
484   //
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]
503   //                       OR
504   //    track's longitudinal parameter is larger than cleanPars[3]
505   //    an attempt to remove this track from ESD is made.
506   //
507   //    The track gets removed if it does not come 
508   //    from a reconstructed decay
509   //
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
527
528   Float_t dmax=cleanPars[2], zmax=cleanPars[3];
529
530   const AliESDVertex *vertex=GetVertex();
531   Bool_t vtxOK=vertex->GetStatus();
532   
533   Int_t nTracks=GetNumberOfTracks();
534   for (Int_t i=nTracks-1; i>=0; i--) {
535     AliESDtrack *track=GetTrack(i);
536     if (!track) {AliFatal(Form("NULL pointer for ESD track %d",i)); return kFALSE;}
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
546 Int_t AliESD::AddV0(const AliESDv0 *v) {
547   //
548   // Add V0
549   //
550     Int_t idx=fV0s.GetEntriesFast();
551     new(fV0s[idx]) AliESDv0(*v);
552     return idx;
553 }  
554
555 //______________________________________________________________________________
556 void AliESD::Print(Option_t *) const 
557 {
558   //
559   // Print header information of the event
560   //
561   printf("ESD run information\n");
562   printf("Event # in file %d Bunch crossing # %d Orbit # %d Period # %d Run # %d Trigger %lld %lld Magnetic field %f \n",
563          GetEventNumberInFile(),
564          GetBunchCrossNumber(),
565          GetOrbitNumber(),
566          GetPeriodNumber(),
567          GetRunNumber(),
568          GetTriggerMask(),
569          GetTriggerMaskNext50(),
570          GetMagneticField() );
571     printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n",
572            fPrimaryVertex.GetX(), fPrimaryVertex.GetXRes(),
573            fPrimaryVertex.GetY(), fPrimaryVertex.GetYRes(),
574            fPrimaryVertex.GetZ(), fPrimaryVertex.GetZRes());
575     printf("Mean vertex in RUN: X=%.4f Y=%.4f cm\n",
576            GetDiamondX(),GetDiamondY());
577     printf("SPD Multiplicity. Number of tracklets %d \n",
578            fSPDMult.GetNumberOfTracklets());
579   printf("Event from reconstruction version %d \n",fRecoVersion);
580   printf("Number of tracks: \n");
581   printf("                 charged   %d\n", GetNumberOfTracks());
582   printf("                 hlt CF    %d\n", GetNumberOfHLTConfMapTracks());
583   printf("                 hlt HT    %d\n", GetNumberOfHLTHoughTracks());
584   printf("                 muon      %d\n", GetNumberOfMuonTracks());
585   printf("                 pmd       %d\n", GetNumberOfPmdTracks());
586   printf("                 trd       %d\n", GetNumberOfTrdTracks());
587   printf("                 v0        %d\n", GetNumberOfV0s());
588   printf("                 cascades  %d\n", GetNumberOfCascades());
589   printf("                 kinks     %d\n", GetNumberOfKinks());
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"));
594   printf("                 VZERO     %s\n", (fESDVZERO ? "yes" : "no"));
595 }
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();
604
605   for (Int_t i=0; i<ntrk; i++) {
606     const AliESDfriendTrack *f=ev->GetTrack(i);
607     if (!f) {AliFatal(Form("NULL pointer for ESD track %d",i));}
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++) {
621     AliESDtrack *t=GetTrack(i);
622     if (!t) {AliFatal(Form("NULL pointer for ESD track %d",i));}
623     const AliESDfriendTrack *f=t->GetFriendTrack();
624     ev->AddTrack(f);
625
626     t->ReleaseESDfriendTrack();// Not to have two copies of "friendTrack"
627
628   }
629 }
630
631 void AliESD::SetDiamond(const AliESDVertex *vertex)
632 {
633   //
634   // Set the interaction diamond
635   //  
636     fDiamondXY[0]=vertex->GetX();
637     fDiamondXY[1]=vertex->GetY();
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   }