CGEM BOSS 6.6.5.g
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)
 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.
 
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 38 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/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 52 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

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

◆ Ext_Helix() [2/3]

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

Constructor without error matrix.

Definition at line 72 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

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

◆ 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 92 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

95 : //m_bField(-10.0),
96 //m_alpha(-333.564095),
97 m_pivot(position),
98 m_a(HepVector(5,0)),
99 m_matrixValid(false),
100 m_Ea(HepSymMatrix(5,0)) {
101 StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF);
102 if(scmgn!=StatusCode::SUCCESS) {
103 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq;
104 std::cout<< "Unable to open Magnetic field service"<<std::endl;
105 }
106 m_bField = 10000*(m_pmgnIMF->getReferField());
107 m_alpha = 10000. / 2.99792458 / m_bField;
108
109 m_a[0] = 0.;
110 m_a[1] = fmod(atan2(- momentum.x(), momentum.y())
111 + M_PI4, M_PI2);
112 m_a[3] = 0.;
113 double perp(momentum.perp());
114 if (perp != 0.0) {
115 m_a[2] = charge / perp;
116 m_a[4] = momentum.z() / perp;
117 }
118 else {
119 m_a[2] = charge * (DBL_MAX);
120 if (momentum.z() >= 0) {
121 m_a[4] = (DBL_MAX);
122 } else {
123 m_a[4] = -(DBL_MAX);
124 }
125 }
126 // m_alpha = 333.564095;
127 updateCache();
128}
**********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
#define DBL_MAX
Definition: KalFitAlg.h:13

◆ ~Ext_Helix()

Ext_Helix::~Ext_Helix ( )
virtual

Destructor.

Definition at line 130 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

130 {
131}

Member Function Documentation

◆ a() [1/2]

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

sets helix parameters.

Definition at line 255 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

255 {
256 m_a = i;
257 updateCache();
258 return m_a;
259}

◆ a() [2/2]

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

returns helix parameters.

Definition at line 243 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

243 {
244 return m_a;
245}

Referenced by bFieldZ(), and set().

◆ bFieldZ() [1/2]

double Ext_Helix::bFieldZ ( double  a)
inline

sets/returns z componet of the magnetic field.

Definition at line 269 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

269 {
270 m_bField = a;
271 m_alpha = 10000. / 2.99792458 / m_bField;
272 updateCache();
273 return m_bField;
274}

◆ bFieldZ() [2/2]

double Ext_Helix::bFieldZ ( void  ) const
inline

Definition at line 278 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

278 {
279 return m_bField;
280}

◆ center()

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

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

Definition at line 183 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

183 {
184 return m_center;
185}

◆ cosPhi0()

double Ext_Helix::cosPhi0 ( void  ) const
inline

Definition at line 290 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

290 {
291 return m_cp;
292}

◆ curv()

double Ext_Helix::curv ( void  ) const
inline

Definition at line 237 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

237 {
238 return m_r;
239}

◆ del4MDelA()

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

Definition at line 602 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

602 {
603 //
604 // Calculate Jacobian (@4m/@a)
605 // Vector a is helix parameters and phi is internal parameter.
606 // Vector 4m is 4 momentum.
607 //
608
609 HepMatrix d4MDA(4,5,0);
610
611 double phi0 = m_ac[1];
612 double cpa = m_ac[2];
613 double tnl = m_ac[4];
614
615 double cosf0phi = cos(phi0+phi);
616 double sinf0phi = sin(phi0+phi);
617
618 double rho;
619 if(cpa != 0.)rho = 1./cpa;
620 else rho = (DBL_MAX);
621
622 double charge = 1.;
623 if(cpa < 0.)charge = -1.;
624
625 double E = sqrt(rho*rho*(1.+tnl*tnl)+mass*mass);
626
627 d4MDA[0][1] = -fabs(rho)*cosf0phi;
628 d4MDA[0][2] = charge*rho*rho*sinf0phi;
629
630 d4MDA[1][1] = -fabs(rho)*sinf0phi;
631 d4MDA[1][2] = -charge*rho*rho*cosf0phi;
632
633 d4MDA[2][2] = -charge*rho*rho*tnl;
634 d4MDA[2][4] = fabs(rho);
635
636 if (cpa != 0.0 && E != 0.0) {
637 d4MDA[3][2] = (-1.-tnl*tnl)/(cpa*cpa*cpa*E);
638 d4MDA[3][4] = tnl/(cpa*cpa*E);
639 } else {
640 d4MDA[3][2] = (DBL_MAX);
641 d4MDA[3][4] = (DBL_MAX);
642 }
643 return d4MDA;
644}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
double mass

