New tracker by Markus and Alexandru
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackerV1.h
1 #ifndef ALITRDTRACKERV1_H
2 #define ALITRDTRACKERV1_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */ 
5
6 /* $Id$ */
7
8 ////////////////////////////////////////////////////////////////////////////
9 //                                                                        //
10 //  The TRD tracker                                                       //
11 //                                                                        //
12 //  Authors:                                                              //
13 //    Alex Bercuci <A.Bercuci@gsi.de>                                     //
14 //    Markus Fasel <M.Fasel@gsi.de>                                       //
15 //                                                                        //
16 /////////////////////////////////////////////////////////////////////////////
17
18 #ifndef ALITRDTRACKER_H
19 #include "AliTRDtracker.h"
20 #endif
21
22 #define DEBUG
23
24 /**************************************************************************
25  * Class Status see source file                                           *
26  **************************************************************************/
27  
28 class TFile;
29 class TTreeSRedirector;
30 class TClonesArray;
31
32 class AliRieman;
33 class AliESDEvent;
34
35 class AliTRDseedV1;
36 class AliTRDstackLayer;
37 class AliTRDtrackerFitter;
38 class AliTRDrecoParam;
39 class AliTRDtrackV1;
40 class AliTrackPoint;
41 class AliTRDtrackerV1 : public AliTRDtracker
42 {
43
44  public:
45         enum{
46                 kNTimeBins = 35,
47                 kNPlanes = 6,
48                 kNSeedPlanes = 4,
49                 kMaxTracksStack = 100,
50                 kNConfigs = 15
51         };
52         AliTRDtrackerV1(AliTRDrecoParam *p = 0x0);
53         AliTRDtrackerV1(const TFile *in, AliTRDrecoParam *p);
54         virtual ~AliTRDtrackerV1();
55   
56         Int_t          Clusters2Tracks(AliESDEvent *esd);
57         static void    GetExtrapolationConfig(Int_t iconfig, Int_t planes[2]);
58         static void    GetSeedingConfig(Int_t iconfig, Int_t planes[4]);
59         Int_t          FollowBackProlongation(AliTRDtrackV1 &t);
60         Int_t          FollowProlongation(AliTRDtrackV1 &t);
61         Int_t          PropagateBack(AliESDEvent *event);
62         Int_t          RefitInward(AliESDEvent *event);
63         void           SetRecoParam(AliTRDrecoParam *p){fRecoParam = p;}
64         void           UnloadClusters();
65
66  protected:
67         Double_t       BuildSeedingConfigs(AliTRDstackLayer *layer, Int_t *configs);
68         Int_t          Clusters2TracksSM( AliTRDtracker::AliTRDtrackingSector *sector, AliESDEvent *esd);
69         Int_t          Clusters2TracksStack(AliTRDstackLayer *layer, TClonesArray *esdTrackList);
70         void           CookLabel(AliKalmanTrack *pt, Float_t wrong) const;
71         Int_t          GetSeedingLayers(AliTRDstackLayer *layers, Double_t *params);
72         void           GetMeanCLStack(AliTRDstackLayer *layers, Int_t *planes, Double_t *params);
73         AliTRDseedV1*  GetTracklet(AliTRDtrackV1 *trk, Int_t plane, Int_t &idx);
74         virtual Bool_t GetTrackPoint(Int_t index, AliTrackPoint &p) const;
75         AliTRDcluster *FindSeedingCluster(AliTRDstackLayer *layers, AliTRDseedV1/*AliRieman*/ *sfit);
76         
77         Double_t       MakeSeedingPlanes(AliTRDstackLayer *layer);
78         AliTRDstackLayer *MakeSeedingLayer(AliTRDstackLayer *layers, Int_t Plane);
79         Int_t          MakeSeeds(AliTRDstackLayer *layers, AliTRDseedV1 *sseed, Int_t *ipar);
80         AliTRDtrackV1*   MakeTrack(AliTRDseedV1 *seeds, Double_t *params);
81         Int_t          SetTracklet(AliTRDseedV1 *tracklet);
82
83 private:
84         AliTRDtrackerV1(const AliTRDtrackerV1 &tracker);
85         AliTRDtrackerV1 &operator=(const AliTRDtrackerV1 &tracker);
86         Double_t       CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4], Double_t *chi2);
87         void           ImproveSeedQuality(AliTRDstackLayer *layer, AliTRDseedV1 *cseed);
88
89 private:
90
91         static Double_t      fgTopologicQA[kNConfigs];         //  Topologic quality
92         Double_t             fTrackQuality[kMaxTracksStack];  //  Track quality 
93         Int_t                fSeedLayer[kMaxTracksStack];     //  Seed layer
94         Int_t                fSieveSeeding;                   //! Seeding iterator
95         TClonesArray        *fTracklets;                      // List of tracklets for all sectors
96         AliTRDrecoParam     *fRecoParam;                      //  Reconstruction parameters
97         AliTRDtrackerFitter *fFitter;                         //! Fitter class of the tracker
98
99         ClassDef(AliTRDtrackerV1, 1)                          //  Stand alone tracker development class
100
101 };
102 #endif