CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
Dedx_Helix Class Reference

Helix parameter class. More...

#include <Dedx_Helix.h>

Public Member Functions

 Dedx_Helix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Constructor with pivot, helix parameter a, and its error matrix.
 
 Dedx_Helix (const HepPoint3D &pivot, const HepVector &a)
 Constructor without error matrix.
 
 Dedx_Helix (const HepPoint3D &position, const Hep3Vector &momentum, double charge)
 Constructor with position, momentum, and charge.
 
virtual ~Dedx_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
 
Dedx_Helixoperator= (const Dedx_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.
 

Detailed Description

Helix parameter class.

Definition at line 33 of file Dedx_Helix.h.

Constructor & Destructor Documentation

◆ Dedx_Helix() [1/3]

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

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

Definition at line 126 of file Dedx_Helix.cxx.

129: //m_bField(10.0),
130 //m_alpha(333.564095),
131 m_pivot(pivot),
132 m_a(a),
133 m_matrixValid(true),
134 m_Ea(Ea) {
135 //ISvcLocator * SvcLocator = Gaudi::SvcLocator();
136 StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF);
137 if(scmgn!=StatusCode::SUCCESS) {
138 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq;
139 std::cout<< "Unable to open Magnetic field service"<<std::endl;
140 }
141 m_bField = 10000*(m_pmgnIMF->getReferField());
142 m_alpha = 10000. / 2.99792458 / m_bField;
143 // m_alpha = 222.376063;
144 updateCache();
145}
const HepVector & a(void) const
returns helix parameters.
Definition: Dedx_Helix.h:238
const HepSymMatrix & Ea(void) const
returns error matrix.
Definition: Dedx_Helix.h:244
const HepPoint3D & pivot(void) const
returns pivot position.
Definition: Dedx_Helix.h:184
virtual double getReferField()=0

◆ Dedx_Helix() [2/3]

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

Constructor without error matrix.

Definition at line 147 of file Dedx_Helix.cxx.

149: //m_bField(10.0),
150 //m_alpha(333.564095),
151 m_pivot(pivot),
152 m_a(a),
153 m_matrixValid(false),
154 m_Ea(HepSymMatrix(5,0)) {
155 StatusCode scmgn = Gaudi::svcLocator()->service ("MagneticFieldSvc",m_pmgnIMF);
156 if(scmgn!=StatusCode::SUCCESS) {
157 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq;
158 std::cout<< "Unable to open Magnetic field service"<<std::endl;
159 }
160 m_bField = 10000*(m_pmgnIMF->getReferField());
161 m_alpha = 10000. / 2.99792458 / m_bField;
162 //cout<<"m_bField is = "<<m_bField<<" m_alpha is = "<<m_alpha<<endl;
163 // m_alpha = 222.376063;
164 updateCache();
165}

◆ Dedx_Helix() [3/3]

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

Constructor with position, momentum, and charge.

Definition at line 167 of file Dedx_Helix.cxx.

170: //m_bField(10.0),
171 //m_alpha(333.564095),
172 m_pivot(position),
173 m_a(HepVector(5,0)),
174 m_matrixValid(false),
175 m_Ea(HepSymMatrix(5,0)) {
176 StatusCode scmgn = Gaudi::svcLocator()->service ("MagneticFieldSvc",m_pmgnIMF);
177 if(scmgn!=StatusCode::SUCCESS) {
178 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq;
179 std::cout<< "Unable to open Magnetic field service"<<std::endl;
180 }
181 m_bField = 10000*(m_pmgnIMF->getReferField());
182 m_alpha = 10000. / 2.99792458 / m_bField;
183
184 m_a[0] = 0.;
185 m_a[1] = fmod(atan2(- momentum.x(), momentum.y())
186 + M_PI4, M_PI2);
187 m_a[3] = 0.;
188 double perp(momentum.perp());
189 if (perp != 0.0) {
190 m_a[2] = charge / perp;
191 m_a[4] = momentum.z() / perp;
192 }
193 else {
194 m_a[2] = charge * (DBL_MAX);
195 if (momentum.z() >= 0) {
196 m_a[4] = (DBL_MAX);
197 } else {
198 m_a[4] = -(DBL_MAX);
199 }
200 }
201 // m_alpha = 222.376063;
202 updateCache();
203}
**********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

◆ ~Dedx_Helix()

