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

Helix parameter class. More...

#include <Helix.h>

Public Member Functions

 Ext_Helix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Constructor with pivot, helix parameter a, and its error matrix.
 Ext_Helix (const HepPoint3D &pivot, const HepVector &a)
 Constructor without error matrix.
 Ext_Helix (const HepPoint3D &position, const Hep3Vector &momentum, double charge)
 Constructor with position, momentum, and charge.
virtual ~Ext_Helix ()
 Destructor.
const HepPoint3Dcenter (void) const
 returns position of helix center(z = 0.);
const HepPoint3Dpivot (void) const
 returns pivot position.
double radius (void) const
 returns radious of helix.
HepPoint3D x (double dPhi=0.) const
 returns position after rotating angle dPhi in phi direction.
double * x (double dPhi, double p[3]) const
HepPoint3D x (double dPhi, HepSymMatrix &Ex) const
 returns position and convariance matrix(Ex) after rotation.
Hep3Vector direction (double dPhi=0.) const
 returns direction vector after rotating angle dPhi in phi direction.
Hep3Vector momentum (double dPhi=0.) const
 returns momentum vector after rotating angle dPhi in phi direction.
Hep3Vector momentum (double dPhi, HepSymMatrix &Em) const
 returns momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass, HepSymMatrix &Em) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass, HepPoint3D &x, HepSymMatrix &Emx) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
double dr (void) const
 returns an element of parameters.
double phi0 (void) const
double kappa (void) const
double dz (void) const
double tanl (void) const
double curv (void) const
double sinPhi0 (void) const
double cosPhi0 (void) const
const HepVector & a (void) const
 returns helix parameters.
const HepSymMatrix & Ea (void) const
 returns error matrix.
const HepVector & a (const HepVector &newA)
 sets helix parameters.
const HepSymMatrix & Ea (const HepSymMatrix &newdA)
 sets helix paramters and error matrix.
const HepPoint3Dpivot (const HepPoint3D &newPivot)
 sets pivot position.
