1 #ifndef ALIITSTRACKERV2_H
2 #define ALIITSTRACKERV2_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 //-------------------------------------------------------------------------
8 // reads AliITSclusterV2 clusters and creates AliITStrackV2 tracks
9 // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
10 //-------------------------------------------------------------------------
11 #include "AliTracker.h"
12 #include "AliITSrecoV2.h"
13 #include "AliITStrackV2.h"
15 class AliITSclusterV2;
21 //-------------------------------------------------------------------------
22 class AliITStrackerV2 : public AliTracker {
24 AliITStrackerV2():AliTracker(){}
25 AliITStrackerV2(const AliITSgeom *geom);
27 AliCluster *GetCluster(Int_t index) const;
28 AliITSclusterV2 *GetCluster(Int_t l, Int_t c) const {
29 return fgLayers[l].GetCluster(c);
31 Int_t GetNumberOfClustersLayer(Int_t n) const {
32 return fgLayers[n].GetNumberOfClusters();
34 Int_t LoadClusters(TTree *cf);
35 void UnloadClusters();
36 Int_t Clusters2Tracks(AliESD *event);
37 Int_t PropagateBack(AliESD *event);
38 Int_t RefitInward(AliESD *event);
39 Bool_t RefitAt(Double_t x, AliITStrackV2 *seed, const AliITStrackV2 *t);
40 void SetupFirstPass(Int_t *flags, Double_t *cuts=0);
41 void SetupSecondPass(Int_t *flags, Double_t *cuts=0);
43 void SetLastLayerToTrackTo(Int_t l=0) {fLastLayerToTrackTo=l;}
44 void SetLayersNotToSkip(Int_t *l);
46 void UseClusters(const AliKalmanTrack *t, Int_t from=0) const;
48 class AliITSdetector {
51 AliITSdetector(Double_t r,Double_t phi) {fR=r; fPhi=phi;}
52 Double_t GetR() const {return fR;}
53 Double_t GetPhi() const {return fPhi;}
55 Double_t fR; // polar coordinates
56 Double_t fPhi; // of this detector
61 enum {kNsector=5, kMaxClusterPerSector=kMaxClusterPerLayer/kNsector};
63 AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd);
65 Int_t InsertCluster(AliITSclusterV2 *c);
67 Int_t SelectClusters(Float_t zmi, Float_t zma, Float_t ymi, Float_t yma);
68 const AliITSclusterV2 *GetNextCluster(Int_t &ci);
70 Double_t GetRoad() const {return fRoad;}
71 Double_t GetR() const {return fR;}
72 AliITSclusterV2 *GetCluster(Int_t i) const { return fClusters[i]; }
73 AliITSdetector &GetDetector(Int_t n) const { return fDetectors[n]; }
74 Int_t FindDetectorIndex(Double_t phi, Double_t z) const;
75 Double_t GetThickness(Double_t y, Double_t z, Double_t &x0) const;
76 Int_t GetNladders() const {return fNladders;}
77 Int_t GetNdetectors() const {return fNdetectors;}
78 Int_t GetNumberOfClusters() const;
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
87 AliITSclusterV2 *fClusters[kMaxClusterPerLayer]; // pointers to clusters
88 Int_t fN[kNsector]; // numbers of clusters sector by sector
90 Int_t fIndex[kMaxClusterPerLayer]; // indexes of selected clusters
91 Int_t fNsel; // number of selected clusters
93 Double_t fRoad; // road defined by the cluster density
94 Int_t FindClusterIndex(Float_t z, Int_t s) const;
98 void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
99 Double_t GetEffectiveThickness(Double_t y, Double_t z) const;
100 void FollowProlongation();
101 Int_t TakeNextProlongation();
102 void ResetBestTrack() {
103 fBestTrack.~AliITStrackV2();
104 new(&fBestTrack) AliITStrackV2(fTrackToFollow);
106 void ResetTrackToFollow(const AliITStrackV2 &t) {
107 fTrackToFollow.~AliITStrackV2();
108 new(&fTrackToFollow) AliITStrackV2(t);
110 Int_t fI; // index of the current layer
111 static AliITSlayer fgLayers[kMaxLayer];// ITS layers
112 AliITStrackV2 fTracks[kMaxLayer]; // track estimations at the ITS layers
113 AliITStrackV2 fBestTrack; // "best" track
114 AliITStrackV2 fTrackToFollow; // followed track
115 Int_t fPass; // current pass through the data
116 Int_t fConstraint[2]; // constraint flags
118 Int_t fLayersNotToSkip[kMaxLayer]; // layer masks
119 Int_t fLastLayerToTrackTo; // the innermost layer to track to
121 ClassDef(AliITStrackerV2,1) //ITS tracker V2
125 inline void AliITStrackerV2::SetupFirstPass(Int_t *flags, Double_t *cuts) {
126 // This function sets up flags and cuts for the first tracking pass
128 // flags[0] - vertex constaint flag
129 // negative means "skip the pass"
130 // 0 means "no constraint"
131 // positive means "normal constraint"
133 fConstraint[0]=flags[0];
137 inline void AliITStrackerV2::SetupSecondPass(Int_t *flags, Double_t *cuts) {
138 // This function sets up flags and cuts for the second tracking pass
140 // flags[0] - vertex constaint flag
141 // negative means "skip the pass"
142 // 0 means "no constraint"
143 // positive means "normal constraint"
145 fConstraint[1]=flags[0];
149 inline void AliITStrackerV2::CookLabel(AliKalmanTrack *t,Float_t wrong) const {
150 //--------------------------------------------------------------------
151 //This function "cooks" a track label. If label<0, this track is fake.
152 //--------------------------------------------------------------------
153 Int_t tpcLabel=t->GetLabel();
154 if (tpcLabel<0) return;
155 AliTracker::CookLabel(t,wrong);
156 if (tpcLabel != t->GetLabel()) t->SetLabel(-tpcLabel);