3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ////////////////////////////////////////////////////////////////////////////
10 // The TRD track seed //
12 ////////////////////////////////////////////////////////////////////////////
15 #include "AliTRDseed.h"
18 #ifndef ALITRDGEOMETRY_H
19 #include "AliTRDgeometry.h"
27 #include "AliRieman.h"
30 class TTreeSRedirector;
34 class AliTRDtrackingChamber;
37 class AliTRDReconstructor;
38 class AliTRDseedV1 : public AliTRDseed
46 // bits from 0-13 are reserved by ROOT (see TObject.h)
47 enum AliTRDtrackletStatus {
52 AliTRDseedV1(Int_t det = -1);
54 AliTRDseedV1(const AliTRDseedV1 &ref);
55 AliTRDseedV1& operator=(const AliTRDseedV1 &ref);
57 Bool_t AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t quality, Bool_t kZcorr = kFALSE
58 , AliTRDcluster *c=0x0);
59 Bool_t AttachClusters(AliTRDtrackingChamber *chamber, Bool_t kZcorr = kFALSE);
60 void CookdEdx(Int_t nslices);
61 Bool_t Fit(Bool_t tilt=kTRUE);
63 Bool_t Init(AliTRDtrackV1 *track);
64 inline void Init(const AliRieman *fit);
65 Bool_t IsOwner() const { return TestBit(kOwner);}
66 Bool_t IsRowCross() const { return TestBit(kRowCross);}
68 inline Float_t GetChi2Z(const Float_t z = 999.) const;
69 inline Float_t GetChi2Y(const Float_t y = 999.) const;
70 void GetCovAt(Double_t x, Double_t *cov) const;
71 Double_t* GetCrossXYZ() { return &fCross[0];}
72 Double_t GetCrossSz2() const { return fCross[3];}
73 Float_t* GetdEdx() {return &fdEdx[0];}
74 Float_t GetdQdl(Int_t ic) const;
75 Int_t GetDetector() const {return fDet;}
76 Double_t GetMomentum() const {return fMom;}
77 Int_t GetN() const {return fN2;}
78 Float_t GetQuality(Bool_t kZcorr) const;
79 Int_t GetPlane() const { return AliTRDgeometry::GetLayer(fDet); }
81 Double_t* GetProbability();
82 Double_t GetSnp() const { return fSnp;}
83 Double_t GetTgl() const { return fTgl;}
84 Double_t GetYat(Double_t x) const { return fYfit[0] + fYfit[1] * (x-fX0);}
85 Double_t GetZat(Double_t x) const { return fZfit[0] + fZfit[1] * (x-fX0);}
87 inline AliTRDcluster* NextCluster();
88 inline AliTRDcluster* PrevCluster();
89 void Print(Option_t *o = "") const;
90 inline void ResetClusterIter(Bool_t forward = kTRUE);
92 void SetMomentum(Double_t mom) {fMom = mom;}
94 void SetDetector(Int_t d) {fDet = d; }
95 void SetSnp(Double_t snp) {fSnp = snp;}
96 void SetTgl(Double_t tgl) {fTgl = tgl;}
97 void SetReconstructor(const AliTRDReconstructor *rec) {fReconstructor = rec;}
100 void Copy(TObject &ref) const;
103 const AliTRDReconstructor *fReconstructor;//! local reconstructor
104 AliTRDcluster **fClusterIter; //! clusters iterator
105 Char_t fClusterIdx; //! clusters iterator
106 Int_t fDet; // TRD detector
107 Float_t fMom; // Momentum estimate for tracklet [GeV/c]
108 Float_t fSnp; // sin of track with respect to x direction in XY plane
109 Float_t fTgl; // tg of track with respect to x direction in XZ plane
110 Float_t fdX; // length of time bin
111 Float_t fdEdx[knSlices]; // dE/dx measurements for tracklet
112 Double_t fCross[4]; // spatial parameters of the pad row crossing
113 Double_t fProb[AliPID::kSPECIES]; // PID probabilities
115 ClassDef(AliTRDseedV1, 2) // New TRD seed
119 //____________________________________________________________
120 inline Float_t AliTRDseedV1::GetChi2Z(const Float_t z) const
122 Float_t z1 = (z == 999.) ? fMeanz : z;
123 Float_t chi = fZref[0] - z1;
127 //____________________________________________________________
128 inline Float_t AliTRDseedV1::GetChi2Y(const Float_t y) const
130 Float_t y1 = (y == 999.) ? fYfitR[0] : y;
131 Float_t chi = fYref[0] - y1;
135 //____________________________________________________________
136 inline void AliTRDseedV1::Init(const AliRieman *rieman)
138 fZref[0] = rieman->GetZat(fX0);
139 fZref[1] = rieman->GetDZat(fX0);
140 fYref[0] = rieman->GetYat(fX0);
141 fYref[1] = rieman->GetDYat(fX0);
143 fChi2 = rieman->GetChi2();
146 //____________________________________________________________
147 inline AliTRDcluster* AliTRDseedV1::NextCluster()
149 // Mimic the usage of STL iterators.
152 fClusterIdx++; fClusterIter++;
153 while(fClusterIdx < AliTRDseed::knTimebins){
154 if(!(*fClusterIter)){
159 return *fClusterIter;
164 //____________________________________________________________
165 inline AliTRDcluster* AliTRDseedV1::PrevCluster()
167 // Mimic the usage of STL iterators.
170 fClusterIdx--; fClusterIter--;
171 while(fClusterIdx >= 0){
172 if(!(*fClusterIter)){
177 return *fClusterIter;
182 //____________________________________________________________
183 inline void AliTRDseedV1::ResetClusterIter(Bool_t forward)
185 // Mimic the usage of STL iterators.
186 // Facilitate the usage of NextCluster for forward like
187 // iterator (kTRUE) and PrevCluster for backward like iterator (kFALSE)
190 fClusterIter = &fClusters[0]; fClusterIter--;
193 fClusterIter = &fClusters[AliTRDseed::knTimebins-1]; fClusterIter++;
194 fClusterIdx=AliTRDseed::knTimebins;