Update in the interface for HLT and for visualization
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackerV1.h
CommitLineData
e4f2f73d 1#ifndef ALITRDTRACKERV1_H
2#define ALITRDTRACKERV1_H
eb38ed55 3
e4f2f73d 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9////////////////////////////////////////////////////////////////////////////
10// //
11// The TRD tracker //
12// //
13// Authors: //
eb38ed55 14// Marian Ivanov <M.Ivanov@gsi.de> //
e4f2f73d 15// Alex Bercuci <A.Bercuci@gsi.de> //
eb38ed55 16// Jouri Belikov <J.Belikov@cern.ch> //
e4f2f73d 17// Markus Fasel <M.Fasel@gsi.de> //
18// //
eb38ed55 19////////////////////////////////////////////////////////////////////////////
e4f2f73d 20
eb38ed55 21#ifndef ALITRACKER_H
22#include "AliTracker.h"
e4f2f73d 23#endif
24
eb38ed55 25#ifndef ALITRDTRACKINGSECTOR_H
26#include "AliTRDtrackingSector.h"
27#endif
e4f2f73d 28
29/**************************************************************************
30 * Class Status see source file *
31 **************************************************************************/
32
33class TFile;
34class TTreeSRedirector;
35class TClonesArray;
eb38ed55 36class TLinearFitter;
e4f2f73d 37
38class AliRieman;
39class AliESDEvent;
eb38ed55 40class AliCluster;
e4f2f73d 41
eb38ed55 42class AliTRDcluster;
e4f2f73d 43class AliTRDseedV1;
eb38ed55 44class AliTRDtrackingChamber;
45class AliTRDchamberTimeBin;
e4f2f73d 46class AliTRDtrackerFitter;
0906e73e 47class AliTRDtrackV1;
48class AliTrackPoint;
eb38ed55 49class AliTRDtrackerV1 : public AliTracker
e4f2f73d 50{
eb38ed55 51public:
e4f2f73d 52 enum{
eb38ed55 53 kMaxLayersPerSector = 1000
54 , kMaxTimeBinIndex = 216
55 , kTrackingSectors = 18
56 , kNTimeBins = 35
57 , kNPlanes = 6
58 , kNSeedPlanes = 4
59 , kMaxTracksStack = 100
60 , kNConfigs = 15
e4f2f73d 61 };
eb38ed55 62 AliTRDtrackerV1();
0906e73e 63 virtual ~AliTRDtrackerV1();
e4f2f73d 64
eb38ed55 65 //temporary
66 AliTRDtrackingSector* GetTrackingSector(Int_t sec) {return &fTrSec[sec];}
67
e4f2f73d 68 Int_t Clusters2Tracks(AliESDEvent *esd);
eb38ed55 69 static TTreeSRedirector* DebugStreamer() {return fgDebugStreamer;}
d739fd4e 70 static void SetNTimeBins(Int_t nTimeBins){fgNTimeBins = nTimeBins; }
eb38ed55 71 AliCluster* GetCluster(Int_t index) const;
0906e73e 72 static void GetExtrapolationConfig(Int_t iconfig, Int_t planes[2]);
2985ffcb 73 static const Int_t GetNTimeBins() {return fgNTimeBins;}
0906e73e 74 static void GetSeedingConfig(Int_t iconfig, Int_t planes[4]);
eb38ed55 75 static TLinearFitter *GetTiltedRiemanFitter();
76 static TLinearFitter *GetTiltedRiemanFitterConstraint();
77 static AliRieman *GetRiemanFitter();
78 static void FitRieman(AliTRDcluster **clusters, Double_t chi2[2]);
79 static Float_t FitRieman(AliTRDseedV1 *tracklets, Double_t *chi2, Int_t *planes = 0x0);
80 static Float_t FitTiltedRiemanConstraint(AliTRDseedV1 *tracklets, Double_t zVertex);
81 static Float_t FitTiltedRieman(AliTRDseedV1 *tracklets, Bool_t sigError);
82
0906e73e 83 Int_t FollowBackProlongation(AliTRDtrackV1 &t);
84 Int_t FollowProlongation(AliTRDtrackV1 &t);
eb38ed55 85 Int_t LoadClusters(TTree *cTree);
0906e73e 86 Int_t PropagateBack(AliESDEvent *event);
eb38ed55 87 Int_t ReadClusters(TClonesArray* &array, TTree *in) const;
0906e73e 88 Int_t RefitInward(AliESDEvent *event);
0906e73e 89 void UnloadClusters();
eb38ed55 90
91 static Int_t Freq(Int_t n, const Int_t *inlist, Int_t *outlist, Bool_t down); // to be removed
8acca6a3 92
93 class AliTRDLeastSquare{
94 public:
95 AliTRDLeastSquare();
96 ~AliTRDLeastSquare(){};
97
98 void AddPoint(Double_t *x, Double_t y, Double_t sigmaY);
99 void RemovePoint(Double_t *x, Double_t y, Double_t sigmaY);
100 void Eval();
101
102 Double_t GetFunctionParameter(Int_t ParNumber) const {return fParams[ParNumber];}
103 Double_t GetFunctionValue(Double_t *xpos) const;
104 void GetCovarianceMatrix(Double_t *storage) const;
105 private:
106 AliTRDLeastSquare(const AliTRDLeastSquare &);
107 AliTRDLeastSquare& operator=(const AliTRDLeastSquare &);
108 Double_t fParams[2]; // Fitparameter
109 Double_t fCovarianceMatrix[3]; // Covariance Matrix
110 Double_t fSums[6]; // Sums
111 };
fbb2ea06 112
eb38ed55 113protected:
114 Bool_t AdjustSector(AliTRDtrackV1 *track);
115 Double_t BuildSeedingConfigs(AliTRDtrackingChamber **stack, Int_t *configs);
bb56afff 116 static Float_t CalculateChi2Z(AliTRDseedV1 *tracklets, Double_t offset, Double_t slope, Double_t xref);
eb38ed55 117 Int_t Clusters2TracksSM(Int_t sector, AliESDEvent *esd);
118 Int_t Clusters2TracksStack(AliTRDtrackingChamber **stack, TClonesArray *esdTrackList);
0906e73e 119 AliTRDseedV1* GetTracklet(AliTRDtrackV1 *trk, Int_t plane, Int_t &idx);
eb38ed55 120 Bool_t GetTrackPoint(Int_t index, AliTrackPoint &p) const;
121 Int_t MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *sseed, Int_t *ipar);
122 AliTRDtrackV1* MakeTrack(AliTRDseedV1 *seeds, Double_t *params);
bccda319 123 Int_t PropagateToX(AliTRDtrackV1 &t, Double_t xToGo, Double_t maxStep);
0906e73e 124 Int_t SetTracklet(AliTRDseedV1 *tracklet);
972ef65e 125 Bool_t UpdateTracklet(AliTRDseedV1 *tracklet, Int_t index);
e4f2f73d 126
0906e73e 127private:
e4f2f73d 128 AliTRDtrackerV1(const AliTRDtrackerV1 &tracker);
129 AliTRDtrackerV1 &operator=(const AliTRDtrackerV1 &tracker);
bb56afff 130 Double_t CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4], Double_t *chi2);
131 Double_t CalculateTrackLikelihood(AliTRDseedV1 *tracklets, Double_t *chi2);
132 Int_t ImproveSeedQuality(AliTRDtrackingChamber **stack, AliTRDseedV1 *tracklet);
bb56afff 133 static Float_t CalculateReferenceX(AliTRDseedV1 *tracklets);
134
135 Float_t GetChi2Y(AliTRDseedV1 *tracklets) const;
136 Float_t GetChi2Z(AliTRDseedV1 *tracklets) const;
e4f2f73d 137
0906e73e 138private:
eb38ed55 139 AliTRDgeometry *fGeom; // Pointer to TRD geometry
140 AliTRDtrackingSector fTrSec[kTrackingSectors]; // Array of tracking sectors;
e4f2f73d 141
bb56afff 142 TClonesArray *fClusters; // List of clusters
143 TClonesArray *fTracklets; // List of tracklets
144 TClonesArray *fTracks; // List of tracks
eb38ed55 145
146 // should go to the recoParam
147 static const Double_t fgkMaxChi2; // Max increment in track chi2
148 static const Float_t fgkMinClustersInTrack; // Min number of clusters in track
149 static const Float_t fgkLabelFraction; // Min fraction of same label
150 static const Double_t fgkMaxSnp; // Maximal snp for tracking
151 static const Double_t fgkMaxStep; // Maximal step for tracking
152
153 // stand alone tracking
2985ffcb 154 static Double_t fgTopologicQA[kNConfigs]; // Topologic quality
e4f2f73d 155 Double_t fTrackQuality[kMaxTracksStack]; // Track quality
156 Int_t fSeedLayer[kMaxTracksStack]; // Seed layer
157 Int_t fSieveSeeding; //! Seeding iterator
eb38ed55 158
2985ffcb 159 static Int_t fgNTimeBins; // Timebins per plane in track prolongation
160 static TLinearFitter *fgTiltedRieman; // Fitter for the tilted Rieman fit without vertex constriant
161 static TLinearFitter *fgTiltedRiemanConstrained; // Fitter for the tilted Rieman fit with vertex constraint
162 static AliRieman *fgRieman; // Fitter for the untilted Rieman fit
bb56afff 163
164 static TTreeSRedirector *fgDebugStreamer; //!Debug streamer
165
eb38ed55 166 ClassDef(AliTRDtrackerV1, 2) // TRD tracker development class
e4f2f73d 167
168};
169#endif