Updates in SA tracker
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUTrackerSA.h
CommitLineData
2cbb5f31 1#ifndef ALIITSUTRACKERSA_H
2#define ALIITSUTRACKERSA_H
3
a0c47fdb 4#define __DEBUG__
57a336dd 5#ifdef __DEBUG__
a0c47fdb 6#include <TString.h>
57a336dd 7#include <TCanvas.h>
8#include <TLine.h>
9#include <TPoint.h>
10#include <TMarker.h>
11#include <TText.h>
a0c47fdb 12#endif
13
2cbb5f31 14//-------------------------------------------------------------------------
15// The stand-alone ITSU tracker
16// It reads AliITSUClusterPix clusters and writes the tracks to the ESD
17//-------------------------------------------------------------------------
18
19#include "AliTracker.h"
20#include "AliITSUGeomTGeo.h"
21#include <TClonesArray.h>
22#include <vector>
57a336dd 23#include "AliITSUTrackerSAaux.h" // Structs and other stuff
a0c47fdb 24#include "AliITSUMatLUT.h"
25#include "AliITSUAux.h"
26#include "AliExternalTrackParam.h"
27class AliITSUReconstructor;
28class AliITSURecoDet;
29class AliITSURecoLayer;
2cbb5f31 30
31class TTree;
32class AliCluster;
33class AliESDEvent;
34
35using std::vector;
36
37//-------------------------------------------------------------------------
38class AliITSUTrackerSA : public AliTracker {
39public:
a0c47fdb 40 AliITSUTrackerSA(AliITSUReconstructor* rec=0);
41 virtual ~AliITSUTrackerSA();
2cbb5f31 42
57a336dd 43 // These functions must be implemented
2cbb5f31 44 Int_t Clusters2Tracks(AliESDEvent *event);
45 Int_t PropagateBack(AliESDEvent *event);
46 Int_t RefitInward(AliESDEvent *event);
47 Int_t LoadClusters(TTree *ct);
48 void UnloadClusters();
49 AliCluster *GetCluster(Int_t index) const;
50
51 // Possibly, other public functions
a0c47fdb 52 void Init(AliITSUReconstructor* rec);
57a336dd 53 Double_t RefitTrack(AliExternalTrackParam* trc, Int_t clInfo[2*AliITSUAux::kMaxLayers], Double_t rDest, Int_t stopCond);
a0c47fdb 54 Bool_t PropagateSeed(AliExternalTrackParam *seed, Double_t xToGo, Double_t mass, Double_t maxStep=1.0, Bool_t matCorr=kTRUE);
55 Double_t GetMaterialBudget(const double* pnt0, const double* pnt1, double& x2x0, double& rhol) const;
56 Bool_t GoToEntranceToLayer(AliExternalTrackParam* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kFALSE);
57 Bool_t GoToExitFromLayer(AliExternalTrackParam* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kTRUE);
57a336dd 58 Bool_t TransportToLayerX(AliExternalTrackParam* seed, Int_t lFrom, Int_t lTo, Double_t xStop);
a0c47fdb 59 Bool_t TransportToLayer(AliExternalTrackParam* seed, Int_t lFrom, Int_t lTo, Double_t rLim=-1);
60 //
2cbb5f31 61protected:
62 AliITSUTrackerSA(const AliITSUTrackerSA&);
63
64 void MakeDoublets();
a0c47fdb 65 // void MakeTriplets();
57a336dd 66 void CandidatesTreeTraversal( vector<Road> &vec, const int &iD, const int &doubl);
a0c47fdb 67 Bool_t InitTrackParams(trackC &track);
68 void CASelection(AliESDEvent *ev);
2cbb5f31 69 void GlobalFit();
70 void ChiSquareSelection();
57a336dd 71 void MergeTracks( vector<trackC> &vec, bool flags[] );
2cbb5f31 72 // Other protected functions
57a336dd 73 // (Sorting, labeling, calculations of "roads", etc)
a0c47fdb 74 static Double_t Curvature(Double_t x1,Double_t y1,Double_t x2,Double_t y2,Double_t x3,Double_t y3);
75
57a336dd 76#ifdef __DEBUG__
a0c47fdb 77 void PrintInfo(TString opt);
57a336dd 78 void DrawEvent(TString opt);
79 void DrawRoads(vector<Road> &vec);
a0c47fdb 80#endif
2cbb5f31 81
82private:
83 AliITSUTrackerSA &operator=(const AliITSUTrackerSA &tr);
84
85 // Data members
a0c47fdb 86
87 // classes for interfacing the geometry, materials etc.
57a336dd 88 AliITSUReconstructor* fReconstructor; // ITS global reconstructor
a0c47fdb 89 AliITSURecoDet* fITS; // interface to ITS, borrowed from reconstructor
90 AliITSUMatLUT* fMatLUT; // material lookup table
91 Bool_t fUseMatLUT; //! use material lookup table rather than TGeo
92 Double_t fCurrMass; // assumption about particle mass
93
94
2cbb5f31 95 // Internal tracker arrays, layers, modules, etc
96 vector<itsCluster> fClusters[7];
a0c47fdb 97 TClonesArray *fClustersTC[7];
2cbb5f31 98 vector<nPlets> fDoublets[6];
99 Int_t *fIndex[7];
100 Int_t fNClusters[7];
101 Int_t fNDoublets[6];
102 Float_t fPhiCut;
103 Float_t fRPhiCut;
104 Float_t fZCut;
105
57a336dd 106 #ifdef __DEBUG__
107 TCanvas *fCv;
108 TMarker *fMk;
109 TLine *fLn;
110 TText *fTx;
111 #endif
112
a0c47fdb 113 //
114 static const Double_t fgkToler; // tracking tolerance
57a336dd 115 static const Double_t fgkChi2Cut; // chi2 cut during track merging
a0c47fdb 116 //
2cbb5f31 117 ClassDef(AliITSUTrackerSA,1) //ITSU stand-alone tracker
118};
119
120#endif