#include <TrackTrajectory.h>
Collaboration diagram for Atlfast::TrackTrajectory:
Public Member Functions | |
TrackTrajectory () | |
TrackTrajectory (TrackParameters,::HepPoint3D, double) | |
TrackTrajectory (const Hep3Vector &p, const Hep3Vector &vertex, double charge, double bField) | |
TrackTrajectory (const TrackTrajectory &src) | |
~TrackTrajectory () | |
TrackTrajectory & | operator= (const TrackTrajectory &src) |
TrackParameters | parameters () const |
int | signOfCharge () const |
HepPoint3D | startPoint () const |
double | radius () const |
double | curvature () const |
Private Attributes | |
TrackParameters | m_parameters |
::HepPoint3D | m_startPoint |
double | m_curvature |
Definition at line 36 of file TrackTrajectory.h.
Atlfast::TrackTrajectory::TrackTrajectory | ( | ) | [inline] |
Atlfast::TrackTrajectory::TrackTrajectory | ( | TrackParameters | , | |
::HepPoint3D | , | |||
double | ||||
) |
Explicit Constructor
Definition at line 92 of file TrackTrajectory.cxx.
00095 : 00096 m_parameters(p), m_startPoint(startPoint), m_curvature(curvature) 00097 { }
Atlfast::TrackTrajectory::TrackTrajectory | ( | const Hep3Vector & | p, | |
const Hep3Vector & | vertex, | |||
double | charge, | |||
double | bField | |||
) |
Constructor from a 3-momentum, vertex, charge and magnetic field
Definition at line 116 of file TrackTrajectory.cxx.
00122 { 00123 double pt = momentum.perp(); 00124 double q = charge; 00125 q /= abs(q); // q = |1| 00126 00127 // Calculate helix radius of curvature and centre 00128 00129 // Working in GeV and cm 00130 //double radius = pt/(2*0.00149898*bField); 00131 00132 // Working in MeV and mm 00133 double radius = pt/(2*0.149898*bField); 00134 double x0 = vertex.x() + q*radius*sin(momentum.phi()); 00135 double y0 = vertex.y() - q*radius*cos(momentum.phi()); 00136 Hep3Vector hCentre(x0,y0); 00137 00138 // calculate parameters 00139 // Tidier version of Fortran code zvhepa.F - Tarta 00140 00141 double impactParameter = -q*(hCentre.perp() - radius); 00142 double theta = momentum.theta(); 00143 double cotTheta = 1/tan(theta); 00144 double eta = momentum.pseudoRapidity(); 00145 double zPerigee; 00146 double phi; 00147 00148 // Calculate Phi 00149 00150 if (abs(vertex.x()) < 1e-4 && abs(vertex.y()) < 1e-4) 00151 {phi = momentum.phi();} else 00152 {if ( (vertex.phi() - hCentre.phi()) > 0 ) 00153 { phi = hCentre.phi() + M_PI/2; } else 00154 { phi = hCentre.phi() - M_PI/2;} } 00155 00156 double x1 = sin(phi)*q*hCentre.perp()/(radius*radius); 00157 double y1 = -cos(phi)*q*hCentre.perp()/(radius*radius); 00158 if (x1*x0 < 0 || y1*y0 < 0) {phi += M_PI;} 00159 if (phi < 0) {phi += 2.*M_PI;} else 00160 { if(phi > 2.*M_PI) {phi -= 2.*M_PI;} } 00161 00162 // z of perigee 00163 00164 double dot = vertex.x()*momentum.x() + vertex.y()*momentum.y(); 00165 double dotsign = dot/abs(dot) ; 00166 double dV = (vertex.perp()*vertex.perp()) - 00167 (impactParameter*impactParameter); 00168 double denom = hCentre.perp()/radius; 00169 00170 // NAN protection 00171 if (dV < 0) {dV = 0;} 00172 if (abs(dotsign)!=1) dotsign=0; 00173 00174 zPerigee = vertex.z() - (2*q*radius)*dotsign*cotTheta* 00175 asin((sqrt(dV/(denom)))*q/(2*radius) ); 00176 00177 // set parameters 00178 m_parameters = TrackParameters 00179 (eta, phi, pt, impactParameter, zPerigee, cotTheta, q/pt ); 00180 m_startPoint = HepPoint3D(vertex); 00181 m_curvature = radius; 00182 }
Atlfast::TrackTrajectory::TrackTrajectory | ( | const TrackTrajectory & | src | ) |
Atlfast::TrackTrajectory::~TrackTrajectory | ( | ) |
TrackTrajectory & Atlfast::TrackTrajectory::operator= | ( | const TrackTrajectory & | src | ) |
Assignment
Definition at line 105 of file TrackTrajectory.cxx.
00105 { 00106 m_parameters = other.m_parameters ; 00107 m_startPoint = other.m_startPoint; 00108 m_curvature = other.m_curvature; 00109 return *this ; 00110 }
TrackParameters Atlfast::TrackTrajectory::parameters | ( | ) | const |
int Atlfast::TrackTrajectory::signOfCharge | ( | ) | const |
Definition at line 196 of file TrackTrajectory.cxx.
00197 { return int( abs(m_parameters.invPtCharge() )/m_parameters.invPtCharge() ) ; }
HepPoint3D Atlfast::TrackTrajectory::startPoint | ( | ) | const |
double Atlfast::TrackTrajectory::radius | ( | ) | const |
double Atlfast::TrackTrajectory::curvature | ( | ) | const |
Definition at line 41 of file TrackTrajectory.h.
::HepPoint3D Atlfast::TrackTrajectory::m_startPoint [private] |
Definition at line 42 of file TrackTrajectory.h.
double Atlfast::TrackTrajectory::m_curvature [private] |
Definition at line 43 of file TrackTrajectory.h.