Dedx_Helix::~Dedx_Helix ( )
virtual

Destructor.

Definition at line 205 of file Dedx_Helix.cxx.

205 {
206}

Member Function Documentation

◆ a() [1/2]

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

sets helix parameters.

Definition at line 250 of file Dedx_Helix.h.

250 {
251 m_a = i;
252 updateCache();
253 return m_a;
254}

◆ a() [2/2]

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

returns helix parameters.

Definition at line 238 of file Dedx_Helix.h.

238 {
239 return m_a;
240}

Referenced by bFieldZ(), DedxCorrecSvc::PathL(), and set().

◆ bFieldZ() [1/2]

double Dedx_Helix::bFieldZ ( double  a)
inline

sets/returns z componet of the magnetic field.

Definition at line 264 of file Dedx_Helix.h.

264 {
265 m_bField = a;
266 m_alpha = 10000. / 2.99792458 / m_bField;
267 updateCache();
268 return m_bField;
269}

◆ bFieldZ() [2/2]

double Dedx_Helix::bFieldZ ( void  ) const
inline

Definition at line 273 of file Dedx_Helix.h.

273 {
274 return m_bField;
275}

◆ center()

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

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

Definition at line 178 of file Dedx_Helix.h.

178 {
179 return m_center;
180}

◆ cosPhi0()

double Dedx_Helix::cosPhi0 ( void  ) const
inline

Definition at line 285 of file Dedx_Helix.h.

285 {
286 return m_cp;
287}

◆ curv()

double Dedx_Helix::curv ( void  ) const
inline

Definition at line 232 of file Dedx_Helix.h.

232 {
233 return m_r;
234}

◆ del4MDelA()

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

Definition at line 681 of file Dedx_Helix.cxx.

681 {
682 //
683 // Calculate Jacobian (@4m/@a)
684 // Vector a is helix parameters and phi is internal parameter.
685 // Vector 4m is 4 momentum.
686 //
687
688 HepMatrix d4MDA(4,5,0);
689
690 double phi0 = m_ac[1];
691 double cpa = m_ac[2];
692 double tnl = m_ac[4];
693
694 double cosf0phi = cos(phi0+phi);
695 double sinf0phi = sin(phi0+phi);
696
697 double rho;
698 if(cpa != 0.)rho = 1./cpa;
699 else rho = (DBL_MAX);
700
701 double charge = 1.;
702 if(cpa < 0.)charge = -1.;
703
704 double E = sqrt(rho*rho*(1.+tnl*tnl)+mass*mass);
705
706 d4MDA[0][1] = -fabs(rho)*cosf0phi;
707 d4MDA[0][2] = charge*rho*rho*sinf0phi;
708
709 d4MDA[1][1] = -fabs(rho)*sinf0phi;
710 d4MDA[1][2] = -charge*rho*rho*cosf0phi;
711
712 d4MDA[2][2] = -charge*rho*rho*tnl;
713 d4MDA[2][4] = fabs(rho);
714
715 if (cpa != 0.0 && E != 0.0) {
716 d4MDA[3][2] = (-1.-tnl*tnl)/(cpa*cpa*cpa*E);
717 d4MDA[3][4] = tnl/(cpa*cpa*E);
718 } else {
719 d4MDA[3][2] = (DBL_MAX);
720 d4MDA[3][4] = (DBL_MAX);
721 }
722 return d4MDA;
723}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
double mass
double phi0(void) const
Definition: Dedx_Helix.h:208

Referenced by momentum().

◆ del4MXDelA()

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

Definition at line 727 of file Dedx_Helix.cxx.

