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