]>
Commit | Line | Data |
---|---|---|
32d38de2 | 1 | #ifndef ALIITSTRACKERU_H |
2 | #define ALIITSTRACKERU_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 upgrade tracker base class | |
8 | //------------------------------------------------------------------------- | |
9 | ||
10 | #include "AliTracker.h" | |
11 | #include "AliESDEvent.h" | |
f8832015 | 12 | #include "AliITSUSeed.h" |
c8d1f258 | 13 | #include "AliITSUTrackCond.h" |
716ccba7 | 14 | #include "AliITSUTrackHyp.h" |
32d38de2 | 15 | |
16 | class AliITSUReconstructor; | |
17 | class AliITSURecoDet; | |
c61e50c3 | 18 | class AliITSUClusterPix; |
0091e9f0 | 19 | class AliESDtrack; |
e2d2481c | 20 | class AliITSURecoLayer; |
32d38de2 | 21 | class TTree; |
22 | ||
c61e50c3 | 23 | |
32d38de2 | 24 | //------------------------------------------------------------------------- |
25 | class AliITSUTrackerGlo : public AliTracker { | |
26 | ||
27 | public: | |
76390254 | 28 | enum {kClus2Tracks,kPropBack,kRefitInw,kNTrackingPhases}; // tracking phases |
32d38de2 | 29 | enum { // info from track extrapolation to layer for cluster check |
30 | kTrXIn ,kTrYIn ,kTrZIn ,kTrPhiIn , // entrance (outer) point on the layer from above | |
31 | kTrXOut,kTrYOut,kTrZOut,kTrPhiOut, // exit (inner) point on the layer | |
32 | kTrPhi0, kTrDPhi, kTrZ0, kTrDZ, // mean phi,dPhi, mean z, dZ (don't change this order) | |
c61e50c3 | 33 | kNTrImpData}; |
32d38de2 | 34 | // |
f8832015 | 35 | enum {kMissingCluster=0 // no cluster found on this layer |
36 | ,kTransportFailed=1 // seed did not reach target layer | |
32d38de2 | 37 | ,kRWCheckFailed =2 // failed to rotate the seed to frame of the layer impact point |
38 | }; | |
f8832015 | 39 | enum {kStopSearchOnSensor,kClusterNotMatching,kClusterMatching}; // flags for track-to-cluster checks |
dd2117a2 | 40 | // |
41 | enum {kDummyLabel=-3141593}; | |
38997c3c | 42 | // |
32d38de2 | 43 | AliITSUTrackerGlo(AliITSUReconstructor* rec); |
44 | virtual ~AliITSUTrackerGlo(); | |
45 | ||
46 | virtual Int_t Clusters2Tracks(AliESDEvent *event); | |
47 | virtual Int_t PropagateBack(AliESDEvent *event); | |
48 | virtual Int_t RefitInward(AliESDEvent *event); | |
49 | virtual Int_t LoadClusters(TTree * treeRP=0); | |
50 | virtual void UnloadClusters(); | |
51 | virtual AliCluster* GetCluster(Int_t index) const; | |
0ddbf657 | 52 | // |
53 | Int_t GetCountPronlongationTrials() const {return fCountProlongationTrials;} | |
54 | Int_t GetCountITSin() const {return fCountITSin;} | |
55 | Int_t GetCountITSout() const {return fCountITSout;} | |
56 | Int_t GetCountITSrefit() const {return fCountITSrefit;} | |
57 | ||
0091e9f0 | 58 | //------------------------------------ |
59 | AliITSURecoDet* GetITSInterface() const {return fITS;} | |
60 | // | |
32d38de2 | 61 | //------------------------------------ |
62 | Bool_t NeedToProlong(AliESDtrack* estTr); | |
63 | void Init(AliITSUReconstructor* rec); | |
716ccba7 | 64 | void FindTrack(AliESDtrack* esdTr, Int_t esdID); |
42c3d4bd | 65 | void CreateDefaultTrackCond(); |
3e4e3c23 | 66 | Bool_t InitHypothesis(AliESDtrack *esdTr, Int_t esdID); |
32d38de2 | 67 | Bool_t TransportToLayer(AliITSUSeed* seed, Int_t lFrom, Int_t lTo); |
3e4e3c23 | 68 | Bool_t TransportToLayer(AliExternalTrackParam* seed, Int_t lFrom, Int_t lTo); |
e7d83d38 | 69 | Bool_t GoToExitFromLayer(AliITSUSeed* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kTRUE); |
70 | Bool_t GoToExitFromLayer(AliExternalTrackParam* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kTRUE); | |
e2d2481c | 71 | Bool_t GoToEntranceToLayer(AliITSUSeed* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kFALSE); |
72 | Bool_t GoToEntranceToLayer(AliExternalTrackParam* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kFALSE); | |
44785f3e | 73 | Bool_t PropagateSeed(AliITSUSeed *seed, Double_t xToGo, Double_t mass, Double_t maxStep=1.0, Bool_t matCorr=kTRUE); |
3e4e3c23 | 74 | Bool_t PropagateSeed(AliExternalTrackParam *seed, Double_t xToGo, Double_t mass, Double_t maxStep=1.0, Bool_t matCorr=kTRUE); |
68a0f687 | 75 | Bool_t RefitTrack(AliITSUTrackHyp* trc, Double_t r, Bool_t stopAtLastCl=kFALSE); |
e7d83d38 | 76 | Int_t GetTrackingPhase() const {return fTrackPhase;} |
77 | ||
44785f3e | 78 | // |
b8b59e05 | 79 | void KillSeed(AliITSUSeed* seed, Bool_t branch=kFALSE); |
c8d1f258 | 80 | Bool_t NeedToKill(AliITSUSeed* seed, Int_t flag); |
c61e50c3 | 81 | Bool_t GetRoadWidth(AliITSUSeed* seed, int ilrA); |
f8832015 | 82 | Int_t CheckCluster(AliITSUSeed* seed, Int_t lr, Int_t clID); |
83 | void AddProlongationHypothesis(AliITSUSeed* seed, Int_t lr); | |
38997c3c | 84 | Bool_t AddSeedBranch(AliITSUSeed* seed); |
85 | void ValidateAllowedBranches(Int_t accMax); | |
86 | void ValidateAllowedCandidates(Int_t ilr, Int_t accMax); | |
c61e50c3 | 87 | // |
88 | AliITSUSeed* NewSeedFromPool(const AliITSUSeed* src=0); | |
b8b59e05 | 89 | void ResetSeedsPool(); |
90 | void MarkSeedFree(AliITSUSeed* seed ); | |
91 | ||
716ccba7 | 92 | AliITSUTrackHyp* GetTrackHyp(Int_t id) const {return (AliITSUTrackHyp*)fHypStore.UncheckedAt(id);} |
93 | void SetTrackHyp(AliITSUTrackHyp* hyp,Int_t id) {fHypStore.AddAtAndExpand(hyp,id);} | |
94 | void DeleteLastSeedFromPool() {fSeedsPool.RemoveLast();} | |
95 | void SaveCurrentTrackHypotheses(); | |
3e4e3c23 | 96 | void FinalizeHypotheses(); |
68a0f687 | 97 | void UpdateESDTrack(AliITSUTrackHyp* hyp,Int_t flag); |
dd2117a2 | 98 | void CookMCLabel(AliITSUTrackHyp* hyp); |
e7d83d38 | 99 | void SetTrackingPhase(Int_t p) {fTrackPhase = p;} |
716ccba7 | 100 | // |
b8b59e05 | 101 | protected: |
102 | TObject*& NextFreeSeed(); | |
103 | // | |
32d38de2 | 104 | private: |
b8b59e05 | 105 | // |
32d38de2 | 106 | AliITSUTrackerGlo(const AliITSUTrackerGlo&); |
107 | AliITSUTrackerGlo &operator=(const AliITSUTrackerGlo &tr); | |
108 | // | |
109 | protected: | |
110 | AliITSUReconstructor* fReconstructor; // ITS global reconstructor | |
3d4dc3e2 | 111 | AliITSURecoDet* fITS; // interface to ITS, borrowed from reconstructor |
0091e9f0 | 112 | AliESDtrack* fCurrESDtrack; // current esd track in processing |
0ddbf657 | 113 | Int_t fCurrESDtrMClb; // its eventual mc label |
32d38de2 | 114 | Double_t fCurrMass; // current track mass |
c61e50c3 | 115 | Double_t fTrImpData[kNTrImpData]; // data on track impact on the layer |
32d38de2 | 116 | // |
0ddbf657 | 117 | Int_t fCountProlongationTrials; // number of TPC seeds |
118 | Int_t fCountITSin; // number of successful ITSin | |
119 | Int_t fCountITSout; // number of successful ITSout | |
120 | Int_t fCountITSrefit; // number of successful ITSrefit | |
121 | // | |
c61e50c3 | 122 | // the seeds management to be optimized |
716ccba7 | 123 | TObjArray fHypStore; // storage for tracks hypotheses |
38997c3c | 124 | AliITSUSeed* fLayerCandidates[AliITSUTrackCond::kMaxCandidates]; // array for branches of current track prolongation |
125 | Int_t fNBranchesAdded; // number of branches created for current seed in prolongation | |
126 | Int_t fNCandidatesAdded; // number of candidates added for current seed in prolongation | |
716ccba7 | 127 | AliITSUTrackHyp* fCurrHyp; // hypotheses container for current track |
b8b59e05 | 128 | TClonesArray fSeedsPool; //! pool for seeds |
129 | TArrayI fFreeSeedsID; //! array of ID's of freed seeds | |
130 | Int_t fNFreeSeeds; //! number of seeds freed in the pool | |
131 | Int_t fLastSeedID; //! id of the pool seed on which is returned by the NextFreeSeed method | |
c8d1f258 | 132 | // |
42c3d4bd | 133 | TObjArray fDefTrackConds; //! default tracking conditions |
134 | AliITSUTrackCond* fCurrTrackCond; // current tracking condition | |
c51c3124 | 135 | Int_t fTrackPhase; // tracking phase |
8b16dbae | 136 | Int_t* fClInfo; //! auxiliary track cluster info |
c8d1f258 | 137 | // |
e2d2481c | 138 | static const Double_t fgkToler; // tracking tolerance |
139 | // | |
32d38de2 | 140 | ClassDef(AliITSUTrackerGlo,1) //ITS upgrade tracker |
141 | ||
142 | }; | |
f8832015 | 143 | |
b8b59e05 | 144 | //________________________________________ |
145 | inline TObject *&AliITSUTrackerGlo::NextFreeSeed() | |
146 | { | |
147 | // return next free slot where the seed can be created | |
148 | fLastSeedID = fNFreeSeeds ? fFreeSeedsID.GetArray()[--fNFreeSeeds] : fSeedsPool.GetEntriesFast(); | |
149 | // AliInfo(Form("%d",fLastSeedID)); | |
150 | return fSeedsPool[ fLastSeedID ]; | |
151 | // | |
152 | } | |
153 | ||
154 | //_________________________________________________________________________ | |
155 | inline AliITSUSeed* AliITSUTrackerGlo::NewSeedFromPool(const AliITSUSeed* src) | |
156 | { | |
157 | // create new seed, optionally copying from the source | |
158 | AliITSUSeed* sd = src ? new( NextFreeSeed() ) AliITSUSeed(*src) : new( NextFreeSeed() ) AliITSUSeed(); | |
159 | sd->SetPoolID(fLastSeedID); | |
160 | return sd; | |
161 | } | |
162 | ||
163 | //_________________________________________________________________________ | |
164 | inline void AliITSUTrackerGlo::KillSeed(AliITSUSeed* seed, Bool_t branch) | |
165 | { | |
166 | // flag seed as killed, if requested, kill recursively its parents whose sole child is the seed being killed | |
167 | seed->Kill(); | |
168 | seed = (AliITSUSeed*)seed->GetParent(); | |
169 | if (seed && !seed->DecChildren() && branch) KillSeed(seed,branch); | |
170 | } | |
f8832015 | 171 | |
38997c3c | 172 | //_________________________________________________________________________ |
173 | inline void AliITSUTrackerGlo::AddProlongationHypothesis(AliITSUSeed* seed, Int_t lr) | |
174 | { | |
175 | // add new seed prolongation hypothesis | |
176 | fCurrHyp->AddSeed(seed,lr); | |
177 | } | |
178 | ||
32d38de2 | 179 | #endif |
180 |