]>
Commit | Line | Data |
---|---|---|
18856a77 | 1 | #ifndef ALIITSTRACKERV2_H |
2 | #define ALIITSTRACKERV2_H | |
006b5f7f | 3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | //------------------------------------------------------------------------- | |
7 | // ITS tracker | |
18856a77 | 8 | // reads AliITSclusterV2 clusters and creates AliITStrackV2 tracks |
9 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch | |
006b5f7f | 10 | //------------------------------------------------------------------------- |
64ea0cbc | 11 | |
12 | #include <TObjArray.h> | |
13 | ||
006b5f7f | 14 | #include "AliTracker.h" |
15 | #include "AliITSrecoV2.h" | |
16 | #include "AliITStrackV2.h" | |
17 | ||
18 | class AliITSclusterV2; | |
c630aafd | 19 | class AliESD; |
006b5f7f | 20 | class AliITSgeom; |
c630aafd | 21 | class TTree; |
006b5f7f | 22 | |
23 | ||
24 | //------------------------------------------------------------------------- | |
25 | class AliITStrackerV2 : public AliTracker { | |
26 | public: | |
27 | AliITStrackerV2():AliTracker(){} | |
c630aafd | 28 | AliITStrackerV2(const AliITSgeom *geom); |
006b5f7f | 29 | AliCluster *GetCluster(Int_t index) const; |
235b705f | 30 | AliITSclusterV2 *GetClusterLayer(Int_t layn, Int_t ncl) const |
31 | {return fgLayers[layn].GetCluster(ncl);} | |
32 | Int_t GetNumberOfClustersLayer(Int_t layn) const | |
33 | {return fgLayers[layn].GetNumberOfClusters();} | |
c630aafd | 34 | Int_t LoadClusters(TTree *cf); |
61ab8ea8 | 35 | void UnloadClusters(); |
c630aafd | 36 | Int_t Clusters2Tracks(TTree *in, TTree *out); |
37 | Int_t Clusters2Tracks(AliESD *event); | |
c630aafd | 38 | Int_t PropagateBack(AliESD *event); |
c630aafd | 39 | Int_t RefitInward(AliESD *event); |
40 | Bool_t RefitAt(Double_t x, AliITStrackV2 *seed, const AliITStrackV2 *t); | |
7f6ddf58 | 41 | void SetupFirstPass(Int_t *flags, Double_t *cuts=0); |
42 | void SetupSecondPass(Int_t *flags, Double_t *cuts=0); | |
43 | ||
c0dd5278 | 44 | void SetLastLayerToTrackTo(Int_t l=0) {fLastLayerToTrackTo=l;} |
45 | void SetLayersNotToSkip(Int_t *l); | |
46 | ||
b87bd7cd | 47 | void UseClusters(const AliKalmanTrack *t, Int_t from=0) const; |
48 | ||
7f6ddf58 | 49 | class AliITSdetector { |
50 | public: | |
51 | AliITSdetector(){} | |
52 | AliITSdetector(Double_t r,Double_t phi) {fR=r; fPhi=phi;} | |
7f6ddf58 | 53 | Double_t GetR() const {return fR;} |
54 | Double_t GetPhi() const {return fPhi;} | |
55 | private: | |
56 | Double_t fR; // polar coordinates | |
57 | Double_t fPhi; // of this detector | |
58 | }; | |
59 | ||
60 | class AliITSlayer { | |
61 | public: | |
62 | AliITSlayer(); | |
63 | AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd); | |
64 | ~AliITSlayer(); | |
65 | Int_t InsertCluster(AliITSclusterV2 *c); | |
61ab8ea8 | 66 | void ResetClusters(); |
7f6ddf58 | 67 | void SelectClusters(Double_t zmi,Double_t zma,Double_t ymi,Double_t yma); |
68 | const AliITSclusterV2 *GetNextCluster(Int_t &ci); | |
b87bd7cd | 69 | void ResetRoad(); |
70 | Double_t GetRoad() const {return fRoad;} | |
7f6ddf58 | 71 | Double_t GetR() const {return fR;} |
de5d3595 | 72 | AliITSclusterV2 *GetCluster(Int_t i) const {return i<fN? fClusters[i]:0;} |
7f6ddf58 | 73 | AliITSdetector &GetDetector(Int_t n) const { return fDetectors[n]; } |
74 | Int_t FindDetectorIndex(Double_t phi, Double_t z) const; | |
61ab8ea8 | 75 | Double_t GetThickness(Double_t y, Double_t z, Double_t &x0) const; |
7f6ddf58 | 76 | Int_t InRoad() const ; |
77 | Int_t GetNumberOfClusters() const {return fN;} | |
61ab8ea8 | 78 | Int_t GetNladders() const {return fNladders;} |
79 | Int_t GetNdetectors() const {return fNdetectors;} | |
235b705f | 80 | protected: |
7f6ddf58 | 81 | Double_t fR; // mean radius of this layer |
82 | Double_t fPhiOffset; // offset of the first detector in Phi | |
83 | Int_t fNladders; // number of ladders | |
84 | Double_t fZOffset; // offset of the first detector in Z | |
85 | Int_t fNdetectors; // detectors/ladder | |
86 | AliITSdetector *fDetectors; // array of detectors | |
87 | Int_t fN; // number of clusters | |
88 | AliITSclusterV2 *fClusters[kMaxClusterPerLayer]; // pointers to clusters | |
89 | Double_t fZmax; // edges | |
90 | Double_t fYmin; // of the | |
91 | Double_t fYmax; // "window" | |
92 | Int_t fI; // index of the current cluster within the "window" | |
b87bd7cd | 93 | Double_t fRoad; // road defined by the cluster density |
7f6ddf58 | 94 | Int_t FindClusterIndex(Double_t z) const; |
95 | }; | |
de5d3595 | 96 | |
235b705f | 97 | protected: |
7f6ddf58 | 98 | void CookLabel(AliKalmanTrack *t,Float_t wrong) const; |
a9a2d814 | 99 | Double_t GetEffectiveThickness(Double_t y, Double_t z) const; |
006b5f7f | 100 | void FollowProlongation(); |
101 | Int_t TakeNextProlongation(); | |
006b5f7f | 102 | void ResetBestTrack() { |
103 | fBestTrack.~AliITStrackV2(); | |
104 | new(&fBestTrack) AliITStrackV2(fTrackToFollow); | |
105 | } | |
006b5f7f | 106 | void ResetTrackToFollow(const AliITStrackV2 &t) { |
107 | fTrackToFollow.~AliITStrackV2(); | |
108 | new(&fTrackToFollow) AliITStrackV2(t); | |
109 | } | |
de5d3595 | 110 | void AddTrackHypothesys(AliITStrackV2 * track, Int_t esdindex); |
111 | void CompressTrackHypothesys(Int_t esdindex, Int_t maxsize); | |
112 | AliITStrackV2 * GetBestHypothesys(Int_t esdindex, AliITStrackV2 * original); | |
7f6ddf58 | 113 | Int_t fI; // index of the current layer |
18856a77 | 114 | static AliITSlayer fgLayers[kMaxLayer];// ITS layers |
7f6ddf58 | 115 | AliITStrackV2 fTracks[kMaxLayer]; // track estimations at the ITS layers |
116 | AliITStrackV2 fBestTrack; // "best" track | |
117 | AliITStrackV2 fTrackToFollow; // followed track | |
de5d3595 | 118 | TObjArray fTrackHypothesys; // ! array with track hypothesys- ARRAY is the owner of tracks- MI |
119 | Int_t fCurrentEsdTrack; // ! current esd track - MI | |
7f6ddf58 | 120 | Int_t fPass; // current pass through the data |
121 | Int_t fConstraint[2]; // constraint flags | |
8676d691 | 122 | |
c0dd5278 | 123 | Int_t fLayersNotToSkip[kMaxLayer]; // layer masks |
124 | Int_t fLastLayerToTrackTo; // the innermost layer to track to | |
125 | ||
c630aafd | 126 | ClassDef(AliITStrackerV2,1) //ITS tracker V2 |
006b5f7f | 127 | }; |
128 | ||
129 | ||
7f6ddf58 | 130 | inline void AliITStrackerV2::SetupFirstPass(Int_t *flags, Double_t *cuts) { |
131 | // This function sets up flags and cuts for the first tracking pass | |
132 | // | |
133 | // flags[0] - vertex constaint flag | |
134 | // negative means "skip the pass" | |
135 | // 0 means "no constraint" | |
136 | // positive means "normal constraint" | |
137 | ||
138 | fConstraint[0]=flags[0]; | |
139 | if (cuts==0) return; | |
140 | } | |
141 | ||
142 | inline void AliITStrackerV2::SetupSecondPass(Int_t *flags, Double_t *cuts) { | |
143 | // This function sets up flags and cuts for the second tracking pass | |
144 | // | |
145 | // flags[0] - vertex constaint flag | |
146 | // negative means "skip the pass" | |
147 | // 0 means "no constraint" | |
148 | // positive means "normal constraint" | |
149 | ||
150 | fConstraint[1]=flags[0]; | |
151 | if (cuts==0) return; | |
152 | } | |
153 | ||
154 | inline void AliITStrackerV2::CookLabel(AliKalmanTrack *t,Float_t wrong) const { | |
155 | //-------------------------------------------------------------------- | |
156 | //This function "cooks" a track label. If label<0, this track is fake. | |
157 | //-------------------------------------------------------------------- | |
158 | Int_t tpcLabel=t->GetLabel(); | |
159 | if (tpcLabel<0) return; | |
160 | AliTracker::CookLabel(t,wrong); | |
161 | if (tpcLabel != t->GetLabel()) t->SetLabel(-tpcLabel); | |
162 | } | |
006b5f7f | 163 | |
164 | #endif |