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