28 #include "CLHEP/Units/PhysicalConstants.h"
105 theclass->
message(
"movePoint1ToZPlaneAndPoint2 Error: Points have same z!!");
108 double s( (
z-
p1.z())/dz );
123 double p1r(
p1.perp());
124 double dr(
p2.perp()-p1r);
126 theclass->message(
"movePoint1ToInfiniteCylinderAndPoint2 Error: Points have same r!!");
129 double s((
r-p1r)/
dr);
158 message(
"makePointsNeutral called with null track pointer");
161 const unsigned npars =
track->trackParameters()->size();
163 message(
"makePointsNeutral Error: No TrackParameters on track!");
174 bool problems(
false);
175 for (; tsos_iter != tsos_end; ++tsos_iter) {
190 messageDebug(
"makePointsNeutral WARNING: Track had one or more track parameters which is unsafe to use in job.");
192 messageDebug(
"makePointsNeutral ERROR: Track did not have at least two safe parameters.");
243 messageVerbose(
"makePointsCharged start with hypo="+
str(hypo)+
", useMEOT="+
str(useMEOT)+
", volume=" +
str(volume));
251 message(
"makePointsCharged ERROR: Null extrapolator tool provided!");
255 message(
"makePointsCharged ERROR: Called with null track pointer");
258 const unsigned npars =
track->trackParameters()->size();
260 message(
"makePointsCharged ERROR: No TrackParameters on track!");
267 const EventContext& ctx = Gaudi::Hive::currentContext();
273 bool problems(
false);
274 for (; tsos_iter != tsos_end; ++tsos_iter) {
277 if ((*tsos_iter)->measurementOnTrack()==
nullptr && ( (*tsos_iter)->materialEffectsOnTrack()&&!useMEOT ) )
279 trackParam = (*tsos_iter)->trackParameters();
284 prevpar = trackParam;
291 prevpar = trackParam;
295 messageDebug(
"WARNING: Problems encountered adding point(s) between track parameters");
303 const std::vector<const Trk::Surface*>* bsurfs =
305 .decomposeToSurfaces(volume->
transform());
310 std::vector< const Trk::Surface * >::const_iterator bSurfsIt = bsurfs->begin();
311 for (;bSurfsIt!= bsurfs->end(); ++bSurfsIt){
324 messageDebug(
"WARNING: Problems encountered adding point(s) between track parameters in extending to Volume");
328 messageDebug(
"WARNING: Problems encountered getting boundary surfaces from Volume");
343 if (!trk||!prevpars||!extrapolator)
354 if (showExtrapSurfaces) surfaces.push_back(surf);
359 newpars = extrapolator->
extrapolate(Gaudi::Hive::currentContext(),
363 }
catch (
const std::runtime_error&
e) {
364 theclass->message(
"Failure trying to use extrapolator for track (Exception thrown: " + QString(
e.what())+
")");
368 theclass->message(
"Failure trying to use extrapolator for track");
372 theclass->message(
"Failure trying to use extrapolator for track");
388 theclass->messageVerbose(
"makePointsCharged_SinglePar start");
391 theclass->message(
"makePointsCharged_SinglePar ERROR: Null extrapolator tool provided!");
395 if (!tracksanity->isSafe(
par)) {
396 theclass->messageDebug(
"makePointsCharged_SinglePar called with unsafe track parameter");
402 const bool startoutsideID(outsideIDVolume(
p0));
405 const double maxdistadded = 2*
CLHEP::m;
410 while (distadded<maxdistadded) {
411 temppars = extrapolateToNewPar( extrapolator,
track, prevpars, hypo, maxPointDistSq(prevpars->
position()));
418 theclass->messageDebug(
"makePointsCharged_SinglePar ERROR: Failed to use extrapolator for next point");
429 if (!startoutsideID && outsideIDVolume(
p)) {
440 theclass->messageVerbose(
"makePointsCharged_SinglePar end");
451 if (distbetween<0.001) {
452 theclass->messageVerbose(
"TrackPropagationHelper::Imp::addPointsBetweenParameters_Charged: parameters on top of each other. Skip, but no error.");
461 double olddistsq(1.0e99);
464 while ( (prevpars->
position()-
p2).mag()> maxPointDistSq(prevpars->
position()) && distadded<maxdistadded ) {
470 theclass->messageVerbose(
"TrackPropagationHelper::Imp::addPointsBetweenParameters_Charged: Extrapolation failed.");
474 if (distsq>olddistsq) {
477 theclass->messageVerbose(
"TrackPropagationHelper::Imp::addPointsBetweenParameters_Charged: distq("+
str(distsq)+
")>olddistsq ("+
str(olddistsq)+
") so overshot?");
493 return (distadded<maxdistadded);