25 using namespace SurfaceSideDefinition;
27 std::pair<TrajectoryStateOnSurface,double>
29 const Plane& plane)
const
40 const float maxDistToPlane(0.1
e-4);
41 const float numericalPrecision(5.
e-7);
42 float maxDz = numericalPrecision*plane.
position().
mag();
43 if ( fabs(plane.
localZ(fts.
position()))>(maxDistToPlane>maxDz?maxDistToPlane:maxDz) ) {
45 bool parametersOK = this->propagateParametersOnPlane(fts, plane, x, p, s);
52 LogDebug(
"AnalyticalPropagator")<<
"not going anywhere. Already on surface.\n"
53 <<
"plane.localZ(fts.position()): "<<plane.
localZ(fts.
position())<<
"\n"
54 <<
"maxDistToPlane: "<<maxDistToPlane<<
"\n"
55 <<
"maxDz: "<<maxDz<<
"\n"
56 <<
"plane.position().mag(): "<<plane.
position().
mag();
65 if ( fabs(rho)>1.e-10 && fabs((gtp.transverseCurvature()-
rho)/rho)>theMaxDBzRatio )
70 return propagatedStateWithPath(fts,plane,gtp,s);
74 std::pair<TrajectoryStateOnSurface,double>
86 bool parametersOK = this->propagateParametersOnCylinder(fts, cylinder, x, p, s);
95 if ( fabs(rho)>1.e-10 && fabs((gtp.transverseCurvature()-
rho)/rho)>theMaxDBzRatio )
103 return propagatedStateWithPath(fts,*plane,gtp,s);
114 std::pair<TrajectoryStateOnSurface,double>
118 const double&
s)
const
153 if (sp.
x()!=0. || sp.
y()!=0.) {
166 if( fabs(rho)<1.
e-10 )
167 return propagateWithLineCrossing(fts.
position(),
p,cylinder,
x,
s);
172 const double tolerance = 1.e-4;
173 double rdiff = x.perp() - cylinder.radius();
174 if ( fabs(rdiff) < tolerance )
return true;
179 propagationDirection(),cylinder);
180 if ( !cylinderCrossing.hasSolution() )
return false;
184 x = cylinderCrossing.position();
207 if( fabs(rho)<1.
e-10 )
208 return propagateWithLineCrossing(fts.
position(),
p,plane,
x,
s);
213 const double small = 1.e-6;
221 if (isOldPropagationType && fabs(u.z()) < small) {
225 return propagateWithHelixCrossing(planeCrossing,plane,fts.
momentum().
mag(),
x,
p,
s);
227 if (isOldPropagationType && fabs(u.x()) < small && fabs(u.y()) < small) {
231 return propagateWithHelixCrossing(planeCrossing,plane,fts.
momentum().
mag(),
x,
p,
s);
236 if(isOldPropagationType){
238 return propagateWithHelixCrossing(planeCrossing,plane,fts.
momentum().
mag(),
x,
p,
s);
245 LogDebug(
"AnalyticalPropagator") <<
"In AnaliticalProp, calling HAPC " <<
"\n"
246 <<
"plane is centered in xyz: "
247 << plane.position().x() <<
" , "
248 << plane.position().y() <<
" , "
249 << plane.position().z() <<
"\n";
258 LogDebug(
"AnalyticalPropagator") <<
"gp1 before calling planeCrossing1: " << gp1 <<
"\n";
264 double tolerance(0.0050);
268 bool check1 = propagateWithHelixCrossing(planeCrossing1,plane,fts.
momentum().
mag(),gp1,gm1,s1);
269 double dphi1 = fabs(fts.
momentum().
phi()-gm1.phi());
270 LogDebug(
"AnalyticalPropagator") <<
"check1, s1, dphi, gp1: "
278 xGen = planeCrossing1.
position(s1+tolerance);
279 pGen = planeCrossing1.
direction(s1+tolerance);
297 LogDebug(
"AnalyticalPropagator") <<
"failed also second attempt. No idea what to do, then bailout" <<
"\n";
301 pGen *= gm1.
mag()/pGen.
mag();
310 bool check2 = propagateWithHelixCrossing(planeCrossing2,plane,gm2.
mag(),gp2,gm2,
s2);
320 edm::LogError(
"AnalyticalPropagator") <<
"LOGIC ERROR: I should not have entered here!" <<
"\n";
325 LogDebug(
"AnalyticalPropagator") <<
"check2, s2, gp2: "
327 << s2 <<
" , " << gp2 <<
"\n";
330 double dist1 = (plane.position()-gp1).
perp();
331 double dist2 = (plane.position()-gp2).
perp();
334 LogDebug(
"AnalyticalPropagator") <<
"propDir, dist1, dist2: "
335 << propagationDirection() <<
" , "
345 }
else if(dist2<2*dist1){
351 if(fabs(s1)<fabs(s2)){
387 std::pair<bool,double> propResult = planeCrossing.
pathLength(plane);
388 if ( !propResult.first )
return false;
389 s = propResult.second;
411 std::pair<bool,double> propResult = cylCrossing.
pathLength(cylinder);
412 if ( !propResult.first )
return false;
413 s = propResult.second;
428 std::pair<bool,double> propResult = planeCrossing.
pathLength(plane);
429 if ( !propResult.first )
return false;
430 s = propResult.second;
436 pGen *= pmag/pGen.
mag();
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
bool propagateParametersOnPlane(const FreeTrajectoryState &fts, const Plane &plane, GlobalPoint &x, GlobalVector &p, double &s) const dso_internal
parameter propagation to plane (returns position, momentum and path length)
virtual ReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const
tangent plane to surface from global point
std::pair< TrajectoryStateOnSurface, double > propagatedStateWithPath(const FreeTrajectoryState &fts, const Surface &surface, const GlobalTrajectoryParameters >p, const double &s) const dso_internal
propagation of errors (if needed) and generation of a new TSOS
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
Fast access to distance from plane for a point.
virtual DirectionType direction(double s) const
TrackCharge charge() const
virtual PositionType position(double s) const
const CurvilinearTrajectoryError & curvilinearError() const
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &fts, const Plane &plane) const
propagation to plane with path length
GlobalVector momentum() const
bool propagateParametersOnCylinder(const FreeTrajectoryState &fts, const Cylinder &cylinder, GlobalPoint &x, GlobalVector &p, double &s) const dso_internal
parameter propagation to cylinder (returns position, momentum and path length)
GlobalVector momentum() const
std::pair< bool, double > pathLength(const Plane &plane) const
double pathLength() const
GlobalPoint position() const
PositionType position(double s) const
Vector3DBase unit() const
GlobalPoint position() const
GlobalPoint position(const double s) const
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
bool propagateWithHelixCrossing(HelixPlaneCrossing &, const Plane &, const float, GlobalPoint &, GlobalVector &, double &s) const dso_internal
helix parameter propagation to a plane using HelixPlaneCrossing
std::pair< TrajectoryStateOnSurface, double > TsosWP
std::pair< bool, double > pathLength(const Cylinder &cyl) const
const PositionType & position() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
bool propagateWithLineCrossing(const GlobalPoint &, const GlobalVector &, const Plane &, GlobalPoint &, double &) const dso_internal
straight line parameter propagation to a plane
Global3DVector GlobalVector