BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
FTTrack Class Reference

#include <FTTrack.h>

Public Member Functions

 FTTrack (FTList< FTSegment * > &axial_segments, float kappa, float chi2_kappa)
 constructor
 ~FTTrack ()
 destructor
int r_phiFit ()
 do r-phi circle fit
int r_phiReFit (float vx, float xy, int vtx_flag)
 do r-phi refit
int r_phi2Fit (float vx, float xy, int vtx_flag)
int r_phi3Fit (int l, float vx, float xy, int vtx_flag)
int r_phi4Fit (float vx, float xy, int vtx_flag)
int s_zFit ()
 do s-z linear fit
void updateSZ ()
 update s and z information for linking
int linkStereoSegments ()
 link stereo segments by tanLambda
Helixhelix () const
 returns helix parameters
const Lpavlpav () const
 returns lpav
const zavZav () const
 returns zav
const FTList< FTSegment * > & axial_segments ()
 returns axial segments
const FTList< FTSegment * > & stereo_segments ()
 returns stereo_segments
float kappa_tmp () const
 returns kappa at linking
float chi2_kappa_tmp () const
 returns sigmaKappa at linking
float d_z (float s, float z) const
void printout ()
float SigmaZ (float z)
 add z for culculation of tanLambda
float SigmaS (float s)
 add s for culculation of tanLambda
float SigmaSS (float ss)
 add s for culculation of dz, tanLambda
float SigmaSZ (float sz)
 add s for culculation of dz, tanLambda
void append_stereo (FTSegment *, float s, float z)
 append stereo segment to the stereo segment list
void append_stereo_cache (FTSegment *)
 append stereo segment to the cache
int get_nhits ()
 calculate the wire hits number
void setFTFinder (FTFinder *)

Public Attributes

float minPt
float minDr
float xtCoEff
float Testime
Lpav_la
zav_za
Helix_helix
FTList< FTSegment * > _axial_segments
FTList< FTSegment * > _stereo_segments
FTList< FTSegment * > _stereo_segments_cache
FTList< FTList< FTSegment * > > _stereo_segments_by_superLayer
union { 
   float   _kappa 
   float   _SigmaS 
}; 
union { 
   float   _chi2_kappa 
   float   _SigmaSS 
}; 
float _SigmaZ
float _SigmaSZ

Static Public Attributes

static MdcParameterparam = MdcParameter::instance()

Detailed Description

Definition at line 19 of file FTTrack.h.

Constructor & Destructor Documentation

◆ FTTrack()

FTTrack::FTTrack ( FTList< FTSegment * > & axial_segments,
float kappa,
float chi2_kappa )

constructor

Definition at line 35 of file FTTrack.cxx.

36 : _la( nullptr )
37 , _za( nullptr )
38 , _helix( nullptr )
40 , _kappa( kappa )
41 , _chi2_kappa( chi2_kappa ) {
42 StatusCode scmgn = Gaudi::svcLocator()->service( "MagneticFieldSvc", m_pmgnIMF );
43 if ( scmgn != StatusCode::SUCCESS )
44 { std::cout << "Unable to open MagneticField service" << std::endl; }
45}
Helix * _helix
Definition FTTrack.h:118
float _kappa
Definition FTTrack.h:126
float _chi2_kappa
Definition FTTrack.h:131
zav * _za
Definition FTTrack.h:117
const FTList< FTSegment * > & axial_segments()
returns axial segments
Definition FTTrack.cxx:54
Lpav * _la
Definition FTTrack.h:116
FTList< FTSegment * > _axial_segments
Definition FTTrack.h:119

◆ ~FTTrack()

FTTrack::~FTTrack ( )

destructor

Definition at line 47 of file FTTrack.cxx.

47 {
48 // for ( auto i : _axial_segments ) delete i; // FIXME: this is a memory leak
49 // delete _la;
50 // delete _za;
51 // delete _helix;
52}

Member Function Documentation

◆ append_stereo()

void FTTrack::append_stereo ( FTSegment * src,
float s = 0,
float z = 0 )

append stereo segment to the stereo segment list

Definition at line 71 of file FTTrack.cxx.

