|
ATLAS Offline Software
|
Go to the documentation of this file.
42 m_trackingGeometryName(
"AtlasTrackingGeometry"),
45 m_useStraightLineApproximation(false),
46 m_searchWithDistance(true),
49 declareInterface<INavigator>(
this);
65 m_useConditions=!m_trackingGeometryReadKey.key().empty();
67 if (!m_useConditions) {
68 if (m_trackingGeometrySvc.retrieve().isSuccess()) {
69 ATH_MSG_DEBUG(
"Successfully retrieved " << m_trackingGeometrySvc);
70 m_trackingGeometryName = m_trackingGeometrySvc->trackingGeometryName();
74 << m_trackingGeometryName <<
"' from DetectorStore.");
78 ATH_CHECK(m_trackingGeometryReadKey.initialize(m_useConditions));
80 m_fieldProperties = m_fastField
84 return StatusCode::SUCCESS;
90 return (trackingGeometry(ctx)->lowestTrackingVolume(gp));
96 return (trackingGeometry(ctx)->highestTrackingVolume());
106 if (trackingVolume) {
107 return (nextBoundarySurface(ctx,prop, parms,
dir, *trackingVolume));
143 << surface_id <<
" of Volume: '"
153 (!m_useStraightLineApproximation || tryBoundary > 1)
155 ctx, parms, currentSurface, searchDir,
true, m_fieldProperties)
157 ctx, parms, currentSurface, searchDir,
true, s_zeroMagneticField);
161 " [N] --> next BoundarySurface found with Parameters: " << *trackPar);
162 return currentBoundary;
199 ATH_MSG_VERBOSE(
" [N] Parameters have been flagged as being outside !");
213 if (!currentBoundary) {
215 << surface_id <<
" of Volume: '"
220 << surface_id <<
" of Volume: '"
227 std::unique_ptr<Trk::TrackParameters> trackPar =
nullptr;
232 (!m_useStraightLineApproximation || tryBoundary > 1)
234 ctx, parms, currentSurface, searchDir,
true, m_fieldProperties)
236 ctx, parms, currentSurface, searchDir,
true, s_zeroMagneticField);
238 trackPar.reset(parms.
clone());
244 return {nextVolume, std::move(trackPar),
263 return {
nullptr,
nullptr};
273 bool isAtBoundary =
false;
279 for (
unsigned int ib = 0;
ib < bounds.size();
ib++) {
291 if (!nextVol && attachedVol) {
292 nextVol = attachedVol;
299 <<
" has loose ends. because the navigation of "
301 << (*parms) << std::endl
302 <<
" failed. Please consult the experts or have a "
303 "look at ATLASRECTS-7147");
310 if (not surfingTheBeamPipe) {
311 ATH_MSG_WARNING(
"navigator detects tangential intersection: switch of volumes reverted ");
313 ATH_MSG_VERBOSE(
"navigator detects particle entering and re-entering the beampipe");
315 if (nextVol and (not surfingTheBeamPipe)) {
318 isAtBoundary =
false;
340 std::vector<const Trk::TrackParameters *> measuredParameters;
345 if (!mtp || !mtp->covariance()) {
348 measuredParameters.push_back(*
it);
352 if (measuredParameters.empty()) {
356 if (m_searchWithDistance) {
358 std::vector<const Trk::TrackParameters *>::const_iterator tpIter = measuredParameters.begin();
359 std::vector<const Trk::TrackParameters *>::const_iterator tpIterEnd = measuredParameters.end();
361 double closestDistance = 10e10;
364 for (; tpIter != tpIterEnd; ++tpIter) {
371 double firstDistance = std::abs(currentDistance.
first());
373 1 ? std::abs(currentDistance.
second()) : firstDistance;
375 if (firstDistance < closestDistance || secondDistance < closestDistance) {
376 currentClosestParameters = (*tpIter);
377 closestDistance = firstDistance <= secondDistance ? firstDistance : secondDistance;
383 return currentClosestParameters;
388 closestTrackParameters =
389 *(std::min_element(measuredParameters.begin(), measuredParameters.end(),
390 tParFinderCylinder));
391 return closestTrackParameters;
397 sf.center(),
sf.transform().rotation().col(2));
398 closestTrackParameters = *(std::min_element(
399 measuredParameters.begin(), measuredParameters.end(), tParFinderLine));
400 return closestTrackParameters;
404 closestTrackParameters = *(std::min_element(measuredParameters.begin(), measuredParameters.end(), tParFinderCenter));
406 return closestTrackParameters;
412 if (m_useConditions) {
415 throw std::runtime_error{
416 "Could not retrieve TrackingGeometry from Conditions Store."
419 return handle.
cptr();
423 ->
retrieve(trackingGeometry, m_trackingGeometryName)
425 throw std::runtime_error{
426 "Could not retrieve TrackingGeometry from Detector Store."
429 return trackingGeometry;
def retrieve(aClass, aKey=None)
double currentDistance(bool signedDist=false) const
Current distance to surface (spatial), signed (along/opposite to surface normal) if input argument tr...
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.
Const iterator class for DataVector/DataList.
bool inverseRetrieval() const
const Amg::Vector3D & position() const
Access method for the position.
GeometrySignature geometrySignature() const
return the Signature
int numberOfSolutions() const
Number of intersection solutions.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const =0
fast straight line distance evaluation to Surface
std::vector< SharedObject< BoundarySurface< TrackingVolume > > > & boundarySurfaces()
Method to return the BoundarySurfaces.
virtual const Tvol * attachedVolume(const TrackParameters &parms, PropDirection dir) const =0
Get the next Volume depending on the TrackParameters and the requested direction.
Navigator(const std::string &, const std::string &, const IInterface *)
Constructor.
double first() const
Distance to first intersection solution along direction.
#define ATH_MSG_VERBOSE(x)
virtual StatusCode initialize() override
AlgTool initialize method.
double m_insideVolumeTolerance
Tolerance for inside() method of Volumes.
@ FastField
call the fast field access method of the FieldSvc
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...
virtual const Surface & surfaceRepresentation() const =0
The Surface Representation of this.
virtual const TrackingVolume * highestVolume(const EventContext &ctx) const override final
INavigator interface method - forward hightes TrackingVolume.
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 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.
::StatusCode StatusCode
StatusCode definition for legacy code.
const BoundarySurface< TrackingVolume > * boundarySurface(const ObjectAccessor::value_type &oa) const
Get the BoundarySurface to the appointed Accessor state.
double second() const
Distance to second intersection solution along direction (for a cylinder surface)
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool forceInside=false) const
Provide accessor for BoundarySurfaces.
@ FullField
Field is set to be realistic, but within a given Volume.
double m_isOnSurfaceTolerance
Tolerance for isOnSurface() method of BoundarySurfaces.
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.
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
@ NoField
Field is set to 0., 0., 0.,.
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
Eigen::Matrix< double, 3, 1 > Vector3D
bool m_useStraightLineApproximation
use the straight line approximation for the next boundary sf
useful struct for a single navigation cell
const Amg::Vector3D & momentum() const
Access method for the momentum.
An STL vector of pointers that by default owns its pointed-to elements.
bool m_searchWithDistance
search with new distanceToSurface() method
#define ATH_MSG_WARNING(x)
=============================================================================
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 const TrackingGeometry * trackingGeometry(const EventContext &ctx) const override final
INavigator interface method - returns the TrackingGeometry used for navigation.
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 ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy
const_pointer_type cptr()