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"
30 //______________________________________________________________________________
31 AliAODPid::AliAODPid():
41 // default constructor
42 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i] = 0;
43 for(Int_t i=0; i<3; i++) fEMCALPosition[i] = 0.;
44 for(Int_t i=0; i<5; i++) fTOFpidResolution[i] = 0.;
45 for(Int_t i=0; i<6; i++) fTRDmomentum[i] = 0.;
46 for(Int_t i=0; i<3; i++) fEMCALMomentum[i] = 0.;
50 //______________________________________________________________________________
51 AliAODPid::~AliAODPid()
59 //______________________________________________________________________________
60 AliAODPid::AliAODPid(const AliAODPid& pid) :
62 fITSsignal(pid.fITSsignal),
63 fTPCsignal(pid.fTPCsignal),
64 fTPCsignalN(pid.fTPCsignalN),
65 fTPCmomentum(pid.fTPCmomentum),
66 fTRDnSlices(pid.fTRDnSlices),
68 fTOFesdsignal(pid.fTOFesdsignal),
69 fHMPIDsignal(pid.fHMPIDsignal)
72 fTRDslices = new Double32_t[fTRDnSlices];
73 for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
74 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
75 for(Int_t i=0; i<3; i++) {
76 fEMCALPosition[i]=pid.fEMCALPosition[i];
77 fEMCALMomentum[i]=pid.fEMCALMomentum[i];
79 for(Int_t i=0; i<6; i++) fTRDmomentum[i]=pid.fTRDmomentum[i];
81 for(Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
84 //______________________________________________________________________________
85 AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
87 // Assignment operator
90 fITSsignal=pid.fITSsignal;
91 fTPCsignal=pid.fTPCsignal;
93 if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){
94 // only delete if number changed or is 0
97 if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices];
99 fTRDnSlices=pid.fTRDnSlices;
101 for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
102 fTOFesdsignal=pid.fTOFesdsignal;
103 fHMPIDsignal=pid.fHMPIDsignal;
104 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
105 for(Int_t i=0; i<6; i++) fTRDmomentum[i]=pid.fTRDmomentum[i];
106 for(Int_t i=0; i<3; i++) {
107 fEMCALPosition[i]=pid.fEMCALPosition[i];
108 fEMCALMomentum[i]=pid.fEMCALMomentum[i];
110 for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
115 //_______________________________________________________________________________
116 void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES]) const
118 // Returns the array with integrated times for each particle hypothesis
119 for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
121 //_______________________________________________________________________________
122 void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
124 // Returns the array with integrated times for each particle hypothesis
125 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
127 //_______________________________________________________________________________
128 void AliAODPid::GetEMCALPosition(Double_t emcalpos[3]) const
130 // Returns the array with extrapolated track position at the EMCAL surface
131 for(Int_t i=0; i<3; i++) emcalpos[i]=fEMCALPosition[i];
133 //_______________________________________________________________________________
134 void AliAODPid::SetEMCALPosition(Double_t emcpos[3])
136 // Sets the array with extrapolated track position at the EMCAL surface
137 for(Int_t i=0; i<3; i++) fEMCALPosition[i]=emcpos[i];
139 //_______________________________________________________________________________
140 void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3]) const
142 // Returns the array with extrapolated track momentum at the EMCAL surface
143 for(Int_t i=0; i<3; i++) emcalmom[i]=fEMCALMomentum[i];
145 //_______________________________________________________________________________
146 void AliAODPid::SetEMCALMomentum(Double_t emcmom[3])
148 // Sets the array with extrapolated track momentum at the EMCAL surface
149 for(Int_t i=0; i<3; i++) fEMCALMomentum[i]=emcmom[i];
151 //______________________________________________________________________________
152 void AliAODPid::SetTOFpidResolution(Double_t tofPIDres[5])
154 for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=tofPIDres[i];
157 //______________________________________________________________________________
158 void AliAODPid::GetTOFpidResolution(Double_t tofRes[5]) const
160 for (Int_t i=0; i<5; i++) tofRes[i]=fTOFpidResolution[i];