727 {
728 //
729 // Calculate Jacobian (@4mx/@a)
730 // Vector a is helix parameters and phi is internal parameter.
731 // Vector 4xm is 4 momentum and position.
732 //
733
734 HepMatrix d4MXDA(7,5,0);
735
736 const double & dr = m_ac[0];
737 const double & phi0 = m_ac[1];
738 const double & cpa = m_ac[2];
739 const double & dz = m_ac[3];
740 const double & tnl = m_ac[4];
741
742 double cosf0phi = cos(phi0+phi);
743 double sinf0phi = sin(phi0+phi);
744
745 double rho;
746 if(cpa != 0.)rho = 1./cpa;
747 else rho = (DBL_MAX);
748
749 double charge = 1.;
750 if(cpa < 0.)charge = -1.;
751
752 double E = sqrt(rho * rho * (1. + tnl * tnl) + mass * mass);
753
754 d4MXDA[0][1] = - fabs(rho) * cosf0phi;
755 d4MXDA[0][2] = charge * rho * rho * sinf0phi;
756
757 d4MXDA[1][1] = - fabs(rho) * sinf0phi;
758 d4MXDA[1][2] = - charge * rho * rho * cosf0phi;
759
760 d4MXDA[2][2] = - charge * rho * rho * tnl;
761 d4MXDA[2][4] = fabs(rho);
762
763 if (cpa != 0.0 && E != 0.0) {
764 d4MXDA[3][2] = (- 1. - tnl * tnl) / (cpa * cpa * cpa * E);
765 d4MXDA[3][4] = tnl / (cpa * cpa * E);
766 } else {
767 d4MXDA[3][2] = (DBL_MAX);
768 d4MXDA[3][4] = (DBL_MAX);
769 }
770
771 d4MXDA[4][0] = m_cp;
772 d4MXDA[4][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi);
773 if (cpa != 0.0) {
774 d4MXDA[4][2] = - (m_r / cpa) * (m_cp - cosf0phi);
775 } else {
776 d4MXDA[4][2] = (DBL_MAX);
777 }
778
779 d4MXDA[5][0] = m_sp;
780 d4MXDA[5][1] = dr * m_cp + m_r * (m_cp - cosf0phi);
781 if (cpa != 0.0) {
782 d4MXDA[5][2] = - (m_r / cpa) * (m_sp - sinf0phi);
783
784 d4MXDA[6][2] = (m_r / cpa) * tnl * phi;
785 } else {
786 d4MXDA[5][2] = (DBL_MAX);
787
788 d4MXDA[6][2] = (DBL_MAX);
789 }
790
791 d4MXDA[6][3] = 1.;
792 d4MXDA[6][4] = - m_r * phi;
793
794 return d4MXDA;
795}
double dz(void) const
Definition: Dedx_Helix.h:220
double dr(void) const
returns an element of parameters.
Definition: Dedx_Helix.h:202

Referenced by momentum().

◆ delApDelA()

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

Definition at line 522 of file Dedx_Helix.cxx.

522 {
523 //
524 // Calculate Jacobian (@ap/@a)
525 // Vector ap is new helix parameters and a is old helix parameters.
526 //
527
528 HepMatrix dApDA(5,5,0);
529
530 const double & dr = m_ac[0];
531 const double & phi0 = m_ac[1];
532 const double & cpa = m_ac[2];
533 const double & dz = m_ac[3];
534 const double & tnl = m_ac[4];
535
536 double drp = ap[0];
537 double phi0p = ap[1];
538 double cpap = ap[2];
539 double dzp = ap[3];
540 double tnlp = ap[4];
541
542 double rdr = m_r + dr;
543 double rdrpr;
544 if ((m_r + drp) != 0.0) {
545 rdrpr = 1. / (m_r + drp);
546 } else {
547 rdrpr = (DBL_MAX);
548 }
549 // double csfd = cos(phi0)*cos(phi0p) + sin(phi0)*sin(phi0p);
550 // double snfd = cos(phi0)*sin(phi0p) - sin(phi0)*cos(phi0p);
551 double csfd = cos(phi0p - phi0);
552 double snfd = sin(phi0p - phi0);
553 double phid = fmod(phi0p - phi0 + M_PI8, M_PI2);
554 if (phid > M_PI) phid = phid - M_PI2;
555
556 dApDA[0][0] = csfd;
557 dApDA[0][1] = rdr*snfd;
558 if(cpa!=0.0) {
559 dApDA[0][2] = (m_r/cpa)*( 1.0 - csfd );
560 } else {
561 dApDA[0][2] = (DBL_MAX);
562 }
563
564 dApDA[1][0] = - rdrpr*snfd;
565 dApDA[1][1] = rdr*rdrpr*csfd;
566 if(cpa!=0.0) {
567 dApDA[1][2] = (m_r/cpa)*rdrpr*snfd;
568 } else {
569 dApDA[1][2] = (DBL_MAX);
570 }
571
572 dApDA[2][2] = 1.0;
573
574 dApDA[3][0] = m_r*rdrpr*tnl*snfd;
575 dApDA[3][1] = m_r*tnl*(1.0 - rdr*rdrpr*csfd);
576 if(cpa!=0.0) {
577 dApDA[3][2] = (m_r/cpa)*tnl*(phid - m_r*rdrpr*snfd);
578 } else {
579 dApDA[3][2] = (DBL_MAX);
580 }
581 dApDA[3][3] = 1.0;
582 dApDA[3][4] = - m_r*phid;
583
584 dApDA[4][4] = 1.0;
585
586 return dApDA;
587}
#define M_PI
Definition: TConstant.h:4

