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(
58 AliTRDtrackingChamber *chamber, Float_t quality,
59 Bool_t kZcorr = kFALSE, AliTRDcluster *c=0x0);
60 Bool_t AttachClusters(
61 AliTRDtrackingChamber *chamber, Bool_t kZcorr = kFALSE);
62 void Bootstrap(const AliTRDReconstructor *rec);
63 void CookdEdx(Int_t nslices);
64 Bool_t Fit(Bool_t tilt=kTRUE);
66 Bool_t Init(AliTRDtrackV1 *track);
67 inline void Init(const AliRieman *fit);
68 Bool_t IsEqual(const TObject *inTracklet) const;
69 Bool_t IsOwner() const { return TestBit(kOwner);}
70 Bool_t IsRowCross() const { return TestBit(kRowCross);}
72 inline Float_t GetChi2Z(const Float_t z = 999.) const;
73 inline Float_t GetChi2Y(const Float_t y = 999.) const;
74 void GetCovAt(Double_t x, Double_t *cov) const;
75 Double_t* GetCrossXYZ() { return &fCross[0];}
76 Double_t GetCrossSz2() const { return fCross[3];}
77 Float_t GetdX() const { return fdX;}
78 Float_t* GetdEdx() { return &fdEdx[0];}
79 Float_t GetdQdl(Int_t ic) const;
80 Int_t GetDetector() const { return fDet;}
81 Double_t GetMomentum() const { return fMom;}
82 Int_t GetN() const { return fN2;}
83 Float_t GetQuality(Bool_t kZcorr) const;
84 Int_t GetPlane() const { return AliTRDgeometry::GetLayer(fDet); }
86 Double_t* GetProbability();
87 Double_t GetSnp() const { return fSnp;}
88 Double_t GetTgl() const { return fTgl;}
89 Double_t GetYat(Double_t x) const { return fYfit[0] + fYfit[1] * (x-fX0);}
90 Double_t GetZat(Double_t x) const { return fZfit[0] + fZfit[1] * (x-fX0);}
92 inline AliTRDcluster* NextCluster();
93 inline AliTRDcluster* PrevCluster();
94 void Print(Option_t *o = "") const;
95 inline void ResetClusterIter(Bool_t forward = kTRUE);
97 void SetMomentum(Double_t mom){ fMom = mom;}
99 void SetDetector(Int_t d) { fDet = d; }
100 void SetDX(Float_t inDX) { fdX = inDX;}
101 void SetSnp(Double_t snp) { fSnp = snp;}
102 void SetTgl(Double_t tgl) { fTgl = tgl;}
103 void SetReconstructor(const AliTRDReconstructor *rec) {fReconstructor = rec;}
106 void Copy(TObject &ref) const;
109 const AliTRDReconstructor *fReconstructor;//! local reconstructor
110 AliTRDcluster **fClusterIter; //! clusters iterator
111 Char_t fClusterIdx; //! clusters iterator
112 Int_t fDet; // TRD detector
113 Float_t fMom; // Momentum estimate for tracklet [GeV/c]
114 Float_t fSnp; // sin of track with respect to x direction in XY plane
115 Float_t fTgl; // tg of track with respect to x direction in XZ plane
116 Float_t fdX; // length of time bin
117 Float_t fdEdx[knSlices]; // dE/dx measurements for tracklet
118 Double_t fCross[4]; // spatial parameters of the pad row crossing
119 Double_t fProb[AliPID::kSPECIES]; // PID probabilities
121 ClassDef(AliTRDseedV1, 2) // New TRD seed
125 //____________________________________________________________
126 inline Float_t AliTRDseedV1::GetChi2Z(const Float_t z) const
128 Float_t z1 = (z == 999.) ? fMeanz : z;
129 Float_t chi = fZref[0] - z1;
133 //____________________________________________________________
134 inline Float_t AliTRDseedV1::GetChi2Y(const Float_t y) const
136 Float_t y1 = (y == 999.) ? fYfitR[0] : y;
137 Float_t chi = fYref[0] - y1;
141 //____________________________________________________________
142 inline void AliTRDseedV1::Init(const AliRieman *rieman)
144 fZref[0] = rieman->GetZat(fX0);
145 fZref[1] = rieman->GetDZat(fX0);
146 fYref[0] = rieman->GetYat(fX0);
147 fYref[1] = rieman->GetDYat(fX0);
149 fChi2 = rieman->GetChi2();
152 //____________________________________________________________
153 inline AliTRDcluster* AliTRDseedV1::NextCluster()
155 // Mimic the usage of STL iterators.
158 fClusterIdx++; fClusterIter++;
159 while(fClusterIdx < AliTRDseed::knTimebins){
160 if(!(*fClusterIter)){
165 return *fClusterIter;
170 //____________________________________________________________
171 inline AliTRDcluster* AliTRDseedV1::PrevCluster()
173 // Mimic the usage of STL iterators.
176 fClusterIdx--; fClusterIter--;
177 while(fClusterIdx >= 0){
178 if(!(*fClusterIter)){
183 return *fClusterIter;
188 //____________________________________________________________
189 inline void AliTRDseedV1::ResetClusterIter(Bool_t forward)
191 // Mimic the usage of STL iterators.
192 // Facilitate the usage of NextCluster for forward like
193 // iterator (kTRUE) and PrevCluster for backward like iterator (kFALSE)
196 fClusterIter = &fClusters[0]; fClusterIter--;
199 fClusterIter = &fClusters[AliTRDseed::knTimebins-1]; fClusterIter++;
200 fClusterIdx=AliTRDseed::knTimebins;