BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/MdcFastTrkAlg/MdcFastTrkAlg/FTTrack.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// Package: MdcFastTrkAlg
4// Module: FTTrack
5//
6// Description: track class for MdcFastTrkAlg
7//
8
9#ifndef FTTrack_FLAG_
10#define FTTrack_FLAG_
11
12#include"TrackUtil/Helix.h"
13#include"TrackUtil/Lpav.h"
14#include"TrackUtil/zav.h"
15
16#include "MdcFastTrkAlg/FTList.h"
17#include "MdcFastTrkAlg/FTSegment.h"
18#include "MdcFastTrkAlg/MdcParameter.h"
19#include "MagneticField/IMagneticFieldSvc.h"
20#include "MagneticField/MagneticFieldSvc.h"
21
22#ifndef ENABLE_BACKWARDS_COMPATIBILITY
24#endif
25
26class FTWire;
27class FTTrack{
28public:
29 /// constructor
30 FTTrack(FTList<FTSegment *> & axial_segments, float kappa, float chi2_kappa);
31
32 /// destructor
33 ~FTTrack();
34
35public: // public member functions
36 /// do r-phi circle fit
37 int r_phiFit(void);
38
39 /// do r-phi refit
40 int r_phiReFit(float vx, float xy, int vtx_flag);
41
42 // cut the largest residual hit when do r-phi fit
43 int r_phi2Fit(float vx, float xy, int vtx_flag);
44 int r_phi3Fit(int l, float vx, float xy, int vtx_flag);
45 int r_phi4Fit(float vx, float xy, int vtx_flag);
46
47 /// do s-z linear fit
48 int s_zFit(void);
49
50 /// update s and z information for linking
51 void updateSZ(void);
52
53 /// link stereo segments by tanLambda
54 int linkStereoSegments(void);
55
56public: // Selectors
57
58 /// returns helix parameters
59 Helix * helix(void) const;
60
61 /// returns lpav
62 const Lpav & lpav(void) const;
63
64 /// returns zav
65 const zav & Zav(void) const;
66
67 /// returns axial segments
69
70 /// returns stereo_segments
72
73 /// returns kappa at linking
74 float kappa_tmp(void) const;
75
76 /// returns sigmaKappa at linking
77 float chi2_kappa_tmp(void) const;
78
79 /// returns difference between z and estimated z
80 /// at stereo segment linking if its valid
81 float d_z(float s, float z) const;
82
83#ifndef OnlineMode
84 /// printout _tracks infomation
85 /// added by X.-R. Lu
86 void printout();
87#endif
88
89public: // Modifiers
90 /// add z for culculation of tanLambda
91 float SigmaZ(float z);
92
93 /// add s for culculation of tanLambda
94 float SigmaS(float s);
95
96 /// add s for culculation of dz, tanLambda
97 float SigmaSS(float ss);
98
99 /// add s for culculation of dz, tanLambda
100 float SigmaSZ(float sz);
101
102 /// append stereo segment to the stereo segment list
103 void append_stereo(FTSegment *, float s, float z);
104
105 /// append stereo segment to the cache
107
108 /// calculate the wire hits number
109 int get_nhits(void);
110
111public: // static data members
112 float minPt;
113 float minDr;
114 //const HepPoint3D pivot;
115 // int evtTiming;
116 float xtCoEff;
117 float Testime;
118
119public:
120 void setFTFinder(FTFinder*);
121
122private:
123 FTFinder* m_ftFinder;
124 IMagneticFieldSvc* m_pmgnIMF;
125
126public: // private data members
135
136 union{
137 float _kappa;
138 float _SigmaS;
139 };
140 union{
142 float _SigmaSS;
143 };
144 float _SigmaZ;
145 float _SigmaSZ;
146};
147
148
149//----------------------------------------------
150#ifdef FTTrack_NO_INLINE
151#define inline
152#else
153#undef inline
154#define FTTrack_INLINE_DEFINE_HERE
155#endif
156
157#ifdef FTTrack_INLINE_DEFINE_HERE
158
159inline
161 float kappa, float chi2_kappa)
162 : _la(NULL),
163 _za(NULL),
164 _helix(NULL),
165 _axial_segments(axial_segments),
166 _stereo_segments(NULL),
167 _stereo_segments_cache(NULL),
168 _stereo_segments_by_superLayer(NULL),
169 //_wireHits(*(new FTList<FTWire *>(50))),
170 _kappa(kappa),
171 _chi2_kappa(chi2_kappa)
172{
173 StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF);
174 if(scmgn!=StatusCode::SUCCESS) {
175 std::cout<< "Unable to open Magnetic field service"<<std::endl;
176 }
177}
178
179inline
181{
182 delete &_axial_segments;
183 delete _la;
184 delete _za;
185 delete _stereo_segments;
186 delete _helix;
187}
188
189inline
192{
193 return _axial_segments;
194}
195
196inline
199{
200 return *_stereo_segments;
201}
202
203inline
204void
206{
208}
209
210inline
211void
212FTTrack::append_stereo(FTSegment * src, float s = 0, float z = 0)
213{
215 _SigmaS += s;
216 _SigmaZ += z;
217 _SigmaSZ += s*z;
218 _SigmaSS += s*s;
219}
220
221inline
222float
224{
225 return _kappa;
226}
227
228inline
229float
231{
232 return _chi2_kappa;
233}
234
235inline
236const Lpav &
237FTTrack::lpav(void) const
238{
239 return *_la;
240}
241
242inline
243const zav &
244FTTrack::Zav(void) const
245{
246 return *_za;
247}
248
249inline
250Helix *
251FTTrack::helix(void) const
252{
253 return _helix;
254}
255
256inline
257float
259{
260 return _SigmaZ += z;
261}
262
263inline
264float
266{
267 return _SigmaS += s;
268}
269
270inline
271float
273{
274 return _SigmaSZ += sz;
275}
276
277inline
278float
280{
281 return _SigmaSS += ss;
282}
283
284inline
285float
286FTTrack::d_z(float s, float z) const
287{
288 int n = _stereo_segments->length();
289 if (!n) return 0;
290 float Dz = (n==1)
291 ? z - s*_SigmaZ/_SigmaS
294 return (Dz < 10*(7-n)) ? Dz : 9999.;
295}
296
297
298inline
299void
301{
303 if (n==1){
305 float s_tmp = s->s();
306 float z_tmp = s->z();
307 if (d_z(s_tmp,z_tmp) < 9998.){
308 _SigmaS += s_tmp;
309 _SigmaZ += z_tmp;
310 _SigmaSS += s_tmp*s_tmp;
311 _SigmaSZ += s_tmp*z_tmp;
313 }
315 }else if(n){
318 }
319}
320
321inline
322void
324{
325 m_ftFinder = finder;
326}
327
328#endif
329
330#undef inline
331
332#endif /* FTTrack_FLAG_ */
333
const Int_t n
XmlRpcServer s
Definition: HelloServer.cpp:11
HepGeom::Point3D< double > HepPoint3D
T & first(void) const
returns the first object in the list
void clear(void)
clear lists but the allocated memory remains same
int length(void) const
returns the length of the list
int append(const T &x)
append an object into the end of the list
Helix * helix(void) const
returns helix parameters
int r_phiReFit(float vx, float xy, int vtx_flag)
do r-phi refit
Definition: FTTrack.cxx:144
int get_nhits(void)
calculate the wire hits number
Definition: FTTrack.cxx:484
void append_stereo_cache(FTSegment *)
append stereo segment to the cache
FTTrack(FTList< FTSegment * > &axial_segments, float kappa, float chi2_kappa)
constructor
FTList< FTSegment * > & axial_segments(void) const
returns axial segments
float SigmaZ(float z)
add z for culculation of tanLambda
int r_phi4Fit(float vx, float xy, int vtx_flag)
Definition: FTTrack.cxx:295
void updateSZ(void)
update s and z information for linking
const zav & Zav(void) const
returns zav
int r_phiFit(void)
do r-phi circle fit
Definition: FTTrack.cxx:37
void printout()
Definition: FTTrack.cxx:499
FTList< FTList< FTSegment * > * > * _stereo_segments_by_superLayer
float SigmaSZ(float sz)
add s for culculation of dz, tanLambda
FTList< FTSegment * > & stereo_segments(void) const
returns stereo_segments
float SigmaS(float s)
add s for culculation of tanLambda
const Lpav & lpav(void) const
returns lpav
void append_stereo(FTSegment *, float s, float z)
append stereo segment to the stereo segment list
int r_phi3Fit(int l, float vx, float xy, int vtx_flag)
Definition: FTTrack.cxx:249
float SigmaSS(float ss)
add s for culculation of dz, tanLambda
float kappa_tmp(void) const
returns kappa at linking
int r_phi2Fit(float vx, float xy, int vtx_flag)
Definition: FTTrack.cxx:191
int s_zFit(void)
do s-z linear fit
Definition: FTTrack.cxx:378
int linkStereoSegments(void)
link stereo segments by tanLambda
Definition: FTTrack.cxx:342
float chi2_kappa_tmp(void) const
returns sigmaKappa at linking