1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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"
23 #include "TObjArray.h"
24 #include "AliKalmanTrack.h"
26 ClassImp(AliESDfriendTrack)
28 AliESDfriendTrack::AliESDfriendTrack():
46 // Default constructor
49 // fITSindex = new Int_t[fnMaxITScluster];
50 //fTPCindex = new Int_t[fnMaxTPCcluster];
51 //fTRDindex = new Int_t[fnMaxTRDcluster];
52 //for (i=0; i<kMaxITScluster; i++) fITSindex[i]=-2;
53 //for (i=0; i<kMaxTPCcluster; i++) fTPCindex[i]=-2;
54 //for (i=0; i<kMaxTRDcluster; i++) fTRDindex[i]=-2;
57 AliESDfriendTrack::AliESDfriendTrack(const AliESDfriendTrack &t):
60 fnMaxITScluster(t.fnMaxITScluster),
61 fnMaxTPCcluster(t.fnMaxTPCcluster),
62 fnMaxTRDcluster(t.fnMaxTRDcluster),
77 AliDebug(2,"Calling copy constructor");
80 if (fnMaxITScluster != 0){
81 fITSindex = new Int_t[fnMaxITScluster];
82 for (i=0; i<fnMaxITScluster; i++) fITSindex[i]=t.fITSindex[i];
84 if (fnMaxTPCcluster != 0){
85 fTPCindex = new Int_t[fnMaxTPCcluster];
86 for (i=0; i<fnMaxTPCcluster; i++) fTPCindex[i]=t.fTPCindex[i];
88 if (fnMaxTRDcluster != 0){
89 fTRDindex = new Int_t[fnMaxTRDcluster];
90 for (i=0; i<fnMaxTRDcluster; i++) fTRDindex[i]=t.fTRDindex[i];
92 AliDebug(2,Form("fnMaxITScluster = %d",fnMaxITScluster));
93 AliDebug(2,Form("fnMaxTPCcluster = %d",fnMaxTPCcluster));
94 AliDebug(2,Form("fnMaxTRDcluster = %d",fnMaxTRDcluster));
95 if (t.fPoints) fPoints=new AliTrackPointArray(*t.fPoints);
96 if (t.fCalibContainer) {
97 fCalibContainer = new TObjArray(5);
98 Int_t no=t.fCalibContainer->GetEntriesFast();
99 for (i=0; i<no; i++) {
100 TObject *o=t.fCalibContainer->At(i);
101 fCalibContainer->AddLast(o->Clone());
105 if (t.fTPCOut) fTPCOut = new AliExternalTrackParam(*(t.fTPCOut));
106 if (t.fITSOut) fITSOut = new AliExternalTrackParam(*(t.fITSOut));
107 if (t.fTRDIn) fTRDIn = new AliExternalTrackParam(*(t.fTRDIn));
111 AliESDfriendTrack::~AliESDfriendTrack() {
116 if (fCalibContainer) fCalibContainer->Delete();
117 delete fCalibContainer;
129 void AliESDfriendTrack::AddCalibObject(TObject * calibObject){
131 // add calibration object to array -
132 // track is owner of the objects in the container
134 if (!fCalibContainer) fCalibContainer = new TObjArray(5);
135 fCalibContainer->AddLast(calibObject);
138 TObject * AliESDfriendTrack::GetCalibObject(Int_t index){
142 if (!fCalibContainer) return 0;
143 if (index>=fCalibContainer->GetEntriesFast()) return 0;
144 return fCalibContainer->At(index);
148 void AliESDfriendTrack::SetTPCOut(const AliExternalTrackParam ¶m) {
150 // backup TPC out track
153 fTPCOut=new AliExternalTrackParam(param);
155 void AliESDfriendTrack::SetITSOut(const AliExternalTrackParam ¶m) {
157 // backup ITS out track
160 fITSOut=new AliExternalTrackParam(param);
162 void AliESDfriendTrack::SetTRDIn(const AliExternalTrackParam ¶m) {
164 // backup TRD in track
167 fTRDIn=new AliExternalTrackParam(param);
170 void AliESDfriendTrack::SetITSIndices(Int_t* indices, Int_t n){
174 // instantiating the pointer if still NULL
178 AliDebug(2,Form("fnMaxITScluster = %d",fnMaxITScluster));
179 if (fITSindex == 0x0){
180 fITSindex = new Int_t[fnMaxITScluster];
182 for (Int_t i = 0; i < fnMaxITScluster; i++){
183 fITSindex[i] = indices[i];
187 void AliESDfriendTrack::SetTPCIndices(Int_t* indices, Int_t n){
191 // instantiating the pointer if still NULL
195 AliDebug(2,Form("fnMaxTPCcluster = %d",fnMaxTPCcluster));
196 if (fTPCindex == 0x0){
197 fTPCindex = new Int_t[fnMaxTPCcluster];
199 for (Int_t i = 0; i < fnMaxTPCcluster; i++){
200 fTPCindex[i] = indices[i];
204 void AliESDfriendTrack::SetTRDIndices(Int_t* indices, Int_t n){
208 // instantiating the pointer if still NULL
212 AliDebug(2,Form("fnMaxTRDcluster = %d",fnMaxTRDcluster));
213 if (fTRDindex == 0x0){
214 fTRDindex = new Int_t[fnMaxTRDcluster];
216 for (Int_t i = 0; i < fnMaxTRDcluster; i++){
217 fTRDindex[i] = indices[i];