1 #ifndef ALIITSTRACKER_H
2 #define ALIITSTRACKER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 //-------------------------------------------------------------------------
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);
26 AliCluster *GetCluster(Int_t index) const;
28 Int_t LoadClusters(const TFile *cf);
29 void UnloadClusters();
30 Int_t Clusters2Tracks(const TFile *in, TFile *out);
31 Int_t Clusters2Tracks(AliESD *event);
32 Int_t PropagateBack(const TFile *in, TFile *out);
33 Int_t PropagateBack(AliESD *event);
34 Int_t RefitInward(const TFile *in, TFile *out);
35 Int_t RefitInward(AliESD *event);
36 Bool_t RefitAt(Double_t x, AliITStrackV2 *seed, const AliITStrackV2 *t);
37 void SetupFirstPass(Int_t *flags, Double_t *cuts=0);
38 void SetupSecondPass(Int_t *flags, Double_t *cuts=0);
40 void SetLastLayerToTrackTo(Int_t l=0) {fLastLayerToTrackTo=l;}
41 void SetLayersNotToSkip(Int_t *l);
43 void UseClusters(const AliKalmanTrack *t, Int_t from=0) const;
45 class AliITSdetector {
48 AliITSdetector(Double_t r,Double_t phi) {fR=r; fPhi=phi;}
49 void *operator new(size_t s,AliITSdetector *p) {return p;}
50 Double_t GetR() const {return fR;}
51 Double_t GetPhi() const {return fPhi;}
53 Double_t fR; // polar coordinates
54 Double_t fPhi; // of this detector
60 AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd);
62 Int_t InsertCluster(AliITSclusterV2 *c);
64 void SelectClusters(Double_t zmi,Double_t zma,Double_t ymi,Double_t yma);
65 const AliITSclusterV2 *GetNextCluster(Int_t &ci);
66 void *operator new(size_t s, AliITSlayer *p) {return p;}
68 Double_t GetRoad() const {return fRoad;}
69 Double_t GetR() const {return fR;}
70 AliITSclusterV2 *GetCluster(Int_t i) const {return fClusters[i];}
71 AliITSdetector &GetDetector(Int_t n) const { return fDetectors[n]; }
72 Int_t FindDetectorIndex(Double_t phi, Double_t z) const;
73 Double_t GetThickness(Double_t y, Double_t z, Double_t &x0) const;
74 Int_t InRoad() const ;
75 Int_t GetNumberOfClusters() const {return fN;}
76 Int_t GetNladders() const {return fNladders;}
77 Int_t GetNdetectors() const {return fNdetectors;}
79 Double_t fR; // mean radius of this layer
80 Double_t fPhiOffset; // offset of the first detector in Phi
81 Int_t fNladders; // number of ladders
82 Double_t fZOffset; // offset of the first detector in Z
83 Int_t fNdetectors; // detectors/ladder
84 AliITSdetector *fDetectors; // array of detectors
85 Int_t fN; // number of clusters
86 AliITSclusterV2 *fClusters[kMaxClusterPerLayer]; // pointers to clusters
87 Double_t fZmax; // edges
88 Double_t fYmin; // of the
89 Double_t fYmax; // "window"
90 Int_t fI; // index of the current cluster within the "window"
91 Double_t fRoad; // road defined by the cluster density
92 Int_t FindClusterIndex(Double_t z) const;
96 void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
97 Double_t GetEffectiveThickness(Double_t y, Double_t z) const;
98 void FollowProlongation();
99 Int_t TakeNextProlongation();
100 void ResetBestTrack() {
101 fBestTrack.~AliITStrackV2();
102 new(&fBestTrack) AliITStrackV2(fTrackToFollow);
104 void ResetTrackToFollow(const AliITStrackV2 &t) {
105 fTrackToFollow.~AliITStrackV2();
106 new(&fTrackToFollow) AliITStrackV2(t);
108 Int_t fI; // index of the current layer
109 static AliITSlayer fLayers[kMaxLayer]; // ITS layers
110 AliITStrackV2 fTracks[kMaxLayer]; // track estimations at the ITS layers
111 AliITStrackV2 fBestTrack; // "best" track
112 AliITStrackV2 fTrackToFollow; // followed track
113 Int_t fPass; // current pass through the data
114 Int_t fConstraint[2]; // constraint flags
116 Int_t fLayersNotToSkip[kMaxLayer]; // layer masks
117 Int_t fLastLayerToTrackTo; // the innermost layer to track to
119 ClassDef(AliITStrackerV2,1) //ITS tracker V2
123 inline void AliITStrackerV2::SetupFirstPass(Int_t *flags, Double_t *cuts) {
124 // This function sets up flags and cuts for the first tracking pass
126 // flags[0] - vertex constaint flag
127 // negative means "skip the pass"
128 // 0 means "no constraint"
129 // positive means "normal constraint"
131 fConstraint[0]=flags[0];
135 inline void AliITStrackerV2::SetupSecondPass(Int_t *flags, Double_t *cuts) {
136 // This function sets up flags and cuts for the second tracking pass
138 // flags[0] - vertex constaint flag
139 // negative means "skip the pass"
140 // 0 means "no constraint"
141 // positive means "normal constraint"
143 fConstraint[1]=flags[0];
147 inline void AliITStrackerV2::CookLabel(AliKalmanTrack *t,Float_t wrong) const {
148 //--------------------------------------------------------------------
149 //This function "cooks" a track label. If label<0, this track is fake.
150 //--------------------------------------------------------------------
151 Int_t tpcLabel=t->GetLabel();
152 if (tpcLabel<0) return;
153 AliTracker::CookLabel(t,wrong);
154 if (tpcLabel != t->GetLabel()) t->SetLabel(-tpcLabel);