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():
43 // default constructor
44 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i] = 0;
45 for(Int_t i=0; i<5; i++) fHMPIDprobs[i] = 0.;
46 for(Int_t i=0; i<3; i++) fEMCALPosition[i] = 0.;
47 for(Int_t i=0; i<5; i++) fTOFpidResolution[i] = 0.;
48 for(Int_t i=0; i<6; i++) {
52 for(Int_t i=0; i<3; i++) fEMCALMomentum[i] = 0.;
53 for(Int_t i=0; i<4; i++) fITSdEdxSamples[i] = 0.;
56 //______________________________________________________________________________
57 AliAODPid::~AliAODPid()
65 //______________________________________________________________________________
66 AliAODPid::AliAODPid(const AliAODPid& pid) :
68 fITSsignal(pid.fITSsignal),
69 fTPCsignal(pid.fTPCsignal),
70 fTPCsignalN(pid.fTPCsignalN),
71 fTPCmomentum(pid.fTPCmomentum),
72 fTRDnSlices(pid.fTRDnSlices),
73 fTRDntls(pid.fTRDntls),
75 fTOFesdsignal(pid.fTOFesdsignal),
76 fHMPIDsignal(pid.fHMPIDsignal)
79 SetTRDsignal(fTRDnSlices, pid.fTRDslices);
80 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
81 for(Int_t i=0; i<5; i++) fHMPIDprobs[i] = pid.fHMPIDprobs[i];
82 for(Int_t i=0; i<3; i++) {
83 fEMCALPosition[i]=pid.fEMCALPosition[i];
84 fEMCALMomentum[i]=pid.fEMCALMomentum[i];
86 for(Int_t i=0; i<6; i++){
87 fTRDmomentum[i]=pid.fTRDmomentum[i];
91 for(Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
93 for(Int_t i=0; i<4; i++) fITSdEdxSamples[i]=pid.fITSdEdxSamples[i];
96 //______________________________________________________________________________
97 AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
99 // Assignment operator
102 fITSsignal=pid.fITSsignal;
103 fTPCsignal=pid.fTPCsignal;
105 if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){
106 // only delete if number changed or is 0
107 delete [] fTRDslices;
109 if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices];
111 fTRDnSlices=pid.fTRDnSlices;
113 for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
114 fTOFesdsignal=pid.fTOFesdsignal;
115 fHMPIDsignal=pid.fHMPIDsignal;
116 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
117 for(Int_t i=0; i<5; i++) fHMPIDprobs[i] = pid.fHMPIDprobs[i];
118 for(Int_t i=0; i<6; i++){
119 fTRDmomentum[i]=pid.fTRDmomentum[i];
120 fTRDncls[i] = pid.fTRDncls[i];
122 for(Int_t i=0; i<3; i++) {
123 fEMCALPosition[i]=pid.fEMCALPosition[i];
124 fEMCALMomentum[i]=pid.fEMCALMomentum[i];
126 for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
127 for (Int_t i=0; i<4; i++) fITSdEdxSamples[i]=pid.fITSdEdxSamples[i];
132 //_______________________________________________________________________________
133 void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES]) const
135 // Returns the array with integrated times for each particle hypothesis
136 for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
138 //_______________________________________________________________________________
139 void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
141 // Returns the array with integrated times for each particle hypothesis
142 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
144 //_______________________________________________________________________________
145 void AliAODPid::GetEMCALPosition(Double_t emcalpos[3]) const
147 // Returns the array with extrapolated track position at the EMCAL surface
148 for(Int_t i=0; i<3; i++) emcalpos[i]=fEMCALPosition[i];
150 //_______________________________________________________________________________
151 void AliAODPid::SetEMCALPosition(Double_t emcpos[3])
153 // Sets the array with extrapolated track position at the EMCAL surface
154 for(Int_t i=0; i<3; i++) fEMCALPosition[i]=emcpos[i];
156 //_______________________________________________________________________________
157 void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3]) const
159 // Returns the array with extrapolated track momentum at the EMCAL surface
160 for(Int_t i=0; i<3; i++) emcalmom[i]=fEMCALMomentum[i];
162 //_______________________________________________________________________________
163 void AliAODPid::SetEMCALMomentum(Double_t emcmom[3])
165 // Sets the array with extrapolated track momentum at the EMCAL surface
166 for(Int_t i=0; i<3; i++) fEMCALMomentum[i]=emcmom[i];
168 //______________________________________________________________________________
169 void AliAODPid::SetTOFpidResolution(Double_t tofPIDres[5])
171 for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=tofPIDres[i];
174 //______________________________________________________________________________
175 void AliAODPid::GetTOFpidResolution(Double_t tofRes[5]) const
177 for (Int_t i=0; i<5; i++) tofRes[i]=fTOFpidResolution[i];
180 //______________________________________________________________________________
181 void AliAODPid::SetHMPIDprobs(Double_t hmpPid[5])
184 // Set the HMPID PID probablities that are read from ESD
186 for(Int_t i = 0; i < 5; i++ ) fHMPIDprobs[i] = hmpPid[i];
188 //______________________________________________________________________________
189 void AliAODPid::GetHMPIDprobs(Double_t *p) const
192 // Set the HMPID PID probablities that are read from ESD
194 for(Int_t i = 0; i < AliPID::kSPECIES; i++ ) p[i] = fHMPIDprobs[i];
196 //______________________________________________________________________________
197 void AliAODPid::SetITSdEdxSamples(const Double_t s[4])
200 // Set the 4 values of dE/dx from individual ITS layers that are read from ESD
202 for (Int_t i=0; i<4; i++) fITSdEdxSamples[i]=s[i];
204 //______________________________________________________________________________
205 void AliAODPid::GetITSdEdxSamples(Double_t s[4]) const
208 // Get the 4 values of dE/dx from individual ITS layers that are read from ESD
210 for (Int_t i=0; i<4; i++) s[i]=fITSdEdxSamples[i];