43 declareInterface<INavigator>(
this);
70 return StatusCode::SUCCESS;
129 << surface_id <<
" of Volume: '"
143 ctx, parms, currentSurface, searchDir,
true, s_zeroMagneticField);
147 " [N] --> next BoundarySurface found with Parameters: " << *trackPar);
148 return currentBoundary;
185 ATH_MSG_VERBOSE(
" [N] Parameters have been flagged as being outside !");
199 if (!currentBoundary) {
201 << surface_id <<
" of Volume: '"
206 << surface_id <<
" of Volume: '"
213 std::unique_ptr<Trk::TrackParameters> trackPar =
nullptr;
222 ctx, parms, currentSurface, searchDir,
true, s_zeroMagneticField);
224 trackPar.reset(parms.
clone());
229 trackPar->position(), trackPar->momentum().normalized(), dir);
230 return {nextVolume, std::move(trackPar),
249 return {
nullptr,
nullptr};
259 bool isAtBoundary =
false;
265 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
266 const Trk::Surface &surf = bounds[ib]->surfaceRepresentation();
277 if (!nextVol && attachedVol) {
278 nextVol = attachedVol;
285 <<
" has loose ends. because the navigation of "
287 << (*parms) << std::endl
288 <<
" failed. Please consult the experts or have a "
289 "look at ATLASRECTS-7147");
296 if (not surfingTheBeamPipe) {
297 ATH_MSG_WARNING(
"navigator detects tangential intersection: switch of volumes reverted ");
299 ATH_MSG_VERBOSE(
"navigator detects particle entering and re-entering the beampipe");
301 if (nextVol and (not surfingTheBeamPipe)) {
304 isAtBoundary =
false;
326 std::vector<const Trk::TrackParameters *> measuredParameters;
331 if (!mtp || !mtp->covariance()) {
334 measuredParameters.push_back(*it);
338 if (measuredParameters.empty()) {
344 std::vector<const Trk::TrackParameters *>::const_iterator tpIter = measuredParameters.begin();
345 std::vector<const Trk::TrackParameters *>::const_iterator tpIterEnd = measuredParameters.end();
347 double closestDistance = 10e10;
350 for (; tpIter != tpIterEnd; ++tpIter) {
352 Amg::Vector3D tpDirection = (*tpIter)->momentum().normalized();
354 Trk::DistanceSolution currentDistance = sf.straightLineDistanceEstimate((*tpIter)->position(), tpDirection);
357 double firstDistance = std::abs(currentDistance.
first());
359 1 ? std::abs(currentDistance.
second()) : firstDistance;
361 if (firstDistance < closestDistance || secondDistance < closestDistance) {
362 currentClosestParameters = (*tpIter);
363 closestDistance = firstDistance <= secondDistance ? firstDistance : secondDistance;
369 return currentClosestParameters;
374 closestTrackParameters =
375 *(std::min_element(measuredParameters.begin(), measuredParameters.end(),
376 tParFinderCylinder));
377 return closestTrackParameters;
383 sf.center(), sf.transform().rotation().col(2));
384 closestTrackParameters = *(std::min_element(
385 measuredParameters.begin(), measuredParameters.end(), tParFinderLine));
386 return closestTrackParameters;
390 closestTrackParameters = *(std::min_element(measuredParameters.begin(), measuredParameters.end(), tParFinderCenter));
392 return closestTrackParameters;
401 throw std::runtime_error{
402 "Could not retrieve TrackingGeometry from Conditions Store."
405 return handle.
cptr();
411 throw std::runtime_error{
412 "Could not retrieve TrackingGeometry from Detector Store."
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
An STL vector of pointers that by default owns its pointed-to elements.
const ServiceHandle< StoreGateSvc > & detStore() const
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
const_pointer_type cptr()
Description of a BoundarySurface inside the tracking realm, it extends the Surface description to mak...
virtual const Tvol * attachedVolume(const TrackParameters &parms, PropDirection dir) const =0
Get the next Volume depending on the TrackParameters and the requested direction.
virtual const Surface & surfaceRepresentation() const =0
The Surface Representation of this.
Access to distance solutions.
double second() const
Distance to second intersection solution along direction (for a cylinder surface)
double currentDistance(bool signedDist=false) const
Current distance to surface (spatial), signed (along/opposite to surface normal) if input argument tr...
int numberOfSolutions() const
Number of intersection solutions.
double first() const
Distance to first intersection solution along direction.
Interface class IPropagators It inherits from IAlgTool.
virtual std::unique_ptr< TrackParameters > propagateParameters(const EventContext &ctx, const TrackParameters &parm, const Surface &sf, PropDirection dir, const BoundaryCheck &bcheck, const MagneticFieldProperties &mprop, ParticleHypothesis particle=pion, bool returnCurv=false, const TrackingVolume *tVol=nullptr) const =0
Main propagation method for parameters only.
magnetic field properties to steer the behavior of the extrapolation
Navigator(const std::string &, const std::string &, const IInterface *)
Constructor.
std::string m_trackingGeometryName
Name of the TrackingGeometry as given in Detector Store.
Trk::MagneticFieldProperties m_fieldProperties
virtual const TrackParameters * closestParameters(const Track &trk, const Surface &sf) const override final
INavigator interface method - getting the closest TrackParameters from a Track to a Surface.
virtual NavigationCell nextTrackingVolume(const EventContext &ctx, const IPropagator &prop, const TrackParameters &parms, PropDirection dir, const TrackingVolume &vol) const override final
INavigator interface method - getting the next Volume and the parameter for the next Navigation.
ServiceHandle< Trk::ITrackingGeometrySvc > m_trackingGeometrySvc
ToolHandle to the TrackingGeometrySvc.
BooleanProperty m_useStraightLineApproximation
virtual const BoundarySurface< TrackingVolume > * nextBoundarySurface(const EventContext &ctx, const IPropagator &prop, const TrackParameters &parms, PropDirection dir) const override final
INavigator interface methods - getting the next BoundarySurface not knowing the Volume.
virtual const TrackingVolume * volume(const EventContext &ctx, const Amg::Vector3D &gp) const override final
INavigator interface methods - global search for the Volume one is in.
virtual const TrackingVolume * highestVolume(const EventContext &ctx) const override final
INavigator interface method - forward hightes TrackingVolume.
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
BooleanProperty m_searchWithDistance
search with new distanceToSurface() method
virtual bool atVolumeBoundary(const Trk::TrackParameters *parms, const Trk::TrackingVolume *vol, Trk::PropDirection dir, const Trk::TrackingVolume *&nextVol, double tol) const override final
INavigator method to resolve navigation at boundary.
virtual StatusCode initialize() override
AlgTool initialize method.
virtual const TrackingGeometry * trackingGeometry(const EventContext &ctx) const override final
INavigator interface method - returns the TrackingGeometry used for navigation.
BooleanProperty m_fastField
bool inverseRetrieval() const
const Amg::Vector3D & momentum() const
Access method for the momentum.
virtual ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy
const Amg::Vector3D & position() const
Access method for the position.
Abstract Base Class for tracking surfaces.
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const =0
fast straight line distance evaluation to Surface
virtual bool isOnSurface(const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const
This method returns true if the GlobalPosition is on the Surface for both, within or without check of...
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
The TrackingGeometry class is the owner of the constructed TrackingVolumes.
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
GeometrySignature geometrySignature() const
return the Signature
std::vector< std::shared_ptr< BoundarySurface< TrackingVolume > > > & boundarySurfaces()
Method to return the BoundarySurfaces.
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
const BoundarySurface< TrackingVolume > * boundarySurface(const ObjectAccessor::value_type &oa) const
Get the BoundarySurface to the appointed Accessor state.
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool forceInside=false) const
Provide accessor for BoundarySurfaces.
Eigen::Matrix< double, 3, 1 > Vector3D
PropDirection
PropDirection, enum for direction of the propagation.
BoundarySurfaceFace
Enum to describe the position of the BoundarySurface respectively to the frame orientatin of the volu...
ComparisonFunction< TrackParameters > TrkParametersComparisonFunction
@ FastField
call the fast field access method of the FieldSvc
@ NoField
Field is set to 0., 0., 0.,.
@ FullField
Field is set to be realistic, but within a given Volume.
ParametersBase< TrackParametersDim, Charged > TrackParameters
useful struct for a single navigation cell