26 const Plane& plane)
const {
52 const Plane& plane)
const {
55 double startZ = plane.
localZ(gpos);
69 LogDebug(
"RKPropagatorInS") <<
" startZ = " << startZ;
72 LogDebug(
"RKPropagatorInS") <<
"Propagation is not performed: state is already on final surface.";
83 std::pair<bool, double> propResult = planeCrossing.
pathLength(plane);
85 double s = propResult.second;
92 LogDebug(
"RKPropagatorInS") <<
"Straight line propgation to plane failed !!";
98 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: starting prop to plane in volume with pos " 101 LogDebug(
"RKPropagatorInS") <<
"The starting position is " << ts.
position() <<
" (global) " 106 LogDebug(
"RKPropagatorInS") <<
"The plane position is " << plane.
position() <<
" (global) " << localPlane.position()
112 std::pair<bool, double> res3 =
cross.pathLength(plane);
113 LogDebug(
"RKPropagatorInS") <<
"straight line distance " << res3.first <<
" " << res3.second;
133 while (safeGuard++ < 100) {
136 std::pair<bool, double>
path =
139 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Path length calculation to plane failed!" 141 <<
"...Local starting position in volume " << startState.
position()
147 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Path lenght to plane is " <<
path.second;
149 double sstep =
path.second;
151 LogDebug(
"RKPropagatorInS") <<
"On-surface accuracy not reached, but pathLength calculation says we are there! " 152 <<
"path " <<
path.second <<
" distance to plane is " << startZ;
157 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Solving for " << sstep <<
" current distance to plane is " 160 RKVector rkresult = solver(0,
start, sstep, deriv, dist,
eps);
165 if (fabs(remainingZ) <
eps) {
166 LogDebug(
"RKPropagatorInS") <<
"On-surface accuracy reached! " << remainingZ;
173 if (remainingZ * startZ > 0) {
174 LogDebug(
"RKPropagatorInS") <<
"Accuracy not reached yet, trying in same direction again " << remainingZ;
176 LogDebug(
"RKPropagatorInS") <<
"Accuracy not reached yet, trying in opposite direction " << remainingZ;
182 edm::LogError(
"FailedPropagation") <<
" too many iterations trying to reach plane ";
200 double startR = cyl.
radius() -
pos.perp();
223 std::pair<bool, double> propResult = cylCrossing.
pathLength(cyl);
225 double s = propResult.second;
229 LogDebug(
"RKPropagatorInS") <<
"Straight line propagation to cylinder succeeded !!";
234 edm::LogError(
"RKPropagatorInS") <<
"Straight line propagation to cylinder failed !!";
250 while (safeGuard++ < 100) {
257 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Path length calculation to cylinder failed!" 258 <<
"Radius " << cyl.
radius() <<
" pos.perp() " 263 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Path lenght to cylinder is " <<
path.second <<
" from point (R,z) " 267 double sstep =
path.second;
269 LogDebug(
"RKPropagatorInS") <<
"accuracy not reached, but pathLength calculation says we are there! " 276 LogDebug(
"RKPropagatorInS") <<
"RKPropagatorInS: Solving for " << sstep <<
" current distance to cylinder is " 279 RKVector rkresult = solver(0,
start, sstep, deriv, dist,
eps);
284 if (fabs(remainingR) <
eps) {
285 LogDebug(
"RKPropagatorInS") <<
"Accuracy reached! " << remainingR;
291 if (remainingR * startR > 0) {
292 LogDebug(
"RKPropagatorInS") <<
"Accuracy not reached yet, trying in same direction again " << remainingR;
294 LogDebug(
"RKPropagatorInS") <<
"Accuracy not reached yet, trying in opposite direction " << remainingR;
300 edm::LogError(
"FailedPropagation") <<
" too many iterations trying to reach cylinder ";
329 return pos.basicVector();
std::pair< bool, double > pathLength(const Cylinder &cyl) const
GlobalPoint toGlobal(const LocalPoint &lp) const
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
Local3DVector LocalVector
Point3DBase< Scalar, LocalTag > LocalPoint
ROOT::Math::Plane3D::Vector Vector
Propagator * clone() const override
Global3DPoint GlobalPoint
RKLocalFieldProvider fieldProvider() const
ALPAKA_FN_ACC int side(int ieta, int iphi)
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Plane &) const override
Basic3DVector< double > rkPosition(const GlobalPoint &pos) const
virtual PropagationDirection propagationDirection() const final
Log< level::Error, false > LogError
LocalPoint toLocal(const GlobalPoint &gp) const
std::pair< bool, double > pathLength(const Cylinder &cyl) const
GlobalPoint position() const
GlobalVector globalMomentum(const Basic3DVector< float > &mom) const
Estimator of the distance between two state vectors, e.g. for convergence test.
TrackCharge charge() const
Derivative calculation for the 6D cartesian case.
GlobalVector momentum() const
Abs< T >::type abs(const T &t)
GlobalTrajectoryParameters gtpFromVolumeLocal(const CartesianStateAdaptor &state, TrackCharge charge) const
const MagVolume * theVolume
PositionType position(float s) const
std::pair< TrajectoryStateOnSurface, double > analyticalErrorPropagation(const FreeTrajectoryState &startingState, const Surface &surface, SurfaceSideDefinition::SurfaceSide side, const GlobalTrajectoryParameters &destParameters, const double &s)
const BasicVectorType & basicVector() const
T perp() const
Magnitude of transverse component.
std::pair< bool, double > pathLength(const Plane &plane) const
T perp() const
Magnitude of transverse component.
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const Vector3D & momentum() const
float localZ(const GlobalPoint &gp) const
GlobalParametersWithPath propagateParametersOnPlane(const FreeTrajectoryState &ts, const Plane &plane) const
double transverseCurvature() const
static Plane transformPlane(const Plane &plane, const GloballyPositioned< T > &frame)
const PositionType & position() const
T z() const
Cartesian z coordinate.
PropagationDirection invertDirection(PropagationDirection dir) const
GlobalPoint position(const double s) const
std::pair< TrajectoryStateOnSurface, double > TsosWP
GlobalTrajectoryParameters gtpFromLocal(const Basic3DVector< float > &lpos, const Basic3DVector< float > &lmom, TrackCharge ch, const Surface &surf) const
GlobalPoint globalPosition(const Basic3DVector< float > &pos) const
const Frame & frame() const
The reference frame in which the field is defined.
GlobalParametersWithPath propagateParametersOnCylinder(const FreeTrajectoryState &ts, const Cylinder &cyl) const
Scalar radius() const
Radius of the cylinder.
Vector inTesla(const LocalPoint &lp) const
the argument lp is in the local frame specified in the constructor
const Vector3D & position() const
RKPropagatorInS(const MagVolume &vol, PropagationDirection dir=alongMomentum, double tolerance=5.e-5)
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
Basic3DVector< double > rkMomentum(const GlobalVector &mom) const
Global3DVector GlobalVector