71 {
72 _stereo_segments.push_back( src );
73 _SigmaS += s;
74 _SigmaZ += z;
75 _SigmaSZ += s * z;
76 _SigmaSS += s * s;
77}
XmlRpcServer s
FTList< FTSegment * > _stereo_segments
Definition FTTrack.h:120
float _SigmaSZ
Definition FTTrack.h:136
float _SigmaS
Definition FTTrack.h:127
float _SigmaZ
Definition FTTrack.h:135
float _SigmaSS
Definition FTTrack.h:132

◆ append_stereo_cache()

void FTTrack::append_stereo_cache ( FTSegment * src)

append stereo segment to the cache

Definition at line 67 of file FTTrack.cxx.

67 {
68 _stereo_segments_cache.push_back( src );
69}
FTList< FTSegment * > _stereo_segments_cache
Definition FTTrack.h:121

◆ axial_segments()

const FTList< FTSegment * > & FTTrack::axial_segments ( )

returns axial segments

Definition at line 54 of file FTTrack.cxx.

54{ return _axial_segments; }

Referenced by FTTrack().

◆ chi2_kappa_tmp()

float FTTrack::chi2_kappa_tmp ( ) const

returns sigmaKappa at linking

Definition at line 57 of file FTTrack.cxx.

57{ return _chi2_kappa; }

◆ d_z()

float FTTrack::d_z ( float s,
float z ) const

returns difference between z and estimated z at stereo segment linking if its valid

Definition at line 79 of file FTTrack.cxx.

79 {
80 int n = _stereo_segments.size();
81 if ( !n ) return 0;
82 float Dz = ( n == 1 ) ? z - s * _SigmaZ / _SigmaS
83 : z - ( s * ( _SigmaSZ - _SigmaS * _SigmaZ ) + _SigmaSS * _SigmaZ -
84 _SigmaS * _SigmaSZ ) /
85 ( _SigmaSS - _SigmaS * _SigmaS );
86 return ( Dz < 10 * ( 7 - n ) ) ? Dz : 9999.;
87}
const Int_t n

Referenced by linkStereoSegments(), and updateSZ().

◆ get_nhits()

int FTTrack::get_nhits ( )

calculate the wire hits number

Definition at line 657 of file FTTrack.cxx.

657 {
658 int nhits = 0;
659 for ( auto i : _axial_segments ) nhits += i->wireHits().size();
660 for ( auto i : _stereo_segments ) nhits += i->wireHits().size();
661 return nhits;
662}

◆ helix()

Helix * FTTrack::helix ( ) const

returns helix parameters

Definition at line 60 of file FTTrack.cxx.

60{ return _helix; }

◆ kappa_tmp()

float FTTrack::kappa_tmp ( ) const

returns kappa at linking

Definition at line 56 of file FTTrack.cxx.

56{ return _kappa; }

◆ linkStereoSegments()

int FTTrack::linkStereoSegments ( )

link stereo segments by tanLambda

Definition at line 466 of file FTTrack.cxx.

466 {
467 // delete _stereo_segments_cache;
469 for ( int i = 0; i != n; i++ )
470 {
471 FTList<FTSegment*>& segments = _stereo_segments_by_superLayer[i];
472
473 int m = segments.size();
474 float min_D_z = 9998.;
475 float S = 0.;
476 float Z = 0.;
477 FTSegment* selected = nullptr;
478 for ( int j = 0; j != m; j++ )
479 {
480 FTSegment* s = segments[j];
481 float s_tmp = s->s();
482 float z_tmp = s->z();
483 double D_z = fabs( d_z( s_tmp, z_tmp ) );
484 if ( D_z < min_D_z )
485 {
486 selected = s;
487 min_D_z = D_z;
488 S = s_tmp;
489 Z = z_tmp;
490 }
491 }
492 if ( selected )
493 {
494 _stereo_segments.push_back( selected );
495 _SigmaS += S;
496 _SigmaZ += Z;
497 _SigmaSZ += S * Z;
498 _SigmaSS += S * S;
499 }
500 }
501
502 // for ( auto i : _stereo_segments_by_superLayer )
503 // {
504 // for ( auto j : i ) delete j;
505 // }
506
507 return 0;
508}
int selected
FTList< FTList< FTSegment * > > _stereo_segments_by_superLayer
Definition FTTrack.h:122
float d_z(float s, float z) const
Definition FTTrack.cxx:79

◆ lpav()

const Lpav & FTTrack::lpav ( ) const

