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
145 bool AnalyticalPropagator::propagateParametersOnCylinder(
152 throw PropagationException(
"Cannot propagate to an arbitrary cylinder");
177 propagationDirection(),cylinder);
180 s = cylinderCrossing.pathLength();
182 x = cylinderCrossing.position();
184 p = cylinderCrossing.direction().
unit()*fts.momentum().
mag();
200 auto rho = fts.transverseCurvature();
206 return propagateWithLineCrossing(fts.position(),p,plane,x,s);
223 HelixBarrelPlaneCrossingByCircle planeCrossing(helixPos,helixDir,rho,propagationDirection());
224 return propagateWithHelixCrossing(planeCrossing,plane,fts.momentum().mag(),
x,
p,
s);
229 HelixForwardPlaneCrossing planeCrossing(helixPos,helixDir,rho,propagationDirection());
230 return propagateWithHelixCrossing(planeCrossing,plane,fts.momentum().mag(),
x,
p,
s);
234 HelixArbitraryPlaneCrossing planeCrossing(helixPos,helixDir,rho,propagationDirection());
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";
256 double rho1 = fts.transverseCurvature();
259 LogDebug(
"AnalyticalPropagator") <<
"gp1 before calling planeCrossing1: " << gp1 <<
"\n";
260 HelixArbitraryPlaneCrossing planeCrossing1(helixPos1,helixDir1,rho1,propagationDirection());
265 double tolerance(0.0050);
269 bool check1 = propagateWithHelixCrossing(planeCrossing1,plane,fts.momentum().mag(),gp1,gm1,s1);
270 double dphi1 = fabs(fts.momentum().phi()-gm1.phi());
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();
309 HelixArbitraryPlaneCrossing planeCrossing2(helixPos2,helixDir2,rho2,propagationDirection());
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)){
370 AnalyticalPropagator::propagateWithLineCrossing (
const GlobalPoint& x0,
386 std::pair<bool,double> propResult = planeCrossing.pathLength(plane);
387 if ( !propResult.first )
return false;
388 s = propResult.second;
396 AnalyticalPropagator::propagateWithLineCrossing (
const GlobalPoint& x0,
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);
434 pGen *= pmag/pGen.mag();
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const GlobalTrajectoryParameters & parameters() const
const AlgebraicMatrix55 & jacobian() const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Global3DPoint GlobalPoint
float localZ(const GlobalPoint &gp) const
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
static int position[TOTALCHAMBERS][3]
Point3DBase< Scalar, GlobalTag > PositionType
U second(std::pair< T, U > const &p)
GlobalVector momentum() const
Abs< T >::type abs(const T &t)
GlobalVector momentum() const
GlobalPoint position() const
GlobalPoint position() const
float localZclamped(const GlobalPoint &gp) const
virtual std::pair< bool, double > pathLength(const Plane &)=0
double transverseCurvature() const
return(e1-e2)*(e1-e2)+dp *dp
T perp() const
Magnitude of transverse component.
const AlgebraicSymMatrix55 & matrix() const
volatile std::atomic< bool > shutdown_flag false
const PositionType & position() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
tuple AnalyticalPropagator