BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Helix Class Reference

Helix parameter class. More...

#include <Helix.h>

Public Member Functions

 Helix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Constructor with pivot, helix parameter a, and its error matrix.
 
 Helix (const HepPoint3D &pivot, const HepVector &a)
 Constructor without error matrix.
 
 Helix (const HepPoint3D &position, const Hep3Vector &momentum, double charge)
 Constructor with position, momentum, and charge.
 
virtual ~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.
 
double pt (void) const
 
double cosTheta (void) const
 
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
 
Helixoperator= (const 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 = 333.564095
 Constant alpha for uniform field.
 

Protected Attributes

IMagneticFieldSvcm_pmgnIMF
 
double m_bField
 
double m_alpha
 

Detailed Description

Helix parameter class.

Definition at line 53 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

Constructor & Destructor Documentation

◆ Helix() [1/3]

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

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

Definition at line 47 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/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 }
60 m_bField = -10000*(m_pmgnIMF->getReferField());
61 m_alpha = 10000. / 2.99792458 / m_bField;
62 // m_alpha = 10000. / 2.99792458 / m_bField;
63 // m_alpha = 333.564095;
64 updateCache();
65}
virtual double getReferField()=0

Referenced by Helix(), Helix(), and Helix().

◆ Helix() [2/3]

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

Constructor without error matrix.

Definition at line 67 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

69 : //m_bField(-10.0),
70 //m_alpha(-333.564095),
71 m_pivot(pivot),
72 m_a(a),
73 m_matrixValid(false),
74 m_Ea(HepSymMatrix(5,0)) {
75 StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF);
76 if(scmgn!=StatusCode::SUCCESS) {
77 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq;
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}

◆ Helix() [3/3]

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

Constructor with position, momentum, and charge.

Definition at line 87 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

90 : //m_bField(-10.0),
91 //m_alpha(-333.564095),
92 m_pivot(position),
93 m_a(HepVector(5,0)),
94 m_matrixValid(false),
95 m_Ea(HepSymMatrix(5,0)) {
96 StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF);
97 if(scmgn!=StatusCode::SUCCESS) {
98 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq;
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())
106 + M_PI4, M_PI2);
107 m_a[3] = 0.;
108 double perp(momentum.perp());
109 if (perp != 0.0) {
110 m_a[2] = charge / perp;
111 m_a[4] = momentum.z() / perp;
112 }
113 else {
114 m_a[2] = charge * (DBL_MAX);
115 if (momentum.z() >= 0) {
116 m_a[4] = (DBL_MAX);
117 } else {
118 m_a[4] = -(DBL_MAX);
119 }
120 }
121 // m_alpha = 333.564095;
122 updateCache();
123}
**********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
float charge

◆ ~Helix()

Helix::~Helix ( )
virtual

Destructor.

Definition at line 125 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

125 {
126}

Referenced by ~Helix().

Member Function Documentation

◆ a() [1/2]

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

sets helix parameters.

Definition at line 275 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

275 {
276 m_a = i;
277 updateCache();
278 return m_a;
279}

◆ a() [2/2]

◆ bFieldZ() [1/2]

double Helix::bFieldZ ( double a)
inline

sets/returns z componet of the magnetic field.

Definition at line 289 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

289 {
290 m_bField = a;
291 m_alpha = 10000. / 2.99792458 / m_bField;
292 updateCache();
293 return m_bField;
294}
const HepVector & a(void) const
returns helix parameters.

Referenced by bFieldZ(), and bFieldZ().

◆ bFieldZ() [2/2]

double Helix::bFieldZ ( void ) const
inline

Definition at line 298 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

298 {
299 return m_bField;
300}

◆ center()

◆ cosPhi0()

double Helix::cosPhi0 ( void ) const
inline

Definition at line 310 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

310 {
311 return m_cp;
312}

Referenced by cosPhi0().

◆ cosTheta()

double Helix::cosTheta ( void ) const
inline

Definition at line 126 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

126{ return m_a[4]/sqrt(1.+ m_a[4]*m_a[4]); }

◆ curv()

◆ del4MDelA()

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

Definition at line 597 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

Referenced by del4MDelA(), and momentum().

◆ del4MXDelA()

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

Definition at line 643 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

Referenced by del4MXDelA(), and momentum().

◆ delApDelA()

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

Definition at line 438 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

Referenced by delApDelA(), and pivot().

◆ delMDelA()

HepMatrix Helix::delMDelA ( double phi) const

Definition at line 560 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

Referenced by delMDelA(), and momentum().

◆ delXDelA()

HepMatrix Helix::delXDelA ( double phi) const

Definition at line 506 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

Referenced by delXDelA(), and x().

◆ direction()

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

returns direction vector after rotating angle dPhi in phi direction.

Definition at line 221 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

