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