Referenced by pivot().

◆ delMDelA()

HepMatrix Dedx_Helix::delMDelA ( double  phi) const

Definition at line 644 of file Dedx_Helix.cxx.

644 {
645 //
646 // Calculate Jacobian (@m/@a)
647 // Vector a is helix parameters and phi is internal parameter.
648 // Vector m is momentum.
649 //
650
651 HepMatrix dMDA(3,5,0);
652
653 const double & phi0 = m_ac[1];
654 const double & cpa = m_ac[2];
655 const double & tnl = m_ac[4];
656
657 double cosf0phi = cos(phi0+phi);
658 double sinf0phi = sin(phi0+phi);
659
660 double rho;
661 if(cpa != 0.)rho = 1./cpa;
662 else rho = (DBL_MAX);
663
664 double charge = 1.;
665 if(cpa < 0.)charge = -1.;
666
667 dMDA[0][1] = -fabs(rho)*cosf0phi;
668 dMDA[0][2] = charge*rho*rho*sinf0phi;
669
670 dMDA[1][1] = -fabs(rho)*sinf0phi;
671 dMDA[1][2] = -charge*rho*rho*cosf0phi;
672
673 dMDA[2][2] = -charge*rho*rho*tnl;
674 dMDA[2][4] = fabs(rho);
675
676 return dMDA;
677}

Referenced by momentum().

◆ delXDelA()

HepMatrix Dedx_Helix::delXDelA ( double  phi) const

Definition at line 590 of file Dedx_Helix.cxx.

590 {
591 //
592 // Calculate Jacobian (@x/@a)
593 // Vector a is helix parameters and phi is internal parameter
594 // which specifys the point to be calculated for Ex(phi).
595 //
596
597 HepMatrix dXDA(3,5,0);
598
599 const double & dr = m_ac[0];
600 const double & phi0 = m_ac[1];
601 const double & cpa = m_ac[2];
602 const double & dz = m_ac[3];
603 const double & tnl = m_ac[4];
604
605 double cosf0phi = cos(phi0 + phi);
606 double sinf0phi = sin(phi0 + phi);
607
608 dXDA[0][0] = m_cp;
609 dXDA[0][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi);
610 if(cpa!=0.0) {
611 dXDA[0][2] = - (m_r / cpa) * (m_cp - cosf0phi);
612 } else {
613 dXDA[0][2] = (DBL_MAX);
614 }
615 // dXDA[0][3] = 0.0;
616 // dXDA[0][4] = 0.0;
617
618 dXDA[1][0] = m_sp;
619 dXDA[1][1] = dr * m_cp + m_r * (m_cp - cosf0phi);
620 if(cpa!=0.0) {
621 dXDA[1][2] = - (m_r / cpa) * (m_sp - sinf0phi);
622 } else {
623 dXDA[1][2] = (DBL_MAX);
624 }
625 // dXDA[1][3] = 0.0;
626 // dXDA[1][4] = 0.0;
627
628 // dXDA[2][0] = 0.0;
629 // dXDA[2][1] = 0.0;
630 if(cpa!=0.0) {
631 dXDA[2][2] = (m_r / cpa) * tnl * phi;
632 } else {
633 dXDA[2][2] = (DBL_MAX);
634 }
635 dXDA[2][3] = 1.0;
636 dXDA[2][4] = - m_r * phi;
637
638 return dXDA;
639}

Referenced by x().

◆ direction()

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

returns direction vector after rotating angle dPhi in phi direction.

Definition at line 196 of file Dedx_Helix.h.

196 {
197 return momentum(phi).unit();
198}

◆ dr()

double Dedx_Helix::dr ( void  ) const
inline

returns an element of parameters.

Definition at line 202 of file Dedx_Helix.h.

202 {
203 return m_ac[0];
204}

Referenced by del4MXDelA(), delApDelA(), delXDelA(), DedxCorrecSvc::PathL(), and pivot().

