]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCTracklet.h
Update of DAs to use Monitoring Bit,
[u/mrichter/AliRoot.git] / TPC / AliTPCTracklet.h
1 #ifndef ALITPCTRACKLET_H
2 #define ALITPCTRACKLET_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 ////
8 // A class that contains a tracklet (a track that lives only in a single TPC
9 // sector).
10 ////
11
12
13 #include "TObject.h"
14
15 class TObjArray;
16 class AliTPCseed;
17 class AliExternalTrackParam;
18 class AliTPCclusterMI;
19
20 #include "TEllipse.h"
21
22 class AliTPCTracklet:public TObject {
23 public: 
24   enum TrackType {kKalman,kRiemann,kLinear,kQuadratic};
25
26   AliTPCTracklet();
27   AliTPCTracklet(const AliTPCseed *s,Int_t sector,TrackType type=kKalman,
28                  Bool_t storeClusters=kFALSE);
29   AliTPCTracklet(const TObjArray &clusters,Int_t sector,TrackType type=kKalman,
30                  Bool_t storeClusters=kFALSE);
31   AliTPCTracklet(const AliTPCTracklet &t);
32   AliTPCTracklet& operator=(const AliTPCTracklet &t);
33   virtual ~AliTPCTracklet();
34
35   static TObjArray CreateTracklets(const TObjArray &clusters,
36                                    TrackType type=kKalman,
37                                    Bool_t storeClusters=kFALSE,
38                                    Int_t minClusters=0,
39                                    Int_t maxTracklets=72);
40
41   static TObjArray CreateTracklets(const AliTPCseed *s,
42                                    TrackType type=kKalman,
43                                    Bool_t storeClusters=kFALSE,
44                                    Int_t minClusters=0,
45                                    Int_t maxTracklets=72);
46
47   static Bool_t PropagateToMeanX(const AliTPCTracklet &t1,
48                                  const AliTPCTracklet &t2,
49                                  AliExternalTrackParam *&t1m,
50                                  AliExternalTrackParam *&t2m);
51
52   // Returns the tracklet parametrisation at its outer most cluster.
53   AliExternalTrackParam* GetOuter() const {return fOuter;};
54   // Returns the tracklet parametrisation at its inner most cluster.
55   AliExternalTrackParam* GetInner() const {return fInner;};
56   // Returns the tracklet parametrisation at X=0, i.e. the "primary vertex".
57   AliExternalTrackParam* GetPrimary() const {return fPrimary;};
58   // Returns the sector in which the tracklet lives.
59   Int_t GetSector() const {return fSector;}
60   // Returns the number of clusters assined to the tracklet.
61   Int_t GetNClusters() const {return fNClusters;}
62   // Returns the clusters of this tracklet. In case they weren't stored it
63   // returns 0.
64   AliTPCclusterMI* GetClusters() const {return fClusters;};
65   // Test the functionality of the class. Generates some random tracks and
66   // refits them into tracklets. 
67   static void Test(const char *filename);
68   static void RandomND(Int_t ndim,const Double_t *p,const Double_t *c,
69                        Double_t *x);
70   static TEllipse ErrorEllipse(Double_t x,Double_t y,
71                                Double_t sx,Double_t sy,Double_t sxy);
72   static inline void SetEdgeCut(Float_t edgeX, Float_t edgeY);
73 private:
74   static Bool_t RejectCluster(AliTPCclusterMI* cl,AliExternalTrackParam * param=0);
75   static const Double_t kB2C; //! ugly to have the track parametrised in a way, that constand is allways needed
76   static double GetBz(Double_t *xyz);
77   static Float_t        fgEdgeCutY; //cut on the edge effect in local Y 
78   static Float_t        fgEdgeCutX; //cut on the edge effect in local X 
79   void FitLinear(const AliTPCseed *track,Int_t sector,TrackType type);
80   void FitKalman(const AliTPCseed *track,Int_t sector);
81   void FitRiemann(const AliTPCseed *track,Int_t sector);
82   void Quadratic2Helix(Double_t *a,Double_t *ca,
83                        Double_t *b,Double_t *cb,
84                        Double_t x0,
85                        Double_t *p,Double_t *c);
86   Bool_t Riemann2Helix(Double_t *a,Double_t *ca,
87                        Double_t *b,Double_t *cb,
88                        Double_t x0,
89                        Double_t *p,Double_t *c);   
90   Int_t fNClusters; // The number of clusters assined to the tracklet.
91   Int_t fNStoredClusters; // The number of stored clusters.
92   AliTPCclusterMI *fClusters; //[fNStoredClusters] The clusters of the track, if stored (otherwise 0)
93   Int_t fSector; // The sector this tracklet lives in.
94   AliExternalTrackParam *fOuter; // The tracklet parametrisation at its outer most cluster.
95   AliExternalTrackParam *fInner; // The tracklet parametrisation at its inner most cluster.
96   AliExternalTrackParam *fPrimary; // The tracklet parametrisation at X=0, i.e. the "primary vertex".
97
98   ClassDef(AliTPCTracklet,1)
99 };
100
101
102 void AliTPCTracklet::SetEdgeCut(Float_t edgeX, Float_t edgeY){
103   //
104   //
105   fgEdgeCutY=edgeY;
106   fgEdgeCutX=edgeX;
107 }
108
109 #endif