void set (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 sets helix pivot position, parameters, and error matrix.
void ignoreErrorMatrix (void)
double bFieldZ (double)
 sets/returns z componet of the magnetic field.
double bFieldZ (void) const
Ext_Helixoperator= (const Ext_Helix &)
 Copy operator.
HepMatrix delApDelA (const HepVector &ap) const
HepMatrix delXDelA (double phi) const
HepMatrix delMDelA (double phi) const
HepMatrix del4MDelA (double phi, double mass) const
HepMatrix del4MXDelA (double phi, double mass) const

Static Public Attributes

static const double ConstantAlpha
 Constant alpha for uniform field.

Detailed Description

Helix parameter class.

Definition at line 37 of file Reconstruction/TrkExtAlg/src/Helix.h.

Constructor & Destructor Documentation

◆ Ext_Helix() [1/3]

Ext_Helix::Ext_Helix ( const HepPoint3D & pivot,
const HepVector & a,
const HepSymMatrix & Ea )

Constructor with pivot, helix parameter a, and its error matrix.

Definition at line 48 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

50 : // m_bField(-10.0),
51 // m_alpha(-333.564095),
52 m_pivot( pivot )
53 , m_a( a )
54 , m_matrixValid( true )
55 , m_Ea( Ea ) {
56 StatusCode scmgn = Gaudi::svcLocator()->service( "MagneticFieldSvc", m_pmgnIMF );
57 if ( scmgn != StatusCode::SUCCESS )
58 { std::cout << "Unable to open Magnetic field service" << std::endl; }
59 m_bField = 10000 * ( m_pmgnIMF->getReferField() );
60 m_alpha = 10000. / 2.99792458 / m_bField;
61 // m_alpha = 10000. / 2.99792458 / m_bField;
62 // m_alpha = 333.564095;
63 updateCache();
64}
const HepSymMatrix & Ea(void) const
returns error matrix.
const HepPoint3D & pivot(void) const
returns pivot position.
const HepVector & a(void) const
returns helix parameters.

Referenced by operator=().

◆ Ext_Helix() [2/3]

Ext_Helix::Ext_Helix ( const HepPoint3D & pivot,
const HepVector & a )

Constructor without error matrix.

Definition at line 66 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

68 : // m_bField(-10.0),
69 // m_alpha(-333.564095),
70 m_pivot( pivot )
71 , m_a( a )
72 , m_matrixValid( false )
73 , m_Ea( HepSymMatrix( 5, 0 ) ) {
74 StatusCode scmgn = Gaudi::svcLocator()->service( "MagneticFieldSvc", m_pmgnIMF );
75 if ( scmgn != StatusCode::SUCCESS )
76 {
77 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endmsg;
78 std::cout << "Unable to open Magnetic field service" << std::endl;
79 }
80 m_bField = 10000 * ( m_pmgnIMF->getReferField() );
81 m_alpha = 10000. / 2.99792458 / m_bField;
82 // m_alpha = 333.564095;
83 // cout<<"MdcFastTrakAlg:: bField,alpha: "<<m_bField<<" , "<<m_alpha<<endl;
84 updateCache();
85}

◆ Ext_Helix() [3/3]

Ext_Helix::Ext_Helix ( const HepPoint3D & position,
const Hep3Vector & momentum,
double charge )

Constructor with position, momentum, and charge.

Definition at line 87 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

89 : // m_bField(-10.0),
90 // m_alpha(-333.564095),
91 m_pivot( position )
92 , m_a( HepVector( 5, 0 ) )
93 , m_matrixValid( false )
94 , m_Ea( HepSymMatrix( 5, 0 ) ) {
95 StatusCode scmgn = Gaudi::svcLocator()->service( "MagneticFieldSvc", m_pmgnIMF );
96 if ( scmgn != StatusCode::SUCCESS )
97 {
98 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endmsg;
99 std::cout << "Unable to open Magnetic field service" << std::endl;
100 }
101 m_bField = 10000 * ( m_pmgnIMF->getReferField() );
102 m_alpha = 10000. / 2.99792458 / m_bField;
103
104 m_a[0] = 0.;
105 m_a[1] = fmod( atan2( -momentum.x(), momentum.y() ) + M_PI4, M_PI2 );
106 m_a[3] = 0.;
107 double perp( momentum.perp() );
108 if ( perp != 0.0 )
109 {
110 m_a[2] = charge / perp;
111 m_a[4] = momentum.z() / perp;
112 }
113 else
114 {
115 m_a[2] = charge * ( DBL_MAX );
116 if ( momentum.z() >= 0 ) { m_a[4] = ( DBL_MAX ); }
117 else { m_a[4] = -( DBL_MAX ); }
118 }
119 // m_alpha = 333.564095;
120 updateCache();
121}
const double M_PI2
const double M_PI4
Hep3Vector momentum(double dPhi=0.) const
returns momentum vector after rotating angle dPhi in phi direction.

◆ ~Ext_Helix()

Ext_Helix::~Ext_Helix ( )
virtual

Destructor.

Definition at line 123 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

123{}

Member Function Documentation

◆ a() [1/2]

const HepVector & Ext_Helix::a ( const HepVector & newA)
inline

sets helix parameters.

Definition at line 201 of file Reconstruction/TrkExtAlg/src/Helix.h.

201 {
202 m_a = i;
203 updateCache();
204 return m_a;
205}

◆ a() [2/2]

const HepVector & Ext_Helix::a ( void ) const
inline

returns helix parameters.

Definition at line 197 of file Reconstruction/TrkExtAlg/src/Helix.h.

197{ return m_a; }

Referenced by bFieldZ(), Ext_Helix(), Ext_Helix(), and set().

◆ bFieldZ() [1/2]

double Ext_Helix::bFieldZ ( double a)
inline

sets/returns z componet of the magnetic field.

Definition at line 209 of file Reconstruction/TrkExtAlg/src/Helix.h.

209 {
210 m_bField = a;
211 m_alpha = 10000. / 2.99792458 / m_bField;
212 updateCache();
213 return m_bField;
214}

◆ bFieldZ() [2/2]

double Ext_Helix::bFieldZ ( void ) const
inline

Definition at line 216 of file Reconstruction/TrkExtAlg/src/Helix.h.

216{ return m_bField; }

◆ center()

const HepPoint3D & Ext_Helix::center ( void ) const
inline

returns position of helix center(z = 0.);

Definition at line 177 of file Reconstruction/TrkExtAlg/src/Helix.h.

177{ return m_center; }

◆ cosPhi0()

double Ext_Helix::cosPhi0 ( void ) const
inline

Definition at line 220 of file Reconstruction/TrkExtAlg/src/Helix.h.

220{ return m_cp; }

◆ curv()

double Ext_Helix::curv ( void ) const
inline

Definition at line 195 of file Reconstruction/TrkExtAlg/src/Helix.h.

195{ return m_r; }

◆ del4MDelA()

HepMatrix Ext_Helix::del4MDelA ( double phi,
double mass ) const

Definition at line 555 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

555 {
556 //
557 // Calculate Jacobian (@4m/@a)
558 // Vector a is helix parameters and phi is internal parameter.
559 // Vector 4m is 4 momentum.
560 //
561
562 HepMatrix d4MDA( 4, 5, 0 );
563
564 double phi0 = m_ac[1];
565 double cpa = m_ac[2];
566 double tnl = m_ac[4];
567
568 double cosf0phi = cos( phi0 + phi );
569 double sinf0phi = sin( phi0 + phi );
570
571 double rho;
572 if ( cpa != 0. ) rho = 1. / cpa;
573 else rho = ( DBL_MAX );
574
575 double charge = 1.;
576 if ( cpa < 0. ) charge = -1.;
577
578 double E = sqrt( rho * rho * ( 1. + tnl * tnl ) + mass * mass );
579
580 d4MDA[0][1] = -fabs( rho ) * cosf0phi;
581 d4MDA[0][2] = charge * rho * rho * sinf0phi;
582
583 d4MDA[1][1] = -fabs( rho ) * sinf0phi;
584 d4MDA[1][2] = -charge * rho * rho * cosf0phi;
585
586 d4MDA[2][2] = -charge * rho * rho * tnl;
587 d4MDA[2][4] = fabs( rho );
588
589 if ( cpa != 0.0 && E != 0.0 )
590 {
591 d4MDA[3][2] = ( -1. - tnl * tnl ) / ( cpa * cpa * cpa * E );
592 d4MDA[3][4] = tnl / ( cpa * cpa * E );
593 }
594 else
595 {
596 d4MDA[3][2] = ( DBL_MAX );
597 d4MDA[3][4] = ( DBL_MAX );
598 }
599 return d4MDA;
600}
double mass

Referenced by momentum().

◆ del4MXDelA()

HepMatrix Ext_Helix::del4MXDelA ( double phi,
double mass ) const

Definition at line 602 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

602 {
603 //
604 // Calculate Jacobian (@4mx/@a)
605 // Vector a is helix parameters and phi is internal parameter.
606 // Vector 4xm is 4 momentum and position.
607 //
608
609 HepMatrix d4MXDA( 7, 5, 0 );
610
611 const double& dr = m_ac[0];
612 const double& phi0 = m_ac[1];
613 const double& cpa = m_ac[2];
614 const double& dz = m_ac[3];
615 const double& tnl = m_ac[4];
616
617 double cosf0phi = cos( phi0 + phi );
618 double sinf0phi = sin( phi0 + phi );
619
620 double rho;
621 if ( cpa != 0. ) rho = 1. / cpa;
622 else rho = ( DBL_MAX );
623
624 double charge = 1.;
625 if ( cpa < 0. ) charge = -1.;
626
627 double E = sqrt( rho * rho * ( 1. + tnl * tnl ) + mass * mass );
628
629 d4MXDA[0][1] = -fabs( rho ) * cosf0phi;
630 d4MXDA[0][2] = charge * rho * rho * sinf0phi;
631
632 d4MXDA[1][1] = -fabs( rho ) * sinf0phi;
633 d4MXDA[1][2] = -charge * rho * rho * cosf0phi;
634
635 d4MXDA[2][2] = -charge * rho * rho * tnl;
636 d4MXDA[2][4] = fabs( rho );
637
638 if ( cpa != 0.0 && E != 0.0 )
639 {
640 d4MXDA[3][2] = ( -1. - tnl * tnl ) / ( cpa * cpa * cpa * E );
641 d4MXDA[3][4] = tnl / ( cpa * cpa * E );
642 }
643 else
644 {
645 d4MXDA[3][2] = ( DBL_MAX );
646 d4MXDA[3][4] = ( DBL_MAX );
647 }
648
649 d4MXDA[4][0] = m_cp;
650 d4MXDA[4][1] = -dr * m_sp + m_r * ( -m_sp + sinf0phi );
651 if ( cpa != 0.0 ) { d4MXDA[4][2] = -( m_r / cpa ) * ( m_cp - cosf0phi ); }
652 else { d4MXDA[4][2] = ( DBL_MAX ); }
653
654 d4MXDA[5][0] = m_sp;
655 d4MXDA[5][1] = dr * m_cp + m_r * ( m_cp - cosf0phi );
656 if ( cpa != 0.0 )
657 {
658 d4MXDA[5][2] = -( m_r / cpa ) * ( m_sp - sinf0phi );
659
660 d4MXDA[6][2] = ( m_r / cpa ) * tnl * phi;
661 }
662 else
663 {
664 d4MXDA[5][2] = ( DBL_MAX );
665
666 d4MXDA[6][2] = ( DBL_MAX );
667 }
668
669 d4MXDA[6][3] = 1.;
670 d4MXDA[6][4] = -m_r * phi;
671
672 return d4MXDA;
673}
double dr(void) const
returns an element of parameters.

Referenced by momentum().

◆ delApDelA()

HepMatrix Ext_Helix::delApDelA ( const HepVector & ap) const

Definition at line 423 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

423 {
424 //
425 // Calculate Jacobian (@ap/@a)
426 // Vector ap is new helix parameters and a is old helix parameters.
427 //
428
429 HepMatrix dApDA( 5, 5, 0 );
430
431 const double& dr = m_ac[0];
432 const double& phi0 = m_ac[1];
433 const double& cpa = m_ac[2];
434 const double& dz = m_ac[3];
435 const double& tnl = m_ac[4];
436
437 double drp = ap[0];
438 double phi0p = ap[1];
439 double cpap = ap[2];
440 double dzp = ap[3];
441 double tnlp = ap[4];
442
443 double rdr = m_r + dr;
444 double rdrpr;
445 if ( ( m_r + drp ) != 0.0 ) { rdrpr = 1. / ( m_r + drp ); }
446 else { rdrpr = ( DBL_MAX ); }
447 // double csfd = cos(phi0)*cos(phi0p) + sin(phi0)*sin(phi0p);
448 // double snfd = cos(phi0)*sin(phi0p) - sin(phi0)*cos(phi0p);
449 double csfd = cos( phi0p - phi0 );
450 double snfd = sin( phi0p - phi0 );
451 double phid = fmod( phi0p - phi0 + M_PI8, M_PI2 );
452 if ( phid > M_PI ) phid = phid - M_PI2;
453
454 dApDA[0][0] = csfd;
455 dApDA[0][1] = rdr * snfd;
456 if ( cpa != 0.0 ) { dApDA[0][2] = ( m_r / cpa ) * ( 1.0 - csfd ); }
457 else { dApDA[0][2] = ( DBL_MAX ); }
458
459 dApDA[1][0] = -rdrpr * snfd;
460 dApDA[1][1] = rdr * rdrpr * csfd;
461 if ( cpa != 0.0 ) { dApDA[1][2] = ( m_r / cpa ) * rdrpr * snfd; }
462 else { dApDA[1][2] = ( DBL_MAX ); }
463
464 dApDA[2][2] = 1.0;
465
466 dApDA[3][0] = m_r * rdrpr * tnl * snfd;
467 dApDA[3][1] = m_r * tnl * ( 1.0 - rdr * rdrpr * csfd );
468 if ( cpa != 0.0 ) { dApDA[3][2] = ( m_r / cpa ) * tnl * ( phid - m_r * rdrpr * snfd ); }
469 else { dApDA[3][2] = ( DBL_MAX ); }
470 dApDA[3][3] = 1.0;
471 dApDA[3][4] = -m_r * phid;
472
473 dApDA[4][4] = 1.0;
474
475 return dApDA;
476}
const double M_PI8
#define M_PI
Definition TConstant.h:4

Referenced by pivot().

◆ delMDelA()

HepMatrix Ext_Helix::delMDelA ( double phi) const

Definition at line 520 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

520 {
521 //
522 // Calculate Jacobian (@m/@a)
523 // Vector a is helix parameters and phi is internal parameter.
524 // Vector m is momentum.
525 //
526
527 HepMatrix dMDA( 3, 5, 0 );
528
529 const double& phi0 = m_ac[1];
530 const double& cpa = m_ac[2];
531 const double& tnl = m_ac[4];
532
533 double cosf0phi = cos( phi0 + phi );
534 double sinf0phi = sin( phi0 + phi );
535
536 double rho;
537 if ( cpa != 0. ) rho = 1. / cpa;
538 else rho = ( DBL_MAX );
539
540 double charge = 1.;
541 if ( cpa < 0. ) charge = -1.;
542
543 dMDA[0][1] = -fabs( rho ) * cosf0phi;
544 dMDA[0][2] = charge * rho * rho * sinf0phi;
545
546 dMDA[1][1] = -fabs( rho ) * sinf0phi;
547 dMDA[1][2] = -charge * rho * rho * cosf0phi;
548
549 dMDA[2][2] = -charge * rho * rho * tnl;
550 dMDA[2][4] = fabs( rho );
551
552 return dMDA;
553}

Referenced by momentum().

◆ delXDelA()

HepMatrix Ext_Helix::delXDelA ( double phi) const

Definition at line 478 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

478 {
479 //
480 // Calculate Jacobian (@x/@a)
481 // Vector a is helix parameters and phi is internal parameter
482 // which specifys the point to be calculated for Ex(phi).
483 //
484
485 HepMatrix dXDA( 3, 5, 0 );
486
487 const double& dr = m_ac[0];
488 const double& phi0 = m_ac[1];
489 const double& cpa = m_ac[2];
490 const double& dz = m_ac[3];
491 const double& tnl = m_ac[4];
492
493 double cosf0phi = cos( phi0 + phi );
494 double sinf0phi = sin( phi0 + phi );
495
496 dXDA[0][0] = m_cp;
497 dXDA[0][1] = -dr * m_sp + m_r * ( -m_sp + sinf0phi );
498 if ( cpa != 0.0 ) { dXDA[0][2] = -( m_r / cpa ) * ( m_cp - cosf0phi ); }
499 else { dXDA[0][2] = ( DBL_MAX ); }
500 // dXDA[0][3] = 0.0;
501 // dXDA[0][4] = 0.0;
502
503 dXDA[1][0] = m_sp;
504 dXDA[1][1] = dr * m_cp + m_r * ( m_cp - cosf0phi );
505 if ( cpa != 0.0 ) { dXDA[1][2] = -( m_r / cpa ) * ( m_sp - sinf0phi ); }
506 else { dXDA[1][2] = ( DBL_MAX ); }
507 // dXDA[1][3] = 0.0;
508 // dXDA[1][4] = 0.0;
509
510 // dXDA[2][0] = 0.0;
511 // dXDA[2][1] = 0.0;
512 if ( cpa != 0.0 ) { dXDA[2][2] = ( m_r / cpa ) * tnl * phi; }
513 else { dXDA[2][2] = ( DBL_MAX ); }
514 dXDA[2][3] = 1.0;
515 dXDA[2][4] = -m_r * phi;
516
517 return dXDA;
518}

Referenced by x().

◆ direction()

Hep3Vector Ext_Helix::direction ( double dPhi = 0.) const
inline

returns direction vector after rotating angle dPhi in phi direction.

Definition at line 183 of file Reconstruction/TrkExtAlg/src/Helix.h.

183{ return momentum( phi ).unit(); }
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum

◆ dr()

double Ext_Helix::dr ( void ) const
inline

returns an element of parameters.

Definition at line 185 of file Reconstruction/TrkExtAlg/src/Helix.h.

185{ return m_ac[0]; }

Referenced by del4MXDelA(), delApDelA(), delXDelA(), and pivot().

◆ dz()

double Ext_Helix::dz ( void ) const
inline

Definition at line 191 of file Reconstruction/TrkExtAlg/src/Helix.h.

191{ return m_ac[3]; }

Referenced by del4MXDelA(), delApDelA(), delXDelA(), and pivot().

◆ Ea() [1/2]

const HepSymMatrix & Ext_Helix::Ea ( const HepSymMatrix & newdA)
inline

sets helix paramters and error matrix.

Definition at line 207 of file Reconstruction/TrkExtAlg/src/Helix.h.

207{ return m_Ea = i; }

◆ Ea() [2/2]

const HepSymMatrix & Ext_Helix::Ea ( void ) const
inline

returns error matrix.

Definition at line 199 of file Reconstruction/TrkExtAlg/src/Helix.h.

199{ return m_Ea; }

Referenced by Ext_Helix(), ExtMdcTrack::GetErrorMatrix(), and set().

◆ ignoreErrorMatrix()

void Ext_Helix::ignoreErrorMatrix ( void )

unsets error matrix. Error calculations will be ignored after this function call until an error matrix be set again. 0 matrix will be return as a return value for error matrix when you call functions which returns an error matrix.

Definition at line 675 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

675 {
676 m_matrixValid = false;
677 m_Ea *= 0.;
678}

◆ kappa()

double Ext_Helix::kappa ( void ) const
inline

Definition at line 189 of file Reconstruction/TrkExtAlg/src/Helix.h.

189{ return m_ac[2]; }

Referenced by ExtMdcTrack::GetErrorMatrix(), and pivot().

◆ momentum() [1/5]

HepLorentzVector Ext_Helix::momentum ( double dPhi,
double mass ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

Definition at line 218 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

218 {
219 //
220 // Calculate momentum.
221 //
222 // Pt = | 1/kappa | (GeV/c)
223 //
224 // Px = -Pt * sin(phi0 + phi)
225 // Py = Pt * cos(phi0 + phi)
226 // Pz = Pt * tan(lambda)
227 //
228 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
229
230 double pt = fabs( m_pt );
231 double px = -pt * sin( m_ac[1] + phi );
232 double py = pt * cos( m_ac[1] + phi );
233 double pz = pt * m_ac[4];
234 double E = sqrt( pt * pt * ( 1. + m_ac[4] * m_ac[4] ) + mass * mass );
235
236 return HepLorentzVector( px, py, pz, E );
237}

◆ momentum() [2/5]

HepLorentzVector Ext_Helix::momentum ( double dPhi,
double mass,
HepPoint3D & x,
HepSymMatrix & Emx ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

Definition at line 263 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

264 {
265 //
266 // Calculate momentum.
267 //
268 // Pt = | 1/kappa | (GeV/c)
269 //
270 // Px = -Pt * sin(phi0 + phi)
271 // Py = Pt * cos(phi0 + phi)
272 // Pz = Pt * tan(lambda)
273 //
274 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
275
276 double pt = fabs( m_pt );
277 double px = -pt * sin( m_ac[1] + phi );
278 double py = pt * cos( m_ac[1] + phi );
279 double pz = pt * m_ac[4];
280 double E = sqrt( pt * pt * ( 1. + m_ac[4] * m_ac[4] ) + mass * mass );
281
282 x.setX( m_pivot.x() + m_ac[0] * m_cp + m_r * ( m_cp - cos( m_ac[1] + phi ) ) );
283 x.setY( m_pivot.y() + m_ac[0] * m_sp + m_r * ( m_sp - sin( m_ac[1] + phi ) ) );
284 x.setZ( m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi );
285
286 if ( m_matrixValid ) Emx = m_Ea.similarity( del4MXDelA( phi, mass ) );
287 else Emx = m_Ea;
288
289 return HepLorentzVector( px, py, pz, E );
290}
HepMatrix del4MXDelA(double phi, double mass) const
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.

◆ momentum() [3/5]

HepLorentzVector Ext_Helix::momentum ( double dPhi,
double mass,
HepSymMatrix & Em ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

Definition at line 239 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

239 {
240 //
241 // Calculate momentum.
242 //
243 // Pt = | 1/kappa | (GeV/c)
244 //
245 // Px = -Pt * sin(phi0 + phi)
246 // Py = Pt * cos(phi0 + phi)
247 // Pz = Pt * tan(lambda)
248 //
249 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
250
251 double pt = fabs( m_pt );
252 double px = -pt * sin( m_ac[1] + phi );
253 double py = pt * cos( m_ac[1] + phi );
254 double pz = pt * m_ac[4];
255 double E = sqrt( pt * pt * ( 1. + m_ac[4] * m_ac[4] ) + mass * mass );
256
257 if ( m_matrixValid ) Em = m_Ea.similarity( del4MDelA( phi, mass ) );
258 else Em = m_Ea;
259
260 return HepLorentzVector( px, py, pz, E );
261}
HepMatrix del4MDelA(double phi, double mass) const

◆ momentum() [4/5]

Hep3Vector Ext_Helix::momentum ( double dPhi,
HepSymMatrix & Em ) const

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 196 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

196 {
197 //
198 // Calculate momentum.
199 //
200 // Pt = | 1/kappa | (GeV/c)
201 //
202 // Px = -Pt * sin(phi0 + phi)
203 // Py = Pt * cos(phi0 + phi)
204 // Pz = Pt * tan(lambda)
205 //
206
207 double pt = fabs( m_pt );
208 double px = -pt * sin( m_ac[1] + phi );
209 double py = pt * cos( m_ac[1] + phi );
210 double pz = pt * m_ac[4];
211
212 if ( m_matrixValid ) Em = m_Ea.similarity( delMDelA( phi ) );
213 else Em = m_Ea;
214
215 return Hep3Vector( px, py, pz );
216}
HepMatrix delMDelA(double phi) const

◆ momentum() [5/5]

Hep3Vector Ext_Helix::momentum ( double dPhi = 0.) const

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 177 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

177 {
178 //
179 // Calculate momentum.
180 //
181 // Pt = | 1/kappa | (GeV/c)
182 //
183 // Px = -Pt * sin(phi0 + phi)
184 // Py = Pt * cos(phi0 + phi)
185 // Pz = Pt * tan(lambda)
186 //
187
188 double pt = fabs( m_pt );
189 double px = -pt * sin( m_ac[1] + phi );
190 double py = pt * cos( m_ac[1] + phi );
191 double pz = pt * m_ac[4];
192
193 return Hep3Vector( px, py, pz );
194}

Referenced by Ext_Helix(), ExtMdcTrack::GetErrorMatrix(), and ExtMdcTrack::GetMomentum().

◆ operator=()

Ext_Helix & Ext_Helix::operator= ( const Ext_Helix & i)

Copy operator.

Definition at line 365 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

365 {
366 if ( this == &i ) return *this;
367
368 m_bField = i.m_bField;
369 m_alpha = i.m_alpha;
370 m_pivot = i.m_pivot;
371 m_a = i.m_a;
372 m_Ea = i.m_Ea;
373 m_matrixValid = i.m_matrixValid;
374
375 m_center = i.m_center;
376 m_cp = i.m_cp;
377 m_sp = i.m_sp;
378 m_pt = i.m_pt;
379 m_r = i.m_r;
380 m_ac[0] = i.m_ac[0];
381 m_ac[1] = i.m_ac[1];
382 m_ac[2] = i.m_ac[2];
383 m_ac[3] = i.m_ac[3];
384 m_ac[4] = i.m_ac[4];
385
386 return *this;
387}

◆ phi0()

double Ext_Helix::phi0 ( void ) const
inline

Definition at line 187 of file Reconstruction/TrkExtAlg/src/Helix.h.

187{ return m_ac[1]; }

Referenced by del4MDelA(), del4MXDelA(), delApDelA(), delMDelA(), delXDelA(), ExtMdcTrack::GetErrorMatrix(), and pivot().

◆ pivot() [1/2]

const HepPoint3D & Ext_Helix::pivot ( const HepPoint3D & newPivot)

sets pivot position.

Definition at line 292 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

292 {
293 const double& dr = m_ac[0];
294 const double& phi0 = m_ac[1];
295 const double& kappa = m_ac[2];
296 const double& dz = m_ac[3];
297 const double& tanl = m_ac[4];
298
299 double rdr = dr + m_r;
300 double phi = fmod( phi0 + M_PI4, M_PI2 );
301 double csf0 = cos( phi );
302 double snf0 = ( 1. - csf0 ) * ( 1. + csf0 );
303 snf0 = sqrt( ( snf0 > 0. ) ? snf0 : 0. );
304 if ( phi > M_PI ) snf0 = -snf0;
305
306 double xc = m_pivot.x() + rdr * csf0;
307 double yc = m_pivot.y() + rdr * snf0;
308 double csf, snf;
309 if ( m_r != 0.0 )
310 {
311 csf = ( xc - newPivot.x() ) / m_r;
312 snf = ( yc - newPivot.y() ) / m_r;
313 double anrm = sqrt( csf * csf + snf * snf );
314 if ( anrm != 0.0 )
315 {
316 csf /= anrm;
317 snf /= anrm;
318 phi = atan2( snf, csf );
319 }
320 else
321 {
322 csf = 1.0;
323 snf = 0.0;
324 phi = 0.0;
325 }
326 }
327 else
328 {
329 csf = 1.0;
330 snf = 0.0;
331 phi = 0.0;
332 }
333 double phid = fmod( phi - phi0 + M_PI8, M_PI2 );
334 if ( phid > M_PI ) phid = phid - M_PI2;
335 double drp = ( m_pivot.x() + dr * csf0 + m_r * ( csf0 - csf ) - newPivot.x() ) * csf +
336 ( m_pivot.y() + dr * snf0 + m_r * ( snf0 - snf ) - newPivot.y() ) * snf;
337 double dzp = m_pivot.z() + dz - m_r * tanl * phid - newPivot.z();
338
339 HepVector ap( 5 );
340 ap[0] = drp;
341 ap[1] = fmod( phi + M_PI4, M_PI2 );
342 ap[2] = kappa;
343 ap[3] = dzp;
344 ap[4] = tanl;
345
346 // if (m_matrixValid) m_Ea.assign(delApDelA(ap) * m_Ea * delApDelA(ap).T());
347 if ( m_matrixValid ) m_Ea = m_Ea.similarity( delApDelA( ap ) );
348
349 m_a = ap;
350 m_pivot = newPivot;
351
352 //...Are these needed?...iw...
353 updateCache();
354 return m_pivot;
355}
HepMatrix delApDelA(const HepVector &ap) const

◆ pivot() [2/2]

const HepPoint3D & Ext_Helix::pivot ( void ) const
inline

returns pivot position.

Definition at line 179 of file Reconstruction/TrkExtAlg/src/Helix.h.

179{ return m_pivot; }

Referenced by Ext_Helix(), Ext_Helix(), and set().

◆ radius()

double Ext_Helix::radius ( void ) const
inline

returns radious of helix.

Definition at line 181 of file Reconstruction/TrkExtAlg/src/Helix.h.

181{ return m_r; }

Referenced by ExtMdcTrack::GetTrackLength().

◆ set()

void Ext_Helix::set ( const HepPoint3D & pivot,
const HepVector & a,
const HepSymMatrix & Ea )

sets helix pivot position, parameters, and error matrix.

Definition at line 357 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

357 {
358 m_pivot = pivot;
359 m_a = a;
360 m_Ea = Ea;
361 m_matrixValid = true;
362 updateCache();
363}

◆ sinPhi0()

double Ext_Helix::sinPhi0 ( void ) const
inline

Definition at line 218 of file Reconstruction/TrkExtAlg/src/Helix.h.

218{ return m_sp; }

◆ tanl()

double Ext_Helix::tanl ( void ) const
inline

Definition at line 193 of file Reconstruction/TrkExtAlg/src/Helix.h.

193{ return m_ac[4]; }

Referenced by ExtMdcTrack::GetTrackLength(), and pivot().

◆ x() [1/3]

double * Ext_Helix::x ( double dPhi,
double p[3] ) const

Definition at line 141 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

141 {
142 //
143 // Calculate position (x,y,z) along helix.
144 //
145 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
146 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
147 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
148 //
149
150 p[0] = m_pivot.x() + m_ac[0] * m_cp + m_r * ( m_cp - cos( m_ac[1] + phi ) );
151 p[1] = m_pivot.y() + m_ac[0] * m_sp + m_r * ( m_sp - sin( m_ac[1] + phi ) );
152 p[2] = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
153
154 return p;
155}

◆ x() [2/3]

HepPoint3D Ext_Helix::x ( double dPhi,
HepSymMatrix & Ex ) const

returns position and convariance matrix(Ex) after rotation.

Definition at line 157 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

157 {
158 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * ( m_cp - cos( m_ac[1] + phi ) );
159 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * ( m_sp - sin( m_ac[1] + phi ) );
160 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
161
162 //
163 // Calculate position error matrix.
164 // Ex(phi) = (@x/@a)(Ea)(@x/@a)^T, phi is deflection angle to specify the
165 // point to be calcualted.
166 //
167 // HepMatrix dXDA(3, 5, 0);
168 // dXDA = delXDelA(phi);
169 // Ex.assign(dXDA * m_Ea * dXDA.T());
170
171 if ( m_matrixValid ) Ex = m_Ea.similarity( delXDelA( phi ) );
172 else Ex = m_Ea;
173
174 return HepPoint3D( x, y, z );
175}
HepGeom::Point3D< double > HepPoint3D
HepMatrix delXDelA(double phi) const

◆ x() [3/3]

HepPoint3D Ext_Helix::x ( double dPhi = 0.) const

returns position after rotating angle dPhi in phi direction.

Definition at line 125 of file Reconstruction/TrkExtAlg/src/Helix.cxx.

125 {
126 //
127 // Calculate position (x,y,z) along helix.
128 //
129 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
130 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
131 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
132 //
133
134 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * ( m_cp - cos( m_ac[1] + phi ) );
135 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * ( m_sp - sin( m_ac[1] + phi ) );
136 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
137
138 return HepPoint3D( x, y, z );
139}

Referenced by ExtMdcTrack::GetErrorMatrix(), ExtMdcTrack::GetPosition(), momentum(), x(), and x().

Member Data Documentation

◆ ConstantAlpha

const double Ext_Helix::ConstantAlpha
static

Constant alpha for uniform field.

Definition at line 147 of file Reconstruction/TrkExtAlg/src/Helix.h.


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