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 "TClonesArray.h"
25 #include "AliKalmanTrack.h"
27 ClassImp(AliESDfriendTrack)
29 AliESDfriendTrack::AliESDfriendTrack():
47 // Default constructor
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;
57 //fHmpPhotClus->SetOwner(kTRUE);
61 AliESDfriendTrack::AliESDfriendTrack(const AliESDfriendTrack &t):
64 fnMaxITScluster(t.fnMaxITScluster),
65 fnMaxTPCcluster(t.fnMaxTPCcluster),
66 fnMaxTRDcluster(t.fnMaxTRDcluster),
81 AliDebug(2,"Calling copy constructor");
84 if (fnMaxITScluster != 0){
85 fITSindex = new Int_t[fnMaxITScluster];
86 for (i=0; i<fnMaxITScluster; i++) fITSindex[i]=t.fITSindex[i];
88 if (fnMaxTPCcluster != 0){
89 fTPCindex = new Int_t[fnMaxTPCcluster];
90 for (i=0; i<fnMaxTPCcluster; i++) fTPCindex[i]=t.fTPCindex[i];
92 if (fnMaxTRDcluster != 0){
93 fTRDindex = new Int_t[fnMaxTRDcluster];
94 for (i=0; i<fnMaxTRDcluster; i++) fTRDindex[i]=t.fTRDindex[i];
96 AliDebug(2,Form("fnMaxITScluster = %d",fnMaxITScluster));
97 AliDebug(2,Form("fnMaxTPCcluster = %d",fnMaxTPCcluster));
98 AliDebug(2,Form("fnMaxTRDcluster = %d",fnMaxTRDcluster));
99 if (t.fPoints) fPoints=new AliTrackPointArray(*t.fPoints);
100 if (t.fCalibContainer) {
101 fCalibContainer = new TObjArray(5);
102 Int_t no=t.fCalibContainer->GetEntriesFast();
103 for (i=0; i<no; i++) {
104 TObject *o=t.fCalibContainer->At(i);
105 fCalibContainer->AddLast(o->Clone());
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));
115 AliESDfriendTrack::~AliESDfriendTrack() {
120 if (fCalibContainer) fCalibContainer->Delete();
121 delete fCalibContainer;
133 void AliESDfriendTrack::AddCalibObject(TObject * calibObject){
135 // add calibration object to array -
136 // track is owner of the objects in the container
138 if (!fCalibContainer) fCalibContainer = new TObjArray(5);
139 fCalibContainer->AddLast(calibObject);
142 TObject * AliESDfriendTrack::GetCalibObject(Int_t index){
146 if (!fCalibContainer) return 0;
147 if (index>=fCalibContainer->GetEntriesFast()) return 0;
148 return fCalibContainer->At(index);
152 void AliESDfriendTrack::SetTPCOut(const AliExternalTrackParam ¶m) {
154 // backup TPC out track
157 fTPCOut=new AliExternalTrackParam(param);
159 void AliESDfriendTrack::SetITSOut(const AliExternalTrackParam ¶m) {
161 // backup ITS out track
164 fITSOut=new AliExternalTrackParam(param);
166 void AliESDfriendTrack::SetTRDIn(const AliExternalTrackParam ¶m) {
168 // backup TRD in track
171 fTRDIn=new AliExternalTrackParam(param);
174 void AliESDfriendTrack::SetITSIndices(Int_t* indices, Int_t n){
178 // instantiating the pointer if still NULL
182 AliDebug(2,Form("fnMaxITScluster = %d",fnMaxITScluster));
183 if (fITSindex == 0x0){
184 fITSindex = new Int_t[fnMaxITScluster];
186 for (Int_t i = 0; i < fnMaxITScluster; i++){
187 fITSindex[i] = indices[i];
191 void AliESDfriendTrack::SetTPCIndices(Int_t* indices, Int_t n){
195 // instantiating the pointer if still NULL
199 AliDebug(2,Form("fnMaxTPCcluster = %d",fnMaxTPCcluster));
200 if (fTPCindex == 0x0){
201 fTPCindex = new Int_t[fnMaxTPCcluster];
203 for (Int_t i = 0; i < fnMaxTPCcluster; i++){
204 fTPCindex[i] = indices[i];
208 void AliESDfriendTrack::SetTRDIndices(Int_t* indices, Int_t n){
212 // instantiating the pointer if still NULL
216 AliDebug(2,Form("fnMaxTRDcluster = %d",fnMaxTRDcluster));
217 if (fTRDindex == 0x0){
218 fTRDindex = new Int_t[fnMaxTRDcluster];
220 for (Int_t i = 0; i < fnMaxTRDcluster; i++){
221 fTRDindex[i] = indices[i];