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