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