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