Referenced by momentum().

◆ del4MXDelA()

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

Definition at line 648 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

648 {
649 //
650 // Calculate Jacobian (@4mx/@a)
651 // Vector a is helix parameters and phi is internal parameter.
652 // Vector 4xm is 4 momentum and position.
653 //
654
655 HepMatrix d4MXDA(7,5,0);
656
657 const double & dr = m_ac[0];
658 const double & phi0 = m_ac[1];
659 const double & cpa = m_ac[2];
660 const double & dz = m_ac[3];
661 const double & tnl = m_ac[4];
662
663 double cosf0phi = cos(phi0+phi);
664 double sinf0phi = sin(phi0+phi);
665
666 double rho;
667 if(cpa != 0.)rho = 1./cpa;
668 else rho = (DBL_MAX);
669
670 double charge = 1.;
671 if(cpa < 0.)charge = -1.;
672
673 double E = sqrt(rho * rho * (1. + tnl * tnl) + mass * mass);
674
675 d4MXDA[0][1] = - fabs(rho) * cosf0phi;
676 d4MXDA[0][2] = charge * rho * rho * sinf0phi;
677
678 d4MXDA[1][1] = - fabs(rho) * sinf0phi;
679 d4MXDA[1][2] = - charge * rho * rho * cosf0phi;
680
681 d4MXDA[2][2] = - charge * rho * rho * tnl;
682 d4MXDA[2][4] = fabs(rho);
683
684 if (cpa != 0.0 && E != 0.0) {
685 d4MXDA[3][2] = (- 1. - tnl * tnl) / (cpa * cpa * cpa * E);
686 d4MXDA[3][4] = tnl / (cpa * cpa * E);
687 } else {
688 d4MXDA[3][2] = (DBL_MAX);
689 d4MXDA[3][4] = (DBL_MAX);
690 }
691
692 d4MXDA[4][0] = m_cp;
693 d4MXDA[4][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi);
694 if (cpa != 0.0) {
695 d4MXDA[4][2] = - (m_r / cpa) * (m_cp - cosf0phi);
696 } else {
697 d4MXDA[4][2] = (DBL_MAX);
698 }
699
700 d4MXDA[5][0] = m_sp;
701 d4MXDA[5][1] = dr * m_cp + m_r * (m_cp - cosf0phi);
702 if (cpa != 0.0) {
703 d4MXDA[5][2] = - (m_r / cpa) * (m_sp - sinf0phi);
704
705 d4MXDA[6][2] = (m_r / cpa) * tnl * phi;
706 } else {
707 d4MXDA[5][2] = (DBL_MAX);
708
709 d4MXDA[6][2] = (DBL_MAX);
710 }
711
712 d4MXDA[6][3] = 1.;
713 d4MXDA[6][4] = - m_r * phi;
714
715 return d4MXDA;
716}
double dr(void) const
returns an element of parameters.

Referenced by momentum().

◆ delApDelA()

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

Definition at line 443 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

443 {
444 //
445 // Calculate Jacobian (@ap/@a)
446 // Vector ap is new helix parameters and a is old helix parameters.
447 //
448
449 HepMatrix dApDA(5,5,0);
450
451 const double & dr = m_ac[0];
452 const double & phi0 = m_ac[1];
453 const double & cpa = m_ac[2];
454 const double & dz = m_ac[3];
455 const double & tnl = m_ac[4];
456
457 double drp = ap[0];
458 double phi0p = ap[1];
459 double cpap = ap[2];
460 double dzp = ap[3];
461 double tnlp = ap[4];
462
463 double rdr = m_r + dr;
464 double rdrpr;
465 if ((m_r + drp) != 0.0) {
466 rdrpr = 1. / (m_r + drp);
467 } else {
468 rdrpr = (DBL_MAX);
469 }
470 // double csfd = cos(phi0)*cos(phi0p) + sin(phi0)*sin(phi0p);
471 // double snfd = cos(phi0)*sin(phi0p) - sin(phi0)*cos(phi0p);
472 double csfd = cos(phi0p - phi0);
473 double snfd = sin(phi0p - phi0);
474 double phid = fmod(phi0p - phi0 + M_PI8, M_PI2);
475 if (phid > M_PI) phid = phid - M_PI2;
476
477 dApDA[0][0] = csfd;
478 dApDA[0][1] = rdr*snfd;
479 if(cpa!=0.0) {
480 dApDA[0][2] = (m_r/cpa)*( 1.0 - csfd );
481 } else {
482 dApDA[0][2] = (DBL_MAX);
483 }
484
485 dApDA[1][0] = - rdrpr*snfd;
486 dApDA[1][1] = rdr*rdrpr*csfd;
487 if(cpa!=0.0) {
488 dApDA[1][2] = (m_r/cpa)*rdrpr*snfd;
489 } else {
490 dApDA[1][2] = (DBL_MAX);
491 }
492
493 dApDA[2][2] = 1.0;
494
495 dApDA[3][0] = m_r*rdrpr*tnl*snfd;
496 dApDA[3][1] = m_r*tnl*(1.0 - rdr*rdrpr*csfd);
497 if(cpa!=0.0) {
498 dApDA[3][2] = (m_r/cpa)*tnl*(phid - m_r*rdrpr*snfd);
499 } else {
500 dApDA[3][2] = (DBL_MAX);
501 }
502 dApDA[3][3] = 1.0;
503 dApDA[3][4] = - m_r*phid;
504
505 dApDA[4][4] = 1.0;
506
507 return dApDA;
508}
#define M_PI
Definition: TConstant.h:4

