]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDseedV1.h
extend and fix tracklet fit procedure
[u/mrichter/AliRoot.git] / TRD / AliTRDseedV1.h
1 #ifndef ALITRDSEEDV1_H
2 #define ALITRDSEEDV1_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 track seed                                                    //
11 //                                                                        //
12 ////////////////////////////////////////////////////////////////////////////
13
14 #ifndef ALITRDSEED_H
15 #include "AliTRDseed.h"
16 #endif
17
18 #ifndef ALIPID_H
19 #include "AliPID.h"
20 #endif
21
22 #ifndef ALIRIEMAN_H
23 #include "AliRieman.h"
24 #endif
25
26 class TTreeSRedirector;
27
28 class AliRieman;
29
30 class AliTRDtrackingChamber;
31 class AliTRDcluster;
32 class AliTRDtrackV1;
33 class AliTRDReconstructor;
34 class AliTRDseedV1 : public AliTRDseed
35 {
36
37   public:
38
39   enum {
40     knSlices = 10
41   };
42   // bits from 0-13 are reserved by ROOT (see TObject.h)
43   enum AliTRDtrackletStatus {
44     kOwner    = BIT(14)
45   , kRowCross = BIT(15) 
46   };
47
48   AliTRDseedV1(Int_t plane = -1);
49   ~AliTRDseedV1();
50   AliTRDseedV1(const AliTRDseedV1 &ref);
51   AliTRDseedV1& operator=(const AliTRDseedV1 &ref);
52
53   Bool_t        AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t quality, Bool_t kZcorr = kFALSE
54                                 , AliTRDcluster *c=0x0);
55   Bool_t        AttachClusters(AliTRDtrackingChamber *chamber, Bool_t kZcorr = kFALSE);
56   void    CookdEdx(Int_t nslices);
57   void    Draw(Option_t* o = "");
58   Bool_t  Fit(Bool_t tilt=kTRUE);
59
60   Bool_t  Init(AliTRDtrackV1 *track);
61   inline void      Init(const AliRieman *fit);
62   Bool_t    IsOwner() const          { return TestBit(kOwner);}
63   Bool_t    IsRowCross() const       { return TestBit(kRowCross);}
64
65   inline Float_t   GetChi2Z(const Float_t z = 999.) const;
66   inline Float_t   GetChi2Y(const Float_t y = 999.) const;
67   void      GetCovAt(Double_t x, Double_t *cov) const;
68   Double_t* GetCrossXYZ() { return &fCross[0];}
69   Double_t  GetCrossSz2() const { return fCross[3];}
70   Float_t*  GetdEdx() {return &fdEdx[0];}
71   Float_t   GetdQdl(Int_t ic) const;
72   Double_t  GetMomentum() const {return fMom;}
73   Int_t     GetN() const {return fN2;}
74   Float_t   GetQuality(Bool_t kZcorr) const;
75   Int_t     GetPlane() const         { return fPlane;    }
76   Double_t* GetProbability();
77   Double_t  GetSnp() const           { return fSnp;}
78   Double_t  GetTgl() const           { return fTgl;}
79   Double_t  GetYat(Double_t x) const { return fYfit[0] + fYfit[1] * (x-fX0);}
80   Double_t  GetZat(Double_t x) const { return fZfit[0] + fZfit[1] * (x-fX0);}
81   
82   void      Print(Option_t *o = "") const;
83   
84   void      SetMomentum(Double_t mom) {fMom = mom;}
85   void      SetOwner();
86   void      SetPlane(Int_t p)                      { fPlane     = p;   }
87   void      SetSnp(Double_t snp) {fSnp = snp;}
88   void      SetTgl(Double_t tgl) {fTgl = tgl;}
89   void      SetReconstructor(const AliTRDReconstructor *rec) {fReconstructor = rec;}
90 protected:
91
92   void Copy(TObject &ref) const;
93
94 private:
95   const AliTRDReconstructor *fReconstructor;//! local reconstructor
96   Int_t            fPlane;                  //  TRD plane
97   Float_t          fMom;                    //  Momentum estimate for tracklet [GeV/c]
98   Float_t          fSnp;                    // sin of track with respect to x direction in XY plane     
99   Float_t          fTgl;                    // tg of track with respect to x direction in XZ plane      
100   Float_t          fdX;                     // length of time bin
101   Float_t          fdEdx[knSlices];         //  dE/dx measurements for tracklet
102   Double_t         fCross[4];            // spatial parameters of the pad row crossing
103   Double_t         fProb[AliPID::kSPECIES]; //  PID probabilities
104
105   ClassDef(AliTRDseedV1, 1)                 //  New TRD seed 
106
107 };
108
109 //____________________________________________________________
110 inline Float_t AliTRDseedV1::GetChi2Z(const Float_t z) const
111 {
112   Float_t z1  = (z == 999.) ? fMeanz : z;
113   Float_t chi = fZref[0] - z1;
114   return chi*chi;
115 }
116
117 //____________________________________________________________
118 inline Float_t AliTRDseedV1::GetChi2Y(const Float_t y) const
119 {
120   Float_t y1  = (y == 999.) ? fYfitR[0] : y;
121   Float_t chi = fYref[0] - y1;
122   return chi*chi;
123 }
124
125 //____________________________________________________________
126 inline void AliTRDseedV1::Init(const AliRieman *rieman)
127 {
128   fZref[0] = rieman->GetZat(fX0);
129   fZref[1] = rieman->GetDZat(fX0);
130   fYref[0] = rieman->GetYat(fX0);
131   fYref[1] = rieman->GetDYat(fX0);
132   fC       = rieman->GetC(); 
133   fChi2    = rieman->GetChi2();
134 }
135
136 #endif
137
138
139