]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/ESD/AliESDfriendTrack.cxx
Number of sigma pedestal cut increased to 4
[u/mrichter/AliRoot.git] / STEER / ESD / AliESDfriendTrack.cxx
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"
23 #include "TObjArray.h"
24 #include "TClonesArray.h"
25 #include "AliKalmanTrack.h"
26
27 ClassImp(AliESDfriendTrack)
28
29 AliESDfriendTrack::AliESDfriendTrack(): 
30 TObject(), 
31 f1P(0), 
32 fnMaxITScluster(0),
33 fnMaxTPCcluster(0),
34 fnMaxTRDcluster(0),
35 fITSindex(0x0),
36 fTPCindex(0x0),
37 fTRDindex(0x0),
38 fPoints(0),
39 fCalibContainer(0),
40 fITStrack(0),
41 fTRDtrack(0),
42 fTPCOut(0),
43 fITSOut(0),
44 fTRDIn(0)
45 {
46   //
47   // Default constructor
48   //
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;
56   
57   //fHmpPhotClus->SetOwner(kTRUE); 
58   
59 }
60
61 AliESDfriendTrack::AliESDfriendTrack(const AliESDfriendTrack &t): 
62 TObject(t),
63 f1P(t.f1P),
64 fnMaxITScluster(t.fnMaxITScluster),
65 fnMaxTPCcluster(t.fnMaxTPCcluster),
66 fnMaxTRDcluster(t.fnMaxTRDcluster),
67 fITSindex(0x0),
68 fTPCindex(0x0),
69 fTRDindex(0x0),
70 fPoints(0),
71 fCalibContainer(0),
72 fITStrack(0),
73 fTRDtrack(0),
74 fTPCOut(0),
75 fITSOut(0),
76 fTRDIn(0)
77 {
78   //
79   // Copy constructor
80   //
81   AliDebug(2,"Calling copy constructor");
82
83   Int_t i;
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));
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());
106      }  
107   }
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));
112   
113 }
114
115 AliESDfriendTrack::~AliESDfriendTrack() {
116   //
117   // Simple destructor
118   //
119    delete fPoints;
120    if (fCalibContainer) fCalibContainer->Delete();
121    delete fCalibContainer;
122    delete fITStrack;
123    delete fTRDtrack;
124    delete fTPCOut;
125    delete fITSOut;
126    delete fTRDIn;
127    delete[] fITSindex;
128    delete[] fTPCindex;
129    delete[] fTRDindex;
130 }
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 }
150
151
152 void AliESDfriendTrack::SetTPCOut(const AliExternalTrackParam &param) {
153   // 
154   // backup TPC out track
155   //
156   delete fTPCOut;
157   fTPCOut=new AliExternalTrackParam(param);
158
159 void AliESDfriendTrack::SetITSOut(const AliExternalTrackParam &param) {
160   //
161   // backup ITS out track
162   //
163   delete fITSOut;
164   fITSOut=new AliExternalTrackParam(param);
165
166 void AliESDfriendTrack::SetTRDIn(const AliExternalTrackParam  &param)  {
167   //
168   // backup TRD in track
169   //
170   delete fTRDIn;
171   fTRDIn=new AliExternalTrackParam(param);
172
173
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