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