returns lpav

Definition at line 58 of file FTTrack.cxx.

58{ return *_la; }

◆ printout()

void FTTrack::printout ( )

printout _tracks infomation added by X.-R. Lu

Definition at line 665 of file FTTrack.cxx.

665 {
666 for ( auto i : _axial_segments ) i->printout();
667 for ( auto i : _stereo_segments ) i->printout();
668}

◆ r_phi2Fit()

int FTTrack::r_phi2Fit ( float vx,
float xy,
int vtx_flag )

Definition at line 308 of file FTTrack.cxx.

308 {
309 if ( vtx_flag ) _la->fit( vx, vy, 20 * _la->chisq() / _la->nc() );
310 int n = _axial_segments.size();
311 _la->clear();
312
313 int k = 0, l = 0;
314
315 float temp = 0;
316 for ( int i = 0; i != n; i++ )
317 {
318 FTList<FTWire*>& hits = _axial_segments[i]->wireHits();
319
320 for ( auto it = hits.begin(); it != hits.end(); it++ )
321 {
322 k++;
323 FTWire& h = **it;
324
325 const float x = h.x();
326 const float y = h.y();
327 double d0 = _la->d( (double)x, (double)y );
328 float cellsize = h.layer()->csize();
329 if ( m_ftFinder->evtTiming )
330 {
331 float time = h.time() + m_ftFinder->evtTiming;
332 if ( time < -100 ) continue;
333 h.distance( m_ftFinder->t2x( h.layer(), time ) );
334 }
335 float delta = h.distance() / h.layer()->r();
336 if ( fabs( d0 ) > 0.5 * cellsize ) continue; // remove bad hits
337 if ( h.distance() < 0.1 || h.distance() > 0.6 ) continue;
338
339 if ( d0 > 0 )
340 { // left or right
342 d0 = -d0;
343 }
344 else
345 {
347 delta = -delta;
348 }
349
350 _la->add_point( x - delta * y, y + delta * x, 1 );
351
352 if ( temp < fabs( h.distance() + d0 ) )
353 {
354 temp = fabs( h.distance() + d0 );
355 l = k;
356 }
357 }
358 }
359 HepVector b = _la->Hpar( m_ftFinder->pivot );
360 double chi2 = _la->fit(); // refit using drift distance
361
362 if ( k > 5 ) { return l; }
363 else { return -99; }
364}
Double_t x[10]
Double_t time
#define FTWireHitRight
Definition FTWire.h:14
#define FTWireHitLeft
Definition FTWire.h:15
const float r() const
returns r form origin
Definition FTLayer.h:35
double csize() const
returns cell size
Definition FTLayer.h:53
float time() const
rerurns TDC time(after t0 subtraction)
Definition FTWire.h:87
FTLayer * layer() const
returns layer
Definition FTWire.h:60
void stateOR(const unsigned mask)
set state bit
Definition FTWire.h:117
const float x() const
returns position x
Definition FTWire.h:48
float distance() const
returns drift distance
Definition FTWire.h:66
const float y() const
returns position y
Definition FTWire.h:51

◆ r_phi3Fit()

int FTTrack::r_phi3Fit ( int l,
float vx,
float xy,
int vtx_flag )

Definition at line 366 of file FTTrack.cxx.

366 {
367 if ( vtx_flag ) _la->fit( vx, vy, 20 * _la->chisq() / _la->nc() );
368 int n = _axial_segments.size();
369 _la->clear();
370 int k = 0;
371 for ( int i = 0; i ^ n; i++ )
372 {
373 FTList<FTWire*>& hits = _axial_segments[i]->wireHits();
374
375 for ( auto it = hits.begin();
376 it != hits.end(); ) // erase operation occurs, so no "it++" here
377 {
378 k++;
379 FTWire& h = **it;
380
381 const float x = h.x();
382 const float y = h.y();
383 double d0 = _la->d( (double)x, (double)y );
384 float cellsize = h.layer()->csize();
385 if ( m_ftFinder->evtTiming )
386 {
387 float time = h.time() + m_ftFinder->evtTiming;
388 if ( time < -100 ) continue;
389 h.distance( m_ftFinder->t2x( h.layer(), time ) );
390 // h.distance(time*40*0.0001);
391 }
392 float delta = h.distance() / h.layer()->r();
393 if ( fabs( d0 ) > 0.5 * cellsize ) continue; // remove bad hits
394 if ( d0 > 0 )
395 { // left or right
397 d0 = -d0;
398 }
399 else
400 {
402 delta = -delta;
403 }
404 if ( k == l )
405 {
406 it = hits.erase( it );
407 continue;
408 }
409 _la->add_point( x - delta * y, y + delta * x, 1 );
410
411 it++;
412 }
413 }
414 HepVector b = _la->Hpar( m_ftFinder->pivot );
415 double chi2 = _la->fit(); // refit using drift distance
416 return 1;
417}
std::vector< T >::iterator erase(typename std::vector< T >::iterator it)
Definition FTList.h:10

