#include <Helix.h>
Public Member Functions | |
VFHelix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea) | |
Constructor with pivot, helix parameter a, and its error matrix. | |
VFHelix (const HepPoint3D &pivot, const HepVector &a) | |
Constructor without error matrix. | |
VFHelix (const HepPoint3D &position, const Hep3Vector &momentum, double charge) | |
Constructor with position, momentum, and charge. | |
virtual | ~VFHelix () |
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 |
VFHelix & | operator= (const VFHelix &) |
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 | |
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 38 of file Helix.h.
VFHelix::VFHelix | ( | const HepPoint3D & | pivot, | |
const HepVector & | a, | |||
const HepSymMatrix & | Ea | |||
) |
Constructor with pivot, helix parameter a, and its error matrix.
Definition at line 37 of file Helix.cxx.
References VertexFitBField::getBFieldZRef(), VertexFitBField::instance(), m_alpha, m_bField, and updateCache().
00040 : m_bField(10.0), 00041 m_alpha(333.564095), 00042 m_pivot(pivot), 00043 m_a(a), 00044 m_Ea(Ea), 00045 m_matrixValid(true) 00046 { 00047 // m_alpha = 10000. / 2.99792458 / m_bField; 00048 // m_alpha = 333.564095; 00049 m_bField = 10 * VertexFitBField::instance()->getBFieldZRef(); 00050 m_alpha = 10000. / 2.99792458 / m_bField; 00051 //std::cout << "m_bField = " << m_bField << " m_alpha = " << m_alpha << std::endl; 00052 updateCache(); 00053 }
VFHelix::VFHelix | ( | const HepPoint3D & | pivot, | |
const HepVector & | a | |||
) |
Constructor without error matrix.
Definition at line 55 of file Helix.cxx.
References VertexFitBField::getBFieldZRef(), VertexFitBField::instance(), m_alpha, m_bField, and updateCache().
00057 : m_bField(10.0), 00058 m_alpha(333.564095), 00059 m_pivot(pivot), 00060 m_a(a), 00061 m_Ea(HepSymMatrix(5,0)), 00062 m_matrixValid(false) 00063 { 00064 // m_alpha = 333.564095; 00065 m_bField = 10 * VertexFitBField::instance()->getBFieldZRef(); 00066 m_alpha = 10000. / 2.99792458 / m_bField; 00067 00068 updateCache(); 00069 }
VFHelix::VFHelix | ( | const HepPoint3D & | position, | |
const Hep3Vector & | momentum, | |||
double | charge | |||
) |
Constructor with position, momentum, and charge.
Definition at line 71 of file Helix.cxx.
References DBL_MAX, VertexFitBField::getBFieldZRef(), VertexFitBField::instance(), m_a, m_alpha, m_bField, M_PI2, M_PI4, and updateCache().
00074 : m_bField(10.0), 00075 m_alpha(333.564095), 00076 m_pivot(position), 00077 m_a(HepVector(5,0)), 00078 m_Ea(HepSymMatrix(5,0)), 00079 m_matrixValid(false) 00080 { 00081 00082 m_bField = 10 * VertexFitBField::instance()->getBFieldZRef(); 00083 m_alpha = 10000. / 2.99792458 / m_bField; 00084 00085 m_a[0] = 0.; 00086 m_a[1] = fmod(atan2(- momentum.x(), momentum.y()) 00087 + M_PI4, M_PI2); 00088 m_a[3] = 0.; 00089 double perp(momentum.perp()); 00090 if (perp != 0.0) { 00091 m_a[2] = charge / perp; 00092 m_a[4] = momentum.z() / perp; 00093 } 00094 else { 00095 m_a[2] = charge * (DBL_MAX); 00096 if (momentum.z() >= 0) { 00097 m_a[4] = (DBL_MAX); 00098 } else { 00099 m_a[4] = -(DBL_MAX); 00100 } 00101 } 00102 // m_alpha = 333.564095; 00103 updateCache(); 00104 }
VFHelix::~VFHelix | ( | ) | [virtual] |
const HepVector & VFHelix::a | ( | const HepVector & | newA | ) | [inline] |
sets helix parameters.
Definition at line 252 of file Helix.h.
References m_a, and updateCache().
00252 { 00253 m_a = i; 00254 updateCache(); 00255 return m_a; 00256 }
const HepVector & VFHelix::a | ( | void | ) | const [inline] |
returns helix parameters.
Definition at line 240 of file Helix.h.
References m_a.
Referenced by SD0Tag::execute(), CalibEventSelect::execute(), DQASelHadron::execute(), DQAKsKpi::execute(), Rhopi::execute(), Gam4pikp::execute(), DQADtag::fillTrackItem(), BestDTagSvc::isGoodTrack(), DSemilepAlg::isGoodTrack(), DTagTool::isGoodTrack(), Pipipi0::MTotal(), Pipi::MTotal(), Kpipi0pi0::MTotal(), Kpipi0::MTotal(), Kpi::MTotal(), Kkpipi::MTotal(), Kkpi0::MTotal(), Kk::MTotal(), K3pipi0::MTotal(), K3pi::MTotal(), K0pipipi0::MTotal(), K0pipi::MTotal(), K0pi0::MTotal(), K0kpi::MTotal(), K0kk::MTotal(), LocalPionSelector::operator()(), and LocalKaonSelector::operator()().
00240 { 00241 return m_a; 00242 }
double VFHelix::bFieldZ | ( | void | ) | const [inline] |
double VFHelix::bFieldZ | ( | double | ) | [inline] |
const HepPoint3D & VFHelix::center | ( | void | ) | const [inline] |
double VFHelix::cosPhi0 | ( | void | ) | const [inline] |
double VFHelix::curv | ( | void | ) | const [inline] |
HepMatrix VFHelix::del4MDelA | ( | double | phi, | |
double | mass | |||
) | const |
Definition at line 578 of file Helix.cxx.
References cos(), DBL_MAX, m_ac, phi0(), and sin().
Referenced by momentum().
00578 { 00579 // 00580 // Calculate Jacobian (@4m/@a) 00581 // Vector a is helix parameters and phi is internal parameter. 00582 // Vector 4m is 4 momentum. 00583 // 00584 00585 HepMatrix d4MDA(4,5,0); 00586 00587 double phi0 = m_ac[1]; 00588 double cpa = m_ac[2]; 00589 double tnl = m_ac[4]; 00590 00591 double cosf0phi = cos(phi0+phi); 00592 double sinf0phi = sin(phi0+phi); 00593 00594 double rho; 00595 if(cpa != 0.)rho = 1./cpa; 00596 else rho = (DBL_MAX); 00597 00598 double charge = 1.; 00599 if(cpa < 0.)charge = -1.; 00600 00601 double E = sqrt(rho*rho*(1.+tnl*tnl)+mass*mass); 00602 00603 d4MDA[0][1] = -fabs(rho)*cosf0phi; 00604 d4MDA[0][2] = charge*rho*rho*sinf0phi; 00605 00606 d4MDA[1][1] = -fabs(rho)*sinf0phi; 00607 d4MDA[1][2] = -charge*rho*rho*cosf0phi; 00608 00609 d4MDA[2][2] = -charge*rho*rho*tnl; 00610 d4MDA[2][4] = fabs(rho); 00611 00612 if (cpa != 0.0 && E != 0.0) { 00613 d4MDA[3][2] = (-1.-tnl*tnl)/(cpa*cpa*cpa*E); 00614 d4MDA[3][4] = tnl/(cpa*cpa*E); 00615 } else { 00616 d4MDA[3][2] = (DBL_MAX); 00617 d4MDA[3][4] = (DBL_MAX); 00618 } 00619 return d4MDA; 00620 }
HepMatrix VFHelix::del4MXDelA | ( | double | phi, | |
double | mass | |||
) | const |
Definition at line 624 of file Helix.cxx.
References cos(), DBL_MAX, dr(), dz(), m_ac, m_cp, m_r, m_sp, phi0(), and sin().
Referenced by momentum().
00624 { 00625 // 00626 // Calculate Jacobian (@4mx/@a) 00627 // Vector a is helix parameters and phi is internal parameter. 00628 // Vector 4xm is 4 momentum and position. 00629 // 00630 00631 HepMatrix d4MXDA(7,5,0); 00632 00633 const double & dr = m_ac[0]; 00634 const double & phi0 = m_ac[1]; 00635 const double & cpa = m_ac[2]; 00636 const double & dz = m_ac[3]; 00637 const double & tnl = m_ac[4]; 00638 00639 double cosf0phi = cos(phi0+phi); 00640 double sinf0phi = sin(phi0+phi); 00641 00642 double rho; 00643 if(cpa != 0.)rho = 1./cpa; 00644 else rho = (DBL_MAX); 00645 00646 double charge = 1.; 00647 if(cpa < 0.)charge = -1.; 00648 00649 double E = sqrt(rho * rho * (1. + tnl * tnl) + mass * mass); 00650 00651 d4MXDA[0][1] = - fabs(rho) * cosf0phi; 00652 d4MXDA[0][2] = charge * rho * rho * sinf0phi; 00653 00654 d4MXDA[1][1] = - fabs(rho) * sinf0phi; 00655 d4MXDA[1][2] = - charge * rho * rho * cosf0phi; 00656 00657 d4MXDA[2][2] = - charge * rho * rho * tnl; 00658 d4MXDA[2][4] = fabs(rho); 00659 00660 if (cpa != 0.0 && E != 0.0) { 00661 d4MXDA[3][2] = (- 1. - tnl * tnl) / (cpa * cpa * cpa * E); 00662 d4MXDA[3][4] = tnl / (cpa * cpa * E); 00663 } else { 00664 d4MXDA[3][2] = (DBL_MAX); 00665 d4MXDA[3][4] = (DBL_MAX); 00666 } 00667 00668 d4MXDA[4][0] = m_cp; 00669 d4MXDA[4][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi); 00670 if (cpa != 0.0) { 00671 d4MXDA[4][2] = - (m_r / cpa) * (m_cp - cosf0phi); 00672 } else { 00673 d4MXDA[4][2] = (DBL_MAX); 00674 } 00675 00676 d4MXDA[5][0] = m_sp; 00677 d4MXDA[5][1] = dr * m_cp + m_r * (m_cp - cosf0phi); 00678 if (cpa != 0.0) { 00679 d4MXDA[5][2] = - (m_r / cpa) * (m_sp - sinf0phi); 00680 00681 d4MXDA[6][2] = (m_r / cpa) * tnl * phi; 00682 } else { 00683 d4MXDA[5][2] = (DBL_MAX); 00684 00685 d4MXDA[6][2] = (DBL_MAX); 00686 } 00687 00688 d4MXDA[6][3] = 1.; 00689 d4MXDA[6][4] = - m_r * phi; 00690 00691 return d4MXDA; 00692 }
HepMatrix VFHelix::delApDelA | ( | const HepVector & | ap | ) | const |
Definition at line 419 of file Helix.cxx.
References cos(), DBL_MAX, dr(), dz(), m_ac, M_PI, M_PI2, M_PI8, m_r, phi0(), and sin().
Referenced by pivot().
00419 { 00420 // 00421 // Calculate Jacobian (@ap/@a) 00422 // Vector ap is new helix parameters and a is old helix parameters. 00423 // 00424 00425 HepMatrix dApDA(5,5,0); 00426 00427 const double & dr = m_ac[0]; 00428 const double & phi0 = m_ac[1]; 00429 const double & cpa = m_ac[2]; 00430 const double & dz = m_ac[3]; 00431 const double & tnl = m_ac[4]; 00432 00433 double drp = ap[0]; 00434 double phi0p = ap[1]; 00435 double cpap = ap[2]; 00436 double dzp = ap[3]; 00437 double tnlp = ap[4]; 00438 00439 double rdr = m_r + dr; 00440 double rdrpr; 00441 if ((m_r + drp) != 0.0) { 00442 rdrpr = 1. / (m_r + drp); 00443 } else { 00444 rdrpr = (DBL_MAX); 00445 } 00446 // double csfd = cos(phi0)*cos(phi0p) + sin(phi0)*sin(phi0p); 00447 // double snfd = cos(phi0)*sin(phi0p) - sin(phi0)*cos(phi0p); 00448 double csfd = cos(phi0p - phi0); 00449 double snfd = sin(phi0p - phi0); 00450 double phid = fmod(phi0p - phi0 + M_PI8, M_PI2); 00451 if (phid > M_PI) phid = phid - M_PI2; 00452 00453 dApDA[0][0] = csfd; 00454 dApDA[0][1] = rdr*snfd; 00455 if(cpa!=0.0) { 00456 dApDA[0][2] = (m_r/cpa)*( 1.0 - csfd ); 00457 } else { 00458 dApDA[0][2] = (DBL_MAX); 00459 } 00460 00461 dApDA[1][0] = - rdrpr*snfd; 00462 dApDA[1][1] = rdr*rdrpr*csfd; 00463 if(cpa!=0.0) { 00464 dApDA[1][2] = (m_r/cpa)*rdrpr*snfd; 00465 } else { 00466 dApDA[1][2] = (DBL_MAX); 00467 } 00468 00469 dApDA[2][2] = 1.0; 00470 00471 dApDA[3][0] = m_r*rdrpr*tnl*snfd; 00472 dApDA[3][1] = m_r*tnl*(1.0 - rdr*rdrpr*csfd); 00473 if(cpa!=0.0) { 00474 dApDA[3][2] = (m_r/cpa)*tnl*(phid - m_r*rdrpr*snfd); 00475 } else { 00476 dApDA[3][2] = (DBL_MAX); 00477 } 00478 dApDA[3][3] = 1.0; 00479 dApDA[3][4] = - m_r*phid; 00480 00481 dApDA[4][4] = 1.0; 00482 00483 return dApDA; 00484 }
HepMatrix VFHelix::delMDelA | ( | double | phi | ) | const |
Definition at line 541 of file Helix.cxx.
References cos(), DBL_MAX, m_ac, phi0(), and sin().
Referenced by momentum().
00541 { 00542 // 00543 // Calculate Jacobian (@m/@a) 00544 // Vector a is helix parameters and phi is internal parameter. 00545 // Vector m is momentum. 00546 // 00547 00548 HepMatrix dMDA(3,5,0); 00549 00550 const double & phi0 = m_ac[1]; 00551 const double & cpa = m_ac[2]; 00552 const double & tnl = m_ac[4]; 00553 00554 double cosf0phi = cos(phi0+phi); 00555 double sinf0phi = sin(phi0+phi); 00556 00557 double rho; 00558 if(cpa != 0.)rho = 1./cpa; 00559 else rho = (DBL_MAX); 00560 00561 double charge = 1.; 00562 if(cpa < 0.)charge = -1.; 00563 00564 dMDA[0][1] = -fabs(rho)*cosf0phi; 00565 dMDA[0][2] = charge*rho*rho*sinf0phi; 00566 00567 dMDA[1][1] = -fabs(rho)*sinf0phi; 00568 dMDA[1][2] = -charge*rho*rho*cosf0phi; 00569 00570 dMDA[2][2] = -charge*rho*rho*tnl; 00571 dMDA[2][4] = fabs(rho); 00572 00573 return dMDA; 00574 }
HepMatrix VFHelix::delXDelA | ( | double | phi | ) | const |
Definition at line 487 of file Helix.cxx.
References cos(), DBL_MAX, dr(), dz(), m_ac, m_cp, m_r, m_sp, phi0(), and sin().
Referenced by x().
00487 { 00488 // 00489 // Calculate Jacobian (@x/@a) 00490 // Vector a is helix parameters and phi is internal parameter 00491 // which specifys the point to be calculated for Ex(phi). 00492 // 00493 00494 HepMatrix dXDA(3,5,0); 00495 00496 const double & dr = m_ac[0]; 00497 const double & phi0 = m_ac[1]; 00498 const double & cpa = m_ac[2]; 00499 const double & dz = m_ac[3]; 00500 const double & tnl = m_ac[4]; 00501 00502 double cosf0phi = cos(phi0 + phi); 00503 double sinf0phi = sin(phi0 + phi); 00504 00505 dXDA[0][0] = m_cp; 00506 dXDA[0][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi); 00507 if(cpa!=0.0) { 00508 dXDA[0][2] = - (m_r / cpa) * (m_cp - cosf0phi); 00509 } else { 00510 dXDA[0][2] = (DBL_MAX); 00511 } 00512 // dXDA[0][3] = 0.0; 00513 // dXDA[0][4] = 0.0; 00514 00515 dXDA[1][0] = m_sp; 00516 dXDA[1][1] = dr * m_cp + m_r * (m_cp - cosf0phi); 00517 if(cpa!=0.0) { 00518 dXDA[1][2] = - (m_r / cpa) * (m_sp - sinf0phi); 00519 } else { 00520 dXDA[1][2] = (DBL_MAX); 00521 } 00522 // dXDA[1][3] = 0.0; 00523 // dXDA[1][4] = 0.0; 00524 00525 // dXDA[2][0] = 0.0; 00526 // dXDA[2][1] = 0.0; 00527 if(cpa!=0.0) { 00528 dXDA[2][2] = (m_r / cpa) * tnl * phi; 00529 } else { 00530 dXDA[2][2] = (DBL_MAX); 00531 } 00532 dXDA[2][3] = 1.0; 00533 dXDA[2][4] = - m_r * phi; 00534 00535 return dXDA; 00536 }
Hep3Vector VFHelix::direction | ( | double | dPhi = 0. |
) | const [inline] |
returns direction vector after rotating angle dPhi in phi direction.
Definition at line 198 of file Helix.h.
References momentum().
00198 { 00199 return momentum(phi).unit(); 00200 }
double VFHelix::dr | ( | void | ) | const [inline] |
returns an element of parameters.
Definition at line 204 of file Helix.h.
References m_ac.
Referenced by del4MXDelA(), delApDelA(), delXDelA(), and pivot().
00204 { 00205 return m_ac[0]; 00206 }
double VFHelix::dz | ( | void | ) | const [inline] |
Definition at line 222 of file Helix.h.
References m_ac.
Referenced by del4MXDelA(), delApDelA(), delXDelA(), and pivot().
00222 { 00223 return m_ac[3]; 00224 }
const HepSymMatrix & VFHelix::Ea | ( | const HepSymMatrix & | newdA | ) | [inline] |
const HepSymMatrix & VFHelix::Ea | ( | void | ) | const [inline] |
void VFHelix::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 695 of file Helix.cxx.
References m_Ea, and m_matrixValid.
00695 { 00696 m_matrixValid = false; 00697 m_Ea *= 0.; 00698 }
double VFHelix::kappa | ( | void | ) | const [inline] |
HepLorentzVector VFHelix::momentum | ( | double | dPhi, | |
double | mass, | |||
HepPoint3D & | x, | |||
HepSymMatrix & | Emx | |||
) | const |
returns 4momentum vector after rotating angle dPhi in phi direction.
Definition at line 256 of file Helix.cxx.
References cos(), del4MXDelA(), m_ac, m_cp, m_Ea, m_matrixValid, m_pivot, m_pt, m_r, m_sp, and sin().
00259 { 00260 // 00261 // Calculate momentum. 00262 // 00263 // Pt = | 1/kappa | (GeV/c) 00264 // 00265 // Px = -Pt * sin(phi0 + phi) 00266 // Py = Pt * cos(phi0 + phi) 00267 // Pz = Pt * tan(lambda) 00268 // 00269 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass ) 00270 00271 double pt = fabs(m_pt); 00272 double px = - pt * sin(m_ac[1] + phi); 00273 double py = pt * cos(m_ac[1] + phi); 00274 double pz = pt * m_ac[4]; 00275 double E = sqrt(pt * pt * (1. + m_ac[4] * m_ac[4]) + mass * mass); 00276 00277 x.setX(m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi))); 00278 x.setY(m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi))); 00279 x.setZ(m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi); 00280 00281 if (m_matrixValid) Emx = m_Ea.similarity(del4MXDelA(phi,mass)); 00282 else Emx = m_Ea; 00283 00284 return HepLorentzVector(px, py, pz, E); 00285 }
HepLorentzVector VFHelix::momentum | ( | double | dPhi, | |
double | mass, | |||
HepSymMatrix & | Em | |||
) | const |
returns 4momentum vector after rotating angle dPhi in phi direction.
Definition at line 231 of file Helix.cxx.
References cos(), del4MDelA(), m_ac, m_Ea, m_matrixValid, m_pt, and sin().
00231 { 00232 // 00233 // Calculate momentum. 00234 // 00235 // Pt = | 1/kappa | (GeV/c) 00236 // 00237 // Px = -Pt * sin(phi0 + phi) 00238 // Py = Pt * cos(phi0 + phi) 00239 // Pz = Pt * tan(lambda) 00240 // 00241 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass ) 00242 00243 double pt = fabs(m_pt); 00244 double px = - pt * sin(m_ac[1] + phi); 00245 double py = pt * cos(m_ac[1] + phi); 00246 double pz = pt * m_ac[4]; 00247 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass); 00248 00249 if (m_matrixValid) Em = m_Ea.similarity(del4MDelA(phi,mass)); 00250 else Em = m_Ea; 00251 00252 return HepLorentzVector(px, py, pz, E); 00253 }
HepLorentzVector VFHelix::momentum | ( | double | dPhi, | |
double | mass | |||
) | const |
returns 4momentum vector after rotating angle dPhi in phi direction.
Definition at line 208 of file Helix.cxx.
References cos(), m_ac, m_pt, and sin().
00208 { 00209 // 00210 // Calculate momentum. 00211 // 00212 // Pt = | 1/kappa | (GeV/c) 00213 // 00214 // Px = -Pt * sin(phi0 + phi) 00215 // Py = Pt * cos(phi0 + phi) 00216 // Pz = Pt * tan(lambda) 00217 // 00218 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass ) 00219 00220 double pt = fabs(m_pt); 00221 double px = - pt * sin(m_ac[1] + phi); 00222 double py = pt * cos(m_ac[1] + phi); 00223 double pz = pt * m_ac[4]; 00224 double E = sqrt(pt*pt*(1.+m_ac[4]*m_ac[4])+mass*mass); 00225 00226 return HepLorentzVector(px, py, pz, E); 00227 }
Hep3Vector VFHelix::momentum | ( | double | dPhi, | |
HepSymMatrix & | Em | |||
) | const |
returns momentum vector after rotating angle dPhi in phi direction.
Definition at line 185 of file Helix.cxx.
References cos(), delMDelA(), m_ac, m_Ea, m_matrixValid, m_pt, and sin().
00185 { 00186 // 00187 // Calculate momentum. 00188 // 00189 // Pt = | 1/kappa | (GeV/c) 00190 // 00191 // Px = -Pt * sin(phi0 + phi) 00192 // Py = Pt * cos(phi0 + phi) 00193 // Pz = Pt * tan(lambda) 00194 // 00195 00196 double pt = fabs(m_pt); 00197 double px = - pt * sin(m_ac[1] + phi); 00198 double py = pt * cos(m_ac[1] + phi); 00199 double pz = pt * m_ac[4]; 00200 00201 if (m_matrixValid) Em = m_Ea.similarity(delMDelA(phi)); 00202 else Em = m_Ea; 00203 00204 return Hep3Vector(px, py, pz); 00205 }
Hep3Vector VFHelix::momentum | ( | double | dPhi = 0. |
) | const |
returns momentum vector after rotating angle dPhi in phi direction.
Definition at line 165 of file Helix.cxx.
References cos(), m_ac, m_pt, and sin().
Referenced by direction().
00165 { 00166 // 00167 // Calculate momentum. 00168 // 00169 // Pt = | 1/kappa | (GeV/c) 00170 // 00171 // Px = -Pt * sin(phi0 + phi) 00172 // Py = Pt * cos(phi0 + phi) 00173 // Pz = Pt * tan(lambda) 00174 // 00175 00176 double pt = fabs(m_pt); 00177 double px = - pt * sin(m_ac[1] + phi); 00178 double py = pt * cos(m_ac[1] + phi); 00179 double pz = pt * m_ac[4]; 00180 00181 return Hep3Vector(px, py, pz); 00182 }
Copy operator.
Definition at line 361 of file 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.
00361 { 00362 if (this == & i) return * this; 00363 00364 m_bField = i.m_bField; 00365 m_alpha = i.m_alpha; 00366 m_pivot = i.m_pivot; 00367 m_a = i.m_a; 00368 m_Ea = i.m_Ea; 00369 m_matrixValid = i.m_matrixValid; 00370 00371 m_center = i.m_center; 00372 m_cp = i.m_cp; 00373 m_sp = i.m_sp; 00374 m_pt = i.m_pt; 00375 m_r = i.m_r; 00376 m_ac[0] = i.m_ac[0]; 00377 m_ac[1] = i.m_ac[1]; 00378 m_ac[2] = i.m_ac[2]; 00379 m_ac[3] = i.m_ac[3]; 00380 m_ac[4] = i.m_ac[4]; 00381 00382 return * this; 00383 }
double VFHelix::phi0 | ( | void | ) | const [inline] |
Definition at line 210 of file Helix.h.
References m_ac.
Referenced by del4MDelA(), del4MXDelA(), delApDelA(), delMDelA(), delXDelA(), and pivot().
00210 { 00211 return m_ac[1]; 00212 }
const HepPoint3D & VFHelix::pivot | ( | const HepPoint3D & | newPivot | ) |
sets pivot position.
Definition at line 289 of file 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().
00289 { 00290 const double & dr = m_ac[0]; 00291 const double & phi0 = m_ac[1]; 00292 const double & kappa = m_ac[2]; 00293 const double & dz = m_ac[3]; 00294 const double & tanl = m_ac[4]; 00295 00296 double rdr = dr + m_r; 00297 double phi = fmod(phi0 + M_PI4, M_PI2); 00298 double csf0 = cos(phi); 00299 double snf0 = (1. - csf0) * (1. + csf0); 00300 snf0 = sqrt((snf0 > 0.) ? snf0 : 0.); 00301 if(phi > M_PI) snf0 = - snf0; 00302 00303 double xc = m_pivot.x() + rdr * csf0; 00304 double yc = m_pivot.y() + rdr * snf0; 00305 double csf, snf; 00306 if(m_r != 0.0) { 00307 csf = (xc - newPivot.x()) / m_r; 00308 snf = (yc - newPivot.y()) / m_r; 00309 double anrm = sqrt(csf * csf + snf * snf); 00310 if(anrm != 0.0) { 00311 csf /= anrm; 00312 snf /= anrm; 00313 phi = atan2(snf, csf); 00314 } else { 00315 csf = 1.0; 00316 snf = 0.0; 00317 phi = 0.0; 00318 } 00319 } else { 00320 csf = 1.0; 00321 snf = 0.0; 00322 phi = 0.0; 00323 } 00324 double phid = fmod(phi - phi0 + M_PI8, M_PI2); 00325 if(phid > M_PI) phid = phid - M_PI2; 00326 double drp = (m_pivot.x() + dr * csf0 + m_r * (csf0 - csf) - newPivot.x()) 00327 * csf 00328 + (m_pivot.y() + dr * snf0 + m_r * (snf0 - snf) - newPivot.y()) * snf; 00329 double dzp = m_pivot.z() + dz - m_r * tanl * phid - newPivot.z(); 00330 00331 HepVector ap(5); 00332 ap[0] = drp; 00333 ap[1] = fmod(phi + M_PI4, M_PI2); 00334 ap[2] = kappa; 00335 ap[3] = dzp; 00336 ap[4] = tanl; 00337 00338 // if (m_matrixValid) m_Ea.assign(delApDelA(ap) * m_Ea * delApDelA(ap).T()); 00339 if (m_matrixValid) m_Ea = m_Ea.similarity(delApDelA(ap)); 00340 00341 m_a = ap; 00342 m_pivot = newPivot; 00343 00344 //...Are these needed?...iw... 00345 updateCache(); 00346 return m_pivot; 00347 }
const HepPoint3D & VFHelix::pivot | ( | void | ) | const [inline] |
returns pivot position.
Definition at line 186 of file Helix.h.
References m_pivot.
Referenced by SD0Tag::execute(), CalibEventSelect::execute(), DQASelHadron::execute(), DQAKsKpi::execute(), Rhopi::execute(), Gam4pikp::execute(), DQADtag::fillTrackItem(), BestDTagSvc::isGoodTrack(), DSemilepAlg::isGoodTrack(), DTagTool::isGoodTrack(), Pipipi0::MTotal(), Pipi::MTotal(), Kpipi0pi0::MTotal(), Kpipi0::MTotal(), Kpi::MTotal(), Kkpipi::MTotal(), Kkpi0::MTotal(), Kk::MTotal(), K3pipi0::MTotal(), K3pi::MTotal(), K0pipipi0::MTotal(), K0pipi::MTotal(), K0pi0::MTotal(), K0kpi::MTotal(), K0kk::MTotal(), LocalPionSelector::operator()(), and LocalKaonSelector::operator()().
00186 { 00187 return m_pivot; 00188 }
double VFHelix::radius | ( | void | ) | const [inline] |
void VFHelix::set | ( | const HepPoint3D & | pivot, | |
const HepVector & | a, | |||
const HepSymMatrix & | Ea | |||
) |
sets helix pivot position, parameters, and error matrix.
Definition at line 350 of file Helix.cxx.
References m_a, m_Ea, m_matrixValid, m_pivot, and updateCache().
00352 { 00353 m_pivot = pivot; 00354 m_a = a; 00355 m_Ea = Ea; 00356 m_matrixValid = true; 00357 updateCache(); 00358 }
double VFHelix::sinPhi0 | ( | void | ) | const [inline] |
double VFHelix::tanl | ( | void | ) | const [inline] |
void VFHelix::updateCache | ( | void | ) | [private] |
Definition at line 386 of file 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(), pivot(), set(), and VFHelix().
00386 { 00387 // 00388 // Calculate VFHelix center( xc, yc ). 00389 // 00390 // xc = x0 + (dr + (alpha / kappa)) * cos(phi0) (cm) 00391 // yc = y0 + (dr + (alpha / kappa)) * sin(phi0) (cm) 00392 // 00393 00394 m_ac[0] = m_a[0]; 00395 m_ac[1] = m_a[1]; 00396 m_ac[2] = m_a[2]; 00397 m_ac[3] = m_a[3]; 00398 m_ac[4] = m_a[4]; 00399 00400 m_cp = cos(m_ac[1]); 00401 m_sp = sin(m_ac[1]); 00402 if (m_ac[2] != 0.0) { 00403 m_pt = 1. / m_ac[2]; 00404 m_r = m_alpha / m_ac[2]; 00405 } 00406 else { 00407 m_pt = (DBL_MAX); 00408 m_r = (DBL_MAX); 00409 } 00410 00411 double x = m_pivot.x() + (m_ac[0] + m_r) * m_cp; 00412 double y = m_pivot.y() + (m_ac[0] + m_r) * m_sp; 00413 m_center.setX(x); 00414 m_center.setY(y); 00415 m_center.setZ(0.); 00416 }
HepPoint3D VFHelix::x | ( | double | dPhi, | |
HepSymMatrix & | Ex | |||
) | const |
returns position and convariance matrix(Ex) after rotation.
Definition at line 144 of file Helix.cxx.
References cos(), delXDelA(), m_ac, m_cp, m_Ea, m_matrixValid, m_pivot, m_r, m_sp, sin(), and x().
00144 { 00145 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] +phi)); 00146 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] +phi)); 00147 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi; 00148 00149 // 00150 // Calculate position error matrix. 00151 // Ex(phi) = (@x/@a)(Ea)(@x/@a)^T, phi is deflection angle to specify the 00152 // point to be calcualted. 00153 // 00154 // HepMatrix dXDA(3, 5, 0); 00155 // dXDA = delXDelA(phi); 00156 // Ex.assign(dXDA * m_Ea * dXDA.T()); 00157 00158 if (m_matrixValid) Ex = m_Ea.similarity(delXDelA(phi)); 00159 else Ex = m_Ea; 00160 00161 return HepPoint3D(x, y, z); 00162 }
double * VFHelix::x | ( | double | dPhi, | |
double | p[3] | |||
) | const |
Definition at line 127 of file Helix.cxx.
References cos(), m_ac, m_cp, m_pivot, m_r, m_sp, and sin().
00127 { 00128 // 00129 // Calculate position (x,y,z) along helix. 00130 // 00131 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi)) 00132 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi)) 00133 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi 00134 // 00135 00136 p[0] = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi)); 00137 p[1] = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi)); 00138 p[2] = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi; 00139 00140 return p; 00141 }
HepPoint3D VFHelix::x | ( | double | dPhi = 0. |
) | const |
returns position after rotating angle dPhi in phi direction.
Definition at line 110 of file Helix.cxx.
References cos(), m_ac, m_cp, m_pivot, m_r, m_sp, and sin().
Referenced by updateCache(), and x().
00110 { 00111 // 00112 // Calculate position (x,y,z) along helix. 00113 // 00114 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi)) 00115 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi)) 00116 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi 00117 // 00118 00119 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] +phi)); 00120 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] +phi)); 00121 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi; 00122 00123 return HepPoint3D(x, y, z); 00124 }
const double VFHelix::ConstantAlpha = 333.564095 [static] |
HepVector VFHelix::m_a [private] |
Definition at line 154 of file Helix.h.
Referenced by a(), operator=(), pivot(), set(), updateCache(), and VFHelix().
double VFHelix::m_ac[5] [private] |
Definition at line 164 of file Helix.h.
Referenced by del4MDelA(), del4MXDelA(), delApDelA(), delMDelA(), delXDelA(), dr(), dz(), kappa(), momentum(), operator=(), phi0(), pivot(), tanl(), updateCache(), and x().
double VFHelix::m_alpha [private] |
Definition at line 152 of file Helix.h.
Referenced by bFieldZ(), operator=(), updateCache(), and VFHelix().
double VFHelix::m_bField [private] |
HepPoint3D VFHelix::m_center [private] |
double VFHelix::m_cp [private] |
Definition at line 160 of file Helix.h.
Referenced by cosPhi0(), del4MXDelA(), delXDelA(), momentum(), operator=(), updateCache(), and x().
HepSymMatrix VFHelix::m_Ea [private] |
Definition at line 155 of file Helix.h.
Referenced by Ea(), ignoreErrorMatrix(), momentum(), operator=(), pivot(), set(), and x().
bool VFHelix::m_matrixValid [private] |
Definition at line 156 of file Helix.h.
Referenced by ignoreErrorMatrix(), momentum(), operator=(), pivot(), set(), and x().
HepPoint3D VFHelix::m_pivot [private] |
Definition at line 153 of file Helix.h.
Referenced by momentum(), operator=(), pivot(), set(), updateCache(), and x().
double VFHelix::m_pt [private] |
double VFHelix::m_r [private] |
Definition at line 163 of file Helix.h.
Referenced by curv(), del4MXDelA(), delApDelA(), delXDelA(), momentum(), operator=(), pivot(), radius(), updateCache(), and x().
double VFHelix::m_sp [private] |
Definition at line 161 of file Helix.h.
Referenced by del4MXDelA(), delXDelA(), momentum(), operator=(), sinPhi0(), updateCache(), and x().