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
143 bool AnalyticalPropagator::propagateParametersOnCylinder(
149 if (sp.
x()!=0. || sp.
y()!=0.) {
150 throw PropagationException(
"Cannot propagate to an arbitrary cylinder");
162 if( fabs(rho)<1.
e-10 )
163 return propagateWithLineCrossing(fts.
position(),
p,cylinder,
x,
s);
168 const double tolerance = 1.e-4;
169 double rdiff = x.perp() - cylinder.radius();
170 if ( fabs(rdiff) < tolerance )
return true;
175 propagationDirection(),cylinder);
176 if ( !cylinderCrossing.hasSolution() )
return false;
180 x = cylinderCrossing.position();
203 if( fabs(rho)<1.
e-10 )
204 return propagateWithLineCrossing(fts.
position(),
p,plane,
x,
s);
209 const double small = 1.e-6;
217 if (isOldPropagationType && fabs(u.z()) < small) {
220 HelixBarrelPlaneCrossingByCircle planeCrossing(helixPos,helixDir,rho,propagationDirection());
221 return propagateWithHelixCrossing(planeCrossing,plane,fts.
momentum().
mag(),
x,
p,
s);
223 if (isOldPropagationType && fabs(u.x()) < small && fabs(u.y()) < small) {
226 HelixForwardPlaneCrossing planeCrossing(helixPos,helixDir,rho,propagationDirection());
227 return propagateWithHelixCrossing(planeCrossing,plane,fts.
momentum().
mag(),
x,
p,
s);
232 if(isOldPropagationType){
233 HelixArbitraryPlaneCrossing planeCrossing(helixPos,helixDir,rho,propagationDirection());
234 return propagateWithHelixCrossing(planeCrossing,plane,fts.
momentum().
mag(),
x,
p,
s);
241 LogDebug(
"AnalyticalPropagator") <<
"In AnaliticalProp, calling HAPC " <<
"\n"
242 <<
"plane is centered in xyz: "
243 << plane.position().x() <<
" , "
244 << plane.position().y() <<
" , "
245 << plane.position().z() <<
"\n";
254 LogDebug(
"AnalyticalPropagator") <<
"gp1 before calling planeCrossing1: " << gp1 <<
"\n";
255 HelixArbitraryPlaneCrossing planeCrossing1(helixPos1,helixDir1,rho1,propagationDirection());
260 double tolerance(0.0050);
264 bool check1 = propagateWithHelixCrossing(planeCrossing1,plane,fts.
momentum().
mag(),gp1,gm1,s1);
266 LogDebug(
"AnalyticalPropagator") <<
"check1, s1, dphi, gp1: "
274 xGen = planeCrossing1.position(s1+tolerance);
275 pGen = planeCrossing1.direction(s1+tolerance);
293 LogDebug(
"AnalyticalPropagator") <<
"failed also second attempt. No idea what to do, then bailout" <<
"\n";
297 pGen *= gm1.
mag()/pGen.
mag();
304 HelixArbitraryPlaneCrossing planeCrossing2(helixPos2,helixDir2,rho2,propagationDirection());
306 bool check2 = propagateWithHelixCrossing(planeCrossing2,plane,gm2.mag(),gp2,gm2,
s2);
316 edm::LogError(
"AnalyticalPropagator") <<
"LOGIC ERROR: I should not have entered here!" <<
"\n";
321 LogDebug(
"AnalyticalPropagator") <<
"check2, s2, gp2: "
323 << s2 <<
" , " << gp2 <<
"\n";
326 double dist1 = (plane.position()-gp1).
perp();
327 double dist2 = (plane.position()-gp2).
perp();
330 LogDebug(
"AnalyticalPropagator") <<
"propDir, dist1, dist2: "
331 << propagationDirection() <<
" , "
341 }
else if(dist2<2*dist1){
347 if(fabs(s1)<fabs(s2)){
367 AnalyticalPropagator::propagateWithLineCrossing (
const GlobalPoint& x0,
383 std::pair<bool,double> propResult = planeCrossing.pathLength(plane);
384 if ( !propResult.first )
return false;
385 s = propResult.second;
393 AnalyticalPropagator::propagateWithLineCrossing (
const GlobalPoint& x0,
407 std::pair<bool,double> propResult = cylCrossing.pathLength(cylinder);
408 if ( !propResult.first )
return false;
409 s = propResult.second;
411 x = cylCrossing.position(s);
424 std::pair<bool,double> propResult = planeCrossing.
pathLength(plane);
425 if ( !propResult.first )
return false;
426 s = propResult.second;
432 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
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
GlobalVector momentum() const
Abs< T >::type abs(const T &t)
GlobalVector momentum() const
double pathLength() const
GlobalPoint position() const
Vector3DBase unit() const
GlobalPoint position() const
float localZclamped(const GlobalPoint &gp) 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
const PositionType & position() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
Global3DVector GlobalVector