Adapting BF drawing macros for event classes (multiplicity, centrality, event plane)
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUTrackerGlo.h
CommitLineData
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
16class AliITSUReconstructor;
17class AliITSURecoDet;
c61e50c3 18class AliITSUClusterPix;
0091e9f0 19class AliESDtrack;
c61e50c3 20
32d38de2 21class TTree;
22
c61e50c3 23
32d38de2 24//-------------------------------------------------------------------------
25class AliITSUTrackerGlo : public AliTracker {
26
27 public:
c51c3124 28 enum {kClus2Tracks,kPropBack,kRefitInw}; // 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
32d38de2 40
41 AliITSUTrackerGlo(AliITSUReconstructor* rec);
42 virtual ~AliITSUTrackerGlo();
43
44 virtual Int_t Clusters2Tracks(AliESDEvent *event);
45 virtual Int_t PropagateBack(AliESDEvent *event);
46 virtual Int_t RefitInward(AliESDEvent *event);
47 virtual Int_t LoadClusters(TTree * treeRP=0);
48 virtual void UnloadClusters();
49 virtual AliCluster* GetCluster(Int_t index) const;
0091e9f0 50 //------------------------------------
51 AliITSURecoDet* GetITSInterface() const {return fITS;}
52 //
32d38de2 53 //------------------------------------
54 Bool_t NeedToProlong(AliESDtrack* estTr);
55 void Init(AliITSUReconstructor* rec);
716ccba7 56 void FindTrack(AliESDtrack* esdTr, Int_t esdID);
3e4e3c23 57 Bool_t InitHypothesis(AliESDtrack *esdTr, Int_t esdID);
32d38de2 58 Bool_t TransportToLayer(AliITSUSeed* seed, Int_t lFrom, Int_t lTo);
3e4e3c23 59 Bool_t TransportToLayer(AliExternalTrackParam* seed, Int_t lFrom, Int_t lTo);
44785f3e 60 Bool_t PropagateSeed(AliITSUSeed *seed, Double_t xToGo, Double_t mass, Double_t maxStep=1.0, Bool_t matCorr=kTRUE);
3e4e3c23 61 Bool_t PropagateSeed(AliExternalTrackParam *seed, Double_t xToGo, Double_t mass, Double_t maxStep=1.0, Bool_t matCorr=kTRUE);
c51c3124 62 Bool_t RefitTrack(AliITSUTrackHyp* trc, Double_t r);
44785f3e 63 //
b8b59e05 64 void KillSeed(AliITSUSeed* seed, Bool_t branch=kFALSE);
c8d1f258 65 Bool_t NeedToKill(AliITSUSeed* seed, Int_t flag);
c61e50c3 66 Bool_t GetRoadWidth(AliITSUSeed* seed, int ilrA);
f8832015 67 Int_t CheckCluster(AliITSUSeed* seed, Int_t lr, Int_t clID);
68 void AddProlongationHypothesis(AliITSUSeed* seed, Int_t lr);
c61e50c3 69 //
70 AliITSUSeed* NewSeedFromPool(const AliITSUSeed* src=0);
b8b59e05 71 void ResetSeedsPool();
72 void MarkSeedFree(AliITSUSeed* seed );
73
716ccba7 74 AliITSUTrackHyp* GetTrackHyp(Int_t id) const {return (AliITSUTrackHyp*)fHypStore.UncheckedAt(id);}
75 void SetTrackHyp(AliITSUTrackHyp* hyp,Int_t id) {fHypStore.AddAtAndExpand(hyp,id);}
76 void DeleteLastSeedFromPool() {fSeedsPool.RemoveLast();}
77 void SaveCurrentTrackHypotheses();
3e4e3c23 78 void FinalizeHypotheses();
c51c3124 79 void UpdateESDTrack(AliITSUTrackHyp* hyp);
716ccba7 80 //
b8b59e05 81 protected:
82 TObject*& NextFreeSeed();
83 //
32d38de2 84 private:
b8b59e05 85 //
32d38de2 86 AliITSUTrackerGlo(const AliITSUTrackerGlo&);
87 AliITSUTrackerGlo &operator=(const AliITSUTrackerGlo &tr);
88 //
89 protected:
90 AliITSUReconstructor* fReconstructor; // ITS global reconstructor
91 AliITSURecoDet* fITS; // interface to ITS
0091e9f0 92 AliESDtrack* fCurrESDtrack; // current esd track in processing
32d38de2 93 Double_t fCurrMass; // current track mass
c61e50c3 94 Double_t fTrImpData[kNTrImpData]; // data on track impact on the layer
32d38de2 95 //
c61e50c3 96 // the seeds management to be optimized
716ccba7 97 TObjArray fHypStore; // storage for tracks hypotheses
98 AliITSUTrackHyp* fCurrHyp; // hypotheses container for current track
b8b59e05 99 TClonesArray fSeedsPool; //! pool for seeds
100 TArrayI fFreeSeedsID; //! array of ID's of freed seeds
101 Int_t fNFreeSeeds; //! number of seeds freed in the pool
102 Int_t fLastSeedID; //! id of the pool seed on which is returned by the NextFreeSeed method
c8d1f258 103 //
104 AliITSUTrackCond fTrCond; // tmp, to be moved to recoparam
c51c3124 105 Int_t fTrackPhase; // tracking phase
8b16dbae 106 Int_t* fClInfo; //! auxiliary track cluster info
c8d1f258 107 //
32d38de2 108 ClassDef(AliITSUTrackerGlo,1) //ITS upgrade tracker
109
110};
f8832015 111
112//_________________________________________________________________________
113inline void AliITSUTrackerGlo::AddProlongationHypothesis(AliITSUSeed* seed, Int_t lr)
114{
115 // add new seed prolongation hypothesis
716ccba7 116 fCurrHyp->AddSeed(seed,lr);
c8d1f258 117 printf("*** Adding: "); seed->Print();
f8832015 118}
119
b8b59e05 120//________________________________________
121inline TObject *&AliITSUTrackerGlo::NextFreeSeed()
122{
123 // return next free slot where the seed can be created
124 fLastSeedID = fNFreeSeeds ? fFreeSeedsID.GetArray()[--fNFreeSeeds] : fSeedsPool.GetEntriesFast();
125 // AliInfo(Form("%d",fLastSeedID));
126 return fSeedsPool[ fLastSeedID ];
127 //
128}
129
130//_________________________________________________________________________
131inline AliITSUSeed* AliITSUTrackerGlo::NewSeedFromPool(const AliITSUSeed* src)
132{
133 // create new seed, optionally copying from the source
134 AliITSUSeed* sd = src ? new( NextFreeSeed() ) AliITSUSeed(*src) : new( NextFreeSeed() ) AliITSUSeed();
135 sd->SetPoolID(fLastSeedID);
136 return sd;
137}
138
139//_________________________________________________________________________
140inline void AliITSUTrackerGlo::KillSeed(AliITSUSeed* seed, Bool_t branch)
141{
142 // flag seed as killed, if requested, kill recursively its parents whose sole child is the seed being killed
143 seed->Kill();
144 seed = (AliITSUSeed*)seed->GetParent();
145 if (seed && !seed->DecChildren() && branch) KillSeed(seed,branch);
146}
f8832015 147
32d38de2 148#endif
149