]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDseedV1.h
Update of tracking code (alignment/calibration awareness)
[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 AliTRDtrack;
33 class AliTRDseedV1 : public AliTRDseed
34 {
35
36   public:
37
38         enum {
39           knSlices = 10
40         };
41
42         AliTRDseedV1(Int_t plane = -1);
43         ~AliTRDseedV1();
44         AliTRDseedV1(const AliTRDseedV1 &ref);
45         AliTRDseedV1& operator=(const AliTRDseedV1 &ref);
46
47         Bool_t  AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t quality, Bool_t kZcorr = kFALSE
48                                  , AliTRDcluster *c=0x0);
49         Bool_t  AttachClusters(AliTRDtrackingChamber *chamber, Bool_t kZcorr = kFALSE);
50         void    CookdEdx(Int_t nslices);
51         Bool_t  Fit();
52
53                void      Init(AliTRDtrack *track);
54         inline void      Init(const AliRieman *fit);
55         
56         inline Float_t   GetChi2Z(const Float_t z = 999.) const;
57         inline Float_t   GetChi2Y(const Float_t y = 999.) const;
58                void      GetCovAt(Double_t x, Double_t *cov) const;
59                Float_t*  GetdEdx() {return &fdEdx[0];}
60                Float_t   GetdQdl(Int_t ic) const;
61                Double_t  GetMomentum() const {return fMom;}
62                Int_t     GetN() const {return fN2;}
63                Float_t   GetQuality(Bool_t kZcorr) const;
64                Int_t     GetPlane() const                       { return fPlane;    }
65                Double_t* GetProbability();
66                Double_t  GetSnp() const {return fSnp;}
67                Double_t  GetTgl() const {return fTgl;}
68                Double_t  GetYat(Double_t x) const {return fYfitR[0] + fYfitR[1] * (x - fX0);}
69                Double_t  GetZat(Double_t x) const {return fZfitR[0] + fZfitR[1] * (x - fX0);}
70                                  
71                Bool_t    IsOwner() const {return fOwner;}
72          void      Print(Option_t * /*o*/) const          { }
73                void      Print();
74                
75                void      SetMomentum(Double_t mom) {fMom = mom;}
76                void      SetOwner(Bool_t own = kTRUE);
77                void      SetPlane(Int_t p)                      { fPlane     = p;   }
78                void      SetSnp(Double_t snp) {fSnp = snp;}
79                void      SetTgl(Double_t tgl) {fTgl = tgl;}
80
81  protected:
82
83         void Copy(TObject &ref) const;
84
85  private:
86
87         Int_t            fPlane;                  //  TRD plane
88         Bool_t           fOwner;                  //  Toggle ownership of clusters
89         Float_t          fMom;                    //  Momentum estimate for tracklet [GeV/c]
90         Float_t          fSnp;                    // sin of track with respect to x direction in XY plane       
91         Float_t          fTgl;                    // tg of track with respect to x direction in XZ plane        
92         Float_t          fdX;                     // length of time bin
93         Float_t          fdEdx[knSlices];         //  dE/dx measurements for tracklet
94         Double_t         fProb[AliPID::kSPECIES]; //  PID probabilities
95
96         ClassDef(AliTRDseedV1, 1)                 //  New TRD seed 
97
98 };
99
100 //____________________________________________________________
101 inline Float_t AliTRDseedV1::GetChi2Z(const Float_t z) const
102 {
103         Float_t z1  = (z == 999.) ? fMeanz : z;
104         Float_t chi = fZref[0] - z1;
105         return chi*chi;
106 }
107
108 //____________________________________________________________
109 inline Float_t AliTRDseedV1::GetChi2Y(const Float_t y) const
110 {
111         Float_t y1  = (y == 999.) ? fYfitR[0] : y;
112         Float_t chi = fYref[0] - y1;
113         return chi*chi;
114 }
115
116 //____________________________________________________________
117 inline void AliTRDseedV1::Init(const AliRieman *rieman)
118 {
119         fZref[0] = rieman->GetZat(fX0);
120         fZref[1] = rieman->GetDZat(fX0);
121         fYref[0] = rieman->GetYat(fX0);
122         fYref[1] = rieman->GetDYat(fX0);
123 }
124
125 #endif
126