]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliESDfriendTrack.cxx
Changes in QA to be able to process separately different triggers (Ruben)
[u/mrichter/AliRoot.git] / STEER / AliESDfriendTrack.cxx
CommitLineData
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
27ClassImp(AliESDfriendTrack)
28
15e85efa 29AliESDfriendTrack::AliESDfriendTrack():
30TObject(),
31f1P(0),
6d3a7bbf 32fnMaxITScluster(0),
33fnMaxTPCcluster(0),
34fnMaxTRDcluster(0),
35fITSindex(0x0),
36fTPCindex(0x0),
37fTRDindex(0x0),
00dce61a 38fPoints(0),
39fCalibContainer(0),
15e85efa 40fITStrack(0),
ded25cc6 41fTRDtrack(0),
42fTPCOut(0),
43fITSOut(0),
44fTRDIn(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
61AliESDfriendTrack::AliESDfriendTrack(const AliESDfriendTrack &t):
62TObject(t),
63f1P(t.f1P),
6d3a7bbf 64fnMaxITScluster(t.fnMaxITScluster),
65fnMaxTPCcluster(t.fnMaxTPCcluster),
66fnMaxTRDcluster(t.fnMaxTRDcluster),
67fITSindex(0x0),
68fTPCindex(0x0),
69fTRDindex(0x0),
15e85efa 70fPoints(0),
00dce61a 71fCalibContainer(0),
15e85efa 72fITStrack(0),
ded25cc6 73fTRDtrack(0),
74fTPCOut(0),
75fITSOut(0),
76fTRDIn(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 115AliESDfriendTrack::~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
133void 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
142TObject * 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
152void AliESDfriendTrack::SetTPCOut(const AliExternalTrackParam &param) {
153 //
154 // backup TPC out track
155 //
156 delete fTPCOut;
157 fTPCOut=new AliExternalTrackParam(param);
158}
159void AliESDfriendTrack::SetITSOut(const AliExternalTrackParam &param) {
160 //
161 // backup ITS out track
162 //
163 delete fITSOut;
164 fITSOut=new AliExternalTrackParam(param);
165}
166void AliESDfriendTrack::SetTRDIn(const AliExternalTrackParam &param) {
167 //
168 // backup TRD in track
169 //
170 delete fTRDIn;
171 fTRDIn=new AliExternalTrackParam(param);
172}
173
6d3a7bbf 174void 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
191void 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
208void 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