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