1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-------------------------------------------------------------------------
19 // AOD Pid class to store additional pid information
20 // Author: Annalisa Mastroserio
21 //-------------------------------------------------------------------------
23 #include "AliAODPid.h"
24 #include "AliESDtrack.h"
27 #include "AliTPCdEdxInfo.h"
32 //______________________________________________________________________________
33 AliAODPid::AliAODPid():
45 // default constructor
46 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i] = 0;
47 for(Int_t i=0; i<5; i++) fHMPIDprobs[i] = 0.;
48 for(Int_t i=0; i<3; i++) fEMCALPosition[i] = 0.;
49 for(Int_t i=0; i<5; i++) fTOFpidResolution[i] = 0.;
50 for(Int_t i=0; i<6; i++) {
54 for(Int_t i=0; i<3; i++) fEMCALMomentum[i] = 0.;
55 for(Int_t i=0; i<4; i++) fITSdEdxSamples[i] = 0.;
58 //______________________________________________________________________________
59 AliAODPid::~AliAODPid()
68 //______________________________________________________________________________
69 AliAODPid::AliAODPid(const AliAODPid& pid) :
71 fITSsignal(pid.fITSsignal),
72 fTPCsignal(pid.fTPCsignal),
73 fTPCsignalN(pid.fTPCsignalN),
74 fTPCmomentum(pid.fTPCmomentum),
75 fTRDnSlices(pid.fTRDnSlices),
76 fTRDntls(pid.fTRDntls),
78 fTOFesdsignal(pid.fTOFesdsignal),
79 fHMPIDsignal(pid.fHMPIDsignal),
83 SetTRDsignal(fTRDnSlices, pid.fTRDslices);
84 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
85 for(Int_t i=0; i<5; i++) fHMPIDprobs[i] = pid.fHMPIDprobs[i];
86 for(Int_t i=0; i<3; i++) {
87 fEMCALPosition[i]=pid.fEMCALPosition[i];
88 fEMCALMomentum[i]=pid.fEMCALMomentum[i];
90 for(Int_t i=0; i<6; i++){
91 fTRDmomentum[i]=pid.fTRDmomentum[i];
95 for(Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
97 for(Int_t i=0; i<4; i++) fITSdEdxSamples[i]=pid.fITSdEdxSamples[i];
99 if (pid.fTPCdEdxInfo) fTPCdEdxInfo=new AliTPCdEdxInfo(*pid.fTPCdEdxInfo);
102 //______________________________________________________________________________
103 AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
105 // Assignment operator
108 TObject::operator=(pid);
110 fITSsignal = pid.fITSsignal;
111 for (Int_t i = 0; i < 4; i++) fITSdEdxSamples[i]=pid.fITSdEdxSamples[i];
112 fTPCsignal = pid.fTPCsignal;
113 fTPCsignalN = pid.fTPCsignalN;
114 fTPCmomentum = pid.fTPCmomentum;
117 if(fTRDnSlices != pid.fTRDnSlices) {
118 // only delete if number changed or is 0
119 delete [] fTRDslices;
121 fTRDnSlices = pid.fTRDnSlices;
122 if(pid.fTRDnSlices > 0) fTRDslices = new Double32_t[fTRDnSlices];
125 if (fTRDslices && pid.fTRDslices)
126 memcpy(fTRDslices, pid.fTRDslices, fTRDnSlices*sizeof(Double32_t));
128 fTRDntls = pid.fTRDntls;
129 for(Int_t i = 0; i < 6; i++){
130 fTRDmomentum[i] = pid.fTRDmomentum[i];
131 fTRDncls[i] = pid.fTRDncls[i];
134 fTOFesdsignal=pid.fTOFesdsignal;
135 for (Int_t i = 0; i < 5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
136 for (Int_t i = 0; i < 5; i++) fIntTime[i]=pid.fIntTime[i];
138 fHMPIDsignal=pid.fHMPIDsignal;
140 for(Int_t i = 0; i < 5; i++) fHMPIDprobs[i] = pid.fHMPIDprobs[i];
142 for(Int_t i = 0; i < 3; i++) {
143 fEMCALPosition[i]=pid.fEMCALPosition[i];
144 fEMCALMomentum[i]=pid.fEMCALMomentum[i];
146 SetTPCdEdxInfo(pid.fTPCdEdxInfo);
151 //_______________________________________________________________________________
152 void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES]) const
154 // Returns the array with integrated times for each particle hypothesis
155 for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
157 //_______________________________________________________________________________
158 void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
160 // Returns the array with integrated times for each particle hypothesis
161 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
163 //_______________________________________________________________________________
164 void AliAODPid::GetEMCALPosition(Double_t emcalpos[3]) const
166 // Returns the array with extrapolated track position at the EMCAL surface
167 for(Int_t i=0; i<3; i++) emcalpos[i]=fEMCALPosition[i];
169 //_______________________________________________________________________________
170 void AliAODPid::SetEMCALPosition(Double_t emcpos[3])
172 // Sets the array with extrapolated track position at the EMCAL surface
173 for(Int_t i=0; i<3; i++) fEMCALPosition[i]=emcpos[i];
175 //_______________________________________________________________________________
176 void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3]) const
178 // Returns the array with extrapolated track momentum at the EMCAL surface
179 for(Int_t i=0; i<3; i++) emcalmom[i]=fEMCALMomentum[i];
181 //_______________________________________________________________________________
182 void AliAODPid::SetEMCALMomentum(Double_t emcmom[3])
184 // Sets the array with extrapolated track momentum at the EMCAL surface
185 for(Int_t i=0; i<3; i++) fEMCALMomentum[i]=emcmom[i];
187 //______________________________________________________________________________
188 void AliAODPid::SetTOFpidResolution(Double_t tofPIDres[5])
190 for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=tofPIDres[i];
193 //______________________________________________________________________________
194 void AliAODPid::GetTOFpidResolution(Double_t tofRes[5]) const
196 for (Int_t i=0; i<5; i++) tofRes[i]=fTOFpidResolution[i];
199 //______________________________________________________________________________
200 void AliAODPid::SetHMPIDprobs(Double_t hmpPid[5])
203 // Set the HMPID PID probablities that are read from ESD
205 for(Int_t i = 0; i < 5; i++ ) fHMPIDprobs[i] = hmpPid[i];
207 //______________________________________________________________________________
208 void AliAODPid::GetHMPIDprobs(Double_t *p) const
211 // Set the HMPID PID probablities that are read from ESD
213 for(Int_t i = 0; i < AliPID::kSPECIES; i++ ) p[i] = fHMPIDprobs[i];
215 //______________________________________________________________________________
216 void AliAODPid::SetITSdEdxSamples(const Double_t s[4])
219 // Set the 4 values of dE/dx from individual ITS layers that are read from ESD
221 for (Int_t i=0; i<4; i++) fITSdEdxSamples[i]=s[i];
223 //______________________________________________________________________________
224 void AliAODPid::GetITSdEdxSamples(Double_t s[4]) const
227 // Get the 4 values of dE/dx from individual ITS layers that are read from ESD
229 for (Int_t i=0; i<4; i++) s[i]=fITSdEdxSamples[i];
231 //______________________________________________________________________________
232 void AliAODPid::SetTPCdEdxInfo(AliTPCdEdxInfo * dEdxInfo)
242 if (!fTPCdEdxInfo) fTPCdEdxInfo=new AliTPCdEdxInfo;
243 (*fTPCdEdxInfo)=(*dEdxInfo);