◆ r_phi4Fit()

int FTTrack::r_phi4Fit ( float vx,
float xy,
int vtx_flag )

Definition at line 419 of file FTTrack.cxx.

419 {
420 if ( vtx_flag ) _la->fit( vx, vy, 20 * _la->chisq() / _la->nc() );
421
422 _la->clear();
423
424 int n = _axial_segments.size();
425 for ( int i = 0; i != n; i++ )
426 {
427 FTList<FTWire*>& hits = _axial_segments[i]->wireHits();
428
429 for ( auto it = hits.begin(); it != hits.end(); it++ )
430 {
431 FTWire* h = *it;
432
433 const float x = h->x();
434 const float y = h->y();
435 double d0 = _la->d( (double)x, (double)y );
436 float cellsize = h->layer()->csize();
437 if ( m_ftFinder->evtTiming )
438 {
439 float time = h->time() + m_ftFinder->evtTiming;
440 if ( time < -100 ) continue;
441 h->distance( m_ftFinder->t2x( h->layer(), time ) );
442 }
443 float delta = h->distance() / h->layer()->r();
444 if ( fabs( d0 ) > 0.5 * cellsize ) continue; // remove bad hits
445 if ( d0 > 0 )
446 { // left or right
448 d0 = -d0;
449 }
450 else
451 {
453 delta = -delta;
454 }
455
456 _la->add_point( x - delta * y, y + delta * x, 1 );
457 h->setChi2( h->distance() + d0 );
458 }
459 }
460 HepVector b = _la->Hpar( m_ftFinder->pivot );
461 double chi2 = _la->fit(); // refit using drift distance
462
463 return 1;
464}
void setChi2(float chi2)
set residual fit chi2
Definition FTWire.h:141

◆ r_phiFit()

int FTTrack::r_phiFit ( )

do r-phi circle fit

Definition at line 120 of file FTTrack.cxx.

