]>
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 | |
d7bdc804 | 42 | for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=0; |
a401ba0b | 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.; |
373fc041 | 45 | |
1c28d174 | 46 | } |
47 | ||
48 | //______________________________________________________________________________ | |
49 | AliAODPid::~AliAODPid() | |
50 | { | |
341952b8 | 51 | delete [] fTRDslices; |
52 | fTRDslices = 0; | |
1c28d174 | 53 | // destructor |
54 | } | |
55 | ||
56 | ||
57 | //______________________________________________________________________________ | |
58 | AliAODPid::AliAODPid(const AliAODPid& pid) : | |
d7bdc804 | 59 | TObject(pid), |
60 | fITSsignal(pid.fITSsignal), | |
61 | fTPCsignal(pid.fTPCsignal), | |
a7307087 | 62 | fTPCsignalN(pid.fTPCsignalN), |
d999f2e6 | 63 | fTPCmomentum(pid.fTPCmomentum), |
d7bdc804 | 64 | fTRDnSlices(pid.fTRDnSlices), |
65 | fTRDslices(0x0), | |
66 | fTOFesdsignal(pid.fTOFesdsignal), | |
67 | fHMPIDsignal(pid.fHMPIDsignal) | |
1c28d174 | 68 | { |
69 | // Copy constructor | |
d7bdc804 | 70 | fTRDslices = new Double32_t[fTRDnSlices]; |
71 | for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i]; | |
72 | for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i]; | |
64c79a6a | 73 | for(Int_t i=0; i<3; i++) { |
74 | fEMCALPosition[i]=pid.fEMCALPosition[i]; | |
75 | fEMCALMomentum[i]=pid.fEMCALMomentum[i]; | |
76 | } | |
77 | for(Int_t i=0; i<6; i++) fTRDmomentum[i]=pid.fTRDmomentum[i]; | |
b13bcc35 | 78 | |
79 | for(Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i]; | |
1c28d174 | 80 | } |
81 | ||
82 | //______________________________________________________________________________ | |
83 | AliAODPid& AliAODPid::operator=(const AliAODPid& pid) | |
84 | { | |
85 | // Assignment operator | |
86 | if(this!=&pid) { | |
87 | // copy stuff | |
341952b8 | 88 | fITSsignal=pid.fITSsignal; |
89 | fTPCsignal=pid.fTPCsignal; | |
90 | ||
91 | if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){ | |
92 | // only delete if number changed or is 0 | |
93 | delete [] fTRDslices; | |
94 | fTRDslices = 0; | |
95 | if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices]; | |
96 | } | |
97 | fTRDnSlices=pid.fTRDnSlices; | |
98 | ||
99 | for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i]; | |
100 | fTOFesdsignal=pid.fTOFesdsignal; | |
101 | fHMPIDsignal=pid.fHMPIDsignal; | |
102 | for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i]; | |
64c79a6a | 103 | for(Int_t i=0; i<6; i++) fTRDmomentum[i]=pid.fTRDmomentum[i]; |
104 | for(Int_t i=0; i<3; i++) { | |
105 | fEMCALPosition[i]=pid.fEMCALPosition[i]; | |
106 | fEMCALMomentum[i]=pid.fEMCALMomentum[i]; | |
107 | } | |
b13bcc35 | 108 | for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i]; |
1c28d174 | 109 | } |
110 | ||
111 | return *this; | |
112 | } | |
d7bdc804 | 113 | //_______________________________________________________________________________ |
febefa51 | 114 | void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES]) const |
d7bdc804 | 115 | { |
373fc041 | 116 | // Returns the array with integrated times for each particle hypothesis |
117 | for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i]; | |
d7bdc804 | 118 | } |
373fc041 | 119 | //_______________________________________________________________________________ |
120 | void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES]) | |
d7bdc804 | 121 | { |
122 | // Returns the array with integrated times for each particle hypothesis | |
373fc041 | 123 | for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i]; |
d7bdc804 | 124 | } |
a401ba0b | 125 | //_______________________________________________________________________________ |
febefa51 | 126 | void AliAODPid::GetEMCALPosition(Double_t emcalpos[3]) const |
a401ba0b | 127 | { |
128 | // Returns the array with extrapolated track position at the EMCAL surface | |
129 | for(Int_t i=0; i<3; i++) emcalpos[i]=fEMCALPosition[i]; | |
130 | } | |
131 | //_______________________________________________________________________________ | |
132 | void AliAODPid::SetEMCALPosition(Double_t emcpos[3]) | |
133 | { | |
134 | // Sets the array with extrapolated track position at the EMCAL surface | |
135 | for(Int_t i=0; i<3; i++) fEMCALPosition[i]=emcpos[i]; | |
136 | } | |
137 | //_______________________________________________________________________________ | |
febefa51 | 138 | void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3]) const |
a401ba0b | 139 | { |
140 | // Returns the array with extrapolated track momentum at the EMCAL surface | |
141 | for(Int_t i=0; i<3; i++) emcalmom[i]=fEMCALMomentum[i]; | |
142 | } | |
143 | //_______________________________________________________________________________ | |
144 | void AliAODPid::SetEMCALMomentum(Double_t emcmom[3]) | |
145 | { | |
146 | // Sets the array with extrapolated track momentum at the EMCAL surface | |
147 | for(Int_t i=0; i<3; i++) fEMCALMomentum[i]=emcmom[i]; | |
148 | } | |
b13bcc35 | 149 | //______________________________________________________________________________ |
150 | void AliAODPid::SetTOFpidResolution(Double_t tofPIDres[5]) | |
151 | { | |
152 | for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=tofPIDres[i]; | |
153 | ||
154 | } | |
155 | //______________________________________________________________________________ | |
156 | void AliAODPid::GetTOFpidResolution(Double_t tofRes[5]) const | |
157 | { | |
158 | for (Int_t i=0; i<5; i++) tofRes[i]=fTOFpidResolution[i]; | |
159 | } | |
160 |