25 using namespace SurfaceSideDefinition;
27 std::pair<TrajectoryStateOnSurface,double>
29 const Plane& plane)
const
42 bool parametersOK = this->propagateParametersOnPlane(fts, plane, x, p, s);
44 float dphi2 = float(s)*
rho;
49 LogDebug(
"AnalyticalPropagator")<<
"not going anywhere. Already on surface.\n"
50 <<
"plane.localZ(fts.position()): "<<plane.
localZ(fts.
position())<<
"\n"
51 <<
"plane.position().mag(): "<<plane.
position().
mag() <<
"\n"
52 <<
"plane.posPrec: "<<plane.
posPrec();
66 return propagatedStateWithPath(fts,plane,gtp,s);
70 std::pair<TrajectoryStateOnSurface,double>
82 bool parametersOK = this->propagateParametersOnCylinder(fts, cylinder, x, p, s);
99 return propagatedStateWithPath(fts,*plane,gtp,s);
110 std::pair<TrajectoryStateOnSurface,double>
114 const double& s)
const
165 return propagateWithLineCrossing(fts.
position(),
p,cylinder,
x,
s);
171 auto rdiff = x.perp() - cylinder.radius();
172 if (
std::abs(rdiff) < tolerance )
return true;
177 propagationDirection(),cylinder);
178 if unlikely( !cylinderCrossing.hasSolution() )
return false;
180 s = cylinderCrossing.pathLength();
182 x = cylinderCrossing.position();
206 return propagateWithLineCrossing(fts.
position(),
p,plane,
x,
s);
219 if likely(isOldPropagationType) {
224 return propagateWithHelixCrossing(planeCrossing,plane,fts.
momentum().
mag(),
x,
p,
s);
230 return propagateWithHelixCrossing(planeCrossing,plane,fts.
momentum().
mag(),
x,
p,
s);
235 return propagateWithHelixCrossing(planeCrossing,plane,fts.
momentum().
mag(),
x,
p,
s);
246 LogDebug(
"AnalyticalPropagator") <<
"In AnaliticalProp, calling HAPC " <<
"\n"
247 <<
"plane is centered in xyz: "
248 << plane.position().x() <<
" , "
249 << plane.position().y() <<
" , "
250 << plane.position().z() <<
"\n";
259 LogDebug(
"AnalyticalPropagator") <<
"gp1 before calling planeCrossing1: " << gp1 <<
"\n";
265 double tolerance(0.0050);
269 bool check1 = propagateWithHelixCrossing(planeCrossing1,plane,fts.
momentum().
mag(),gp1,gm1,s1);
271 LogDebug(
"AnalyticalPropagator") <<
"check1, s1, dphi, gp1: "
279 xGen = planeCrossing1.
position(s1+tolerance);
280 pGen = planeCrossing1.
direction(s1+tolerance);
298 LogDebug(
"AnalyticalPropagator") <<
"failed also second attempt. No idea what to do, then bailout" <<
"\n";
302 pGen *= gm1.
mag()/pGen.
mag();
311 bool check2 = propagateWithHelixCrossing(planeCrossing2,plane,gm2.
mag(),gp2,gm2,
s2);
321 edm::LogError(
"AnalyticalPropagator") <<
"LOGIC ERROR: I should not have entered here!" <<
"\n";
326 LogDebug(
"AnalyticalPropagator") <<
"check2, s2, gp2: "
328 << s2 <<
" , " << gp2 <<
"\n";
331 double dist1 = (plane.position()-gp1).
perp();
332 double dist2 = (plane.position()-gp2).
perp();
335 LogDebug(
"AnalyticalPropagator") <<
"propDir, dist1, dist2: "
336 << propagationDirection() <<
" , "
346 }
else if(dist2<2*dist1){
352 if(fabs(s1)<fabs(s2)){
386 std::pair<bool,double> propResult = planeCrossing.pathLength(plane);
387 if ( !propResult.first )
return false;
388 s = propResult.second;
410 std::pair<bool,double> propResult = cylCrossing.pathLength(cylinder);
411 if ( !propResult.first )
return false;
412 s = propResult.second;
414 x = cylCrossing.position(s);
427 std::pair<bool,double> propResult = planeCrossing.
pathLength(plane);
428 if unlikely( !propResult.first )
return false;
430 s = propResult.second;
434 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
virtual DirectionType direction(double s) const
bool propagateWithLineCrossing(const GlobalPoint &, const GlobalVector &, const Plane &, GlobalPoint &, double &) const
straight line parameter propagation to a plane
TrackCharge charge() const
virtual PositionType position(double s) 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
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