221 {
222 return momentum(phi).unit();
223}

Referenced by direction(), Emc_helix::Emc_Get(), and TofFz_helix::TofFz_Get().

◆ dr()

double Helix::dr ( void ) const
inline

returns an element of parameters.

Definition at line 227 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

227 {
228 return m_ac[0];
229}

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

◆ dz()

double Helix::dz ( void ) const
inline

◆ Ea() [1/2]

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

sets helix paramters and error matrix.

Definition at line 283 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

283 {
284 return m_Ea = i;
285}

◆ Ea() [2/2]

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

◆ ignoreErrorMatrix()

void 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 714 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

714 {
715 m_matrixValid = false;
716 m_Ea *= 0.;
717}

Referenced by EsTimeAlg::execute(), and ignoreErrorMatrix().

◆ kappa()

double Helix::kappa ( void ) const
inline

◆ momentum() [1/5]

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

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

Definition at line 227 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

227 {
228 //
229 // Calculate momentum.
230 //
231 // Pt = | 1/kappa | (GeV/c)
232 //
233 // Px = -Pt * sin(phi0 + phi)
234 // Py = Pt * cos(phi0 + phi)
235 // Pz = Pt * tan(lambda)
236 //
237 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
238
239 double pt = fabs(m_pt);
240 double px = - pt * sin(m_ac[1] + phi);
241 double py = pt * cos(m_ac[1] + phi);
242 double pz = pt * m_ac[4];
243 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass);
244
245 return HepLorentzVector(px, py, pz, E);
246}
NTuple::Item< double > m_pt
Definition MdcHistItem.h:76

◆ momentum() [2/5]

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

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

Definition at line 275 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

◆ momentum() [3/5]

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

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

Definition at line 250 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

250 {
251 //
252 // Calculate momentum.
253 //
254 // Pt = | 1/kappa | (GeV/c)
255 //
256 // Px = -Pt * sin(phi0 + phi)
257 // Py = Pt * cos(phi0 + phi)
258 // Pz = Pt * tan(lambda)
259 //
260 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
261
262 double pt = fabs(m_pt);
263 double px = - pt * sin(m_ac[1] + phi);
264 double py = pt * cos(m_ac[1] + phi);
265 double pz = pt * m_ac[4];
266 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass);
267
268 if (m_matrixValid) Em = m_Ea.similarity(del4MDelA(phi,mass));
269 else Em = m_Ea;
270
271 return HepLorentzVector(px, py, pz, E);
272}
HepMatrix del4MDelA(double phi, double mass) const

◆ momentum() [4/5]

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

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 204 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

◆ momentum() [5/5]

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

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 184 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

Referenced by EsTimeAlg::execute(), momentum(), momentum(), momentum(), momentum(), momentum(), and TTrack::p().

◆ operator=()

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

Copy operator.

Definition at line 380 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

◆ phi0()

double Helix::phi0 ( void ) const
inline

◆ pivot() [1/2]

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

sets pivot position.

Definition at line 308 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

◆ pivot() [2/2]

◆ pt()

double Helix::pt ( void ) const
inline

◆ radius()

◆ set()

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

sets helix pivot position, parameters, and error matrix.

Definition at line 369 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

371 {
372 m_pivot = pivot;
373 m_a = a;
374 m_Ea = Ea;
375 m_matrixValid = true;
376 updateCache();
377}

Referenced by MdcUtilitySvc::getHelixOfMcParticle(), and set().

◆ sinPhi0()

double Helix::sinPhi0 ( void ) const
inline

Definition at line 304 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

304 {
305 return m_sp;
306}

Referenced by sinPhi0().

◆ tanl()

double Helix::tanl ( void ) const
inline

◆ x() [1/3]

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

Definition at line 146 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

◆ x() [2/3]

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

returns position and convariance matrix(Ex) after rotation.

Definition at line 163 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

◆ x() [3/3]

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

returns position after rotating angle dPhi in phi direction.

Definition at line 129 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/src/Helix.cxx.

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

Referenced by TTrack::approach(), TTrack::approach2D(), EsTimeAlg::execute(), TTrack::fit2D(), TTrack::HelCyl(), RkFitCylinder::intersect(), RkFitCylinder::intersect(), TRunge::SetFlightLength(), TofFz_helix::TofFz_Get(), x(), x(), and x().

Member Data Documentation

◆ ConstantAlpha

const double Helix::ConstantAlpha = 333.564095
static

Constant alpha for uniform field.

Definition at line 171 of file Reconstruction/TrackUtil/TrackUtil-00-00-08/TrackUtil/Helix.h.

◆ m_alpha

double Helix::m_alpha
protected

◆ m_bField

double Helix::m_bField
protected

◆ m_pmgnIMF

IMagneticFieldSvc* Helix::m_pmgnIMF
protected

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