◆ dz()

double Dedx_Helix::dz ( void  ) const
inline

Definition at line 220 of file Dedx_Helix.h.

220 {
221 return m_ac[3];
222}

Referenced by del4MXDelA(), delApDelA(), delXDelA(), DedxCorrecSvc::PathL(), and pivot().

◆ Ea() [1/2]

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

sets helix paramters and error matrix.

Definition at line 258 of file Dedx_Helix.h.

258 {
259 return m_Ea = i;
260}

◆ Ea() [2/2]

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

returns error matrix.

Definition at line 244 of file Dedx_Helix.h.

244 {
245 return m_Ea;
246}

Referenced by set().

◆ ignoreErrorMatrix()

void Dedx_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 798 of file Dedx_Helix.cxx.

798 {
799 m_matrixValid = false;
800 m_Ea *= 0.;
801}

◆ kappa()

double Dedx_Helix::kappa ( void  ) const
inline

Definition at line 214 of file Dedx_Helix.h.

214 {
215 return m_ac[2];
216}

Referenced by pivot().

◆ momentum() [1/5]

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

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

Definition at line 311 of file Dedx_Helix.cxx.

311 {
312 //
313 // Calculate momentum.
314 //
315 // Pt = | 1/kappa | (GeV/c)
316 //
317 // Px = -Pt * sin(phi0 + phi)
318 // Py = Pt * cos(phi0 + phi)
319 // Pz = Pt * tan(lambda)
320 //
321 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
322
323 double pt = fabs(m_pt);
324 double px = - pt * sin(m_ac[1] + phi);
325 double py = pt * cos(m_ac[1] + phi);
326 double pz = pt * m_ac[4];
327 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass);
328
329 return HepLorentzVector(px, py, pz, E);
330}

◆ momentum() [2/5]

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

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

Definition at line 359 of file Dedx_Helix.cxx.

362 {
363 //
364 // Calculate momentum.
365 //
366 // Pt = | 1/kappa | (GeV/c)
367 //
368 // Px = -Pt * sin(phi0 + phi)
369 // Py = Pt * cos(phi0 + phi)
370 // Pz = Pt * tan(lambda)
371 //
372 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
373
374 double pt = fabs(m_pt);
375 double px = - pt * sin(m_ac[1] + phi);
376 double py = pt * cos(m_ac[1] + phi);
377 double pz = pt * m_ac[4];
378 double E = sqrt(pt * pt * (1. + m_ac[4] * m_ac[4]) + mass * mass);
379
380 x.setX(m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi)));
381 x.setY(m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi)));
382 x.setZ(m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi);
383
384 if (m_matrixValid) Emx = m_Ea.similarity(del4MXDelA(phi,mass));
385 else Emx = m_Ea;
386
387 return HepLorentzVector(px, py, pz, E);
388}
Double_t x[10]
HepMatrix del4MXDelA(double phi, double mass) const
Definition: Dedx_Helix.cxx:727

◆ momentum() [3/5]

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

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

Definition at line 334 of file Dedx_Helix.cxx.

334 {
335 //
336 // Calculate momentum.
337 //
338 // Pt = | 1/kappa | (GeV/c)
339 //
340 // Px = -Pt * sin(phi0 + phi)
341 // Py = Pt * cos(phi0 + phi)
342 // Pz = Pt * tan(lambda)
343 //
344 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
345
346 double pt = fabs(m_pt);
347 double px = - pt * sin(m_ac[1] + phi);
348 double py = pt * cos(m_ac[1] + phi);
349 double pz = pt * m_ac[4];
350 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass);
351
352 if (m_matrixValid) Em = m_Ea.similarity(del4MDelA(phi,mass));
353 else Em = m_Ea;
354
355 return HepLorentzVector(px, py, pz, E);
356}
HepMatrix del4MDelA(double phi, double mass) const
Definition: Dedx_Helix.cxx:681

◆ momentum() [4/5]

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

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 288 of file Dedx_Helix.cxx.