120 {
121 IMessageSvc* msgSvc;
122 Gaudi::svcLocator()->service( "MessageSvc", msgSvc ).ignore();
123
124 MsgStream log( msgSvc, "FTFinder" );
125
126 // static const float alpha(333.564095);
127 if ( fabs( _kappa ) > 1.2 / param->_minPt ) return 0;
128
129 _la = new Lpav;
130 int n = _axial_segments.size();
131 for ( int i = 0; i != n; i++ )
132 {
133 FTList<FTWire*>& hits = _axial_segments[i]->wireHits();
134
135 for ( auto it = hits.begin();
136 it != hits.end(); ) // erase operation occurs, so no "it++" here
137 {
138 FTWire& h = **it;
140 {
141 it = hits.erase( it );
142 continue;
143 }
144
145 double par = h.distance() / ( 0.25 * h.layer()->csize() );
146 _la->add_point( (double)h.x(), (double)h.y(), exp( -par * par ) );
147
148 it++;
149 }
150 }
151
152 double chi2 = _la->fit();
153 HepVector a = _la->Hpar( m_ftFinder->pivot );
154
155 log << MSG::DEBUG << " chi2/_la cut(1): " << chi2 << " / " << _la->nc() << " a1("
156 << param->_minDr << "): " << a( 1 ) << " a3(" << 1.05 / param->_minPt << "):" << a( 3 )
157 << endmsg;
158
159 if ( chi2 / _la->nc() > 1. ) return 0;
160 if ( fabs( a( 3 ) ) > ( 1.05 / param->_minPt ) ) return 0;
161 if ( fabs( a( 1 ) ) > param->_minDr ) return 0;
162
163 _la->clear();
164
165 log << MSG::DEBUG << " passed chi2/_la, a(3) and a(1) cut" << endmsg;
166
167 int layer0 = 0;
168 for ( int i = 0; i != n; i++ )
169 {
170 FTList<FTWire*>& hits = _axial_segments[i]->wireHits();
171 if ( !_axial_segments[i]->superLayer()->superLayerId() ) layer0 = 1;
172 int m = hits.size();
173
174 for ( auto it = hits.begin(); it != hits.end(); it++ )
175 {
176 FTWire& h = **it;
177 const float x = h.x();
178 const float y = h.y();
179 double d0 = _la->d( (double)x, (double)y );
180 float delta = h.distance() / h.layer()->r();
181 if ( fabs( d0 ) > 0.7 * h.layer()->csize() ) continue; // remove bad hits
182 if ( d0 > 0 )
183 { // left or right
184 d0 = -d0;
185 }
186 else { delta = -delta; }
187 _la->add_point( x - delta * y, y + delta * x, 1 );
188 }
189 }
190
191 if ( layer0 == 0 )
192 { // salvage hits from complecated segments in layer0
193 FTList<FTSegment*>& salvage = m_ftFinder->superLayer( 0 )->complecated_segments();
194 HepVector center = _la->center();
195 const float xc = center( 1 );
196 const float yc = center( 2 );
197 const float rc = a( 1 ) + ( -1. / 2.99792458 / m_pmgnIMF->getReferField() ) /
198 a( 3 ); // rho+drho(signed)
199 int nn = salvage.size();
200
201 for ( int i = 0; i != nn; i++ )
202 {
203 int salvaged = 0;
204 FTList<FTWire*>& hits = salvage[i]->wireHits();
205
206 for ( auto it = hits.begin(); it != hits.end(); it++ )
207 {
208 FTWire& h = **it;
209 float x = h.x();
210 float y = h.y();
211 float r = h.layer()->r();
212 if ( ( y * xc - x * yc ) / ( r * rc ) < 0.707 ) break;
213 double d0 = _la->d( (double)x, (double)y );
214 float delta = h.distance() / r;
215 if ( fabs( d0 ) > 0.7 * h.layer()->csize() ) continue; // remove bad hits
216 if ( d0 > 0 )
217 { // left or right
219 d0 = -d0;
220 }
221 else
222 {
224 delta = -delta;
225 }
226 _la->add_point( x - delta * y, y + delta * x, 1 );
227 salvaged = 1;
228 }
229
230 if ( salvaged )
231 {
232 _axial_segments.push_back( salvage[i] );
233 break;
234 }
235 }
236 }
237 chi2 = _la->fit(); // refit using drift distance
238
239 _stereo_segments.clear();
242
243 _za = new zav;
244 _SigmaS = 0.;
245 _SigmaZ = 0.;
246 _SigmaSS = 0.;
247 _SigmaSZ = 0.;
248 return 1;
249}
EvtComplex exp(const EvtComplex &c)
#define FTWireFittingInvalid
Definition FTWire.h:17
IMessageSvc * msgSvc()
static MdcParameter * param
Definition FTTrack.h:123
unsigned stateAND(const unsigned mask) const
returns state bit
Definition FTWire.h:81

◆ r_phiReFit()

int FTTrack::r_phiReFit ( float vx,
float xy,
int vtx_flag )

do r-phi refit

Definition at line 251 of file FTTrack.cxx.