Referenced by pivot().

◆ delMDelA()

HepMatrix Ext_Helix::delMDelA ( double  phi) const

Definition at line 565 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

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

Referenced by momentum().

◆ delXDelA()

HepMatrix Ext_Helix::delXDelA ( double  phi) const

Definition at line 511 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

511 {
512 //
513 // Calculate Jacobian (@x/@a)
514 // Vector a is helix parameters and phi is internal parameter
515 // which specifys the point to be calculated for Ex(phi).
516 //
517
518 HepMatrix dXDA(3,5,0);
519
520 const double & dr = m_ac[0];
521 const double & phi0 = m_ac[1];
522 const double & cpa = m_ac[2];
523 const double & dz = m_ac[3];
524 const double & tnl = m_ac[4];
525
526 double cosf0phi = cos(phi0 + phi);
527 double sinf0phi = sin(phi0 + phi);
528
529 dXDA[0][0] = m_cp;
530 dXDA[0][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi);
531 if(cpa!=0.0) {
532 dXDA[0][2] = - (m_r / cpa) * (m_cp - cosf0phi);
533 } else {
534 dXDA[0][2] = (DBL_MAX);
535 }
536 // dXDA[0][3] = 0.0;
537 // dXDA[0][4] = 0.0;
538
539 dXDA[1][0] = m_sp;
540 dXDA[1][1] = dr * m_cp + m_r * (m_cp - cosf0phi);
541 if(cpa!=0.0) {
542 dXDA[1][2] = - (m_r / cpa) * (m_sp - sinf0phi);
543 } else {
544 dXDA[1][2] = (DBL_MAX);
545 }
546 // dXDA[1][3] = 0.0;
547 // dXDA[1][4] = 0.0;
548
549 // dXDA[2][0] = 0.0;
550 // dXDA[2][1] = 0.0;
551 if(cpa!=0.0) {
552 dXDA[2][2] = (m_r / cpa) * tnl * phi;
553 } else {
554 dXDA[2][2] = (DBL_MAX);
555 }
556 dXDA[2][3] = 1.0;
557 dXDA[2][4] = - m_r * phi;
558
559 return dXDA;
560}

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 201 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

201 {
202 return momentum(phi).unit();
203}

◆ dr()

double Ext_Helix::dr ( void  ) const
inline

returns an element of parameters.

Definition at line 207 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

207 {
208 return m_ac[0];
209}

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

◆ dz()

double Ext_Helix::dz ( void  ) const
inline

Definition at line 225 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

225 {
226 return m_ac[3];
227}

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 263 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

263 {
264 return m_Ea = i;
265}

◆ Ea() [2/2]

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

returns error matrix.

Definition at line 249 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

249 {
250 return m_Ea;
251}

Referenced by 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 719 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

719 {
720 m_matrixValid = false;
721 m_Ea *= 0.;
722}

◆ kappa()

double Ext_Helix::kappa ( void  ) const
inline

Definition at line 219 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

219 {
220 return m_ac[2];
221}

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 232 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

232 {
233 //
234 // Calculate momentum.
235 //
236 // Pt = | 1/kappa | (GeV/c)
237 //
238 // Px = -Pt * sin(phi0 + phi)
239 // Py = Pt * cos(phi0 + phi)
240 // Pz = Pt * tan(lambda)
241 //
242 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
243
244 double pt = fabs(m_pt);
245 double px = - pt * sin(m_ac[1] + phi);
246 double py = pt * cos(m_ac[1] + phi);
247 double pz = pt * m_ac[4];
248 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass);
249
250 return HepLorentzVector(px, py, pz, E);
251}

