1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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 //-----------------------------------------------------------------
26 #include "AliESDfriend.h"
30 //______________________________________________________________________________
32 fEventNumberInFile(0),
54 fTracks("AliESDtrack",15000),
55 fHLTConfMapTracks("AliESDHLTtrack",25000),
56 fHLTHoughTracks("AliESDHLTtrack",15000),
57 fMuonTracks("AliESDMuonTrack",30),
58 fPmdTracks("AliESDPmdTrack",3000),
59 fTrdTracks("AliESDTrdTrack",300),
61 fCascades("AliESDcascade",20),
62 fKinks("AliESDkink",4000),
63 fCaloClusters("AliESDCaloCluster",10000),
65 fFirstEMCALCluster(-1),
66 fEMCALTriggerPosition(0x0),
67 fEMCALTriggerAmplitudes(0x0),
69 fFirstPHOSCluster(-1),
70 fPHOSTriggerPosition(0x0),
71 fPHOSTriggerAmplitudes(0x0),
74 fErrorLogs("AliRawDataErrorLog",5)
77 for (Int_t i=0; i<24; i++) {
81 for (Int_t i=0; i<2; i++) fDiamondXY[i]=0.;
82 for (Int_t i=0; i<3; i++) fDiamondCovXY[i]=0.;
85 //______________________________________________________________________________
86 AliESD::AliESD(const AliESD& esd):
88 fEventNumberInFile(esd.fEventNumberInFile),
89 fBunchCrossNumber(esd.fBunchCrossNumber),
90 fOrbitNumber(esd.fOrbitNumber),
91 fPeriodNumber(esd.fPeriodNumber),
92 fRunNumber(esd.fRunNumber),
93 fTimeStamp(esd.fTimeStamp),
94 fEventType(esd.fEventType),
95 fTriggerMask(esd.fTriggerMask),
96 fTriggerCluster(esd.fTriggerCluster),
97 fRecoVersion(esd.fRecoVersion),
98 fMagneticField(esd.fMagneticField),
99 fZDCN1Energy(esd.fZDCN1Energy),
100 fZDCP1Energy(esd.fZDCP1Energy),
101 fZDCN2Energy(esd.fZDCN2Energy),
102 fZDCP2Energy(esd.fZDCP2Energy),
103 fZDCEMEnergy(esd.fZDCEMEnergy),
104 fZDCParticipants(esd.fZDCParticipants),
105 fT0zVertex(esd.fT0zVertex),
106 fSPDVertex(esd.fSPDVertex),
107 fPrimaryVertex(esd.fPrimaryVertex),
108 fSPDMult(esd.fSPDMult),
109 fT0timeStart(esd.fT0timeStart),
110 fTracks(*((TClonesArray*)esd.fTracks.Clone())),
111 fHLTConfMapTracks(*((TClonesArray*)esd.fHLTConfMapTracks.Clone())),
112 fHLTHoughTracks(*((TClonesArray*)esd.fHLTHoughTracks.Clone())),
113 fMuonTracks(*((TClonesArray*)esd.fMuonTracks.Clone())),
114 fPmdTracks(*((TClonesArray*)esd.fPmdTracks.Clone())),
115 fTrdTracks(*((TClonesArray*)esd.fTrdTracks.Clone())),
116 fV0s(*((TClonesArray*)esd.fV0s.Clone())),
117 fCascades(*((TClonesArray*)esd.fCascades.Clone())),
118 fKinks(*((TClonesArray*)esd.fKinks.Clone())),
119 fCaloClusters(*((TClonesArray*)esd.fCaloClusters.Clone())),
120 fEMCALClusters(esd.fEMCALClusters),
121 fFirstEMCALCluster(esd.fFirstEMCALCluster),
122 fEMCALTriggerPosition(esd. fEMCALTriggerPosition),
123 fEMCALTriggerAmplitudes(esd.fEMCALTriggerAmplitudes),
124 fPHOSClusters(esd.fPHOSClusters),
125 fFirstPHOSCluster(esd.fFirstPHOSCluster),
126 fPHOSTriggerPosition(esd.fPHOSTriggerPosition),
127 fPHOSTriggerAmplitudes(esd.fPHOSTriggerAmplitudes),
128 fESDFMD(esd.fESDFMD),
129 fESDVZERO(esd.fESDVZERO),
130 fErrorLogs(*((TClonesArray*)esd.fErrorLogs.Clone()))
132 for (Int_t i=0; i<24; i++) {
133 fT0time[i] = esd.fT0time[i];
134 fT0amplitude[i] = esd.fT0amplitude[i];
136 for (Int_t i=0; i<2; i++) fDiamondXY[i]=esd.fDiamondXY[i];
137 for (Int_t i=0; i<3; i++) fDiamondCovXY[i]=esd.fDiamondCovXY[i];
140 //______________________________________________________________________________
144 // Standard destructor
147 fHLTConfMapTracks.Delete();
148 fHLTHoughTracks.Delete();
149 fMuonTracks.Delete();
155 fCaloClusters.Delete();
158 // fEMCALTriggerPosition->Delete();
159 // fEMCALTriggerAmplitudes->Delete();
160 // fPHOSTriggerPosition->Delete();
161 // fPHOSTriggerAmplitudes->Delete();
162 // delete fEMCALTriggerPosition;
163 // delete fEMCALTriggerAmplitudes;
164 // delete fPHOSTriggerPosition;
165 // delete fPHOSTriggerAmplitudes;
170 //______________________________________________________________________________
173 fEventNumberInFile=0;
192 new (&fSPDVertex) AliESDVertex();
193 new (&fPrimaryVertex) AliESDVertex();
194 new (&fSPDMult) AliMultiplicity();
196 fHLTConfMapTracks.Clear();
197 fHLTHoughTracks.Clear();
203 fCaloClusters.Clear();
205 fFirstEMCALCluster=-1;
207 fFirstPHOSCluster=-1;
208 if (fESDFMD) fESDFMD->Clear();
209 // fEMCALTriggerPosition->Clear();
210 // fEMCALTriggerAmplitudes->Clear();
211 // fPHOSTriggerPosition->Clear();
212 // fPHOSTriggerAmplitudes->Clear();
216 Bool_t AliESD::RemoveTrack(Int_t /*i*/) {
217 // ---------------------------------------------------------
219 // ---------------------------------------------------------
221 // Check if this track comes from a reconstructed decay
222 // if (yes) return kFALSE
224 // Remap the indices of the daughters of recosntructed decays
227 // delete fTracks->RemoveAt(i);
229 // Compress the array with tracks
230 // fTracks->Compress();
235 Int_t AliESD::AddV0(const AliESDv0 *v) {
239 Int_t idx=fV0s.GetEntriesFast();
240 new(fV0s[idx]) AliESDv0(*v);
244 //______________________________________________________________________________
245 void AliESD::Print(Option_t *) const
248 // Print header information of the event
250 printf("ESD run information\n");
251 printf("Event # in file %d Bunch crossing # %d Orbit # %d Period # %d Run # %d Trigger %lld Magnetic field %f \n",
252 GetEventNumberInFile(),
253 GetBunchCrossNumber(),
258 GetMagneticField() );
259 printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n",
260 fPrimaryVertex.GetXv(), fPrimaryVertex.GetXRes(),
261 fPrimaryVertex.GetYv(), fPrimaryVertex.GetYRes(),
262 fPrimaryVertex.GetZv(), fPrimaryVertex.GetZRes());
263 printf("Mean vertex in RUN: X=%.4f Y=%.4f cm\n",
264 GetDiamondX(),GetDiamondY());
265 printf("SPD Multiplicity. Number of tracklets %d \n",
266 fSPDMult.GetNumberOfTracklets());
267 printf("Event from reconstruction version %d \n",fRecoVersion);
268 printf("Number of tracks: \n");
269 printf(" charged %d\n", GetNumberOfTracks());
270 printf(" hlt CF %d\n", GetNumberOfHLTConfMapTracks());
271 printf(" hlt HT %d\n", GetNumberOfHLTHoughTracks());
272 printf(" muon %d\n", GetNumberOfMuonTracks());
273 printf(" pmd %d\n", GetNumberOfPmdTracks());
274 printf(" trd %d\n", GetNumberOfTrdTracks());
275 printf(" v0 %d\n", GetNumberOfV0s());
276 printf(" cascades %d\n", GetNumberOfCascades());
277 printf(" kinks %d\n", GetNumberOfKinks());
278 printf(" CaloClusters %d\n", GetNumberOfCaloClusters());
279 printf(" phos %d\n", GetNumberOfPHOSClusters());
280 printf(" emcal %d\n", GetNumberOfEMCALClusters());
281 printf(" FMD %s\n", (fESDFMD ? "yes" : "no"));
282 printf(" VZERO %s\n", (fESDVZERO ? "yes" : "no"));
285 void AliESD::SetESDfriend(const AliESDfriend *ev) {
287 // Attaches the complementary info to the ESD
291 Int_t ntrk=ev->GetNumberOfTracks();
293 for (Int_t i=0; i<ntrk; i++) {
294 const AliESDfriendTrack *f=ev->GetTrack(i);
295 GetTrack(i)->SetFriendTrack(f);
299 void AliESD::GetESDfriend(AliESDfriend *ev) const {
301 // Extracts the complementary info from the ESD
305 Int_t ntrk=GetNumberOfTracks();
307 for (Int_t i=0; i<ntrk; i++) {
308 AliESDtrack *t=GetTrack(i);
309 const AliESDfriendTrack *f=t->GetFriendTrack();
312 t->ReleaseESDfriendTrack();// Not to have two copies of "friendTrack"