]>
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" |
be713d4d | 24 | #include "AliKalmanTrack.h" |
1d99986f | 25 | |
26 | ClassImp(AliESDfriendTrack) | |
27 | ||
15e85efa | 28 | AliESDfriendTrack::AliESDfriendTrack(): |
29 | TObject(), | |
30 | f1P(0), | |
00dce61a | 31 | fPoints(0), |
32 | fCalibContainer(0), | |
15e85efa | 33 | fITStrack(0), |
34 | fTRDtrack(0) | |
35 | { | |
1d99986f | 36 | // |
37 | // Default constructor | |
38 | // | |
39 | Int_t i; | |
15e85efa | 40 | for (i=0; i<kMaxITScluster; i++) fITSindex[i]=-2; |
41 | for (i=0; i<kMaxTPCcluster; i++) fTPCindex[i]=-2; | |
42 | for (i=0; i<kMaxTRDcluster; i++) fTRDindex[i]=-2; | |
1d99986f | 43 | } |
44 | ||
45 | AliESDfriendTrack::AliESDfriendTrack(const AliESDfriendTrack &t): | |
46 | TObject(t), | |
47 | f1P(t.f1P), | |
15e85efa | 48 | fPoints(0), |
00dce61a | 49 | fCalibContainer(0), |
15e85efa | 50 | fITStrack(0), |
51 | fTRDtrack(0) | |
1d99986f | 52 | { |
53 | // | |
54 | // Copy constructor | |
55 | // | |
56 | Int_t i; | |
15e85efa | 57 | for (i=0; i<kMaxITScluster; i++) fITSindex[i]=t.fITSindex[i]; |
58 | for (i=0; i<kMaxTPCcluster; i++) fTPCindex[i]=t.fTPCindex[i]; | |
59 | for (i=0; i<kMaxTRDcluster; i++) fTRDindex[i]=t.fTRDindex[i]; | |
1d99986f | 60 | if (t.fPoints) fPoints=new AliTrackPointArray(*t.fPoints); |
f333ed51 | 61 | if (t.fCalibContainer) { |
62 | fCalibContainer = new TObjArray(5); | |
63 | Int_t no=t.fCalibContainer->GetEntriesFast(); | |
6c27b212 | 64 | for (i=0; i<no; i++) { |
f333ed51 | 65 | TObject *o=t.fCalibContainer->At(i); |
66 | fCalibContainer->AddLast(o->Clone()); | |
67 | } | |
68 | } | |
1d99986f | 69 | } |
70 | ||
15e85efa | 71 | AliESDfriendTrack::~AliESDfriendTrack() { |
1d99986f | 72 | // |
15e85efa | 73 | // Simple destructor |
1d99986f | 74 | // |
15e85efa | 75 | delete fPoints; |
f333ed51 | 76 | if (fCalibContainer) fCalibContainer->Delete(); |
2c56c9f6 | 77 | delete fCalibContainer; |
15e85efa | 78 | delete fITStrack; |
79 | delete fTRDtrack; | |
1d99986f | 80 | } |
00dce61a | 81 | |
82 | ||
83 | void AliESDfriendTrack::AddCalibObject(TObject * calibObject){ | |
84 | // | |
85 | // add calibration object to array - | |
86 | // track is owner of the objects in the container | |
87 | // | |
88 | if (!fCalibContainer) fCalibContainer = new TObjArray(5); | |
89 | fCalibContainer->AddLast(calibObject); | |
90 | } | |
91 | ||
92 | TObject * AliESDfriendTrack::GetCalibObject(Int_t index){ | |
93 | // | |
94 | // | |
95 | // | |
96 | if (!fCalibContainer) return 0; | |
97 | if (index>=fCalibContainer->GetEntriesFast()) return 0; | |
98 | return fCalibContainer->At(index); | |
99 | } |