251 {
252 if ( vtx_flag ) _la->fit( vx, vy, 20 * _la->chisq() / _la->nc() );
253
254 _la->clear();
255
256 int n = _axial_segments.size();
257 for ( int i = 0; i != n; i++ )
258 {
259 FTList<FTWire*>& hits = _axial_segments[i]->wireHits();
260
261 for ( auto it = hits.begin(); it != hits.end(); it++ )
262 {
263 FTWire& h = **it;
264 const float x = h.x();
265 const float y = h.y();
266 double d0 = _la->d( (double)x, (double)y );
267 float cellsize = h.layer()->csize();
268 if ( m_ftFinder->evtTiming )
269 {
270 float time = h.time() + m_ftFinder->evtTiming;
271 if ( time < -100 ) continue; // discard the bad TDC time
272 h.distance( m_ftFinder->t2x( h.layer(), time ) );
273 // h.distance(time*40*0.0001);
274 }
275 float delta = h.distance() / h.layer()->r();
276 if ( fabs( d0 ) > 0.5 * cellsize ) continue; // remove bad hits
277 if ( d0 > 0 )
278 { // left or right
280 d0 = -d0;
281 }
282 else
283 {
285 delta = -delta;
286 }
287 h.setChi2( h.distance() + d0 );
288
289#ifndef OnlineMode
290 // fill histogram
291 g_sigmaxy->fill( h.distance() + d0, 1.0 );
292#endif
293
294 _la->add_point( x - delta * y, y + delta * x, 1 );
295 }
296 }
297
298 HepVector b = _la->Hpar( m_ftFinder->pivot );
299 double chi2 = _la->fit(); // refit using drift distance
300
301#ifndef OnlineMode
302 g_chi2xy->fill( chi2 / _la->nc(), 1.0 );
303#endif
304
305 return 1;
306}
AIDA::IHistogram1D * g_chi2xy
Definition ntupleItem.h:37
AIDA::IHistogram1D * g_sigmaxy
Definition ntupleItem.h:35

◆ s_zFit()

int FTTrack::s_zFit ( )

do s-z linear fit

Definition at line 510 of file FTTrack.cxx.

510 {
511 IMessageSvc* msgSvc;
512 Gaudi::svcLocator()->service( "MessageSvc", msgSvc ).ignore();
513
514 MsgStream log( msgSvc, "FTFinder" );
515
516 HepVector a = _la->Hpar( m_ftFinder->pivot );
517
518 int n = _stereo_segments.size();
519 log << MSG::DEBUG << "number of stereo segments: " << n << endmsg;
520 if ( n < ( param->_nseg ) )
521 {
522 a( 4 ) = -9999.;
523 a( 5 ) = -9999.;
524 _helix = new Helix( m_ftFinder->pivot, a );
525 log << MSG::DEBUG << "cut by _nseg" << param->_nseg << endmsg;
526 return 0;
527 }
528
529 FTList<double> zList;
530 FTList<double> sList;
531 FTList<FTWire*> hList;
532 for ( int i = 0; i != n; i++ )
533 {
534 FTList<FTWire*>& hits = _stereo_segments[i]->wireHits();
535
536 for ( auto it = hits.begin(); it != hits.end(); it++ )
537 {
538 FTWire& h = **it;
539
540 double z;
541 if ( !( h.z( *_la, z ) ) ) continue;
542
543 double s = _la->s( h.layer()->r() );
544 float cellsize = h.layer()->csize();
545 log << MSG::DEBUG << "cellsize: " << cellsize << endmsg;
546
547 if ( m_ftFinder->evtTiming )
548 {
549 float time = h.time() + m_ftFinder->evtTiming;
550 if ( time < -100 ) continue; // discard the bad TDC time
551 double distance = m_ftFinder->t2x( h.layer(), time );
552 h.distance( distance );
553 log << MSG::DEBUG << "m_ftFinder->evtTiming: " << m_ftFinder->evtTiming
554 << " TDC time: " << h.time() << " distance: " << distance << endmsg;
555 }
556
557 double par = h.distance() / ( 0.25 * cellsize );
558 _za->add( s, z, exp( -par * par ) );
559 sList.push_back( s );
560 zList.push_back( z );
561 hList.push_back( &h );
562 }
563 }
564
565 if ( hList.size() < ( param->_nlength ) )
566 {
567 a( 4 ) = -9999.;
568 a( 5 ) = -9999.;
569 _helix = new Helix( m_ftFinder->pivot, a );
570 log << MSG::DEBUG << "cut by _nlength: " << param->_nlength << endmsg;
571 return 0;
572 }
573
574 double chi2 = _za->calculate();
575 _za->clear();
576
577 // ----------------------------------
578 for ( auto it = std::make_tuple( zList.begin(), sList.begin(), hList.begin() );
579 it != std::make_tuple( zList.end(), sList.end(), hList.end() ); )
580 {
581 auto itz = std::get<0>( it );
582 auto its = std::get<1>( it );
583 auto ith = std::get<2>( it );
584
585 double d = _za->d( *its, *itz );
586 float z_distance = ( *ith )->distance_z();
587
588 if ( fabs( fabs( d ) - z_distance ) > ( param->_z_cut1 ) )
589 {
590 log << MSG::DEBUG << "cut by _z_cut1: " << param->_z_cut1 << endmsg;
591
592 itz = zList.erase( itz );
593 its = sList.erase( its );
594 ith = hList.erase( ith );
595 it = std::make_tuple( itz, its, ith );
596 continue;
597 }
598
599 _za->add( *its, ( d > 0 ) ? *itz - z_distance : *itz + z_distance, 1. );
600
601 it = std::make_tuple( ++itz, ++its, ++ith );
602 }
603
604 if ( _za->nc() < ( param->_nc ) )
605 {
606 a( 4 ) = -9999.;
607 a( 5 ) = -9999.;
608 _helix = new Helix( m_ftFinder->pivot, a );
609 log << MSG::DEBUG << "cut by _nc: " << param->_nc << endmsg;
610 return 0;
611 }
612
613 chi2 = _za->calculate();
614 _za->clear();
615
616 for ( auto it = std::make_tuple( zList.begin(), sList.begin(), hList.begin() );
617 it != std::make_tuple( zList.end(), sList.end(), hList.end() );
618 it = std::make_tuple( ++std::get<0>( it ), ++std::get<1>( it ), ++std::get<2>( it ) ) )
619 {
620 auto itz = std::get<0>( it );
621 auto its = std::get<1>( it );
622 auto ith = std::get<2>( it );
623
624 double d = _za->d( *its, *itz );
625 float z_distance = ( *ith )->distance_z();
626 ( *ith )->setChi2( fabs( d ) - z_distance );
627
628#ifndef OnlineMode
629 // fill ntuple
630 g_sigmaz->fill( fabs( d ) - z_distance, 1.0 );
631#endif
632
633 if ( fabs( fabs( d ) - z_distance ) > ( param->_z_cut2 ) ) continue;
634 _za->add( *its, ( d > 0 ) ? *itz - z_distance : *itz + z_distance, 1. );
635 }
636
637 if ( _za->nc() < ( param->_nc ) )
638 {
639 a( 4 ) = -9999.;
640 a( 5 ) = -9999.;
641 _helix = new Helix( m_ftFinder->pivot, a );
642 log << MSG::DEBUG << "cut by _nc" << param->_nc << endmsg;
643 return 0;
644 }
645
646 chi2 = _za->calculate();
647#ifndef OnlineMode
648 g_chi2sz->fill( chi2 / _za->nc(), 1.0 );
649#endif
650
651 a( 4 ) = _za->b(); // dz
652 a( 5 ) = _za->a(); // tanLambda
653 _helix = new Helix( m_ftFinder->pivot, a );
654 return 1;
655}
AIDA::IHistogram1D * g_sigmaz
Definition ntupleItem.h:36
AIDA::IHistogram1D * g_chi2sz
Definition ntupleItem.h:38
int z(const Lpav &la, double &z) const
returns z for track la
Definition FTWire.cxx:157

