23 using namespace SurfaceSideDefinition;
25 std::pair<TrajectoryStateOnSurface,double>
27 const Plane& plane)
const
40 bool parametersOK = this->propagateParametersOnPlane(fts, plane, x, p, s);
42 float dphi2 = float(s)*rho;
47 LogDebug(
"AnalyticalPropagator")<<
"not going anywhere. Already on surface.\n"
48 <<
"plane.localZ(fts.position()): "<<plane.
localZ(fts.
position())<<
"\n"
49 <<
"plane.position().mag(): "<<plane.
position().
mag() <<
"\n"
50 <<
"plane.posPrec: "<<plane.
posPrec();
64 return propagatedStateWithPath(fts,plane,gtp,s);
68 std::pair<TrajectoryStateOnSurface,double>
80 bool parametersOK = this->propagateParametersOnCylinder(fts, cylinder, x, p, s);
97 return propagatedStateWithPath(fts,*plane,gtp,s);
108 std::pair<TrajectoryStateOnSurface,double>
112 const double& s)
const
163 return propagateWithLineCrossing(fts.
position(),
p,cylinder,x,
s);
169 auto rdiff = x.perp() - cylinder.radius();
170 if (
std::abs(rdiff) < tolerance )
return true;
175 propagationDirection(),cylinder);
176 if unlikely( !cylinderCrossing.hasSolution() )
return false;
178 s = cylinderCrossing.pathLength();
180 x = cylinderCrossing.position();
204 return propagateWithLineCrossing(fts.
position(),
p,plane,x,
s);
216 if likely(isOldPropagationType) {
218 return propagateWithHelixCrossing(*planeCrossing,plane,fts.
momentum().
mag(),x,
p,
s);
229 LogDebug(
"AnalyticalPropagator") <<
"In AnaliticalProp, calling HAPC " <<
"\n"
230 <<
"plane is centered in xyz: "
231 << plane.position().x() <<
" , "
232 << plane.position().y() <<
" , "
233 << plane.position().z() <<
"\n";
242 LogDebug(
"AnalyticalPropagator") <<
"gp1 before calling planeCrossing1: " << gp1 <<
"\n";
248 double tolerance(0.0050);
252 bool check1 = propagateWithHelixCrossing(*planeCrossing1,plane,fts.
momentum().
mag(),gp1,gm1,s1);
254 LogDebug(
"AnalyticalPropagator") <<
"check1, s1, dphi, gp1: "
262 xGen = (*planeCrossing1).position(s1+tolerance);
263 pGen = (*planeCrossing1).direction(s1+tolerance);
281 LogDebug(
"AnalyticalPropagator") <<
"failed also second attempt. No idea what to do, then bailout" <<
"\n";
285 pGen *= gm1.
mag()/pGen.
mag();
294 bool check2 = propagateWithHelixCrossing(*planeCrossing2,plane,gm2.
mag(),gp2,gm2,
s2);
304 edm::LogError(
"AnalyticalPropagator") <<
"LOGIC ERROR: I should not have entered here!" <<
"\n";
309 LogDebug(
"AnalyticalPropagator") <<
"check2, s2, gp2: "
311 << s2 <<
" , " << gp2 <<
"\n";
314 double dist1 = (plane.position()-gp1).
perp();
315 double dist2 = (plane.position()-gp2).
perp();
318 LogDebug(
"AnalyticalPropagator") <<
"propDir, dist1, dist2: "
319 << propagationDirection() <<
" , "
329 }
else if(dist2<2*dist1){
335 if(fabs(s1)<fabs(s2)){
369 std::pair<bool,double> propResult = planeCrossing.pathLength(plane);
370 if ( !propResult.first )
return false;
371 s = propResult.second;
393 std::pair<bool,double> propResult = cylCrossing.pathLength(cylinder);
394 if ( !propResult.first )
return false;
395 s = propResult.second;
397 x = cylCrossing.position(s);
410 std::pair<bool,double> propResult = planeCrossing.
pathLength(plane);
411 if unlikely( !propResult.first )
return false;
413 s = propResult.second;
417 pGen *= pmag/pGen.
mag();
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const GlobalTrajectoryParameters & parameters() const
const AlgebraicMatrix55 & jacobian() const
virtual DirectionType direction(double s) const =0
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
float localZ(const GlobalPoint &gp) const
bool propagateWithLineCrossing(const GlobalPoint &, const GlobalVector &, const Plane &, GlobalPoint &, double &) const
straight line parameter propagation to a plane
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
bool propagateParametersOnPlane(const FreeTrajectoryState &fts, const Plane &plane, GlobalPoint &x, GlobalVector &p, double &s) const
parameter propagation to plane (returns position, momentum and path length)
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &fts, const Plane &plane) const override
propagation to plane with path length
T x() const
Cartesian x coordinate.
std::pair< TrajectoryStateOnSurface, double > propagatedStateWithPath(const FreeTrajectoryState &fts, const Surface &surface, const GlobalTrajectoryParameters >p, const double &s) const
propagation of errors (if needed) and generation of a new TSOS
GlobalVector momentum() const
bool propagateWithHelixCrossing(HelixPlaneCrossing &, const Plane &, const float, GlobalPoint &, GlobalVector &, double &s) const
helix parameter propagation to a plane using HelixPlaneCrossing
Abs< T >::type abs(const T &t)
GlobalVector momentum() const
GlobalPoint position() const
Vector3DBase unit() const
bool propagateParametersOnCylinder(const FreeTrajectoryState &fts, const Cylinder &cylinder, GlobalPoint &x, GlobalVector &p, double &s) const
parameter propagation to cylinder (returns position, momentum and path length)
GlobalPoint position() const
virtual ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const
tangent plane to surface from global point
virtual std::pair< bool, double > pathLength(const Plane &)=0
double transverseCurvature() const
virtual PositionType position(double s) const =0
T perp() const
Magnitude of transverse component.
const AlgebraicSymMatrix55 & matrix() const
std::pair< TrajectoryStateOnSurface, double > TsosWP
const PositionType & position() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
Global3DVector GlobalVector