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