◆ setFTFinder()

void FTTrack::setFTFinder ( FTFinder * finder)

Definition at line 65 of file FTTrack.cxx.

65{ m_ftFinder = finder; }

◆ SigmaS()

float FTTrack::SigmaS ( float s)

add s for culculation of tanLambda

Definition at line 62 of file FTTrack.cxx.

62{ return _SigmaS += s; }

◆ SigmaSS()

float FTTrack::SigmaSS ( float ss)

add s for culculation of dz, tanLambda

Definition at line 64 of file FTTrack.cxx.

64{ return _SigmaSS += ss; }

◆ SigmaSZ()

float FTTrack::SigmaSZ ( float sz)

add s for culculation of dz, tanLambda

Definition at line 63 of file FTTrack.cxx.

63{ return _SigmaSZ += sz; }

◆ SigmaZ()

float FTTrack::SigmaZ ( float z)

add z for culculation of tanLambda

Definition at line 61 of file FTTrack.cxx.

61{ return _SigmaZ += z; }

◆ stereo_segments()

const FTList< FTSegment * > & FTTrack::stereo_segments ( )

returns stereo_segments

Definition at line 55 of file FTTrack.cxx.

55{ return _stereo_segments; }

◆ updateSZ()

void FTTrack::updateSZ ( )

update s and z information for linking