◆ 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 280 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

283 {
284 //
285 // Calculate momentum.
286 //
287 // Pt = | 1/kappa | (GeV/c)
288 //
289 // Px = -Pt * sin(phi0 + phi)
290 // Py = Pt * cos(phi0 + phi)
291 // Pz = Pt * tan(lambda)
292 //
293 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
294
295 double pt = fabs(m_pt);
296 double px = - pt * sin(m_ac[1] + phi);
297 double py = pt * cos(m_ac[1] + phi);
298 double pz = pt * m_ac[4];
299 double E = sqrt(pt * pt * (1. + m_ac[4] * m_ac[4]) + mass * mass);
300
301 x.setX(m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi)));
302 x.setY(m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi)));
303 x.setZ(m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi);
304
305 if (m_matrixValid) Emx = m_Ea.similarity(del4MXDelA(phi,mass));
306 else Emx = m_Ea;
307
308 return HepLorentzVector(px, py, pz, E);
309}
Double_t x[10]
HepMatrix del4MXDelA(double phi, double mass) const

◆ 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 255 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

255 {
256 //
257 // Calculate momentum.
258 //
259 // Pt = | 1/kappa | (GeV/c)
260 //
261 // Px = -Pt * sin(phi0 + phi)
262 // Py = Pt * cos(phi0 + phi)
263 // Pz = Pt * tan(lambda)
264 //
265 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
266
267 double pt = fabs(m_pt);
268 double px = - pt * sin(m_ac[1] + phi);
269 double py = pt * cos(m_ac[1] + phi);
270 double pz = pt * m_ac[4];
271 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass);
272
273 if (m_matrixValid) Em = m_Ea.similarity(del4MDelA(phi,mass));
274 else Em = m_Ea;
275
276 return HepLorentzVector(px, py, pz, E);
277}
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 209 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

209 {
210 //
211 // Calculate momentum.
212 //
213 // Pt = | 1/kappa | (GeV/c)
214 //
215 // Px = -Pt * sin(phi0 + phi)
216 // Py = Pt * cos(phi0 + phi)
217 // Pz = Pt * tan(lambda)
218 //
219
220 double pt = fabs(m_pt);
221 double px = - pt * sin(m_ac[1] + phi);
222 double py = pt * cos(m_ac[1] + phi);
223 double pz = pt * m_ac[4];
224
225 if (m_matrixValid) Em = m_Ea.similarity(delMDelA(phi));
226 else Em = m_Ea;
227
228 return Hep3Vector(px, py, pz);
229}

◆ momentum() [5/5]

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

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 189 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

189 {
190 //
191 // Calculate momentum.
192 //
193 // Pt = | 1/kappa | (GeV/c)
194 //
195 // Px = -Pt * sin(phi0 + phi)
196 // Py = Pt * cos(phi0 + phi)
197 // Pz = Pt * tan(lambda)
198 //
199
200 double pt = fabs(m_pt);
201 double px = - pt * sin(m_ac[1] + phi);
202 double py = pt * cos(m_ac[1] + phi);
203 double pz = pt * m_ac[4];
204
205 return Hep3Vector(px, py, pz);
206}

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

◆ operator=()

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

Copy operator.

Definition at line 385 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

385 {
386 if (this == & i) return * this;
387
388 m_bField = i.m_bField;
389 m_alpha = i.m_alpha;
390 m_pivot = i.m_pivot;
391 m_a = i.m_a;
392 m_Ea = i.m_Ea;
393 m_matrixValid = i.m_matrixValid;
394
395 m_center = i.m_center;
396 m_cp = i.m_cp;
397 m_sp = i.m_sp;
398 m_pt = i.m_pt;
399 m_r = i.m_r;
400 m_ac[0] = i.m_ac[0];
401 m_ac[1] = i.m_ac[1];
402 m_ac[2] = i.m_ac[2];
403 m_ac[3] = i.m_ac[3];
404 m_ac[4] = i.m_ac[4];
405
406 return * this;
407}

◆ phi0()

double Ext_Helix::phi0 ( void  ) const
inline

◆ pivot() [1/2]

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

sets pivot position.

Definition at line 313 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

