26 std::pair<TrajectoryStateOnSurface,double>
28 const Plane& plane)
const
36 return errorprop( fts, plane, side, gp.
parameters(),gp.
s());
39 std::pair< TrajectoryStateOnSurface, double>
48 return errorprop( fts, cyl, side, gp.
parameters(),gp.
s());
54 const Plane& plane)
const
59 double startZ = plane.
localZ(gpos);
73 LogDebug(
"RKPropagatorInS")<<
" startZ = "<<startZ;
76 LogDebug(
"RKPropagatorInS")<<
"Propagation is not performed: state is already on final surface.";
88 std::pair<bool,double> propResult = planeCrossing.
pathLength(plane);
90 double s = propResult.second;
97 LogDebug(
"RKPropagatorInS")<<
"Straight line propgation to plane failed !!";
108 LogDebug(
"RKPropagatorInS") <<
"The starting position is " << ts.
position() <<
" (global) "
113 LogDebug(
"RKPropagatorInS") <<
"The plane position is " << plane.
position() <<
" (global) "
114 << localPlane->position() <<
" (local) " ;
119 std::pair<bool,double> res3 =
cross.pathLength(plane);
120 LogDebug(
"RKPropagatorInS") <<
"straight line distance " << res3.first <<
" " << res3.second ;
140 while (safeGuard++<100) {
143 std::pair<bool,double>
path = pathLength( plane, startState.
position(),
145 (double) ts.
charge(), currentDirection);
147 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Path length calculation to plane failed!"
149 <<
"...Local starting position in volume " << startState.
position()
156 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Path lenght to plane is " << path.second ;
159 double sstep = path.second;
161 LogDebug(
"RKPropagatorInS") <<
"On-surface accuracy not reached, but pathLength calculation says we are there! "
162 <<
"path " << path.second <<
" distance to plane is " << startZ ;
167 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Solving for " << sstep
168 <<
" current distance to plane is " << startZ ;
170 RKVector rkresult = solver( 0, start, sstep, deriv, dist, eps);
175 if ( fabs(remainingZ) < eps) {
176 LogDebug(
"RKPropagatorInS") <<
"On-surface accuracy reached! " << remainingZ ;
183 if (remainingZ * startZ > 0) {
184 LogDebug(
"RKPropagatorInS") <<
"Accuracy not reached yet, trying in same direction again "
188 LogDebug(
"RKPropagatorInS") <<
"Accuracy not reached yet, trying in opposite direction "
195 edm::LogError(
"FailedPropagation") <<
" too many iterations trying to reach plane ";
216 double startR = cyl.
radius() -
pos.perp();
240 std::pair<bool,double> propResult = cylCrossing.
pathLength(cyl);
242 double s = propResult.second;
246 LogDebug(
"RKPropagatorInS") <<
"Straight line propagation to cylinder succeeded !!";
251 edm::LogError(
"RKPropagatorInS") <<
"Straight line propagation to cylinder failed !!";
269 while (safeGuard++<100) {
273 currentDirection, eps);
277 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Path length calculation to cylinder failed!"
282 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Path lenght to cylinder is " << path.second
285 <<
" to R " << cyl.
radius()
289 double sstep = path.second;
291 LogDebug(
"RKPropagatorInS") <<
"accuracy not reached, but pathLength calculation says we are there! "
300 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Solving for " << sstep
301 <<
" current distance to cylinder is " << startR ;
303 RKVector rkresult = solver( 0, start, sstep, deriv, dist, eps);
308 if ( fabs(remainingR) < eps) {
309 LogDebug(
"RKPropagatorInS") <<
"Accuracy reached! " << remainingR ;
317 if (remainingR * startR > 0) {
318 LogDebug(
"RKPropagatorInS") <<
"Accuracy not reached yet, trying in same direction again "
322 LogDebug(
"RKPropagatorInS") <<
"Accuracy not reached yet, trying in opposite direction "
329 edm::LogError(
"FailedPropagation") <<
" too many iterations trying to reach cylinder ";
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
virtual Propagator * clone() const
Local3DVector LocalVector
virtual PropagationDirection propagationDirection() const
Basic3DVector< double > rkPosition(const GlobalPoint &pos) const dso_internal
ROOT::Math::Plane3D::Vector Vector
GlobalParametersWithPath propagateParametersOnCylinder(const FreeTrajectoryState &ts, const Cylinder &cyl) const dso_internal
RKLocalFieldProvider fieldProvider() const
std::pair< bool, double > pathLength(const Cylinder &cyl) const
Global3DPoint GlobalPoint
float localZ(const GlobalPoint &gp) const
Fast access to distance from plane for a point.
const GlobalTrajectoryParameters & parameters() const
TrackCharge charge() const
GlobalPoint globalPosition(const Basic3DVector< double > &pos) const dso_internal
GlobalParametersWithPath propagateParametersOnPlane(const FreeTrajectoryState &ts, const Plane &plane) const dso_internal
std::pair< TrajectoryStateOnSurface, double > TsosWP
Estimator of the distance between two state vectors, e.g. for convergence test.
Scalar radius() const
Radius of the cylinder.
T z() const
Cartesian z coordinate.
LocalPoint toLocal(const GlobalPoint &gp) const
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Plane &) const
Derivative calculation for the 6D cartesian case.
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
const Vector3D & momentum() const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Plane &) const
const MagVolume * theVolume
T perp() const
Magnitude of transverse component.
GlobalVector momentum() const
GlobalVector globalMomentum(const Basic3DVector< double > &mom) const dso_internal
std::pair< bool, double > pathLength(const Plane &plane) const
PositionType position(double s) const
GlobalPoint toGlobal(const LocalPoint &lp) const
GlobalPoint position() const
GlobalTrajectoryParameters gtpFromLocal(const Basic3DVector< double > &lpos, const Basic3DVector< double > &lmom, TrackCharge ch, const Surface &surf) const dso_internal
const Frame & frame() const
The reference frame in which the field is defined.
static Plane transformPlane(const Plane &plane, const GloballyPositioned< T > &frame)
GlobalPoint position(const double s) const
Basic3DVector< double > rkMomentum(const GlobalVector &mom) const dso_internal
double transverseCurvature() const
GlobalTrajectoryParameters gtpFromVolumeLocal(const CartesianStateAdaptor &state, TrackCharge charge) const dso_internal
T perp() const
Magnitude of transverse component.
RKPropagatorInS(const MagVolume &vol, PropagationDirection dir=alongMomentum, double tolerance=5.e-5)
const Vector3D & position() const
PropagationDirection invertDirection(PropagationDirection dir) const dso_internal
std::pair< bool, double > pathLength(const Cylinder &cyl) const
const BasicVectorType & basicVector() const
const PositionType & position() const
Global3DVector GlobalVector
Vector inTesla(const LocalPoint &lp) const
the argument lp is in the local frame specified in the constructor
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.