#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 HepPoint3D & | center (void) const |
returns position of helix center(z = 0.); | |
const HepPoint3D & | pivot (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 HepPoint3D & | pivot (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_Helix & | operator= (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. | |
Private Member Functions | |
void | updateCache (void) |
Private Attributes | |
IMagneticFieldSvc * | m_pmgnIMF |
double | m_bField |
double | m_alpha |
HepPoint3D | m_pivot |
HepVector | m_a |
HepSymMatrix | m_Ea |
bool | m_matrixValid |
HepPoint3D | m_center |
double | m_cp |
double | m_sp |
double | m_pt |
double | m_r |
double | m_ac [5] |
Definition at line 33 of file Dedx_Helix.h.
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.
References IMagneticFieldSvc::getReferField(), m_alpha, m_bField, m_pmgnIMF, and updateCache().
00129 : //m_bField(10.0), 00130 //m_alpha(333.564095), 00131 m_pivot(pivot), 00132 m_a(a), 00133 m_matrixValid(true), 00134 m_Ea(Ea) { 00135 //ISvcLocator * SvcLocator = Gaudi::SvcLocator(); 00136 StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF); 00137 if(scmgn!=StatusCode::SUCCESS) { 00138 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq; 00139 std::cout<< "Unable to open Magnetic field service"<<std::endl; 00140 } 00141 m_bField = 10000*(m_pmgnIMF->getReferField()); 00142 m_alpha = 10000. / 2.99792458 / m_bField; 00143 // m_alpha = 222.376063; 00144 updateCache(); 00145 }
Dedx_Helix::Dedx_Helix | ( | const HepPoint3D & | pivot, | |
const HepVector & | a | |||
) |
Constructor without error matrix.
Definition at line 147 of file Dedx_Helix.cxx.
References IMagneticFieldSvc::getReferField(), m_alpha, m_bField, m_pmgnIMF, and updateCache().
00149 : //m_bField(10.0), 00150 //m_alpha(333.564095), 00151 m_pivot(pivot), 00152 m_a(a), 00153 m_matrixValid(false), 00154 m_Ea(HepSymMatrix(5,0)) { 00155 StatusCode scmgn = Gaudi::svcLocator()->service ("MagneticFieldSvc",m_pmgnIMF); 00156 if(scmgn!=StatusCode::SUCCESS) { 00157 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq; 00158 std::cout<< "Unable to open Magnetic field service"<<std::endl; 00159 } 00160 m_bField = 10000*(m_pmgnIMF->getReferField()); 00161 m_alpha = 10000. / 2.99792458 / m_bField; 00162 //cout<<"m_bField is = "<<m_bField<<" m_alpha is = "<<m_alpha<<endl; 00163 // m_alpha = 222.376063; 00164 updateCache(); 00165 }
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.
References DBL_MAX, IMagneticFieldSvc::getReferField(), m_a, m_alpha, m_bField, M_PI2, M_PI4, m_pmgnIMF, and updateCache().
00170 : //m_bField(10.0), 00171 //m_alpha(333.564095), 00172 m_pivot(position), 00173 m_a(HepVector(5,0)), 00174 m_matrixValid(false), 00175 m_Ea(HepSymMatrix(5,0)) { 00176 StatusCode scmgn = Gaudi::svcLocator()->service ("MagneticFieldSvc",m_pmgnIMF); 00177 if(scmgn!=StatusCode::SUCCESS) { 00178 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq; 00179 std::cout<< "Unable to open Magnetic field service"<<std::endl; 00180 } 00181 m_bField = 10000*(m_pmgnIMF->getReferField()); 00182 m_alpha = 10000. / 2.99792458 / m_bField; 00183 00184 m_a[0] = 0.; 00185 m_a[1] = fmod(atan2(- momentum.x(), momentum.y()) 00186 + M_PI4, M_PI2); 00187 m_a[3] = 0.; 00188 double perp(momentum.perp()); 00189 if (perp != 0.0) { 00190 m_a[2] = charge / perp; 00191 m_a[4] = momentum.z() / perp; 00192 } 00193 else { 00194 m_a[2] = charge * (DBL_MAX); 00195 if (momentum.z() >= 0) { 00196 m_a[4] = (DBL_MAX); 00197 } else { 00198 m_a[4] = -(DBL_MAX); 00199 } 00200 } 00201 // m_alpha = 222.376063; 00202 updateCache(); 00203 }
Dedx_Helix::~Dedx_Helix | ( | ) | [virtual] |
const HepVector & Dedx_Helix::a | ( | const HepVector & | newA | ) | [inline] |
sets helix parameters.
Definition at line 250 of file Dedx_Helix.h.
References m_a, and updateCache().
00250 { 00251 m_a = i; 00252 updateCache(); 00253 return m_a; 00254 }
const HepVector & Dedx_Helix::a | ( | void | ) | const [inline] |
returns helix parameters.
Definition at line 238 of file Dedx_Helix.h.
References m_a.
Referenced by DedxCorrecSvc::PathL().
00238 { 00239 return m_a; 00240 }
double Dedx_Helix::bFieldZ | ( | void | ) | const [inline] |
Definition at line 273 of file Dedx_Helix.h.
References m_bField.
00273 { 00274 return m_bField; 00275 }
double Dedx_Helix::bFieldZ | ( | double | ) | [inline] |
sets/returns z componet of the magnetic field.
Definition at line 264 of file Dedx_Helix.h.
References m_alpha, m_bField, and updateCache().
00264 { 00265 m_bField = a; 00266 m_alpha = 10000. / 2.99792458 / m_bField; 00267 updateCache(); 00268 return m_bField; 00269 }
const HepPoint3D & Dedx_Helix::center | ( | void | ) | const [inline] |
returns position of helix center(z = 0.);
Definition at line 178 of file Dedx_Helix.h.
References m_center.
00178 { 00179 return m_center; 00180 }
double Dedx_Helix::cosPhi0 | ( | void | ) | const [inline] |
double Dedx_Helix::curv | ( | void | ) | const [inline] |
HepMatrix Dedx_Helix::del4MDelA | ( | double | phi, | |
double | mass | |||
) | const |
Definition at line 681 of file Dedx_Helix.cxx.
References cos(), DBL_MAX, m_ac, phi0(), and sin().
Referenced by momentum().
00681 { 00682 // 00683 // Calculate Jacobian (@4m/@a) 00684 // Vector a is helix parameters and phi is internal parameter. 00685 // Vector 4m is 4 momentum. 00686 // 00687 00688 HepMatrix d4MDA(4,5,0); 00689 00690 double phi0 = m_ac[1]; 00691 double cpa = m_ac[2]; 00692 double tnl = m_ac[4]; 00693 00694 double cosf0phi = cos(phi0+phi); 00695 double sinf0phi = sin(phi0+phi); 00696 00697 double rho; 00698 if(cpa != 0.)rho = 1./cpa; 00699 else rho = (DBL_MAX); 00700 00701 double charge = 1.; 00702 if(cpa < 0.)charge = -1.; 00703 00704 double E = sqrt(rho*rho*(1.+tnl*tnl)+mass*mass); 00705 00706 d4MDA[0][1] = -fabs(rho)*cosf0phi; 00707 d4MDA[0][2] = charge*rho*rho*sinf0phi; 00708 00709 d4MDA[1][1] = -fabs(rho)*sinf0phi; 00710 d4MDA[1][2] = -charge*rho*rho*cosf0phi; 00711 00712 d4MDA[2][2] = -charge*rho*rho*tnl; 00713 d4MDA[2][4] = fabs(rho); 00714 00715 if (cpa != 0.0 && E != 0.0) { 00716 d4MDA[3][2] = (-1.-tnl*tnl)/(cpa*cpa*cpa*E); 00717 d4MDA[3][4] = tnl/(cpa*cpa*E); 00718 } else { 00719 d4MDA[3][2] = (DBL_MAX); 00720 d4MDA[3][4] = (DBL_MAX); 00721 } 00722 return d4MDA; 00723 }
HepMatrix Dedx_Helix::del4MXDelA | ( | double | phi, | |
double | mass | |||
) | const |
Definition at line 727 of file Dedx_Helix.cxx.
References cos(), DBL_MAX, dr(), dz(), m_ac, m_cp, m_r, m_sp, phi0(), and sin().
Referenced by momentum().
00727 { 00728 // 00729 // Calculate Jacobian (@4mx/@a) 00730 // Vector a is helix parameters and phi is internal parameter. 00731 // Vector 4xm is 4 momentum and position. 00732 // 00733 00734 HepMatrix d4MXDA(7,5,0); 00735 00736 const double & dr = m_ac[0]; 00737 const double & phi0 = m_ac[1]; 00738 const double & cpa = m_ac[2]; 00739 const double & dz = m_ac[3]; 00740 const double & tnl = m_ac[4]; 00741 00742 double cosf0phi = cos(phi0+phi); 00743 double sinf0phi = sin(phi0+phi); 00744 00745 double rho; 00746 if(cpa != 0.)rho = 1./cpa; 00747 else rho = (DBL_MAX); 00748 00749 double charge = 1.; 00750 if(cpa < 0.)charge = -1.; 00751 00752 double E = sqrt(rho * rho * (1. + tnl * tnl) + mass * mass); 00753 00754 d4MXDA[0][1] = - fabs(rho) * cosf0phi; 00755 d4MXDA[0][2] = charge * rho * rho * sinf0phi; 00756 00757 d4MXDA[1][1] = - fabs(rho) * sinf0phi; 00758 d4MXDA[1][2] = - charge * rho * rho * cosf0phi; 00759 00760 d4MXDA[2][2] = - charge * rho * rho * tnl; 00761 d4MXDA[2][4] = fabs(rho); 00762 00763 if (cpa != 0.0 && E != 0.0) { 00764 d4MXDA[3][2] = (- 1. - tnl * tnl) / (cpa * cpa * cpa * E); 00765 d4MXDA[3][4] = tnl / (cpa * cpa * E); 00766 } else { 00767 d4MXDA[3][2] = (DBL_MAX); 00768 d4MXDA[3][4] = (DBL_MAX); 00769 } 00770 00771 d4MXDA[4][0] = m_cp; 00772 d4MXDA[4][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi); 00773 if (cpa != 0.0) { 00774 d4MXDA[4][2] = - (m_r / cpa) * (m_cp - cosf0phi); 00775 } else { 00776 d4MXDA[4][2] = (DBL_MAX); 00777 } 00778 00779 d4MXDA[5][0] = m_sp; 00780 d4MXDA[5][1] = dr * m_cp + m_r * (m_cp - cosf0phi); 00781 if (cpa != 0.0) { 00782 d4MXDA[5][2] = - (m_r / cpa) * (m_sp - sinf0phi); 00783 00784 d4MXDA[6][2] = (m_r / cpa) * tnl * phi; 00785 } else { 00786 d4MXDA[5][2] = (DBL_MAX); 00787 00788 d4MXDA[6][2] = (DBL_MAX); 00789 } 00790 00791 d4MXDA[6][3] = 1.; 00792 d4MXDA[6][4] = - m_r * phi; 00793 00794 return d4MXDA; 00795 }
HepMatrix Dedx_Helix::delApDelA | ( | const HepVector & | ap | ) | const |
Definition at line 522 of file Dedx_Helix.cxx.
References cos(), DBL_MAX, dr(), dz(), m_ac, M_PI, M_PI2, M_PI8, m_r, phi0(), and sin().
Referenced by pivot().
00522 { 00523 // 00524 // Calculate Jacobian (@ap/@a) 00525 // Vector ap is new helix parameters and a is old helix parameters. 00526 // 00527 00528 HepMatrix dApDA(5,5,0); 00529 00530 const double & dr = m_ac[0]; 00531 const double & phi0 = m_ac[1]; 00532 const double & cpa = m_ac[2]; 00533 const double & dz = m_ac[3]; 00534 const double & tnl = m_ac[4]; 00535 00536 double drp = ap[0]; 00537 double phi0p = ap[1]; 00538 double cpap = ap[2]; 00539 double dzp = ap[3]; 00540 double tnlp = ap[4]; 00541 00542 double rdr = m_r + dr; 00543 double rdrpr; 00544 if ((m_r + drp) != 0.0) { 00545 rdrpr = 1. / (m_r + drp); 00546 } else { 00547 rdrpr = (DBL_MAX); 00548 } 00549 // double csfd = cos(phi0)*cos(phi0p) + sin(phi0)*sin(phi0p); 00550 // double snfd = cos(phi0)*sin(phi0p) - sin(phi0)*cos(phi0p); 00551 double csfd = cos(phi0p - phi0); 00552 double snfd = sin(phi0p - phi0); 00553 double phid = fmod(phi0p - phi0 + M_PI8, M_PI2); 00554 if (phid > M_PI) phid = phid - M_PI2; 00555 00556 dApDA[0][0] = csfd; 00557 dApDA[0][1] = rdr*snfd; 00558 if(cpa!=0.0) { 00559 dApDA[0][2] = (m_r/cpa)*( 1.0 - csfd ); 00560 } else { 00561 dApDA[0][2] = (DBL_MAX); 00562 } 00563 00564 dApDA[1][0] = - rdrpr*snfd; 00565 dApDA[1][1] = rdr*rdrpr*csfd; 00566 if(cpa!=0.0) { 00567 dApDA[1][2] = (m_r/cpa)*rdrpr*snfd; 00568 } else { 00569 dApDA[1][2] = (DBL_MAX); 00570 } 00571 00572 dApDA[2][2] = 1.0; 00573 00574 dApDA[3][0] = m_r*rdrpr*tnl*snfd; 00575 dApDA[3][1] = m_r*tnl*(1.0 - rdr*rdrpr*csfd); 00576 if(cpa!=0.0) { 00577 dApDA[3][2] = (m_r/cpa)*tnl*(phid - m_r*rdrpr*snfd); 00578 } else { 00579 dApDA[3][2] = (DBL_MAX); 00580 } 00581 dApDA[3][3] = 1.0; 00582 dApDA[3][4] = - m_r*phid; 00583 00584 dApDA[4][4] = 1.0; 00585 00586 return dApDA; 00587 }
HepMatrix Dedx_Helix::delMDelA | ( | double | phi | ) | const |
Definition at line 644 of file Dedx_Helix.cxx.
References cos(), DBL_MAX, m_ac, phi0(), and sin().
Referenced by momentum().
00644 { 00645 // 00646 // Calculate Jacobian (@m/@a) 00647 // Vector a is helix parameters and phi is internal parameter. 00648 // Vector m is momentum. 00649 // 00650 00651 HepMatrix dMDA(3,5,0); 00652 00653 const double & phi0 = m_ac[1]; 00654 const double & cpa = m_ac[2]; 00655 const double & tnl = m_ac[4]; 00656 00657 double cosf0phi = cos(phi0+phi); 00658 double sinf0phi = sin(phi0+phi); 00659 00660 double rho; 00661 if(cpa != 0.)rho = 1./cpa; 00662 else rho = (DBL_MAX); 00663 00664 double charge = 1.; 00665 if(cpa < 0.)charge = -1.; 00666 00667 dMDA[0][1] = -fabs(rho)*cosf0phi; 00668 dMDA[0][2] = charge*rho*rho*sinf0phi; 00669 00670 dMDA[1][1] = -fabs(rho)*sinf0phi; 00671 dMDA[1][2] = -charge*rho*rho*cosf0phi; 00672 00673 dMDA[2][2] = -charge*rho*rho*tnl; 00674 dMDA[2][4] = fabs(rho); 00675 00676 return dMDA; 00677 }
HepMatrix Dedx_Helix::delXDelA | ( | double | phi | ) | const |
Definition at line 590 of file Dedx_Helix.cxx.
References cos(), DBL_MAX, dr(), dz(), m_ac, m_cp, m_r, m_sp, phi0(), and sin().
Referenced by x().
00590 { 00591 // 00592 // Calculate Jacobian (@x/@a) 00593 // Vector a is helix parameters and phi is internal parameter 00594 // which specifys the point to be calculated for Ex(phi). 00595 // 00596 00597 HepMatrix dXDA(3,5,0); 00598 00599 const double & dr = m_ac[0]; 00600 const double & phi0 = m_ac[1]; 00601 const double & cpa = m_ac[2]; 00602 const double & dz = m_ac[3]; 00603 const double & tnl = m_ac[4]; 00604 00605 double cosf0phi = cos(phi0 + phi); 00606 double sinf0phi = sin(phi0 + phi); 00607 00608 dXDA[0][0] = m_cp; 00609 dXDA[0][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi); 00610 if(cpa!=0.0) { 00611 dXDA[0][2] = - (m_r / cpa) * (m_cp - cosf0phi); 00612 } else { 00613 dXDA[0][2] = (DBL_MAX); 00614 } 00615 // dXDA[0][3] = 0.0; 00616 // dXDA[0][4] = 0.0; 00617 00618 dXDA[1][0] = m_sp; 00619 dXDA[1][1] = dr * m_cp + m_r * (m_cp - cosf0phi); 00620 if(cpa!=0.0) { 00621 dXDA[1][2] = - (m_r / cpa) * (m_sp - sinf0phi); 00622 } else { 00623 dXDA[1][2] = (DBL_MAX); 00624 } 00625 // dXDA[1][3] = 0.0; 00626 // dXDA[1][4] = 0.0; 00627 00628 // dXDA[2][0] = 0.0; 00629 // dXDA[2][1] = 0.0; 00630 if(cpa!=0.0) { 00631 dXDA[2][2] = (m_r / cpa) * tnl * phi; 00632 } else { 00633 dXDA[2][2] = (DBL_MAX); 00634 } 00635 dXDA[2][3] = 1.0; 00636 dXDA[2][4] = - m_r * phi; 00637 00638 return dXDA; 00639 }
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.
References momentum().
00196 { 00197 return momentum(phi).unit(); 00198 }
double Dedx_Helix::dr | ( | void | ) | const [inline] |
returns an element of parameters.
Definition at line 202 of file Dedx_Helix.h.
References m_ac.
Referenced by del4MXDelA(), delApDelA(), delXDelA(), DedxCorrecSvc::PathL(), and pivot().
00202 { 00203 return m_ac[0]; 00204 }
double Dedx_Helix::dz | ( | void | ) | const [inline] |
Definition at line 220 of file Dedx_Helix.h.
References m_ac.
Referenced by del4MXDelA(), delApDelA(), delXDelA(), DedxCorrecSvc::PathL(), and pivot().
00220 { 00221 return m_ac[3]; 00222 }
const HepSymMatrix & Dedx_Helix::Ea | ( | const HepSymMatrix & | newdA | ) | [inline] |
sets helix paramters and error matrix.
Definition at line 258 of file Dedx_Helix.h.
References m_Ea.
const HepSymMatrix & Dedx_Helix::Ea | ( | void | ) | const [inline] |
returns error matrix.
Definition at line 244 of file Dedx_Helix.h.
References m_Ea.
00244 { 00245 return m_Ea; 00246 }
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.
References m_Ea, and m_matrixValid.
00798 { 00799 m_matrixValid = false; 00800 m_Ea *= 0.; 00801 }
double Dedx_Helix::kappa | ( | void | ) | const [inline] |
Definition at line 214 of file Dedx_Helix.h.
References m_ac.
Referenced by pivot().
00214 { 00215 return m_ac[2]; 00216 }
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.
References cos(), del4MXDelA(), m_ac, m_cp, m_Ea, m_matrixValid, m_pivot, m_pt, m_r, m_sp, and sin().
00362 { 00363 // 00364 // Calculate momentum. 00365 // 00366 // Pt = | 1/kappa | (GeV/c) 00367 // 00368 // Px = -Pt * sin(phi0 + phi) 00369 // Py = Pt * cos(phi0 + phi) 00370 // Pz = Pt * tan(lambda) 00371 // 00372 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass ) 00373 00374 double pt = fabs(m_pt); 00375 double px = - pt * sin(m_ac[1] + phi); 00376 double py = pt * cos(m_ac[1] + phi); 00377 double pz = pt * m_ac[4]; 00378 double E = sqrt(pt * pt * (1. + m_ac[4] * m_ac[4]) + mass * mass); 00379 00380 x.setX(m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi))); 00381 x.setY(m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi))); 00382 x.setZ(m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi); 00383 00384 if (m_matrixValid) Emx = m_Ea.similarity(del4MXDelA(phi,mass)); 00385 else Emx = m_Ea; 00386 00387 return HepLorentzVector(px, py, pz, E); 00388 }
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.
References cos(), del4MDelA(), m_ac, m_Ea, m_matrixValid, m_pt, and sin().
00334 { 00335 // 00336 // Calculate momentum. 00337 // 00338 // Pt = | 1/kappa | (GeV/c) 00339 // 00340 // Px = -Pt * sin(phi0 + phi) 00341 // Py = Pt * cos(phi0 + phi) 00342 // Pz = Pt * tan(lambda) 00343 // 00344 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass ) 00345 00346 double pt = fabs(m_pt); 00347 double px = - pt * sin(m_ac[1] + phi); 00348 double py = pt * cos(m_ac[1] + phi); 00349 double pz = pt * m_ac[4]; 00350 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass); 00351 00352 if (m_matrixValid) Em = m_Ea.similarity(del4MDelA(phi,mass)); 00353 else Em = m_Ea; 00354 00355 return HepLorentzVector(px, py, pz, E); 00356 }
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.
References cos(), m_ac, m_pt, and sin().
00311 { 00312 // 00313 // Calculate momentum. 00314 // 00315 // Pt = | 1/kappa | (GeV/c) 00316 // 00317 // Px = -Pt * sin(phi0 + phi) 00318 // Py = Pt * cos(phi0 + phi) 00319 // Pz = Pt * tan(lambda) 00320 // 00321 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass ) 00322 00323 double pt = fabs(m_pt); 00324 double px = - pt * sin(m_ac[1] + phi); 00325 double py = pt * cos(m_ac[1] + phi); 00326 double pz = pt * m_ac[4]; 00327 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass); 00328 00329 return HepLorentzVector(px, py, pz, E); 00330 }
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.
References cos(), delMDelA(), m_ac, m_Ea, m_matrixValid, m_pt, and sin().
00288 { 00289 // 00290 // Calculate momentum. 00291 // 00292 // Pt = | 1/kappa | (GeV/c) 00293 // 00294 // Px = -Pt * sin(phi0 + phi) 00295 // Py = Pt * cos(phi0 + phi) 00296 // Pz = Pt * tan(lambda) 00297 // 00298 00299 double pt = fabs(m_pt); 00300 double px = - pt * sin(m_ac[1] + phi); 00301 double py = pt * cos(m_ac[1] + phi); 00302 double pz = pt * m_ac[4]; 00303 00304 if (m_matrixValid) Em = m_Ea.similarity(delMDelA(phi)); 00305 else Em = m_Ea; 00306 00307 return Hep3Vector(px, py, pz); 00308 }
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.
References cos(), m_ac, m_pt, and sin().
Referenced by direction().
00268 { 00269 // 00270 // Calculate momentum. 00271 // 00272 // Pt = | 1/kappa | (GeV/c) 00273 // 00274 // Px = -Pt * sin(phi0 + phi) 00275 // Py = Pt * cos(phi0 + phi) 00276 // Pz = Pt * tan(lambda) 00277 // 00278 00279 double pt = fabs(m_pt); 00280 double px = - pt * sin(m_ac[1] + phi); 00281 double py = pt * cos(m_ac[1] + phi); 00282 double pz = pt * m_ac[4]; 00283 00284 return Hep3Vector(px, py, pz); 00285 }
Dedx_Helix & Dedx_Helix::operator= | ( | const Dedx_Helix & | ) |
Copy operator.
Definition at line 464 of file Dedx_Helix.cxx.
References genRecEmupikp::i, m_a, m_ac, m_alpha, m_bField, m_center, m_cp, m_Ea, m_matrixValid, m_pivot, m_pt, m_r, and m_sp.
00464 { 00465 if (this == & i) return * this; 00466 00467 m_bField = i.m_bField; 00468 m_alpha = i.m_alpha; 00469 m_pivot = i.m_pivot; 00470 m_a = i.m_a; 00471 m_Ea = i.m_Ea; 00472 m_matrixValid = i.m_matrixValid; 00473 00474 m_center = i.m_center; 00475 m_cp = i.m_cp; 00476 m_sp = i.m_sp; 00477 m_pt = i.m_pt; 00478 m_r = i.m_r; 00479 m_ac[0] = i.m_ac[0]; 00480 m_ac[1] = i.m_ac[1]; 00481 m_ac[2] = i.m_ac[2]; 00482 m_ac[3] = i.m_ac[3]; 00483 m_ac[4] = i.m_ac[4]; 00484 00485 return * this; 00486 }
double Dedx_Helix::phi0 | ( | void | ) | const [inline] |
Definition at line 208 of file Dedx_Helix.h.
References m_ac.
Referenced by del4MDelA(), del4MXDelA(), delApDelA(), delMDelA(), delXDelA(), and pivot().
00208 { 00209 return m_ac[1]; 00210 }
const HepPoint3D & Dedx_Helix::pivot | ( | const HepPoint3D & | newPivot | ) |
sets pivot position.
Definition at line 392 of file Dedx_Helix.cxx.
References cos(), delApDelA(), dr(), dz(), kappa(), m_a, m_ac, m_Ea, m_matrixValid, M_PI, M_PI2, M_PI4, M_PI8, m_pivot, m_r, phi0(), tanl(), and updateCache().
00392 { 00393 const double & dr = m_ac[0]; 00394 const double & phi0 = m_ac[1]; 00395 const double & kappa = m_ac[2]; 00396 const double & dz = m_ac[3]; 00397 const double & tanl = m_ac[4]; 00398 00399 double rdr = dr + m_r; 00400 double phi = fmod(phi0 + M_PI4, M_PI2); 00401 double csf0 = cos(phi); 00402 double snf0 = (1. - csf0) * (1. + csf0); 00403 snf0 = sqrt((snf0 > 0.) ? snf0 : 0.); 00404 if(phi > M_PI) snf0 = - snf0; 00405 00406 double xc = m_pivot.x() + rdr * csf0; 00407 double yc = m_pivot.y() + rdr * snf0; 00408 double csf, snf; 00409 if(m_r != 0.0) { 00410 csf = (xc - newPivot.x()) / m_r; 00411 snf = (yc - newPivot.y()) / m_r; 00412 double anrm = sqrt(csf * csf + snf * snf); 00413 if(anrm != 0.0) { 00414 csf /= anrm; 00415 snf /= anrm; 00416 phi = atan2(snf, csf); 00417 } else { 00418 csf = 1.0; 00419 snf = 0.0; 00420 phi = 0.0; 00421 } 00422 } else { 00423 csf = 1.0; 00424 snf = 0.0; 00425 phi = 0.0; 00426 } 00427 double phid = fmod(phi - phi0 + M_PI8, M_PI2); 00428 if(phid > M_PI) phid = phid - M_PI2; 00429 double drp = (m_pivot.x() + dr * csf0 + m_r * (csf0 - csf) - newPivot.x()) 00430 * csf 00431 + (m_pivot.y() + dr * snf0 + m_r * (snf0 - snf) - newPivot.y()) * snf; 00432 double dzp = m_pivot.z() + dz - m_r * tanl * phid - newPivot.z(); 00433 00434 HepVector ap(5); 00435 ap[0] = drp; 00436 ap[1] = fmod(phi + M_PI4, M_PI2); 00437 ap[2] = kappa; 00438 ap[3] = dzp; 00439 ap[4] = tanl; 00440 00441 // if (m_matrixValid) m_Ea.assign(delApDelA(ap) * m_Ea * delApDelA(ap).T()); 00442 if (m_matrixValid) m_Ea = m_Ea.similarity(delApDelA(ap)); 00443 00444 m_a = ap; 00445 m_pivot = newPivot; 00446 00447 //...Are these needed?...iw... 00448 updateCache(); 00449 return m_pivot; 00450 }
const HepPoint3D & Dedx_Helix::pivot | ( | void | ) | const [inline] |
returns pivot position.
Definition at line 184 of file Dedx_Helix.h.
References m_pivot.
Referenced by DedxCorrecSvc::PathL().
00184 { 00185 return m_pivot; 00186 }
double Dedx_Helix::radius | ( | void | ) | const [inline] |
returns radious of helix.
Definition at line 190 of file Dedx_Helix.h.
References m_r.
00190 { 00191 return m_r; 00192 }
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.
References m_a, m_Ea, m_matrixValid, m_pivot, and updateCache().
00455 { 00456 m_pivot = pivot; 00457 m_a = a; 00458 m_Ea = Ea; 00459 m_matrixValid = true; 00460 updateCache(); 00461 }
double Dedx_Helix::sinPhi0 | ( | void | ) | const [inline] |
double Dedx_Helix::tanl | ( | void | ) | const [inline] |
Definition at line 226 of file Dedx_Helix.h.
References m_ac.
Referenced by pivot().
00226 { 00227 return m_ac[4]; 00228 }
void Dedx_Helix::updateCache | ( | void | ) | [private] |
Definition at line 489 of file Dedx_Helix.cxx.
References cos(), DBL_MAX, m_a, m_ac, m_alpha, m_center, m_cp, m_pivot, m_pt, m_r, m_sp, sin(), and x().
Referenced by a(), bFieldZ(), Dedx_Helix(), pivot(), and set().
00489 { 00490 // 00491 // Calculate Helix center( xc, yc ). 00492 // 00493 // xc = x0 + (dr + (alpha / kappa)) * cos(phi0) (cm) 00494 // yc = y0 + (dr + (alpha / kappa)) * sin(phi0) (cm) 00495 // 00496 00497 m_ac[0] = m_a[0]; 00498 m_ac[1] = m_a[1]; 00499 m_ac[2] = m_a[2]; 00500 m_ac[3] = m_a[3]; 00501 m_ac[4] = m_a[4]; 00502 00503 m_cp = cos(m_ac[1]); 00504 m_sp = sin(m_ac[1]); 00505 if (m_ac[2] != 0.0) { 00506 m_pt = 1. / m_ac[2]; 00507 m_r = m_alpha / m_ac[2]; 00508 } 00509 else { 00510 m_pt = (DBL_MAX); 00511 m_r = (DBL_MAX); 00512 } 00513 00514 double x = m_pivot.x() + (m_ac[0] + m_r) * m_cp; 00515 double y = m_pivot.y() + (m_ac[0] + m_r) * m_sp; 00516 m_center.setX(x); 00517 m_center.setY(y); 00518 m_center.setZ(0.); 00519 }
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.
References cos(), delXDelA(), m_ac, m_cp, m_Ea, m_matrixValid, m_pivot, m_r, m_sp, sin(), and x().
00247 { 00248 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] +phi)); 00249 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] +phi)); 00250 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi; 00251 00252 // 00253 // Calculate position error matrix. 00254 // Ex(phi) = (@x/@a)(Ea)(@x/@a)^T, phi is deflection angle to specify the 00255 // point to be calcualted. 00256 // 00257 // HepMatrix dXDA(3, 5, 0); 00258 // dXDA = delXDelA(phi); 00259 // Ex.assign(dXDA * m_Ea * dXDA.T()); 00260 00261 if (m_matrixValid) Ex = m_Ea.similarity(delXDelA(phi)); 00262 else Ex = m_Ea; 00263 00264 return HepPoint3D(x, y, z); 00265 }
double * Dedx_Helix::x | ( | double | dPhi, | |
double | p[3] | |||
) | const |
Definition at line 230 of file Dedx_Helix.cxx.
References cos(), m_ac, m_cp, m_pivot, m_r, m_sp, and sin().
00230 { 00231 // 00232 // Calculate position (x,y,z) along helix. 00233 // 00234 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi)) 00235 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi)) 00236 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi 00237 // 00238 00239 p[0] = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi)); 00240 p[1] = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi)); 00241 p[2] = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi; 00242 00243 return p; 00244 }
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.
References cos(), m_ac, m_cp, m_pivot, m_r, m_sp, and sin().
Referenced by DedxCorrecSvc::PathL(), updateCache(), and x().
00209 { 00210 // 00211 // Calculate position (x,y,z) along helix. 00212 // 00213 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi)) 00214 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi)) 00215 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi 00216 // 00217 // m_ac[0] = m_ac[0] *(-1); 00218 // cout<<"m_bField is = "<<m_bField<<" m_alpha is = "<<m_alpha<<endl; 00219 // 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; 00220 //cout<<"m_cp is = "<<m_cp<<" "<<" m_sp is = "<<m_sp<<" m_r is = "<<m_r<<endl; 00221 //cout<<" m_r + m_ac[0] = "<<m_ac[0] +m_r<<endl; 00222 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] +phi)); 00223 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] +phi)); 00224 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi; 00225 00226 return HepPoint3D(x, y, z); 00227 }
const double Dedx_Helix::ConstantAlpha = -333.564095 [static] |
HepVector Dedx_Helix::m_a [private] |
Definition at line 152 of file Dedx_Helix.h.
Referenced by a(), Dedx_Helix(), operator=(), pivot(), set(), and updateCache().
double Dedx_Helix::m_ac[5] [private] |
Definition at line 162 of file Dedx_Helix.h.
Referenced by del4MDelA(), del4MXDelA(), delApDelA(), delMDelA(), delXDelA(), dr(), dz(), kappa(), momentum(), operator=(), phi0(), pivot(), tanl(), updateCache(), and x().
double Dedx_Helix::m_alpha [private] |
Definition at line 150 of file Dedx_Helix.h.
Referenced by bFieldZ(), Dedx_Helix(), operator=(), and updateCache().
double Dedx_Helix::m_bField [private] |
Definition at line 149 of file Dedx_Helix.h.
Referenced by bFieldZ(), Dedx_Helix(), and operator=().
HepPoint3D Dedx_Helix::m_center [private] |
Definition at line 157 of file Dedx_Helix.h.
Referenced by center(), operator=(), and updateCache().
double Dedx_Helix::m_cp [private] |
Definition at line 158 of file Dedx_Helix.h.
Referenced by cosPhi0(), del4MXDelA(), delXDelA(), momentum(), operator=(), updateCache(), and x().
HepSymMatrix Dedx_Helix::m_Ea [private] |
Definition at line 153 of file Dedx_Helix.h.
Referenced by Ea(), ignoreErrorMatrix(), momentum(), operator=(), pivot(), set(), and x().
bool Dedx_Helix::m_matrixValid [private] |
Definition at line 154 of file Dedx_Helix.h.
Referenced by ignoreErrorMatrix(), momentum(), operator=(), pivot(), set(), and x().
HepPoint3D Dedx_Helix::m_pivot [private] |
Definition at line 151 of file Dedx_Helix.h.
Referenced by momentum(), operator=(), pivot(), set(), updateCache(), and x().
IMagneticFieldSvc* Dedx_Helix::m_pmgnIMF [private] |
double Dedx_Helix::m_pt [private] |
Definition at line 160 of file Dedx_Helix.h.
Referenced by momentum(), operator=(), and updateCache().
double Dedx_Helix::m_r [private] |
Definition at line 161 of file Dedx_Helix.h.
Referenced by curv(), del4MXDelA(), delApDelA(), delXDelA(), momentum(), operator=(), pivot(), radius(), updateCache(), and x().
double Dedx_Helix::m_sp [private] |
Definition at line 159 of file Dedx_Helix.h.
Referenced by del4MXDelA(), delXDelA(), momentum(), operator=(), sinPhi0(), updateCache(), and x().