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