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