44 #include "StPhysicalHelix.hh"
45 #include "PhysicalConstants.h"
46 #include "SystemOfUnits.h"
50 StPhysicalHelix::StPhysicalHelix(){}
52 StPhysicalHelix::~StPhysicalHelix() { }
58 mH = (q*B <= 0) ? 1 : -1;
59 if(p.y() == 0 && p.x() == 0)
62 setPhase(atan2(p.y(),p.x())-mH*M_PI/2);
63 setDipAngle(atan2(p.z(),p.perp()));
66 #ifndef ST_NO_NAMESPACES
68 using namespace units;
70 setCurvature(fabs((c_light*nanosecond/meter*q*B/tesla)/
71 (abs(p)/GeV*mCosDipAngle)/meter));
72 #ifndef ST_NO_NAMESPACES
77 StPhysicalHelix::StPhysicalHelix(
double c,
double d,
double phase,
79 :
StHelix(c, d, phase, o, h) { }
87 #ifndef ST_NO_NAMESPACES
89 using namespace units;
91 double pt = GeV*fabs(c_light*nanosecond/meter*B/tesla)/(fabs(mCurvature)*meter);
94 pt*sin(mPhase+mH*M_PI/2),
96 #ifndef ST_NO_NAMESPACES
107 return tmp.momentum(B);
110 int StPhysicalHelix::charge(
double B)
const
112 return (B > 0 ? -mH : mH);
115 double StPhysicalHelix::geometricSignedDistance(
double x,
double y)
120 DCA2dPosition.setZ(0);
125 if (this->mSingularity) {
126 momVec = this->at(1)- this->at(0);
130 momVec = this->momentumAt(thePath,1./tesla);
134 double cross = DCAVec.x()*momVec.y() - DCAVec.y()*momVec.x();
135 double theSign = (cross>=0) ? 1. : -1.;
136 return theSign*DCAVec.perp();
139 double StPhysicalHelix::curvatureSignedDistance(
double x,
double y)
142 if (this->mSingularity || abs(this->mH)<=0) {
143 return (this->geometricSignedDistance(x,y));
146 return (this->geometricSignedDistance(x,y))/(this->mH);
153 double sdca2d = this->geometricSignedDistance(pos.x(),pos.y());
154 double theSign = (sdca2d>=0) ? 1. : -1.;
155 return (this->
distance(pos))*theSign;
160 double sdca2d = this->curvatureSignedDistance(pos.x(),pos.y());
161 double theSign = (sdca2d>=0) ? 1. : -1.;
162 return (this->
distance(pos))*theSign;
int h() const
y-center of circle in xy-plane
double x(double s) const
coordinates of helix at point s
double distance(const StThreeVector< double > &p, bool scanPeriods=true) const
minimal distance between point and helix
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
void setPhase(double)
performs also various checks
double phase() const
1/R in xy-plane