288 {
289 //
290 // Calculate momentum.
291 //
292 // Pt = | 1/kappa | (GeV/c)
293 //
294 // Px = -Pt * sin(phi0 + phi)
295 // Py = Pt * cos(phi0 + phi)
296 // Pz = Pt * tan(lambda)
297 //
298
299 double pt = fabs(m_pt);
300 double px = - pt * sin(m_ac[1] + phi);
301 double py = pt * cos(m_ac[1] + phi);
302 double pz = pt * m_ac[4];
303
304 if (m_matrixValid) Em = m_Ea.similarity(delMDelA(phi));
305 else Em = m_Ea;
306
307 return Hep3Vector(px, py, pz);
308}
HepMatrix delMDelA(double phi) const
Definition: Dedx_Helix.cxx:644

◆ momentum() [5/5]

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

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 268 of file Dedx_Helix.cxx.

268 {
269 //
270 // Calculate momentum.
271 //
272 // Pt = | 1/kappa | (GeV/c)
273 //
274 // Px = -Pt * sin(phi0 + phi)
275 // Py = Pt * cos(phi0 + phi)
276 // Pz = Pt * tan(lambda)
277 //
278
279 double pt = fabs(m_pt);
280 double px = - pt * sin(m_ac[1] + phi);
281 double py = pt * cos(m_ac[1] + phi);
282 double pz = pt * m_ac[4];
283
284 return Hep3Vector(px, py, pz);
285}

◆ operator=()

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

Copy operator.

Definition at line 464 of file Dedx_Helix.cxx.

464 {
465 if (this == & i) return * this;
466
467 m_bField = i.m_bField;
468 m_alpha = i.m_alpha;
469 m_pivot = i.m_pivot;
470 m_a = i.m_a;
471 m_Ea = i.m_Ea;
472 m_matrixValid = i.m_matrixValid;
473
474 m_center = i.m_center;
475 m_cp = i.m_cp;
476 m_sp = i.m_sp;
477 m_pt = i.m_pt;
478 m_r = i.m_r;
479 m_ac[0] = i.m_ac[0];
480 m_ac[1] = i.m_ac[1];
481 m_ac[2] = i.m_ac[2];
482 m_ac[3] = i.m_ac[3];
483 m_ac[4] = i.m_ac[4];
484
485 return * this;
486}

◆ phi0()

double Dedx_Helix::phi0 ( void  ) const
inline

Definition at line 208 of file Dedx_Helix.h.

208 {
209 return m_ac[1];
210}

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

◆ pivot() [1/2]

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

sets pivot position.

Definition at line 392 of file Dedx_Helix.cxx.

392 {
393 const double & dr = m_ac[0];
394 const double & phi0 = m_ac[1];
395 const double & kappa = m_ac[2];
396 const double & dz = m_ac[3];
397 const double & tanl = m_ac[4];
398
399 double rdr = dr + m_r;
400 double phi = fmod(phi0 + M_PI4, M_PI2);
401 double csf0 = cos(phi);
402 double snf0 = (1. - csf0) * (1. + csf0);
403 snf0 = sqrt((snf0 > 0.) ? snf0 : 0.);
404 if(phi > M_PI) snf0 = - snf0;
405
406 double xc = m_pivot.x() + rdr * csf0;
407 double yc = m_pivot.y() + rdr * snf0;
408 double csf, snf;
409 if(m_r != 0.0) {
410 csf = (xc - newPivot.x()) / m_r;
411 snf = (yc - newPivot.y()) / m_r;
412 double anrm = sqrt(csf * csf + snf * snf);
413 if(anrm != 0.0) {
414 csf /= anrm;
415 snf /= anrm;
416 phi = atan2(snf, csf);
417 } else {
418 csf = 1.0;
419 snf = 0.0;
420 phi = 0.0;
421 }
422 } else {
423 csf = 1.0;
424 snf = 0.0;
425 phi = 0.0;
426 }
427 double phid = fmod(phi - phi0 + M_PI8, M_PI2);
428 if(phid > M_PI) phid = phid - M_PI2;
429 double drp = (m_pivot.x() + dr * csf0 + m_r * (csf0 - csf) - newPivot.x())
430 * csf
431 + (m_pivot.y() + dr * snf0 + m_r * (snf0 - snf) - newPivot.y()) * snf;
432 double dzp = m_pivot.z() + dz - m_r * tanl * phid - newPivot.z();
433
434 HepVector ap(5);
435 ap[0] = drp;
436 ap[1] = fmod(phi + M_PI4, M_PI2);
437 ap[2] = kappa;
438 ap[3] = dzp;
439 ap[4] = tanl;
440
441 // if (m_matrixValid) m_Ea.assign(delApDelA(ap) * m_Ea * delApDelA(ap).T());
442 if (m_matrixValid) m_Ea = m_Ea.similarity(delApDelA(ap));
443
444 m_a = ap;
445 m_pivot = newPivot;
446
447 //...Are these needed?...iw...
448 updateCache();
449 return m_pivot;
450}
double kappa(void) const
Definition: Dedx_Helix.h:214
double tanl(void) const
Definition: Dedx_Helix.h:226
HepMatrix delApDelA(const HepVector &ap) const
Definition: Dedx_Helix.cxx:522

