]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITStrackerV2.h
Transition to NewIO
[u/mrichter/AliRoot.git] / ITS / AliITStrackerV2.h
CommitLineData
006b5f7f 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 */
5
6//-------------------------------------------------------------------------
7// ITS tracker
8//
9// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
10//-------------------------------------------------------------------------
11#include "AliTracker.h"
12#include "AliITSrecoV2.h"
13#include "AliITStrackV2.h"
88cb7938 14#include "AliConfig.h"
006b5f7f 15
16class AliITSclusterV2;
17class AliITSgeom;
18class TFile;
19
20
21//-------------------------------------------------------------------------
22class AliITStrackerV2 : public AliTracker {
23public:
24 AliITStrackerV2():AliTracker(){}
88cb7938 25
26 AliITStrackerV2(const AliITSgeom *geom, Int_t event=0,
27 const char* evfoldname = AliConfig::fgkDefaultEventFolderName);
28
006b5f7f 29 AliCluster *GetCluster(Int_t index) const;
8676d691 30 Int_t LoadClusters();
61ab8ea8 31 void UnloadClusters();
88cb7938 32 Int_t Clusters2Tracks();//
33 Int_t PropagateBack();//
34 Int_t RefitInward();//
35
7f6ddf58 36 void SetupFirstPass(Int_t *flags, Double_t *cuts=0);
37 void SetupSecondPass(Int_t *flags, Double_t *cuts=0);
88cb7938 38 //PH Bool_t RefitAt(Double_t x, AliITStrackV2 *t, Int_t *index);
7f6ddf58 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
7f6ddf58 45 class AliITSdetector {
46 public:
47 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;}
52 private:
53 Double_t fR; // polar coordinates
54 Double_t fPhi; // of this detector
55 };
56
57 class AliITSlayer {
58 public:
59 AliITSlayer();
60 AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd);
61 ~AliITSlayer();
62 Int_t InsertCluster(AliITSclusterV2 *c);
61ab8ea8 63 void ResetClusters();
7f6ddf58 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;}
b87bd7cd 67 void ResetRoad();
68 Double_t GetRoad() const {return fRoad;}
7f6ddf58 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;
61ab8ea8 73 Double_t GetThickness(Double_t y, Double_t z, Double_t &x0) const;
7f6ddf58 74 Int_t InRoad() const ;
75 Int_t GetNumberOfClusters() const {return fN;}
61ab8ea8 76 Int_t GetNladders() const {return fNladders;}
77 Int_t GetNdetectors() const {return fNdetectors;}
7f6ddf58 78 private:
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"
b87bd7cd 91 Double_t fRoad; // road defined by the cluster density
7f6ddf58 92 Int_t FindClusterIndex(Double_t z) const;
93 };
006b5f7f 94
95private:
7f6ddf58 96 void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
a9a2d814 97 Double_t GetEffectiveThickness(Double_t y, Double_t z) const;
006b5f7f 98 void FollowProlongation();
99 Int_t TakeNextProlongation();
88cb7938 100 Bool_t RefitAt(Double_t x, const AliITStrackV2 *t, AliITStrackV2 *tt);
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
006b5f7f 110 static AliITSlayer fLayers[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
88cb7938 116 TString fEvFolderName; //event folder name
8676d691 117
c0dd5278 118 Int_t fLayersNotToSkip[kMaxLayer]; // layer masks
119 Int_t fLastLayerToTrackTo; // the innermost layer to track to
120
88cb7938 121 ClassDef(AliITStrackerV2,2) //ITS tracker V2
006b5f7f 122};
123
124
7f6ddf58 125inline void AliITStrackerV2::SetupFirstPass(Int_t *flags, Double_t *cuts) {
126 // This function sets up flags and cuts for the first tracking pass
127 //
128 // flags[0] - vertex constaint flag
129 // negative means "skip the pass"
130 // 0 means "no constraint"
131 // positive means "normal constraint"
132
133 fConstraint[0]=flags[0];
134 if (cuts==0) return;
135}
136
137inline void AliITStrackerV2::SetupSecondPass(Int_t *flags, Double_t *cuts) {
138 // This function sets up flags and cuts for the second tracking pass
139 //
140 // flags[0] - vertex constaint flag
141 // negative means "skip the pass"
142 // 0 means "no constraint"
143 // positive means "normal constraint"
144
145 fConstraint[1]=flags[0];
146 if (cuts==0) return;
147}
148
149inline 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);
157}
006b5f7f 158
159#endif