]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliESD.cxx
Record changes.
[u/mrichter/AliRoot.git] / STEER / AliESD.cxx
CommitLineData
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
acd84897 16/* $Id$ */
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
25#include "AliESD.h"
d75007f6 26#include "AliESDfriend.h"
8a8d023f 27
28ClassImp(AliESD)
29
af7ba10c 30//______________________________________________________________________________
e2afb3b6 31AliESD::AliESD():
32 fEventNumber(0),
33 fRunNumber(0),
b647652d 34 fTriggerMask(0),
35 fTriggerCluster(0),
e2afb3b6 36 fRecoVersion(0),
a866ac60 37 fMagneticField(0),
32a5cab4 38 fZDCN1Energy(0),
39 fZDCP1Energy(0),
32a5cab4 40 fZDCN2Energy(0),
41 fZDCP2Energy(0),
0ee00e25 42 fZDCEMEnergy(0),
878bc0c2 43 fZDCParticipants(0),
4a78b8c5 44 fT0zVertex(0),
15b965a7 45 fSPDVertex(),
46 fPrimaryVertex(),
6d45eaef 47 fT0timeStart(0),
e23730c7 48 fTracks("AliESDtrack",15000),
482070f2 49 fHLTConfMapTracks("AliESDHLTtrack",25000),
50 fHLTHoughTracks("AliESDHLTtrack",15000),
672b5f43 51 fMuonTracks("AliESDMuonTrack",30),
561b7b31 52 fPmdTracks("AliESDPmdTrack",3000),
0ee00e25 53 fTrdTracks("AliESDTrdTrack",300),
51ad6848 54 fV0s("AliESDv0",200),
a2882fb4 55 fCascades("AliESDcascade",20),
51ad6848 56 fKinks("AliESDkink",4000),
57 fV0MIs("AliESDV0MI",4000),
85c60a8e 58 fCaloClusters("AliESDCaloCluster",10000),
59 fEMCALClusters(0),
60 fFirstEMCALCluster(-1),
61 fPHOSClusters(0),
62 fFirstPHOSCluster(-1),
9da38871 63 fESDFMD(0x0)
64{
6d45eaef 65 for (Int_t i=0; i<24; i++) {
66 fT0time[i] = 0;
67 fT0amplitude[i] = 0;
68 }
873f1f73 69}
e2afb3b6 70
af7ba10c 71//______________________________________________________________________________
72AliESD::~AliESD()
73{
74 //
75 // Standard destructor
76 //
77 fTracks.Delete();
8bbc564d 78 fHLTConfMapTracks.Delete();
79 fHLTHoughTracks.Delete();
af7ba10c 80 fMuonTracks.Delete();
81 fPmdTracks.Delete();
0ee00e25 82 fTrdTracks.Delete();
af7ba10c 83 fV0s.Delete();
84 fCascades.Delete();
51ad6848 85 fKinks.Delete();
86 fV0MIs.Delete();
85c60a8e 87 fCaloClusters.Delete();
9da38871 88 delete fESDFMD;
51ad6848 89}
90
91void AliESD::UpdateV0PIDs()
92{
93 //
94 //
95 //
96 Int_t nV0 = GetNumberOfV0MIs();
97 for (Int_t i=0;i<nV0;i++){
98 AliESDV0MI * v0 = GetV0MI(i);
0703142d 99 AliESDtrack* tp = GetTrack(v0->GetIndex(0));
100 AliESDtrack* tm = GetTrack(v0->GetIndex(1));
51ad6848 101 if (!tm || !tp){
102 printf("BBBUUUUUUUGGGG\n");
103 }
104 Double_t pp[5],pm[5];
105 tp->GetESDpid(pp);
106 tm->GetESDpid(pm);
107 v0->UpdatePID(pp,pm);
108 }
af7ba10c 109}
110
bf25155c 111//______________________________________________________________________________
112void AliESD::Reset()
113{
114 fEventNumber=0;
115 fRunNumber=0;
b647652d 116 fTriggerMask=0;
117 fTriggerCluster=0;
bf25155c 118 fRecoVersion=0;
119 fMagneticField=0;
32a5cab4 120 fZDCN1Energy=0;
121 fZDCP1Energy=0;
32a5cab4 122 fZDCN2Energy=0;
123 fZDCP2Energy=0;
0ee00e25 124 fZDCEMEnergy=0;
bf25155c 125 fZDCParticipants=0;
126 fT0zVertex=0;
6d45eaef 127 fT0timeStart = 0;
15b965a7 128 new (&fSPDVertex) AliESDVertex();
129 new (&fPrimaryVertex) AliESDVertex();
bf25155c 130 fTracks.Clear();
131 fHLTConfMapTracks.Clear();
132 fHLTHoughTracks.Clear();
133 fMuonTracks.Clear();
134 fPmdTracks.Clear();
0ee00e25 135 fTrdTracks.Clear();
bf25155c 136 fV0s.Clear();
137 fCascades.Clear();
85c60a8e 138 fCaloClusters.Clear();
139 fEMCALClusters=0;
140 fFirstEMCALCluster=-1;
141 fPHOSClusters=0;
142 fFirstPHOSCluster=-1;
9da38871 143 if (fESDFMD) fESDFMD->Clear();
bf25155c 144}
af7ba10c 145
146//______________________________________________________________________________
147void AliESD::Print(Option_t *) const
148{
149 //
150 // Print header information of the event
151 //
5f7789fc 152 printf("ESD run information\n");
b647652d 153 printf("Event # %d Run # %d Trigger %lld Magnetic field %f \n",
ef278eae 154 GetEventNumber(),
155 GetRunNumber(),
b647652d 156 GetTriggerMask(),
ef278eae 157 GetMagneticField() );
8497bca0 158 printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n",
15b965a7 159 fPrimaryVertex.GetXv(), fPrimaryVertex.GetXRes(),
160 fPrimaryVertex.GetYv(), fPrimaryVertex.GetYRes(),
161 fPrimaryVertex.GetZv(), fPrimaryVertex.GetZRes());
ef278eae 162 printf("Event from reconstruction version %d \n",fRecoVersion);
163 printf("Number of tracks: \n");
85c60a8e 164 printf(" charged %d\n", GetNumberOfTracks());
482070f2 165 printf(" hlt CF %d\n", GetNumberOfHLTConfMapTracks());
166 printf(" hlt HT %d\n", GetNumberOfHLTHoughTracks());
ef278eae 167 printf(" muon %d\n", GetNumberOfMuonTracks());
a2882fb4 168 printf(" pmd %d\n", GetNumberOfPmdTracks());
0ee00e25 169 printf(" trd %d\n", GetNumberOfTrdTracks());
ef278eae 170 printf(" v0 %d\n", GetNumberOfV0s());
667ee8bf 171 printf(" cascades %d\n", GetNumberOfCascades());
172 printf(" kinks %d\n", GetNumberOfKinks());
173 printf(" V0MIs %d\n", GetNumberOfV0MIs());
174 printf(" CaloClusters %d\n", GetNumberOfCaloClusters());
175 printf(" phos %d\n", GetNumberOfPHOSClusters());
176 printf(" emcal %d\n", GetNumberOfEMCALClusters());
177 printf(" FMD %s\n", (fESDFMD ? "yes" : "no"));
ef278eae 178}
d75007f6 179
180void AliESD::SetESDfriend(const AliESDfriend *ev) {
181 //
182 // Attaches the complementary info to the ESD
183 //
184 if (!ev) return;
185
186 Int_t ntrk=ev->GetNumberOfTracks();
187
188 for (Int_t i=0; i<ntrk; i++) {
189 const AliESDfriendTrack *f=ev->GetTrack(i);
190 GetTrack(i)->SetFriendTrack(f);
191 }
192}
193
194void AliESD::GetESDfriend(AliESDfriend *ev) const {
195 //
196 // Extracts the complementary info from the ESD
197 //
198 if (!ev) return;
199
200 Int_t ntrk=GetNumberOfTracks();
201
202 for (Int_t i=0; i<ntrk; i++) {
203 const AliESDtrack *t=GetTrack(i);
204 const AliESDfriendTrack *f=t->GetFriendTrack();
205 ev->AddTrack(f);
206 }
207}