 |
ATLAS Offline Software
|
Go to the documentation of this file.
43 declareInterface<INavigator>(
this);
51 m_useConditions=!m_trackingGeometryReadKey.key().empty();
53 if (!m_useConditions) {
54 if (m_trackingGeometrySvc.retrieve().isSuccess()) {
55 ATH_MSG_DEBUG(
"Successfully retrieved " << m_trackingGeometrySvc);
56 m_trackingGeometryName = m_trackingGeometrySvc->trackingGeometryName();
60 << m_trackingGeometryName <<
"' from DetectorStore.");
64 ATH_CHECK(m_trackingGeometryReadKey.initialize(m_useConditions));
66 m_fieldProperties = m_fastField
70 return StatusCode::SUCCESS;
76 return (trackingGeometry(ctx)->lowestTrackingVolume(gp));
82 return (trackingGeometry(ctx)->highestTrackingVolume());
93 return (nextBoundarySurface(ctx,prop, parms,
dir, *trackingVolume));
129 << surface_id <<
" of Volume: '"
139 (!m_useStraightLineApproximation || tryBoundary > 1)
141 ctx, parms, currentSurface, searchDir,
true, m_fieldProperties)
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;
218 (!m_useStraightLineApproximation || tryBoundary > 1)
220 ctx, parms, currentSurface, searchDir,
true, m_fieldProperties)
222 ctx, parms, currentSurface, searchDir,
true, s_zeroMagneticField);
224 trackPar.reset(parms.
clone());
230 return {nextVolume, std::move(trackPar),
249 return {
nullptr,
nullptr};
259 bool isAtBoundary =
false;
265 for (
unsigned int ib = 0;
ib < bounds.size();
ib++) {
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()) {
342 if (m_searchWithDistance) {
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) {
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;
398 if (m_useConditions) {
401 throw std::runtime_error{
402 "Could not retrieve TrackingGeometry from Conditions Store."
405 return handle.
cptr();
409 ->
retrieve(trackingGeometry, m_trackingGeometryName)
411 throw std::runtime_error{
412 "Could not retrieve TrackingGeometry from Detector Store."
415 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.
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const =0
fast straight line distance evaluation to Surface
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.
@ 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)
std::vector< std::shared_ptr< BoundarySurface< TrackingVolume > > > & boundarySurfaces()
Method to return the BoundarySurfaces.
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.
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
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.
#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()