]>
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" | |
af48efa8 | 26 | #include "AliTPCdEdxInfo.h" |
1c28d174 | 27 | |
28 | ClassImp(AliAODPid) | |
29 | ||
d7bdc804 | 30 | |
1c28d174 | 31 | //______________________________________________________________________________ |
d7bdc804 | 32 | AliAODPid::AliAODPid(): |
33 | fITSsignal(0), | |
34 | fTPCsignal(0), | |
a7307087 | 35 | fTPCsignalN(0), |
d999f2e6 | 36 | fTPCmomentum(0), |
ef7661fd | 37 | fTPCTgl(0), |
d7bdc804 | 38 | fTRDnSlices(0), |
59a8e853 | 39 | fTRDntls(0), |
d7bdc804 | 40 | fTRDslices(0x0), |
6736efd5 | 41 | fTRDsignal(0), |
820214a7 | 42 | fTRDChi2(0x0), |
d7bdc804 | 43 | fTOFesdsignal(0), |
af48efa8 | 44 | fTPCdEdxInfo(0) |
1c28d174 | 45 | { |
46 | // default constructor | |
00a38d07 | 47 | for(Int_t i=0; i<AliPID::kSPECIES; i++) fIntTime[i] = 0; |
b13bcc35 | 48 | for(Int_t i=0; i<5; i++) fTOFpidResolution[i] = 0.; |
59a8e853 | 49 | for(Int_t i=0; i<6; i++) { |
50 | fTRDmomentum[i] = 0.; | |
51 | fTRDncls[i] = 0; | |
52 | } | |
6d354ed1 | 53 | for(Int_t i=0; i<4; i++) fITSdEdxSamples[i] = 0.; |
1c28d174 | 54 | } |
55 | ||
56 | //______________________________________________________________________________ | |
57 | AliAODPid::~AliAODPid() | |
58 | { | |
341952b8 | 59 | delete [] fTRDslices; |
60 | fTRDslices = 0; | |
af48efa8 | 61 | delete fTPCdEdxInfo; |
1c28d174 | 62 | // destructor |
63 | } | |
64 | ||
65 | ||
66 | //______________________________________________________________________________ | |
67 | AliAODPid::AliAODPid(const AliAODPid& pid) : | |
d7bdc804 | 68 | TObject(pid), |
69 | fITSsignal(pid.fITSsignal), | |
70 | fTPCsignal(pid.fTPCsignal), | |
a7307087 | 71 | fTPCsignalN(pid.fTPCsignalN), |
d999f2e6 | 72 | fTPCmomentum(pid.fTPCmomentum), |
ef7661fd | 73 | fTPCTgl(pid.fTPCTgl), |
d7bdc804 | 74 | fTRDnSlices(pid.fTRDnSlices), |
59a8e853 | 75 | fTRDntls(pid.fTRDntls), |
d7bdc804 | 76 | fTRDslices(0x0), |
6736efd5 | 77 | fTRDsignal(pid.fTRDsignal), |
820214a7 | 78 | fTRDChi2(pid.fTRDChi2), |
d7bdc804 | 79 | fTOFesdsignal(pid.fTOFesdsignal), |
be63c0e3 | 80 | fTPCdEdxInfo(0x0) |
1c28d174 | 81 | { |
82 | // Copy constructor | |
6736efd5 | 83 | SetTRDslices(fTRDnSlices, pid.fTRDslices); |
00a38d07 | 84 | for(Int_t i=0; i<AliPID::kSPECIES; i++) fIntTime[i]=pid.fIntTime[i]; |
996918c5 | 85 | |
59a8e853 | 86 | for(Int_t i=0; i<6; i++){ |
87 | fTRDmomentum[i]=pid.fTRDmomentum[i]; | |
88 | fTRDncls[i] = 0; | |
89 | } | |
b13bcc35 | 90 | |
91 | for(Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i]; | |
6d354ed1 | 92 | |
93 | for(Int_t i=0; i<4; i++) fITSdEdxSamples[i]=pid.fITSdEdxSamples[i]; | |
be63c0e3 | 94 | |
95 | if (pid.fTPCdEdxInfo) fTPCdEdxInfo=new AliTPCdEdxInfo(*pid.fTPCdEdxInfo); | |
1c28d174 | 96 | } |
97 | ||
98 | //______________________________________________________________________________ | |
99 | AliAODPid& AliAODPid::operator=(const AliAODPid& pid) | |
100 | { | |
101 | // Assignment operator | |
102 | if(this!=&pid) { | |
103 | // copy stuff | |
2fb73d52 | 104 | TObject::operator=(pid); |
0f075bdc | 105 | |
106 | fITSsignal = pid.fITSsignal; | |
107 | for (Int_t i = 0; i < 4; i++) fITSdEdxSamples[i]=pid.fITSdEdxSamples[i]; | |
108 | fTPCsignal = pid.fTPCsignal; | |
109 | fTPCsignalN = pid.fTPCsignalN; | |
110 | fTPCmomentum = pid.fTPCmomentum; | |
ef7661fd | 111 | fTPCTgl = pid.fTPCTgl; |
0f075bdc | 112 | |
6736efd5 | 113 | fTRDsignal = pid.fTRDsignal; |
adf964b4 | 114 | if(fTRDnSlices != pid.fTRDnSlices) { |
341952b8 | 115 | // only delete if number changed or is 0 |
116 | delete [] fTRDslices; | |
117 | fTRDslices = 0; | |
adf964b4 | 118 | fTRDnSlices = pid.fTRDnSlices; |
0f075bdc | 119 | if(pid.fTRDnSlices > 0) fTRDslices = new Double32_t[fTRDnSlices]; |
341952b8 | 120 | } |
adf964b4 | 121 | |
73cb1e20 | 122 | if (fTRDslices && pid.fTRDslices) |
123 | memcpy(fTRDslices, pid.fTRDslices, fTRDnSlices*sizeof(Double32_t)); | |
0f075bdc | 124 | |
125 | fTRDntls = pid.fTRDntls; | |
126 | for(Int_t i = 0; i < 6; i++){ | |
127 | fTRDmomentum[i] = pid.fTRDmomentum[i]; | |
128 | fTRDncls[i] = pid.fTRDncls[i]; | |
129 | } | |
130 | ||
820214a7 | 131 | fTRDChi2 = pid.fTRDChi2; |
132 | ||
341952b8 | 133 | fTOFesdsignal=pid.fTOFesdsignal; |
0f075bdc | 134 | for (Int_t i = 0; i < 5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i]; |
135 | for (Int_t i = 0; i < 5; i++) fIntTime[i]=pid.fIntTime[i]; | |
136 | ||
996918c5 | 137 | SetTPCdEdxInfo(pid.fTPCdEdxInfo); |
1c28d174 | 138 | } |
139 | ||
140 | return *this; | |
141 | } | |
d7bdc804 | 142 | //_______________________________________________________________________________ |
fc9b31a7 | 143 | void AliAODPid::GetIntegratedTimes(Double_t *timeint, Int_t nspec) const |
d7bdc804 | 144 | { |
fc9b31a7 | 145 | // Returns the array with integrated times for each particle hypothesis |
146 | // | |
147 | for(Int_t i=0; i<AliPID::kSPECIES; i++) timeint[i]=fIntTime[i]; | |
148 | //Note: at the moment only kSPECIES entries are available | |
149 | if (nspec>AliPID::kSPECIES) for (int i=AliPID::kSPECIES;i<AliPID::kSPECIESC;i++) timeint[i]=0; | |
150 | // | |
d7bdc804 | 151 | } |
373fc041 | 152 | //_______________________________________________________________________________ |
00a38d07 | 153 | void AliAODPid::SetIntegratedTimes(Double_t timeint[AliPID::kSPECIES]) |
d7bdc804 | 154 | { |
155 | // Returns the array with integrated times for each particle hypothesis | |
00a38d07 | 156 | for(Int_t i=0; i<AliPID::kSPECIES; i++) fIntTime[i]=timeint[i]; |
d7bdc804 | 157 | } |
b13bcc35 | 158 | //______________________________________________________________________________ |
159 | void AliAODPid::SetTOFpidResolution(Double_t tofPIDres[5]) | |
160 | { | |
161 | for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=tofPIDres[i]; | |
162 | ||
163 | } | |
164 | //______________________________________________________________________________ | |
165 | void AliAODPid::GetTOFpidResolution(Double_t tofRes[5]) const | |
166 | { | |
167 | for (Int_t i=0; i<5; i++) tofRes[i]=fTOFpidResolution[i]; | |
168 | } | |
169 | ||
6d354ed1 | 170 | //______________________________________________________________________________ |
171 | void AliAODPid::SetITSdEdxSamples(const Double_t s[4]) | |
172 | { | |
173 | // | |
174 | // Set the 4 values of dE/dx from individual ITS layers that are read from ESD | |
175 | // | |
176 | for (Int_t i=0; i<4; i++) fITSdEdxSamples[i]=s[i]; | |
177 | } | |
178 | //______________________________________________________________________________ | |
179 | void AliAODPid::GetITSdEdxSamples(Double_t s[4]) const | |
180 | { | |
181 | // | |
182 | // Get the 4 values of dE/dx from individual ITS layers that are read from ESD | |
183 | // | |
184 | for (Int_t i=0; i<4; i++) s[i]=fITSdEdxSamples[i]; | |
185 | } | |
af48efa8 | 186 | //______________________________________________________________________________ |
187 | void AliAODPid::SetTPCdEdxInfo(AliTPCdEdxInfo * dEdxInfo) | |
188 | { | |
189 | // | |
190 | // Set TPC dEdx info | |
191 | // | |
192 | if (dEdxInfo==0x0){ | |
193 | delete fTPCdEdxInfo; | |
194 | fTPCdEdxInfo=0x0; | |
195 | return; | |
196 | } | |
197 | if (!fTPCdEdxInfo) fTPCdEdxInfo=new AliTPCdEdxInfo; | |
198 | (*fTPCdEdxInfo)=(*dEdxInfo); | |
199 | } | |
200 |