]>
Commit | Line | Data |
---|---|---|
1c28d174 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2007, 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 | // AOD Pid class to store additional pid information | |
d7bdc804 | 20 | // Author: Annalisa Mastroserio |
1c28d174 | 21 | //------------------------------------------------------------------------- |
22 | ||
23 | #include "AliAODPid.h" | |
d7bdc804 | 24 | #include "AliESDtrack.h" |
25 | #include "AliLog.h" | |
1c28d174 | 26 | |
27 | ClassImp(AliAODPid) | |
28 | ||
d7bdc804 | 29 | |
1c28d174 | 30 | //______________________________________________________________________________ |
d7bdc804 | 31 | AliAODPid::AliAODPid(): |
32 | fITSsignal(0), | |
33 | fTPCsignal(0), | |
a7307087 | 34 | fTPCsignalN(0), |
d999f2e6 | 35 | fTPCmomentum(0), |
d7bdc804 | 36 | fTRDnSlices(0), |
37 | fTRDslices(0x0), | |
38 | fTOFesdsignal(0), | |
39 | fHMPIDsignal(0) | |
1c28d174 | 40 | { |
41 | // default constructor | |
7ba6f91a | 42 | for(Int_t i=0; i<kSPECIES; i++) fIntTime[i] = 0; |
43 | for(Int_t i=0; i<3; i++) fEMCALPosition[i] = 0.; | |
b13bcc35 | 44 | for(Int_t i=0; i<5; i++) fTOFpidResolution[i] = 0.; |
7ba6f91a | 45 | for(Int_t i=0; i<6; i++) fTRDmomentum[i] = 0.; |
46 | for(Int_t i=0; i<3; i++) fEMCALMomentum[i] = 0.; | |
373fc041 | 47 | |
1c28d174 | 48 | } |
49 | ||
50 | //______________________________________________________________________________ | |
51 | AliAODPid::~AliAODPid() | |
52 | { | |
341952b8 | 53 | delete [] fTRDslices; |
54 | fTRDslices = 0; | |
1c28d174 | 55 | // destructor |
56 | } | |
57 | ||
58 | ||
59 | //______________________________________________________________________________ | |
60 | AliAODPid::AliAODPid(const AliAODPid& pid) : | |
d7bdc804 | 61 | TObject(pid), |
62 | fITSsignal(pid.fITSsignal), | |
63 | fTPCsignal(pid.fTPCsignal), | |
a7307087 | 64 | fTPCsignalN(pid.fTPCsignalN), |
d999f2e6 | 65 | fTPCmomentum(pid.fTPCmomentum), |
d7bdc804 | 66 | fTRDnSlices(pid.fTRDnSlices), |
67 | fTRDslices(0x0), | |
68 | fTOFesdsignal(pid.fTOFesdsignal), | |
69 | fHMPIDsignal(pid.fHMPIDsignal) | |
1c28d174 | 70 | { |
71 | // Copy constructor | |
d7bdc804 | 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]; | |
64c79a6a | 75 | for(Int_t i=0; i<3; i++) { |
76 | fEMCALPosition[i]=pid.fEMCALPosition[i]; | |
77 | fEMCALMomentum[i]=pid.fEMCALMomentum[i]; | |
78 | } | |
79 | for(Int_t i=0; i<6; i++) fTRDmomentum[i]=pid.fTRDmomentum[i]; | |
b13bcc35 | 80 | |
81 | for(Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i]; | |
1c28d174 | 82 | } |
83 | ||
84 | //______________________________________________________________________________ | |
85 | AliAODPid& AliAODPid::operator=(const AliAODPid& pid) | |
86 | { | |
87 | // Assignment operator | |
88 | if(this!=&pid) { | |
89 | // copy stuff | |
341952b8 | 90 | fITSsignal=pid.fITSsignal; |
91 | fTPCsignal=pid.fTPCsignal; | |
92 | ||
93 | if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){ | |
94 | // only delete if number changed or is 0 | |
95 | delete [] fTRDslices; | |
96 | fTRDslices = 0; | |
97 | if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices]; | |
98 | } | |
99 | fTRDnSlices=pid.fTRDnSlices; | |
100 | ||
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]; | |
64c79a6a | 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]; | |
109 | } | |
b13bcc35 | 110 | for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i]; |
1c28d174 | 111 | } |
112 | ||
113 | return *this; | |
114 | } | |
d7bdc804 | 115 | //_______________________________________________________________________________ |
febefa51 | 116 | void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES]) const |
d7bdc804 | 117 | { |
373fc041 | 118 | // Returns the array with integrated times for each particle hypothesis |
119 | for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i]; | |
d7bdc804 | 120 | } |
373fc041 | 121 | //_______________________________________________________________________________ |
122 | void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES]) | |
d7bdc804 | 123 | { |
124 | // Returns the array with integrated times for each particle hypothesis | |
373fc041 | 125 | for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i]; |
d7bdc804 | 126 | } |
a401ba0b | 127 | //_______________________________________________________________________________ |
febefa51 | 128 | void AliAODPid::GetEMCALPosition(Double_t emcalpos[3]) const |
a401ba0b | 129 | { |
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]; | |
132 | } | |
133 | //_______________________________________________________________________________ | |
134 | void AliAODPid::SetEMCALPosition(Double_t emcpos[3]) | |
135 | { | |
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]; | |
138 | } | |
139 | //_______________________________________________________________________________ | |
febefa51 | 140 | void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3]) const |
a401ba0b | 141 | { |
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]; | |
144 | } | |
145 | //_______________________________________________________________________________ | |
146 | void AliAODPid::SetEMCALMomentum(Double_t emcmom[3]) | |
147 | { | |
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]; | |
150 | } | |
b13bcc35 | 151 | //______________________________________________________________________________ |
152 | void AliAODPid::SetTOFpidResolution(Double_t tofPIDres[5]) | |
153 | { | |
154 | for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=tofPIDres[i]; | |
155 | ||
156 | } | |
157 | //______________________________________________________________________________ | |
158 | void AliAODPid::GetTOFpidResolution(Double_t tofRes[5]) const | |
159 | { | |
160 | for (Int_t i=0; i<5; i++) tofRes[i]=fTOFpidResolution[i]; | |
161 | } | |
162 |