]>
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" |
1f516476 | 26 | #include "AliVTPCseed.h" |
1d99986f | 27 | |
28 | ClassImp(AliESDfriendTrack) | |
29 | ||
15e85efa | 30 | AliESDfriendTrack::AliESDfriendTrack(): |
0e757649 | 31 | AliVfriendTrack(), |
15e85efa | 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): | |
0e757649 | 63 | AliVfriendTrack(t), |
1d99986f | 64 | f1P(t.f1P), |
6d3a7bbf | 65 | fnMaxITScluster(t.fnMaxITScluster), |
66 | fnMaxTPCcluster(t.fnMaxTPCcluster), | |
67 | fnMaxTRDcluster(t.fnMaxTRDcluster), | |
68 | fITSindex(0x0), | |
69 | fTPCindex(0x0), | |
70 | fTRDindex(0x0), | |
15e85efa | 71 | fPoints(0), |
00dce61a | 72 | fCalibContainer(0), |
15e85efa | 73 | fITStrack(0), |
ded25cc6 | 74 | fTRDtrack(0), |
75 | fTPCOut(0), | |
76 | fITSOut(0), | |
77 | fTRDIn(0) | |
1d99986f | 78 | { |
79 | // | |
80 | // Copy constructor | |
81 | // | |
6d3a7bbf | 82 | AliDebug(2,"Calling copy constructor"); |
ddfbc51a | 83 | |
1d99986f | 84 | Int_t i; |
6d3a7bbf | 85 | if (fnMaxITScluster != 0){ |
ddfbc51a | 86 | fITSindex = new Int_t[fnMaxITScluster]; |
87 | for (i=0; i<fnMaxITScluster; i++) fITSindex[i]=t.fITSindex[i]; | |
6d3a7bbf | 88 | } |
89 | if (fnMaxTPCcluster != 0){ | |
ddfbc51a | 90 | fTPCindex = new Int_t[fnMaxTPCcluster]; |
91 | for (i=0; i<fnMaxTPCcluster; i++) fTPCindex[i]=t.fTPCindex[i]; | |
6d3a7bbf | 92 | } |
93 | if (fnMaxTRDcluster != 0){ | |
ddfbc51a | 94 | fTRDindex = new Int_t[fnMaxTRDcluster]; |
95 | for (i=0; i<fnMaxTRDcluster; i++) fTRDindex[i]=t.fTRDindex[i]; | |
6d3a7bbf | 96 | } |
97 | AliDebug(2,Form("fnMaxITScluster = %d",fnMaxITScluster)); | |
98 | AliDebug(2,Form("fnMaxTPCcluster = %d",fnMaxTPCcluster)); | |
99 | AliDebug(2,Form("fnMaxTRDcluster = %d",fnMaxTRDcluster)); | |
ddfbc51a | 100 | if (t.fPoints) fPoints=new AliTrackPointArray(*t.fPoints); |
101 | if (t.fCalibContainer) { | |
f333ed51 | 102 | fCalibContainer = new TObjArray(5); |
103 | Int_t no=t.fCalibContainer->GetEntriesFast(); | |
6c27b212 | 104 | for (i=0; i<no; i++) { |
f333ed51 | 105 | TObject *o=t.fCalibContainer->At(i); |
ddfbc51a | 106 | if (o) fCalibContainer->AddLast(o->Clone()); |
f333ed51 | 107 | } |
108 | } | |
ded25cc6 | 109 | |
ddfbc51a | 110 | if (t.fTPCOut) fTPCOut = new AliExternalTrackParam(*(t.fTPCOut)); |
111 | if (t.fITSOut) fITSOut = new AliExternalTrackParam(*(t.fITSOut)); | |
112 | if (t.fTRDIn) fTRDIn = new AliExternalTrackParam(*(t.fTRDIn)); | |
113 | ||
1d99986f | 114 | } |
115 | ||
ddfbc51a | 116 | AliESDfriendTrack::~AliESDfriendTrack() { |
1d99986f | 117 | // |
15e85efa | 118 | // Simple destructor |
1d99986f | 119 | // |
ddfbc51a | 120 | delete fPoints; |
121 | if (fCalibContainer) fCalibContainer->Delete(); | |
122 | delete fCalibContainer; | |
123 | delete fITStrack; | |
124 | delete fTRDtrack; | |
125 | delete fTPCOut; | |
126 | delete fITSOut; | |
127 | delete fTRDIn; | |
128 | delete[] fITSindex; | |
129 | delete[] fTPCindex; | |
130 | delete[] fTRDindex; | |
1d99986f | 131 | } |
00dce61a | 132 | |
e546b023 | 133 | |
ddfbc51a | 134 | void AliESDfriendTrack::AddCalibObject(TObject * calibObject){ |
135 | // | |
00dce61a | 136 | // add calibration object to array - |
137 | // track is owner of the objects in the container | |
138 | // | |
ddfbc51a | 139 | if (!fCalibContainer) fCalibContainer = new TObjArray(5); |
00dce61a | 140 | fCalibContainer->AddLast(calibObject); |
141 | } | |
142 | ||
a453390d | 143 | TObject * AliESDfriendTrack::GetCalibObject(Int_t index) const { |
ddfbc51a | 144 | // |
145 | // | |
146 | // | |
00dce61a | 147 | if (!fCalibContainer) return 0; |
148 | if (index>=fCalibContainer->GetEntriesFast()) return 0; | |
149 | return fCalibContainer->At(index); | |
150 | } | |
ded25cc6 | 151 | |
6a33e0e9 | 152 | Int_t AliESDfriendTrack::GetTPCseed( AliTPCseed &seed) const { |
153 | TObject* calibObject = NULL; | |
1f516476 | 154 | AliVTPCseed* seedP = NULL; |
6a33e0e9 | 155 | for (Int_t idx = 0; (calibObject = GetCalibObject(idx)); ++idx) { |
1f516476 | 156 | if ((seedP = dynamic_cast<AliVTPCseed*>(calibObject))) { |
6a33e0e9 | 157 | seedP->CopyToTPCseed( seed ); |
158 | return 0; | |
159 | } | |
160 | } | |
161 | return -1; | |
162 | } | |
ded25cc6 | 163 | |
ddfbc51a | 164 | void AliESDfriendTrack::SetTPCOut(const AliExternalTrackParam ¶m) { |
165 | // | |
ded25cc6 | 166 | // backup TPC out track |
167 | // | |
ddfbc51a | 168 | delete fTPCOut; |
169 | fTPCOut=new AliExternalTrackParam(param); | |
ded25cc6 | 170 | } |
ddfbc51a | 171 | void AliESDfriendTrack::SetITSOut(const AliExternalTrackParam ¶m) { |
e546b023 | 172 | // |
ddfbc51a | 173 | // backup ITS out track |
ded25cc6 | 174 | // |
ddfbc51a | 175 | delete fITSOut; |
176 | fITSOut=new AliExternalTrackParam(param); | |
e546b023 | 177 | } |
ddfbc51a | 178 | void AliESDfriendTrack::SetTRDIn(const AliExternalTrackParam ¶m) { |
ded25cc6 | 179 | // |
ddfbc51a | 180 | // backup TRD in track |
e546b023 | 181 | // |
ddfbc51a | 182 | delete fTRDIn; |
183 | fTRDIn=new AliExternalTrackParam(param); | |
ded25cc6 | 184 | } |
185 | ||
ddfbc51a | 186 | void AliESDfriendTrack::SetITSIndices(Int_t* indices, Int_t n){ |
187 | ||
188 | // | |
189 | // setting fITSindex | |
190 | // instantiating the pointer if still NULL | |
191 | // | |
192 | ||
193 | fnMaxITScluster = n; | |
194 | AliDebug(2,Form("fnMaxITScluster = %d",fnMaxITScluster)); | |
195 | if (fITSindex == 0x0){ | |
196 | fITSindex = new Int_t[fnMaxITScluster]; | |
197 | } | |
198 | for (Int_t i = 0; i < fnMaxITScluster; i++){ | |
199 | fITSindex[i] = indices[i]; | |
200 | } | |
6d3a7bbf | 201 | } |
202 | ||
ddfbc51a | 203 | void AliESDfriendTrack::SetTPCIndices(Int_t* indices, Int_t n){ |
204 | ||
205 | // | |
206 | // setting fTPCindex | |
207 | // instantiating the pointer if still NULL | |
208 | // | |
209 | ||
210 | fnMaxTPCcluster = n; | |
211 | AliDebug(2,Form("fnMaxTPCcluster = %d",fnMaxTPCcluster)); | |
212 | if (fTPCindex == 0x0){ | |
213 | fTPCindex = new Int_t[fnMaxTPCcluster]; | |
214 | } | |
215 | for (Int_t i = 0; i < fnMaxTPCcluster; i++){ | |
216 | fTPCindex[i] = indices[i]; | |
217 | } | |
6d3a7bbf | 218 | } |
219 | ||
ddfbc51a | 220 | void AliESDfriendTrack::SetTRDIndices(Int_t* indices, Int_t n){ |
221 | ||
222 | // | |
223 | // setting fTRDindex | |
224 | // instantiating the pointer if still NULL | |
225 | // | |
226 | ||
227 | fnMaxTRDcluster = n; | |
228 | AliDebug(2,Form("fnMaxTRDcluster = %d",fnMaxTRDcluster)); | |
229 | if (fTRDindex == 0x0){ | |
230 | fTRDindex = new Int_t[fnMaxTRDcluster]; | |
231 | } | |
232 | for (Int_t i = 0; i < fnMaxTRDcluster; i++){ | |
233 | fTRDindex[i] = indices[i]; | |
234 | } | |
6d3a7bbf | 235 | } |
236 |