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"
31 //______________________________________________________________________________
32 AliAODPid::AliAODPid():
42 // default constructor
43 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i] = 0;
44 for(Int_t i=0; i<5; i++) fHMPIDprobs[i] = 0.;
45 for(Int_t i=0; i<3; i++) fEMCALPosition[i] = 0.;
46 for(Int_t i=0; i<5; i++) fTOFpidResolution[i] = 0.;
47 for(Int_t i=0; i<6; i++) fTRDmomentum[i] = 0.;
48 for(Int_t i=0; i<3; i++) fEMCALMomentum[i] = 0.;
49 for(Int_t i=0; i<4; i++) fITSdEdxSamples[i] = 0.;
53 //______________________________________________________________________________
54 AliAODPid::~AliAODPid()
62 //______________________________________________________________________________
63 AliAODPid::AliAODPid(const AliAODPid& pid) :
65 fITSsignal(pid.fITSsignal),
66 fTPCsignal(pid.fTPCsignal),
67 fTPCsignalN(pid.fTPCsignalN),
68 fTPCmomentum(pid.fTPCmomentum),
69 fTRDnSlices(pid.fTRDnSlices),
71 fTOFesdsignal(pid.fTOFesdsignal),
72 fHMPIDsignal(pid.fHMPIDsignal)
75 fTRDslices = new Double32_t[fTRDnSlices];
76 for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
77 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
78 for(Int_t i=0; i<5; i++) fHMPIDprobs[i] = pid.fHMPIDprobs[i];
79 for(Int_t i=0; i<3; i++) {
80 fEMCALPosition[i]=pid.fEMCALPosition[i];
81 fEMCALMomentum[i]=pid.fEMCALMomentum[i];
83 for(Int_t i=0; i<6; i++) fTRDmomentum[i]=pid.fTRDmomentum[i];
85 for(Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
87 for(Int_t i=0; i<4; i++) fITSdEdxSamples[i]=pid.fITSdEdxSamples[i];
90 //______________________________________________________________________________
91 AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
93 // Assignment operator
96 fITSsignal=pid.fITSsignal;
97 fTPCsignal=pid.fTPCsignal;
99 if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){
100 // only delete if number changed or is 0
101 delete [] fTRDslices;
103 if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices];
105 fTRDnSlices=pid.fTRDnSlices;
107 for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
108 fTOFesdsignal=pid.fTOFesdsignal;
109 fHMPIDsignal=pid.fHMPIDsignal;
110 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
111 for(Int_t i=0; i<5; i++) fHMPIDprobs[i] = pid.fHMPIDprobs[i];
112 for(Int_t i=0; i<6; i++) fTRDmomentum[i]=pid.fTRDmomentum[i];
113 for(Int_t i=0; i<3; i++) {
114 fEMCALPosition[i]=pid.fEMCALPosition[i];
115 fEMCALMomentum[i]=pid.fEMCALMomentum[i];
117 for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
118 for (Int_t i=0; i<4; i++) fITSdEdxSamples[i]=pid.fITSdEdxSamples[i];
123 //_______________________________________________________________________________
124 void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES]) const
126 // Returns the array with integrated times for each particle hypothesis
127 for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
129 //_______________________________________________________________________________
130 void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
132 // Returns the array with integrated times for each particle hypothesis
133 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
135 //_______________________________________________________________________________
136 void AliAODPid::GetEMCALPosition(Double_t emcalpos[3]) const
138 // Returns the array with extrapolated track position at the EMCAL surface
139 for(Int_t i=0; i<3; i++) emcalpos[i]=fEMCALPosition[i];
141 //_______________________________________________________________________________
142 void AliAODPid::SetEMCALPosition(Double_t emcpos[3])
144 // Sets the array with extrapolated track position at the EMCAL surface
145 for(Int_t i=0; i<3; i++) fEMCALPosition[i]=emcpos[i];
147 //_______________________________________________________________________________
148 void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3]) const
150 // Returns the array with extrapolated track momentum at the EMCAL surface
151 for(Int_t i=0; i<3; i++) emcalmom[i]=fEMCALMomentum[i];
153 //_______________________________________________________________________________
154 void AliAODPid::SetEMCALMomentum(Double_t emcmom[3])
156 // Sets the array with extrapolated track momentum at the EMCAL surface
157 for(Int_t i=0; i<3; i++) fEMCALMomentum[i]=emcmom[i];
159 //______________________________________________________________________________
160 void AliAODPid::SetTOFpidResolution(Double_t tofPIDres[5])
162 for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=tofPIDres[i];
165 //______________________________________________________________________________
166 void AliAODPid::GetTOFpidResolution(Double_t tofRes[5]) const
168 for (Int_t i=0; i<5; i++) tofRes[i]=fTOFpidResolution[i];
171 //______________________________________________________________________________
172 void AliAODPid::SetHMPIDprobs(Double_t hmpPid[5])
175 // Set the HMPID PID probablities that are read from ESD
177 for(Int_t i = 0; i < 5; i++ ) fHMPIDprobs[i] = hmpPid[i];
179 //______________________________________________________________________________
180 void AliAODPid::GetHMPIDprobs(Double_t *p) const
183 // Set the HMPID PID probablities that are read from ESD
185 for(Int_t i = 0; i < AliPID::kSPECIES; i++ ) p[i] = fHMPIDprobs[i];
187 //______________________________________________________________________________
188 void AliAODPid::SetITSdEdxSamples(const Double_t s[4])
191 // Set the 4 values of dE/dx from individual ITS layers that are read from ESD
193 for (Int_t i=0; i<4; i++) fITSdEdxSamples[i]=s[i];
195 //______________________________________________________________________________
196 void AliAODPid::GetITSdEdxSamples(Double_t s[4]) const
199 // Get the 4 values of dE/dx from individual ITS layers that are read from ESD
201 for (Int_t i=0; i<4; i++) s[i]=fITSdEdxSamples[i];