Definition at line 89 of file FTTrack.cxx.

89 {
90 int n = _stereo_segments_cache.size();
91 if ( n == 1 )
92 {
93 FTSegment* s = _stereo_segments_cache[0];
94 float s_tmp = s->s();
95 float z_tmp = s->z();
96 if ( d_z( s_tmp, z_tmp ) < 9998. )
97 {
98 _SigmaS += s_tmp;
99 _SigmaZ += z_tmp;
100 _SigmaSS += s_tmp * s_tmp;
101 _SigmaSZ += s_tmp * z_tmp;
102 _stereo_segments.push_back( s );
103 }
104 // _stereo_segments_cache.clear();
105 }
106 else if ( n )
107 {
109 // _stereo_segments_cache = FTList<FTSegment*>( 3 );
110 }
112}

◆ Zav()

const zav & FTTrack::Zav ( ) const

returns zav

Definition at line 59 of file FTTrack.cxx.

59{ return *_za; }

Member Data Documentation

◆ [union]

union { ... } FTTrack

◆ [union]

union { ... } FTTrack

◆ _axial_segments

FTList<FTSegment*> FTTrack::_axial_segments

◆ _chi2_kappa

float FTTrack::_chi2_kappa

Definition at line 131 of file FTTrack.h.

Referenced by chi2_kappa_tmp(), and FTTrack().

◆ _helix

Helix* FTTrack::_helix

Definition at line 118 of file FTTrack.h.

Referenced by FTTrack(), helix(), and s_zFit().

◆ _kappa

float FTTrack::_kappa

Definition at line 126 of file FTTrack.h.

Referenced by FTTrack(), kappa_tmp(), and r_phiFit().

◆ _la

Lpav* FTTrack::_la

Definition at line 116 of file FTTrack.h.

Referenced by FTTrack(), lpav(), r_phi2Fit(), r_phi3Fit(), r_phi4Fit(), r_phiFit(), r_phiReFit(), and s_zFit().

◆ _SigmaS

float FTTrack::_SigmaS

Definition at line 127 of file FTTrack.h.

Referenced by append_stereo(), d_z(), linkStereoSegments(), r_phiFit(), SigmaS(), and updateSZ().

◆ _SigmaSS

float FTTrack::_SigmaSS

Definition at line 132 of file FTTrack.h.

Referenced by append_stereo(), d_z(), linkStereoSegments(), r_phiFit(), SigmaSS(), and updateSZ().

◆ _SigmaSZ

float FTTrack::_SigmaSZ

Definition at line 136 of file FTTrack.h.

Referenced by append_stereo(), d_z(), linkStereoSegments(), r_phiFit(), SigmaSZ(), and updateSZ().

◆ _SigmaZ

float FTTrack::_SigmaZ

Definition at line 135 of file FTTrack.h.

Referenced by append_stereo(), d_z(), linkStereoSegments(), r_phiFit(), SigmaZ(), and updateSZ().

◆ _stereo_segments

FTList<FTSegment*> FTTrack::_stereo_segments

◆ _stereo_segments_by_superLayer

FTList<FTList<FTSegment*> > FTTrack::_stereo_segments_by_superLayer

Definition at line 122 of file FTTrack.h.

Referenced by linkStereoSegments(), r_phiFit(), and updateSZ().

◆ _stereo_segments_cache

FTList<FTSegment*> FTTrack::_stereo_segments_cache

Definition at line 121 of file FTTrack.h.

Referenced by append_stereo_cache(), r_phiFit(), and updateSZ().

◆ _za

zav* FTTrack::_za

Definition at line 117 of file FTTrack.h.

Referenced by FTTrack(), r_phiFit(), s_zFit(), and Zav().

◆ minDr

float FTTrack::minDr

Definition at line 104 of file FTTrack.h.

◆ minPt

float FTTrack::minPt

Definition at line 103 of file FTTrack.h.

◆ param

MdcParameter * FTTrack::param = MdcParameter::instance()
static

Definition at line 123 of file FTTrack.h.

Referenced by r_phiFit(), and s_zFit().

◆ Testime

float FTTrack::Testime

Definition at line 106 of file FTTrack.h.

◆ xtCoEff

float FTTrack::xtCoEff

Definition at line 105 of file FTTrack.h.


The documentation for this class was generated from the following files: