]>
Commit | Line | Data |
---|---|---|
1d99986f | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, 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 | //------------------------------------------------------------------------- | |
17 | // Implementation of the AliESDfriendTrack class | |
18 | // This class keeps complementary to the AliESDtrack information | |
19 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch | |
20 | //------------------------------------------------------------------------- | |
21 | #include "AliTrackPointArray.h" | |
22 | #include "AliESDfriendTrack.h" | |
00dce61a | 23 | #include "TObjArray.h" |
5637918c | 24 | #include "TClonesArray.h" |
be713d4d | 25 | #include "AliKalmanTrack.h" |
6a33e0e9 | 26 | #include "AliVVTPCseed.h" |
1d99986f | 27 | |
28 | ClassImp(AliESDfriendTrack) | |
29 | ||
15e85efa | 30 | AliESDfriendTrack::AliESDfriendTrack(): |
31 | TObject(), | |
32 | f1P(0), | |
6d3a7bbf | 33 | fnMaxITScluster(0), |
34 | fnMaxTPCcluster(0), | |
35 | fnMaxTRDcluster(0), | |
36 | fITSindex(0x0), | |
37 | fTPCindex(0x0), | |
38 | fTRDindex(0x0), | |
00dce61a | 39 | fPoints(0), |
40 | fCalibContainer(0), | |
15e85efa | 41 | fITStrack(0), |
ded25cc6 | 42 | fTRDtrack(0), |
43 | fTPCOut(0), | |
44 | fITSOut(0), | |
45 | fTRDIn(0) | |
15e85efa | 46 | { |
1d99986f | 47 | // |
48 | // Default constructor | |
49 | // | |
6d3a7bbf | 50 | // Int_t i; |
51 | // fITSindex = new Int_t[fnMaxITScluster]; | |
52 | //fTPCindex = new Int_t[fnMaxTPCcluster]; | |
53 | //fTRDindex = new Int_t[fnMaxTRDcluster]; | |
54 | //for (i=0; i<kMaxITScluster; i++) fITSindex[i]=-2; | |
55 | //for (i=0; i<kMaxTPCcluster; i++) fTPCindex[i]=-2; | |
56 | //for (i=0; i<kMaxTRDcluster; i++) fTRDindex[i]=-2; | |
5637918c | 57 | |
58 | //fHmpPhotClus->SetOwner(kTRUE); | |
59 | ||
1d99986f | 60 | } |
61 | ||
62 | AliESDfriendTrack::AliESDfriendTrack(const AliESDfriendTrack &t): | |
63 | TObject(t), | |
61ac1db0 | 64 | AliVVfriendTrack(), |
1d99986f | 65 | f1P(t.f1P), |
6d3a7bbf | 66 | fnMaxITScluster(t.fnMaxITScluster), |
67 | fnMaxTPCcluster(t.fnMaxTPCcluster), | |
68 | fnMaxTRDcluster(t.fnMaxTRDcluster), | |
69 | fITSindex(0x0), | |
70 | fTPCindex(0x0), | |
71 | fTRDindex(0x0), | |
15e85efa | 72 | fPoints(0), |
00dce61a | 73 | fCalibContainer(0), |
15e85efa | 74 | fITStrack(0), |
ded25cc6 | 75 | fTRDtrack(0), |
76 | fTPCOut(0), | |
77 | fITSOut(0), | |
78 | fTRDIn(0) | |
1d99986f | 79 | { |
80 | // | |
81 | // Copy constructor | |
82 | // | |
6d3a7bbf | 83 | AliDebug(2,"Calling copy constructor"); |
ddfbc51a | 84 | |
1d99986f | 85 | Int_t i; |
6d3a7bbf | 86 | if (fnMaxITScluster != 0){ |
ddfbc51a | 87 | fITSindex = new Int_t[fnMaxITScluster]; |
88 | for (i=0; i<fnMaxITScluster; i++) fITSindex[i]=t.fITSindex[i]; | |
6d3a7bbf | 89 | } |
90 | if (fnMaxTPCcluster != 0){ | |
ddfbc51a | 91 | fTPCindex = new Int_t[fnMaxTPCcluster]; |
92 | for (i=0; i<fnMaxTPCcluster; i++) fTPCindex[i]=t.fTPCindex[i]; | |
6d3a7bbf | 93 | } |
94 | if (fnMaxTRDcluster != 0){ | |
ddfbc51a | 95 | fTRDindex = new Int_t[fnMaxTRDcluster]; |
96 | for (i=0; i<fnMaxTRDcluster; i++) fTRDindex[i]=t.fTRDindex[i]; | |
6d3a7bbf | 97 | } |
98 | AliDebug(2,Form("fnMaxITScluster = %d",fnMaxITScluster)); | |
99 | AliDebug(2,Form("fnMaxTPCcluster = %d",fnMaxTPCcluster)); | |
100 | AliDebug(2,Form("fnMaxTRDcluster = %d",fnMaxTRDcluster)); | |
ddfbc51a | 101 | if (t.fPoints) fPoints=new AliTrackPointArray(*t.fPoints); |
102 | if (t.fCalibContainer) { | |
f333ed51 | 103 | fCalibContainer = new TObjArray(5); |
104 | Int_t no=t.fCalibContainer->GetEntriesFast(); | |
6c27b212 | 105 | for (i=0; i<no; i++) { |
f333ed51 | 106 | TObject *o=t.fCalibContainer->At(i); |
ddfbc51a | 107 | if (o) fCalibContainer->AddLast(o->Clone()); |
f333ed51 | 108 | } |
109 | } | |
ded25cc6 | 110 | |
ddfbc51a | 111 | if (t.fTPCOut) fTPCOut = new AliExternalTrackParam(*(t.fTPCOut)); |
112 | if (t.fITSOut) fITSOut = new AliExternalTrackParam(*(t.fITSOut)); | |
113 | if (t.fTRDIn) fTRDIn = new AliExternalTrackParam(*(t.fTRDIn)); | |
114 | ||
1d99986f | 115 | } |
116 | ||
ddfbc51a | 117 | AliESDfriendTrack::~AliESDfriendTrack() { |
1d99986f | 118 | // |
15e85efa | 119 | // Simple destructor |
1d99986f | 120 | // |
ddfbc51a | 121 | delete fPoints; |
122 | if (fCalibContainer) fCalibContainer->Delete(); | |
123 | delete fCalibContainer; | |
124 | delete fITStrack; | |
125 | delete fTRDtrack; | |
126 | delete fTPCOut; | |
127 | delete fITSOut; | |
128 | delete fTRDIn; | |
129 | delete[] fITSindex; | |
130 | delete[] fTPCindex; | |
131 | delete[] fTRDindex; | |
1d99986f | 132 | } |
00dce61a | 133 | |
e546b023 | 134 | |
ddfbc51a | 135 | void AliESDfriendTrack::AddCalibObject(TObject * calibObject){ |
136 | // | |
00dce61a | 137 | // add calibration object to array - |
138 | // track is owner of the objects in the container | |
139 | // | |
ddfbc51a | 140 | if (!fCalibContainer) fCalibContainer = new TObjArray(5); |
00dce61a | 141 | fCalibContainer->AddLast(calibObject); |
142 | } | |
143 | ||
a453390d | 144 | TObject * AliESDfriendTrack::GetCalibObject(Int_t index) const { |
ddfbc51a | 145 | // |
146 | // | |
147 | // | |
00dce61a | 148 | if (!fCalibContainer) return 0; |
149 | if (index>=fCalibContainer->GetEntriesFast()) return 0; | |
150 | return fCalibContainer->At(index); | |
151 | } | |
ded25cc6 | 152 | |
6a33e0e9 | 153 | Int_t AliESDfriendTrack::GetTPCseed( AliTPCseed &seed) const { |
154 | TObject* calibObject = NULL; | |
155 | AliVVTPCseed* seedP = NULL; | |
156 | for (Int_t idx = 0; (calibObject = GetCalibObject(idx)); ++idx) { | |
157 | if ((seedP = dynamic_cast<AliVVTPCseed*>(calibObject))) { | |
158 | seedP->CopyToTPCseed( seed ); | |
159 | return 0; | |
160 | } | |
161 | } | |
162 | return -1; | |
163 | } | |
ded25cc6 | 164 | |
ddfbc51a | 165 | void AliESDfriendTrack::SetTPCOut(const AliExternalTrackParam ¶m) { |
166 | // | |
ded25cc6 | 167 | // backup TPC out track |
168 | // | |
ddfbc51a | 169 | delete fTPCOut; |
170 | fTPCOut=new AliExternalTrackParam(param); | |
ded25cc6 | 171 | } |
ddfbc51a | 172 | void AliESDfriendTrack::SetITSOut(const AliExternalTrackParam ¶m) { |
e546b023 | 173 | // |
ddfbc51a | 174 | // backup ITS out track |
ded25cc6 | 175 | // |
ddfbc51a | 176 | delete fITSOut; |
177 | fITSOut=new AliExternalTrackParam(param); | |
e546b023 | 178 | } |
ddfbc51a | 179 | void AliESDfriendTrack::SetTRDIn(const AliExternalTrackParam ¶m) { |
ded25cc6 | 180 | // |
ddfbc51a | 181 | // backup TRD in track |
e546b023 | 182 | // |
ddfbc51a | 183 | delete fTRDIn; |
184 | fTRDIn=new AliExternalTrackParam(param); | |
ded25cc6 | 185 | } |
186 | ||
ddfbc51a | 187 | void AliESDfriendTrack::SetITSIndices(Int_t* indices, Int_t n){ |
188 | ||
189 | // | |
190 | // setting fITSindex | |
191 | // instantiating the pointer if still NULL | |
192 | // | |
193 | ||
194 | fnMaxITScluster = n; | |
195 | AliDebug(2,Form("fnMaxITScluster = %d",fnMaxITScluster)); | |
196 | if (fITSindex == 0x0){ | |
197 | fITSindex = new Int_t[fnMaxITScluster]; | |
198 | } | |
199 | for (Int_t i = 0; i < fnMaxITScluster; i++){ | |
200 | fITSindex[i] = indices[i]; | |
201 | } | |
6d3a7bbf | 202 | } |
203 | ||
ddfbc51a | 204 | void AliESDfriendTrack::SetTPCIndices(Int_t* indices, Int_t n){ |
205 | ||
206 | // | |
207 | // setting fTPCindex | |
208 | // instantiating the pointer if still NULL | |
209 | // | |
210 | ||
211 | fnMaxTPCcluster = n; | |
212 | AliDebug(2,Form("fnMaxTPCcluster = %d",fnMaxTPCcluster)); | |
213 | if (fTPCindex == 0x0){ | |
214 | fTPCindex = new Int_t[fnMaxTPCcluster]; | |
215 | } | |
216 | for (Int_t i = 0; i < fnMaxTPCcluster; i++){ | |
217 | fTPCindex[i] = indices[i]; | |
218 | } | |
6d3a7bbf | 219 | } |
220 | ||
ddfbc51a | 221 | void AliESDfriendTrack::SetTRDIndices(Int_t* indices, Int_t n){ |
222 | ||
223 | // | |
224 | // setting fTRDindex | |
225 | // instantiating the pointer if still NULL | |
226 | // | |
227 | ||
228 | fnMaxTRDcluster = n; | |
229 | AliDebug(2,Form("fnMaxTRDcluster = %d",fnMaxTRDcluster)); | |
230 | if (fTRDindex == 0x0){ | |
231 | fTRDindex = new Int_t[fnMaxTRDcluster]; | |
232 | } | |
233 | for (Int_t i = 0; i < fnMaxTRDcluster; i++){ | |
234 | fTRDindex[i] = indices[i]; | |
235 | } | |
6d3a7bbf | 236 | } |
237 |