]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliESD.cxx
AliVertexerTracks used to estimate the position of the primary vertex (Yu.Belikov)
[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),
c5e3e5d1 45 fSPDVertex(0),
46 fPrimaryVertex(0),
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 //
c5e3e5d1 77 delete fSPDVertex;
78 delete fPrimaryVertex;
af7ba10c 79 fTracks.Delete();
8bbc564d 80 fHLTConfMapTracks.Delete();
81 fHLTHoughTracks.Delete();
af7ba10c 82 fMuonTracks.Delete();
83 fPmdTracks.Delete();
0ee00e25 84 fTrdTracks.Delete();
af7ba10c 85 fV0s.Delete();
86 fCascades.Delete();
51ad6848 87 fKinks.Delete();
88 fV0MIs.Delete();
85c60a8e 89 fCaloClusters.Delete();
9da38871 90 delete fESDFMD;
51ad6848 91}
92
93void AliESD::UpdateV0PIDs()
94{
95 //
96 //
97 //
98 Int_t nV0 = GetNumberOfV0MIs();
99 for (Int_t i=0;i<nV0;i++){
100 AliESDV0MI * v0 = GetV0MI(i);
0703142d 101 AliESDtrack* tp = GetTrack(v0->GetIndex(0));
102 AliESDtrack* tm = GetTrack(v0->GetIndex(1));
51ad6848 103 if (!tm || !tp){
104 printf("BBBUUUUUUUGGGG\n");
105 }
106 Double_t pp[5],pm[5];
107 tp->GetESDpid(pp);
108 tm->GetESDpid(pm);
109 v0->UpdatePID(pp,pm);
110 }
af7ba10c 111}
112
bf25155c 113//______________________________________________________________________________
114void AliESD::Reset()
115{
116 fEventNumber=0;
117 fRunNumber=0;
b647652d 118 fTriggerMask=0;
119 fTriggerCluster=0;
bf25155c 120 fRecoVersion=0;
121 fMagneticField=0;
32a5cab4 122 fZDCN1Energy=0;
123 fZDCP1Energy=0;
32a5cab4 124 fZDCN2Energy=0;
125 fZDCP2Energy=0;
0ee00e25 126 fZDCEMEnergy=0;
bf25155c 127 fZDCParticipants=0;
128 fT0zVertex=0;
6d45eaef 129 fT0timeStart = 0;
c5e3e5d1 130 delete fSPDVertex; fSPDVertex=0;
131 delete fPrimaryVertex; fPrimaryVertex=0;
bf25155c 132 fTracks.Clear();
133 fHLTConfMapTracks.Clear();
134 fHLTHoughTracks.Clear();
135 fMuonTracks.Clear();
136 fPmdTracks.Clear();
0ee00e25 137 fTrdTracks.Clear();
bf25155c 138 fV0s.Clear();
139 fCascades.Clear();
85c60a8e 140 fCaloClusters.Clear();
141 fEMCALClusters=0;
142 fFirstEMCALCluster=-1;
143 fPHOSClusters=0;
144 fFirstPHOSCluster=-1;
9da38871 145 if (fESDFMD) fESDFMD->Clear();
bf25155c 146}
af7ba10c 147
148//______________________________________________________________________________
149void AliESD::Print(Option_t *) const
150{
151 //
152 // Print header information of the event
153 //
5f7789fc 154 printf("ESD run information\n");
b647652d 155 printf("Event # %d Run # %d Trigger %lld Magnetic field %f \n",
ef278eae 156 GetEventNumber(),
157 GetRunNumber(),
b647652d 158 GetTriggerMask(),
ef278eae 159 GetMagneticField() );
2257f27e 160 printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n",
c5e3e5d1 161 fPrimaryVertex->GetXv(), fPrimaryVertex->GetXRes(),
162 fPrimaryVertex->GetYv(), fPrimaryVertex->GetYRes(),
163 fPrimaryVertex->GetZv(), fPrimaryVertex->GetZRes());
ef278eae 164 printf("Event from reconstruction version %d \n",fRecoVersion);
165 printf("Number of tracks: \n");
85c60a8e 166 printf(" charged %d\n", GetNumberOfTracks());
482070f2 167 printf(" hlt CF %d\n", GetNumberOfHLTConfMapTracks());
168 printf(" hlt HT %d\n", GetNumberOfHLTHoughTracks());
ef278eae 169 printf(" muon %d\n", GetNumberOfMuonTracks());
a2882fb4 170 printf(" pmd %d\n", GetNumberOfPmdTracks());
0ee00e25 171 printf(" trd %d\n", GetNumberOfTrdTracks());
ef278eae 172 printf(" v0 %d\n", GetNumberOfV0s());
667ee8bf 173 printf(" cascades %d\n", GetNumberOfCascades());
174 printf(" kinks %d\n", GetNumberOfKinks());
175 printf(" V0MIs %d\n", GetNumberOfV0MIs());
176 printf(" CaloClusters %d\n", GetNumberOfCaloClusters());
177 printf(" phos %d\n", GetNumberOfPHOSClusters());
178 printf(" emcal %d\n", GetNumberOfEMCALClusters());
179 printf(" FMD %s\n", (fESDFMD ? "yes" : "no"));
ef278eae 180}
d75007f6 181
182void AliESD::SetESDfriend(const AliESDfriend *ev) {
183 //
184 // Attaches the complementary info to the ESD
185 //
186 if (!ev) return;
187
188 Int_t ntrk=ev->GetNumberOfTracks();
189
190 for (Int_t i=0; i<ntrk; i++) {
191 const AliESDfriendTrack *f=ev->GetTrack(i);
192 GetTrack(i)->SetFriendTrack(f);
193 }
194}
195
196void AliESD::GetESDfriend(AliESDfriend *ev) const {
197 //
198 // Extracts the complementary info from the ESD
199 //
200 if (!ev) return;
201
202 Int_t ntrk=GetNumberOfTracks();
203
204 for (Int_t i=0; i<ntrk; i++) {
205 const AliESDtrack *t=GetTrack(i);
206 const AliESDfriendTrack *f=t->GetFriendTrack();
207 ev->AddTrack(f);
208 }
209}