]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDseedV1.h
Additional setters and getters
[u/mrichter/AliRoot.git] / TRD / AliTRDseedV1.h
CommitLineData
e4f2f73d 1#ifndef ALITRDSEEDV1_H
2#define ALITRDSEEDV1_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
e44586fb 4* See cxx source for full Copyright notice */
e4f2f73d 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
ae4e8b84 18#ifndef ALITRDGEOMETRY_H
19#include "AliTRDgeometry.h"
20#endif
21
0906e73e 22#ifndef ALIPID_H
23#include "AliPID.h"
24#endif
25
e4f2f73d 26#ifndef ALIRIEMAN_H
27#include "AliRieman.h"
28#endif
29
30class TTreeSRedirector;
31
32class AliRieman;
33
eb38ed55 34class AliTRDtrackingChamber;
e4f2f73d 35class AliTRDcluster;
f3d3af1b 36class AliTRDtrackV1;
3a039a31 37class AliTRDReconstructor;
e4f2f73d 38class AliTRDseedV1 : public AliTRDseed
39{
fbb2ea06 40
0906e73e 41 public:
42
e44586fb 43 enum {
44 knSlices = 10
45 };
2e2915e7 46 // bits from 0-13 are reserved by ROOT (see TObject.h)
e44586fb 47 enum AliTRDtrackletStatus {
2e2915e7 48 kOwner = BIT(14)
49 , kRowCross = BIT(15)
e44586fb 50 };
51
ae4e8b84 52 AliTRDseedV1(Int_t det = -1);
e44586fb 53 ~AliTRDseedV1();
54 AliTRDseedV1(const AliTRDseedV1 &ref);
55 AliTRDseedV1& operator=(const AliTRDseedV1 &ref);
56
203967fc 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);
65
66 Bool_t Init(AliTRDtrackV1 *track);
e44586fb 67 inline void Init(const AliRieman *fit);
203967fc 68 Bool_t IsEqual(const TObject *inTracklet) const;
e44586fb 69 Bool_t IsOwner() const { return TestBit(kOwner);}
70 Bool_t IsRowCross() const { return TestBit(kRowCross);}
71
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;
203967fc 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];}
e44586fb 79 Float_t GetdQdl(Int_t ic) const;
203967fc 80 Int_t GetDetector() const { return fDet;}
81 Double_t GetMomentum() const { return fMom;}
82 Int_t GetN() const { return fN2;}
e44586fb 83 Float_t GetQuality(Bool_t kZcorr) const;
ae4e8b84 84 Int_t GetPlane() const { return AliTRDgeometry::GetLayer(fDet); }
85
e44586fb 86 Double_t* GetProbability();
87 Double_t GetSnp() const { return fSnp;}
88 Double_t GetTgl() const { return fTgl;}
d2b9977a 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);}
e44586fb 91
ae4e8b84 92 inline AliTRDcluster* NextCluster();
71ea19a3 93 inline AliTRDcluster* PrevCluster();
e44586fb 94 void Print(Option_t *o = "") const;
71ea19a3 95 inline void ResetClusterIter(Bool_t forward = kTRUE);
ae4e8b84 96
203967fc 97 void SetMomentum(Double_t mom){ fMom = mom;}
29b87567 98 void SetOwner();
203967fc 99 void SetDetector(Int_t d) { fDet = d; }
bee2b41e 100 void SetDX(Float_t inDX) { fdX = inDX;}
203967fc 101 void SetSnp(Double_t snp) { fSnp = snp;}
102 void SetTgl(Double_t tgl) { fTgl = tgl;}
3a039a31 103 void SetReconstructor(const AliTRDReconstructor *rec) {fReconstructor = rec;}
e44586fb 104protected:
e4f2f73d 105
e44586fb 106 void Copy(TObject &ref) const;
e4f2f73d 107
e44586fb 108private:
0ae89c5d 109 const AliTRDReconstructor *fReconstructor;//! local reconstructor
ae4e8b84 110 AliTRDcluster **fClusterIter; //! clusters iterator
71ea19a3 111 Char_t fClusterIdx; //! clusters iterator
ae4e8b84 112 Int_t fDet; // TRD detector
e44586fb 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
e4f2f73d 120
ae4e8b84 121 ClassDef(AliTRDseedV1, 2) // New TRD seed
e4f2f73d 122
123};
124
125//____________________________________________________________
126inline Float_t AliTRDseedV1::GetChi2Z(const Float_t z) const
127{
e44586fb 128 Float_t z1 = (z == 999.) ? fMeanz : z;
129 Float_t chi = fZref[0] - z1;
130 return chi*chi;
e4f2f73d 131}
132
133//____________________________________________________________
134inline Float_t AliTRDseedV1::GetChi2Y(const Float_t y) const
135{
e44586fb 136 Float_t y1 = (y == 999.) ? fYfitR[0] : y;
137 Float_t chi = fYref[0] - y1;
138 return chi*chi;
e4f2f73d 139}
140
141//____________________________________________________________
0906e73e 142inline void AliTRDseedV1::Init(const AliRieman *rieman)
e4f2f73d 143{
e44586fb 144 fZref[0] = rieman->GetZat(fX0);
145 fZref[1] = rieman->GetDZat(fX0);
146 fYref[0] = rieman->GetYat(fX0);
147 fYref[1] = rieman->GetDYat(fX0);
55ef6967 148 fC = rieman->GetC();
149 fChi2 = rieman->GetChi2();
e4f2f73d 150}
151
ae4e8b84 152//____________________________________________________________
153inline AliTRDcluster* AliTRDseedV1::NextCluster()
154{
71ea19a3 155// Mimic the usage of STL iterators.
156// Forward iterator
157
ae4e8b84 158 fClusterIdx++; fClusterIter++;
71ea19a3 159 while(fClusterIdx < AliTRDseed::knTimebins){
160 if(!(*fClusterIter)){
161 fClusterIdx++;
162 fClusterIter++;
163 continue;
164 }
165 return *fClusterIter;
166 }
167 return 0x0;
168}
169
170//____________________________________________________________
171inline AliTRDcluster* AliTRDseedV1::PrevCluster()
172{
173// Mimic the usage of STL iterators.
174// Backward iterator
175
176 fClusterIdx--; fClusterIter--;
177 while(fClusterIdx >= 0){
178 if(!(*fClusterIter)){
179 fClusterIdx--;
180 fClusterIter--;
181 continue;
182 }
183 return *fClusterIter;
184 }
185 return 0x0;
186}
187
188//____________________________________________________________
189inline void AliTRDseedV1::ResetClusterIter(Bool_t forward)
190{
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)
194
195 if(forward){
196 fClusterIter = &fClusters[0]; fClusterIter--;
197 fClusterIdx=-1;
198 } else {
199 fClusterIter = &fClusters[AliTRDseed::knTimebins-1]; fClusterIter++;
200 fClusterIdx=AliTRDseed::knTimebins;
201 }
ae4e8b84 202}
203
e4f2f73d 204#endif
205
47d5d320 206
6e49cfdb 207