313 {
314 const double & dr = m_ac[0];
315 const double & phi0 = m_ac[1];
316 const double & kappa = m_ac[2];
317 const double & dz = m_ac[3];
318 const double & tanl = m_ac[4];
319
320 double rdr = dr + m_r;
321 double phi = fmod(phi0 + M_PI4, M_PI2);
322 double csf0 = cos(phi);
323 double snf0 = (1. - csf0) * (1. + csf0);
324 snf0 = sqrt((snf0 > 0.) ? snf0 : 0.);
325 if(phi > M_PI) snf0 = - snf0;
326
327 double xc = m_pivot.x() + rdr * csf0;
328 double yc = m_pivot.y() + rdr * snf0;
329 double csf, snf;
330 if(m_r != 0.0) {
331 csf = (xc - newPivot.x()) / m_r;
332 snf = (yc - newPivot.y()) / m_r;
333 double anrm = sqrt(csf * csf + snf * snf);
334 if(anrm != 0.0) {
335 csf /= anrm;
336 snf /= anrm;
337 phi = atan2(snf, csf);
338 } else {
339 csf = 1.0;
340 snf = 0.0;
341 phi = 0.0;
342 }
343 } else {
344 csf = 1.0;
345 snf = 0.0;
346 phi = 0.0;
347 }
348 double phid = fmod(phi - phi0 + M_PI8, M_PI2);
349 if(phid > M_PI) phid = phid - M_PI2;
350 double drp = (m_pivot.x() + dr * csf0 + m_r * (csf0 - csf) - newPivot.x())
351 * csf
352 + (m_pivot.y() + dr * snf0 + m_r * (snf0 - snf) - newPivot.y()) * snf;
353 double dzp = m_pivot.z() + dz - m_r * tanl * phid - newPivot.z();
354
355 HepVector ap(5);
356 ap[0] = drp;
357 ap[1] = fmod(phi + M_PI4, M_PI2);
358 ap[2] = kappa;
359 ap[3] = dzp;
360 ap[4] = tanl;
361
362 // if (m_matrixValid) m_Ea.assign(delApDelA(ap) * m_Ea * delApDelA(ap).T());
363 if (m_matrixValid) m_Ea = m_Ea.similarity(delApDelA(ap));
364
365 m_a = ap;
366 m_pivot = newPivot;
367
368 //...Are these needed?...iw...
369 updateCache();
370 return m_pivot;
371}
HepMatrix delApDelA(const HepVector &ap) const

◆ pivot() [2/2]

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

returns pivot position.

Definition at line 189 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

189 {
190 return m_pivot;
191}

Referenced by set().

◆ radius()

double Ext_Helix::radius ( void  ) const
inline

returns radious of helix.

Definition at line 195 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

195 {
196 return m_r;
197}

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 374 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

376 {
377 m_pivot = pivot;
378 m_a = a;
379 m_Ea = Ea;
380 m_matrixValid = true;
381 updateCache();
382}

◆ sinPhi0()

double Ext_Helix::sinPhi0 ( void  ) const
inline

Definition at line 284 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

284 {
285 return m_sp;
286}

◆ tanl()

double Ext_Helix::tanl ( void  ) const
inline

Definition at line 231 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.

231 {
232 return m_ac[4];
233}

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

◆ x() [1/3]

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

Definition at line 151 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

151 {
152 //
153 // Calculate position (x,y,z) along helix.
154 //
155 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
156 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
157 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
158 //
159
160 p[0] = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi));
161 p[1] = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi));
162 p[2] = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
163
164 return p;
165}

◆ x() [2/3]

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

returns position and convariance matrix(Ex) after rotation.

Definition at line 168 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

168 {
169 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] +phi));
170 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] +phi));
171 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
172
173 //
174 // Calculate position error matrix.
175 // Ex(phi) = (@x/@a)(Ea)(@x/@a)^T, phi is deflection angle to specify the
176 // point to be calcualted.
177 //
178 // HepMatrix dXDA(3, 5, 0);
179 // dXDA = delXDelA(phi);
180 // Ex.assign(dXDA * m_Ea * dXDA.T());
181
182 if (m_matrixValid) Ex = m_Ea.similarity(delXDelA(phi));
183 else Ex = m_Ea;
184
185 return HepPoint3D(x, y, z);
186}
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.

◆ x() [3/3]

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

returns position after rotating angle dPhi in phi direction.

Definition at line 134 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/src/Helix.cxx.

134 {
135 //
136 // Calculate position (x,y,z) along helix.
137 //
138 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
139 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
140 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
141 //
142
143 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] +phi));
144 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] +phi));
145 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
146
147 return HepPoint3D(x, y, z);
148}

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

Member Data Documentation

◆ ConstantAlpha

const double Ext_Helix::ConstantAlpha
static

Constant alpha for uniform field.

Definition at line 151 of file Reconstruction/TrkExtAlg/TrkExtAlg-00-00-60-p01/TrkExtAlg/Helix.h.


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