]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESD.cxx
Reconstruction of multiplicity. Ipdated AlITSvertexerZ (Massimo)
[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(),
46   fPrimaryVertex(),
47   fSPDMult(),
48   fT0timeStart(0),
49   fTracks("AliESDtrack",15000),
50   fHLTConfMapTracks("AliESDHLTtrack",25000),
51   fHLTHoughTracks("AliESDHLTtrack",15000),
52   fMuonTracks("AliESDMuonTrack",30),
53   fPmdTracks("AliESDPmdTrack",3000),
54   fTrdTracks("AliESDTrdTrack",300),
55   fV0s("AliESDv0",200),  
56   fCascades("AliESDcascade",20),
57   fKinks("AliESDkink",4000),
58   fV0MIs("AliESDV0MI",4000),
59   fCaloClusters("AliESDCaloCluster",10000),
60   fEMCALClusters(0), 
61   fFirstEMCALCluster(-1),
62   fPHOSClusters(0), 
63   fFirstPHOSCluster(-1),
64   fESDFMD(0x0)
65 {
66   for (Int_t i=0; i<24; i++) {
67     fT0time[i] = 0;
68     fT0amplitude[i] = 0;
69   }
70 }
71
72 //______________________________________________________________________________
73 AliESD::~AliESD()
74 {
75   //
76   // Standard destructor
77   //
78   fTracks.Delete();
79   fHLTConfMapTracks.Delete();
80   fHLTHoughTracks.Delete();
81   fMuonTracks.Delete();
82   fPmdTracks.Delete();
83   fTrdTracks.Delete();
84   fV0s.Delete();
85   fCascades.Delete();
86   fKinks.Delete();
87   fV0MIs.Delete();
88   fCaloClusters.Delete();
89   delete fESDFMD;
90 }
91
92 void AliESD::UpdateV0PIDs()
93 {
94   //
95   //
96   //
97   Int_t nV0 = GetNumberOfV0MIs();
98   for (Int_t i=0;i<nV0;i++){
99     AliESDV0MI * v0 = GetV0MI(i);
100     AliESDtrack* tp = GetTrack(v0->GetIndex(0));
101     AliESDtrack* tm = GetTrack(v0->GetIndex(1));
102     if (!tm || !tp){
103       printf("BBBUUUUUUUGGGG\n");
104     }
105     Double_t pp[5],pm[5];
106     tp->GetESDpid(pp);
107     tm->GetESDpid(pm);
108     v0->UpdatePID(pp,pm);    
109   }
110 }
111
112 //______________________________________________________________________________
113 void AliESD::Reset()
114 {
115   fEventNumber=0;
116   fRunNumber=0;
117   fTriggerMask=0;
118   fTriggerCluster=0;
119   fRecoVersion=0;
120   fMagneticField=0;
121   fZDCN1Energy=0;
122   fZDCP1Energy=0;
123   fZDCN2Energy=0;
124   fZDCP2Energy=0;
125   fZDCEMEnergy=0;
126   fZDCParticipants=0;
127   fT0zVertex=0;
128   fT0timeStart = 0;
129   new (&fSPDVertex) AliESDVertex();
130   new (&fPrimaryVertex) AliESDVertex();
131   new (&fSPDMult) AliMultiplicity();
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     printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n",
161            fPrimaryVertex.GetXv(), fPrimaryVertex.GetXRes(),
162            fPrimaryVertex.GetYv(), fPrimaryVertex.GetYRes(),
163            fPrimaryVertex.GetZv(), fPrimaryVertex.GetZRes());
164     printf("SPD Multiplicity. Number of tracklets %d \n",
165            fSPDMult.GetNumberOfTracklets());
166   printf("Event from reconstruction version %d \n",fRecoVersion);
167   printf("Number of tracks: \n");
168   printf("                 charged   %d\n", GetNumberOfTracks());
169   printf("                 hlt CF    %d\n", GetNumberOfHLTConfMapTracks());
170   printf("                 hlt HT    %d\n", GetNumberOfHLTHoughTracks());
171   printf("                 muon      %d\n", GetNumberOfMuonTracks());
172   printf("                 pmd       %d\n", GetNumberOfPmdTracks());
173   printf("                 trd       %d\n", GetNumberOfTrdTracks());
174   printf("                 v0        %d\n", GetNumberOfV0s());
175   printf("                 cascades  %d\n", GetNumberOfCascades());
176   printf("                 kinks     %d\n", GetNumberOfKinks());
177   printf("                 V0MIs     %d\n", GetNumberOfV0MIs());
178   printf("                 CaloClusters %d\n", GetNumberOfCaloClusters());
179   printf("                 phos      %d\n", GetNumberOfPHOSClusters());
180   printf("                 emcal     %d\n", GetNumberOfEMCALClusters());
181   printf("                 FMD       %s\n", (fESDFMD ? "yes" : "no"));
182 }
183
184 void AliESD::SetESDfriend(const AliESDfriend *ev) {
185   //
186   // Attaches the complementary info to the ESD
187   //
188   if (!ev) return;
189
190   Int_t ntrk=ev->GetNumberOfTracks();
191
192   for (Int_t i=0; i<ntrk; i++) {
193     const AliESDfriendTrack *f=ev->GetTrack(i);
194     GetTrack(i)->SetFriendTrack(f);
195   }
196 }
197
198 void AliESD::GetESDfriend(AliESDfriend *ev) const {
199   //
200   // Extracts the complementary info from the ESD
201   //
202   if (!ev) return;
203
204   Int_t ntrk=GetNumberOfTracks();
205
206   for (Int_t i=0; i<ntrk; i++) {
207     const AliESDtrack *t=GetTrack(i);
208     const AliESDfriendTrack *f=t->GetFriendTrack();
209     ev->AddTrack(f);
210   }
211 }