◆ pivot() [2/2]

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

returns pivot position.

Definition at line 184 of file Dedx_Helix.h.

184 {
185 return m_pivot;
186}

Referenced by DedxCorrecSvc::PathL(), and set().

◆ radius()

double Dedx_Helix::radius ( void  ) const
inline

returns radious of helix.

Definition at line 190 of file Dedx_Helix.h.

190 {
191 return m_r;
192}

◆ set()

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

sets helix pivot position, parameters, and error matrix.

Definition at line 453 of file Dedx_Helix.cxx.

455 {
456 m_pivot = pivot;
457 m_a = a;
458 m_Ea = Ea;
459 m_matrixValid = true;
460 updateCache();
461}

◆ sinPhi0()

double Dedx_Helix::sinPhi0 ( void  ) const
inline

Definition at line 279 of file Dedx_Helix.h.

279 {
280 return m_sp;
281}

◆ tanl()

double Dedx_Helix::tanl ( void  ) const
inline

Definition at line 226 of file Dedx_Helix.h.

226 {
227 return m_ac[4];
228}

Referenced by pivot().

◆ x() [1/3]

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

Definition at line 230 of file Dedx_Helix.cxx.

230 {
231 //
232 // Calculate position (x,y,z) along helix.
233 //
234 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
235 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
236 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
237 //
238
239 p[0] = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi));
240 p[1] = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi));
241 p[2] = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
242
243 return p;
244}

◆ x() [2/3]

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

returns position and convariance matrix(Ex) after rotation.

Definition at line 247 of file Dedx_Helix.cxx.

247 {
248 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] +phi));
249 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] +phi));
250 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
251
252 //
253 // Calculate position error matrix.
254 // Ex(phi) = (@x/@a)(Ea)(@x/@a)^T, phi is deflection angle to specify the
255 // point to be calcualted.
256 //
257 // HepMatrix dXDA(3, 5, 0);
258 // dXDA = delXDelA(phi);
259 // Ex.assign(dXDA * m_Ea * dXDA.T());
260
261 if (m_matrixValid) Ex = m_Ea.similarity(delXDelA(phi));
262 else Ex = m_Ea;
263
264 return HepPoint3D(x, y, z);
265}
HepGeom::Point3D< double > HepPoint3D
Definition: Dedx_Helix.h:25
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.
Definition: Dedx_Helix.cxx:209
HepMatrix delXDelA(double phi) const
Definition: Dedx_Helix.cxx:590

◆ x() [3/3]

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

returns position after rotating angle dPhi in phi direction.

Definition at line 209 of file Dedx_Helix.cxx.

209 {
210 //
211 // Calculate position (x,y,z) along helix.
212 //
213 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
214 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
215 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
216 //
217 // m_ac[0] = m_ac[0] *(-1);
218 // cout<<"m_bField is = "<<m_bField<<" m_alpha is = "<<m_alpha<<endl;
219 // cout<<"m_pivot is = "<<m_pivot<<" m_ac is = ("<<m_ac[0]<<" , "<<m_ac[1]<<" , "<<m_ac[2]<<" , "<<m_ac[3]<<" , "<<m_ac[4]<<" )"<<endl;
220 //cout<<"m_cp is = "<<m_cp<<" "<<" m_sp is = "<<m_sp<<" m_r is = "<<m_r<<endl;
221 //cout<<" m_r + m_ac[0] = "<<m_ac[0] +m_r<<endl;
222 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] +phi));
223 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] +phi));
224 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
225
226 return HepPoint3D(x, y, z);
227}

Referenced by DedxCorrecSvc::PathL(), and x().

Member Data Documentation

◆ ConstantAlpha

const double Dedx_Helix::ConstantAlpha = -333.564095
static

Constant alpha for uniform field.

Definition at line 146 of file Dedx_Helix.h.


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