better organization of private and protected methods. Bug fix in AliITSPlaneEff:...
[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;}
70 AliCluster* GetCluster(Int_t index) const;
0906e73e 71 static void GetExtrapolationConfig(Int_t iconfig, Int_t planes[2]);
72 static void GetSeedingConfig(Int_t iconfig, Int_t planes[4]);
eb38ed55 73 static TLinearFitter *GetTiltedRiemanFitter();
74 static TLinearFitter *GetTiltedRiemanFitterConstraint();
75 static AliRieman *GetRiemanFitter();
76 static void FitRieman(AliTRDcluster **clusters, Double_t chi2[2]);
77 static Float_t FitRieman(AliTRDseedV1 *tracklets, Double_t *chi2, Int_t *planes = 0x0);
78 static Float_t FitTiltedRiemanConstraint(AliTRDseedV1 *tracklets, Double_t zVertex);
79 static Float_t FitTiltedRieman(AliTRDseedV1 *tracklets, Bool_t sigError);
80
0906e73e 81 Int_t FollowBackProlongation(AliTRDtrackV1 &t);
82 Int_t FollowProlongation(AliTRDtrackV1 &t);
eb38ed55 83 Int_t LoadClusters(TTree *cTree);
0906e73e 84 Int_t PropagateBack(AliESDEvent *event);
eb38ed55 85 Int_t ReadClusters(TClonesArray* &array, TTree *in) const;
0906e73e 86 Int_t RefitInward(AliESDEvent *event);
0906e73e 87 void UnloadClusters();
eb38ed55 88
89 static Int_t Freq(Int_t n, const Int_t *inlist, Int_t *outlist, Bool_t down); // to be removed
fbb2ea06 90
eb38ed55 91protected:
92 Bool_t AdjustSector(AliTRDtrackV1 *track);
93 Double_t BuildSeedingConfigs(AliTRDtrackingChamber **stack, Int_t *configs);
94 static Float_t CalculateChi2Z(AliTRDseedV1 *tracklets, Double_t offset, Double_t slope);
95 Int_t Clusters2TracksSM(Int_t sector, AliESDEvent *esd);
96 Int_t Clusters2TracksStack(AliTRDtrackingChamber **stack, TClonesArray *esdTrackList);
0906e73e 97 void CookLabel(AliKalmanTrack *pt, Float_t wrong) const;
eb38ed55 98 AliTRDcluster* FindSeedingCluster(AliTRDtrackingChamber *chamber, AliTRDseedV1 *sfit) const;
99 Int_t GetSeedingLayers(AliTRDtrackingChamber *chamber, Double_t *params);
100 void GetMeanCLStack(AliTRDtrackingChamber *chamber, Int_t *planes, Double_t *params);
0906e73e 101 AliTRDseedV1* GetTracklet(AliTRDtrackV1 *trk, Int_t plane, Int_t &idx);
eb38ed55 102 Bool_t GetTrackPoint(Int_t index, AliTrackPoint &p) const;
103 Int_t MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *sseed, Int_t *ipar);
104 AliTRDtrackV1* MakeTrack(AliTRDseedV1 *seeds, Double_t *params);
bccda319 105 Int_t PropagateToX(AliTRDtrackV1 &t, Double_t xToGo, Double_t maxStep);
0906e73e 106 Int_t SetTracklet(AliTRDseedV1 *tracklet);
e4f2f73d 107
0906e73e 108private:
e4f2f73d 109 AliTRDtrackerV1(const AliTRDtrackerV1 &tracker);
110 AliTRDtrackerV1 &operator=(const AliTRDtrackerV1 &tracker);
0906e73e 111 Double_t CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4], Double_t *chi2);
eb38ed55 112 Double_t CalculateTrackLikelihood(AliTRDseedV1 *tracklets, Double_t *chi2);
113 Int_t ImproveSeedQuality(AliTRDtrackingChamber **stack, AliTRDseedV1 *tracklet);
e4f2f73d 114
0906e73e 115private:
eb38ed55 116 AliTRDgeometry *fGeom; // Pointer to TRD geometry
117 AliTRDtrackingSector fTrSec[kTrackingSectors]; // Array of tracking sectors;
e4f2f73d 118
eb38ed55 119 TClonesArray *fClusters; // List of clusters
120 TClonesArray *fTracklets; // List of tracklets
121 TClonesArray *fTracks; // List of tracks
122 Int_t fTimeBinsPerPlane; // Timebins per plane in track prolongation
123
124 // should go to the recoParam
125 static const Double_t fgkMaxChi2; // Max increment in track chi2
126 static const Float_t fgkMinClustersInTrack; // Min number of clusters in track
127 static const Float_t fgkLabelFraction; // Min fraction of same label
128 static const Double_t fgkMaxSnp; // Maximal snp for tracking
129 static const Double_t fgkMaxStep; // Maximal step for tracking
130
131 // stand alone tracking
0906e73e 132 static Double_t fgTopologicQA[kNConfigs]; // Topologic quality
e4f2f73d 133 Double_t fTrackQuality[kMaxTracksStack]; // Track quality
134 Int_t fSeedLayer[kMaxTracksStack]; // Seed layer
135 Int_t fSieveSeeding; //! Seeding iterator
eb38ed55 136
137 static TLinearFitter *fgTiltedRieman; // Fitter for the tilted Rieman fit without vertex constriant
138 static TLinearFitter *fgTiltedRiemanConstrained; // Fitter for the tilted Rieman fit with vertex constraint
139 static AliRieman *fgRieman; // Fitter for the untilted Rieman fit
140 static TTreeSRedirector *fgDebugStreamer; //!Debug streamer
e4f2f73d 141
eb38ed55 142 ClassDef(AliTRDtrackerV1, 2) // TRD tracker development class
e4f2f73d 143
144};
145#endif