ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::Navigator Class Referencefinal

Main AlgTool for Navigation in the TrkExtrapolation realm : It retrieves the TrackingGeometry from the DetectorStore as the reference Geometry. More...

#include <Navigator.h>

Inheritance diagram for Trk::Navigator:
Collaboration diagram for Trk::Navigator:

Public Member Functions

 Navigator (const std::string &, const std::string &, const IInterface *)
 Constructor.
virtual ~Navigator ()=default
 Destructor.
virtual StatusCode initialize () override
 AlgTool initialize method.
virtual const TrackingGeometrytrackingGeometry (const EventContext &ctx) const override final
 INavigator interface method - returns the TrackingGeometry used for navigation.
virtual const TrackingVolumevolume (const EventContext &ctx, const Amg::Vector3D &gp) const override final
 INavigator interface methods - global search for the Volume one is in.
virtual const TrackingVolumehighestVolume (const EventContext &ctx) const override final
 INavigator interface method - forward hightes TrackingVolume.
virtual const TrackParametersclosestParameters (const Track &trk, const Surface &sf) const override final
 INavigator interface method - getting the closest TrackParameters from a Track to a Surface.
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 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 BoundarySurface< TrackingVolume > * nextBoundarySurface (const EventContext &ctx, const IPropagator &prop, const TrackParameters &parms, PropDirection dir, const TrackingVolume &vol) const override final
 INavigator interface methods - getting the next BoundarySurface when 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.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool and IAlgTool interface methods.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadCondHandleKey< TrackingGeometrym_trackingGeometryReadKey
ServiceHandle< Trk::ITrackingGeometrySvcm_trackingGeometrySvc
 ToolHandle to the TrackingGeometrySvc.
std::string m_trackingGeometryName = "AtlasTrackingGeometry"
 Name of the TrackingGeometry as given in Detector Store.
DoubleProperty m_insideVolumeTolerance
DoubleProperty m_isOnSurfaceTolerance
bool m_useConditions {}
Trk::MagneticFieldProperties m_fieldProperties
BooleanProperty m_useStraightLineApproximation
BooleanProperty m_searchWithDistance
 search with new distanceToSurface() method
BooleanProperty m_fastField {this, "MagneticFieldProperties", false}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Main AlgTool for Navigation in the TrkExtrapolation realm : It retrieves the TrackingGeometry from the DetectorStore as the reference Geometry.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 48 of file Navigator.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ Navigator()

Trk::Navigator::Navigator ( const std::string & t,
const std::string & n,
const IInterface * p )

Constructor.

Definition at line 40 of file Navigator.cxx.

40 :
41 AthAlgTool(t, n, p)
42 {
43 declareInterface<INavigator>(this);
44 }
AthAlgTool()
Default constructor:

◆ ~Navigator()

virtual Trk::Navigator::~Navigator ( )
virtualdefault

Destructor.

Member Function Documentation

◆ atVolumeBoundary()

bool Trk::Navigator::atVolumeBoundary ( const Trk::TrackParameters * parms,
const Trk::TrackingVolume * vol,
Trk::PropDirection dir,
const Trk::TrackingVolume *& nextVol,
double tol ) const
finaloverridevirtual

INavigator method to resolve navigation at boundary.

Implements Trk::INavigator.

Definition at line 253 of file Navigator.cxx.

258{
259 bool isAtBoundary = false;
260 nextVol = nullptr;
261 if (!vol) {
262 return isAtBoundary;
263 }
264 const auto& bounds = vol->boundarySurfaces();
265 for (unsigned int ib = 0; ib < bounds.size(); ib++) {
266 const Trk::Surface &surf = bounds[ib]->surfaceRepresentation();
267 if (surf.isOnSurface(parms->position(), true, tol, tol)) {
268
269 // sanity check to enforce the desired tolerance
270 Trk::DistanceSolution distSol = surf.straightLineDistanceEstimate(parms->position(),
271 dir * parms->momentum().unit());
272 if (distSol.currentDistance(false) < tol && distSol.numberOfSolutions() > 0) {
273 isAtBoundary = true;
274 const Trk::TrackingVolume* attachedVol =
275 (bounds[ib])
276 ->attachedVolume(parms->position(), parms->momentum(), dir);
277 if (!nextVol && attachedVol) {
278 nextVol = attachedVol;
279 }
280 // double good solution indicate tangential intersection : revert the attached volumes
281 if (distSol.numberOfSolutions() > 1 && std::abs(distSol.first()) < tol && std::abs(distSol.second()) < tol) {
282 if (!nextVol) {
283 ATH_MSG_WARNING("Tracking volume "
284 << (*vol)
285 << " has loose ends. because the navigation of "
286 << std::endl
287 << (*parms) << std::endl
288 << " failed. Please consult the experts or have a "
289 "look at ATLASRECTS-7147");
290 continue;
291 }
292 //surfing the beampipe seems to happen particularly often in a Trigger test.
293 //see https://its.cern.ch/jira/browse/ATR-24234
294 //in this case, I downgrade the 'warning' to 'verbose'
295 const bool surfingTheBeamPipe = (vol->geometrySignature() == Trk::BeamPipe) or (nextVol->geometrySignature() == Trk::BeamPipe);
296 if (not surfingTheBeamPipe) {
297 ATH_MSG_WARNING("navigator detects tangential intersection: switch of volumes reverted ");
298 } else {
299 ATH_MSG_VERBOSE("navigator detects particle entering and re-entering the beampipe");
300 }
301 if (nextVol and (not surfingTheBeamPipe)) {
302 ATH_MSG_WARNING(vol->volumeName() << "->" << nextVol->volumeName() << "->" << vol->volumeName());
303 }
304 isAtBoundary = false;
305 // revert attached volume
306 nextVol = vol;
307 }
308 }
309 }
310 }
311
312 return isAtBoundary;
313}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
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.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
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...
Definition Surface.cxx:123
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.

◆ closestParameters()

const Trk::TrackParameters * Trk::Navigator::closestParameters ( const Track & trk,
const Surface & sf ) const
finaloverridevirtual

INavigator interface method - getting the closest TrackParameters from a Track to a Surface.

Implements Trk::INavigator.

Definition at line 316 of file Navigator.cxx.

318{
319
320 // search with dedicated algorithms for cylinder/sl/perigee
321 // surface
322 const Trk::TrackParameters *closestTrackParameters = nullptr;
323
324 // policy change --- only measured parameters are taken
325 DataVector<const TrackParameters>::const_iterator it = trk.trackParameters()->begin();
326 std::vector<const Trk::TrackParameters *> measuredParameters;
327 measuredParameters.reserve(trk.trackParameters()->size());
328 for (; it != trk.trackParameters()->end(); ++it) {
329 // dynamic cast the Measured ones
330 const Trk::TrackParameters *mtp = *it;
331 if (!mtp || !mtp->covariance()) {
332 continue;
333 }
334 measuredParameters.push_back(*it);
335 }
336
337 // new policy --- take only measured parameters
338 if (measuredParameters.empty()) {
339 return nullptr;
340 }
341
343 // loop over the track parameters and get the distance
344 std::vector<const Trk::TrackParameters *>::const_iterator tpIter = measuredParameters.begin();
345 std::vector<const Trk::TrackParameters *>::const_iterator tpIterEnd = measuredParameters.end();
346 // set a maximum distance
347 double closestDistance = 10e10;
348 const Trk::TrackParameters *currentClosestParameters = nullptr;
349
350 for (; tpIter != tpIterEnd; ++tpIter) {
351 // forward-backward solution
352 Amg::Vector3D tpDirection = (*tpIter)->momentum().normalized();
353
354 Trk::DistanceSolution currentDistance = sf.straightLineDistanceEstimate((*tpIter)->position(), tpDirection);
355 if (currentDistance.numberOfSolutions() > 0) {
356 // get the one/two solution(s)
357 double firstDistance = std::abs(currentDistance.first());
358 double secondDistance = currentDistance.numberOfSolutions() >
359 1 ? std::abs(currentDistance.second()) : firstDistance;
360 // now do the check
361 if (firstDistance < closestDistance || secondDistance < closestDistance) {
362 currentClosestParameters = (*tpIter);
363 closestDistance = firstDistance <= secondDistance ? firstDistance : secondDistance;
364 }
365 }
366 }
367
368 // return what has shown to be closest
369 return currentClosestParameters;
370 }
371
372 if (sf.type() == Trk::SurfaceType::Cylinder) {
373 Trk::TrkParametersComparisonFunction tParFinderCylinder(sf.bounds().r());
374 closestTrackParameters =
375 *(std::min_element(measuredParameters.begin(), measuredParameters.end(),
376 tParFinderCylinder));
377 return closestTrackParameters;
378 }
379
380 if (sf.type() == Trk::SurfaceType::Line ||
381 sf.type() == Trk::SurfaceType::Perigee) {
383 sf.center(), sf.transform().rotation().col(2));
384 closestTrackParameters = *(std::min_element(
385 measuredParameters.begin(), measuredParameters.end(), tParFinderLine));
386 return closestTrackParameters;
387 }
388
389 Trk::TrkParametersComparisonFunction tParFinderCenter(sf.center());
390 closestTrackParameters = *(std::min_element(measuredParameters.begin(), measuredParameters.end(), tParFinderCenter));
391
392 return closestTrackParameters;
393}
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
BooleanProperty m_searchWithDistance
search with new distanceToSurface() method
Definition Navigator.h:128
Eigen::Matrix< double, 3, 1 > Vector3D
ComparisonFunction< TrackParameters > TrkParametersComparisonFunction
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ highestVolume()

const Trk::TrackingVolume * Trk::Navigator::highestVolume ( const EventContext & ctx) const
finaloverridevirtual

INavigator interface method - forward hightes TrackingVolume.

Implements Trk::INavigator.

Definition at line 80 of file Navigator.cxx.

81{
82 return (trackingGeometry(ctx)->highestTrackingVolume());
83}
virtual const TrackingGeometry * trackingGeometry(const EventContext &ctx) const override final
INavigator interface method - returns the TrackingGeometry used for navigation.

◆ initialize()

StatusCode Trk::Navigator::initialize ( )
overridevirtual

AlgTool initialize method.

Definition at line 49 of file Navigator.cxx.

49 {
50 //We can use conditions when the key is not empty
52 // get the TrackingGeometry
53 if (!m_useConditions) {
54 if (m_trackingGeometrySvc.retrieve().isSuccess()) {
55 ATH_MSG_DEBUG("Successfully retrieved " << m_trackingGeometrySvc);
56 m_trackingGeometryName = m_trackingGeometrySvc->trackingGeometryName();
57 } else {
58 ATH_MSG_WARNING("Couldn't retrieve " << m_trackingGeometrySvc << ". ");
59 ATH_MSG_WARNING(" -> Trying to retrieve default '"
60 << m_trackingGeometryName << "' from DetectorStore.");
61 }
62 }
63
65
67 ? Trk::MagneticFieldProperties(Trk::FastField)
68 : Trk::MagneticFieldProperties(Trk::FullField);
69
70 return StatusCode::SUCCESS;
71}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
std::string m_trackingGeometryName
Name of the TrackingGeometry as given in Detector Store.
Definition Navigator.h:113
Trk::MagneticFieldProperties m_fieldProperties
Definition Navigator.h:123
ServiceHandle< Trk::ITrackingGeometrySvc > m_trackingGeometrySvc
ToolHandle to the TrackingGeometrySvc.
Definition Navigator.h:110
bool m_useConditions
Definition Navigator.h:122
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
Definition Navigator.h:105
BooleanProperty m_fastField
Definition Navigator.h:131
@ FastField
call the fast field access method of the FieldSvc
@ FullField
Field is set to be realistic, but within a given Volume.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & Trk::INavigator::interfaceID ( )
inlinestaticinherited

AlgTool and IAlgTool interface methods.

Definition at line 74 of file INavigator.h.

74{ return IID_INavigator; }
static const InterfaceID IID_INavigator("INavigator", 1, 0)
Interface ID for INavigator.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ nextBoundarySurface() [1/2]

const Trk::BoundarySurface< Trk::TrackingVolume > * Trk::Navigator::nextBoundarySurface ( const EventContext & ctx,
const IPropagator & prop,
const TrackParameters & parms,
Trk::PropDirection dir ) const
finaloverridevirtual

INavigator interface methods - getting the next BoundarySurface not knowing the Volume.

Implements Trk::INavigator.

Definition at line 86 of file Navigator.cxx.

90{
91 const Trk::TrackingVolume* trackingVolume = volume(ctx,parms.position());
92 if (trackingVolume) {
93 return (nextBoundarySurface(ctx,prop, parms, dir, *trackingVolume));
94 }
95 return nullptr;
96}
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.
Definition Navigator.cxx:86
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.
Definition Navigator.cxx:74

◆ nextBoundarySurface() [2/2]

const Trk::BoundarySurface< Trk::TrackingVolume > * Trk::Navigator::nextBoundarySurface ( const EventContext & ctx,
const IPropagator & prop,
const TrackParameters & parms,
Trk::PropDirection dir,
const TrackingVolume & vol ) const
finaloverridevirtual

INavigator interface methods - getting the next BoundarySurface when knowing the Volume.

Implements Trk::INavigator.

Definition at line 99 of file Navigator.cxx.

104{
105 // get the surface accessor
106 Trk::ObjectAccessor surfAcc = vol.boundarySurfaceAccessor(
107 parms.position(), dir * parms.momentum().normalized());
108 // initialize the currentBoundary surface
109 const Trk::BoundarySurface<Trk::TrackingVolume>* currentBoundary = nullptr;
110 bool outsideVolume = surfAcc.inverseRetrieval();
111 // attempt counter
112 int tryBoundary = 0;
113
114 // set the prop direction according to inverseRetrieval result
115 Trk::PropDirection searchDir = dir;
116 if (outsideVolume) {
117 searchDir =
119 }
120
121 // debug version
122 ATH_MSG_VERBOSE("g [N] Starting parameters are :" << parms);
123
124 // loop over the the boundary surfaces according to the accessor type
125 for (const Trk::ObjectAccessor::value_type& surface_id : surfAcc) {
126 ++tryBoundary;
127 // ----------------- output to screen if outputLevel() says so --------
128 ATH_MSG_VERBOSE(" [N] " << tryBoundary << ". try - BoundarySurface "
129 << surface_id << " of Volume: '"
130 << vol.volumeName() << "'.");
131 // get the boundary Surface according to the surfaceAccessor
132 currentBoundary = vol.boundarySurface(surface_id);
133 const Trk::Surface& currentSurface =
134 currentBoundary->surfaceRepresentation();
135
136 // do either RungeKutta (always after first unsuccessful try) or straight
137 // line
138 auto trackPar =
139 (!m_useStraightLineApproximation || tryBoundary > 1)
140 ? prop.propagateParameters(
141 ctx, parms, currentSurface, searchDir, true, m_fieldProperties)
142 : prop.propagateParameters(
143 ctx, parms, currentSurface, searchDir, true, s_zeroMagneticField);
144
145 if (trackPar) {
147 " [N] --> next BoundarySurface found with Parameters: " << *trackPar);
148 return currentBoundary;
149 }
150 }
151 return nullptr;
152}
virtual const Surface & surfaceRepresentation() const =0
The Surface Representation of this.
BooleanProperty m_useStraightLineApproximation
Definition Navigator.h:124
bool inverseRetrieval() const
PropDirection
PropDirection, enum for direction of the propagation.
@ oppositeMomentum
@ alongMomentum

◆ nextTrackingVolume()

Trk::NavigationCell Trk::Navigator::nextTrackingVolume ( const EventContext & ctx,
const IPropagator & prop,
const TrackParameters & parms,
Trk::PropDirection dir,
const TrackingVolume & vol ) const
finaloverridevirtual

INavigator interface method - getting the next Volume and the parameter for the next Navigation.

Implements Trk::INavigator.

Definition at line 155 of file Navigator.cxx.

160{
161
162 bool first = false;
163 bool second = false;
164
165 // ---------------------------------------------------
166 // get the object accessor from the Volume
167 Trk::ObjectAccessor surfAcc = vol.boundarySurfaceAccessor(
168 parms.position(), dir * parms.momentum().normalized());
169 // the object accessor already solved the outside question
170 bool outsideVolume = surfAcc.inverseRetrieval();
171 // initialize the boundary pointer / tracking volume pointer
172 const Trk::BoundarySurface<Trk::TrackingVolume>* currentBoundary = nullptr;
173 const Trk::TrackingVolume* nextVolume = nullptr;
174
175 // debug version
176 ATH_MSG_VERBOSE(" [N] Starting parameters are : " << parms);
177 ATH_MSG_VERBOSE(" [N] This corresponds to [r,z] = [ "
178 << parms.position().perp() << ", " << parms.position().z()
179 << "]");
180 ATH_MSG_VERBOSE(" [N] Boundary Surface accessor : " << surfAcc);
181
182 // set the prop direction according to inverseRetrieval result
183 Trk::PropDirection searchDir = dir;
184 if (outsideVolume) {
185 ATH_MSG_VERBOSE(" [N] Parameters have been flagged as being outside !");
186 searchDir =
188 }
189
190 // loop over boundary surfaces
191 int tryBoundary = 0;
192
193 for (const Trk::ObjectAccessor::value_type& surface_id : surfAcc) {
194 ++tryBoundary;
195 // get the boundary surface associated to the surfaceAccessor
196 currentBoundary = vol.boundarySurface(surface_id);
197
198 // ----------------- output to screen if outputLevel() says so --------
199 if (!currentBoundary) {
200 ATH_MSG_WARNING(" [N] " << tryBoundary << ". try - BoundarySurface "
201 << surface_id << " of Volume: '"
202 << vol.volumeName() << "' NOT FOUND.");
203 continue;
204 }
205 ATH_MSG_VERBOSE(" [N] " << tryBoundary << ". try - BoundarySurface "
206 << surface_id << " of Volume: '"
207 << vol.volumeName() << "'.");
208
209
210 const Trk::Surface& currentSurface =
211 currentBoundary->surfaceRepresentation();
212 // try the propagation
213 std::unique_ptr<Trk::TrackParameters> trackPar = nullptr;
214 // do either RungeKutta (always after first unsuccessful try) or straight
215 // line
216 if (!currentSurface.isOnSurface(parms.position(), true, 0., 0.)) {
217 trackPar =
218 (!m_useStraightLineApproximation || tryBoundary > 1)
219 ? prop.propagateParameters(
220 ctx, parms, currentSurface, searchDir, true, m_fieldProperties)
221 : prop.propagateParameters(
222 ctx, parms, currentSurface, searchDir, true, s_zeroMagneticField);
223 } else {
224 trackPar.reset(parms.clone()); //to be revisited
225 }
226 if (trackPar) {
227 // the next volume pointer
228 nextVolume = currentBoundary->attachedVolume(
229 trackPar->position(), trackPar->momentum().normalized(), dir);
230 return {nextVolume, std::move(trackPar),
231 Trk::BoundarySurfaceFace(surface_id)};
232 }
233
234 // ---------------------------------------------------
235 if (!first && searchDir == Trk::alongMomentum) {
236 first = true;
237 } else if (!second && searchDir == Trk::alongMomentum) {
238 second = true;
239 } else if (searchDir == Trk::alongMomentum) {
240 } else if (!first && searchDir == Trk::oppositeMomentum) {
241 first = true;
242 } else if (!second && searchDir == Trk::oppositeMomentum) {
243 second = true;
244 } else if (searchDir == Trk::oppositeMomentum) {
245 }
246 // ---------------------------------------------------
247 }
248 // return what you have : no idea
249 return {nullptr, nullptr};
250}
virtual const Tvol * attachedVolume(const TrackParameters &parms, PropDirection dir) const =0
Get the next Volume depending on the TrackParameters and the requested direction.
bool first
Definition DeMoScan.py:534
BoundarySurfaceFace
Enum to describe the position of the BoundarySurface respectively to the frame orientatin of the volu...

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ trackingGeometry()

const Trk::TrackingGeometry * Trk::Navigator::trackingGeometry ( const EventContext & ctx) const
finaloverridevirtual

INavigator interface method - returns the TrackingGeometry used for navigation.

Implements Trk::INavigator.

Definition at line 396 of file Navigator.cxx.

397{
398 if (m_useConditions) {
399 SG::ReadCondHandle<TrackingGeometry> handle(m_trackingGeometryReadKey, ctx);
400 if (!handle.isValid()) {
401 throw std::runtime_error{
402 "Could not retrieve TrackingGeometry from Conditions Store."
403 };
404 }
405 return handle.cptr();
406 } else {
407 const TrackingGeometry* trackingGeometry = nullptr;
408 if (detStore()
410 .isFailure()) {
411 throw std::runtime_error{
412 "Could not retrieve TrackingGeometry from Detector Store."
413 };
414 }
415 return trackingGeometry;
416 }
417}
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ volume()

const Trk::TrackingVolume * Trk::Navigator::volume ( const EventContext & ctx,
const Amg::Vector3D & gp ) const
finaloverridevirtual

INavigator interface methods - global search for the Volume one is in.

Implements Trk::INavigator.

Definition at line 74 of file Navigator.cxx.

75{
76 return (trackingGeometry(ctx)->lowestTrackingVolume(gp));
77}

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fastField

BooleanProperty Trk::Navigator::m_fastField {this, "MagneticFieldProperties", false}
private

Definition at line 131 of file Navigator.h.

131{this, "MagneticFieldProperties", false};

◆ m_fieldProperties

Trk::MagneticFieldProperties Trk::Navigator::m_fieldProperties
private

Definition at line 123 of file Navigator.h.

◆ m_insideVolumeTolerance

DoubleProperty Trk::Navigator::m_insideVolumeTolerance
private
Initial value:
{
this, "InsideVolumeTolerance", 1. * Gaudi::Units::mm,
"Tolerance for inside() method of Volumes"}

Definition at line 116 of file Navigator.h.

116 {
117 this, "InsideVolumeTolerance", 1. * Gaudi::Units::mm,
118 "Tolerance for inside() method of Volumes"};

◆ m_isOnSurfaceTolerance

DoubleProperty Trk::Navigator::m_isOnSurfaceTolerance
private
Initial value:
{
this, "IsOnSurfaceTolerance", 0.005 * Gaudi::Units::mm,
"Tolerance for isOnSurface() method of BoundarySurfaces"}

Definition at line 119 of file Navigator.h.

119 {
120 this, "IsOnSurfaceTolerance", 0.005 * Gaudi::Units::mm,
121 "Tolerance for isOnSurface() method of BoundarySurfaces"};

◆ m_searchWithDistance

BooleanProperty Trk::Navigator::m_searchWithDistance
private
Initial value:
{
this, "SearchWithDistanceToSurface", true,
"search with new distanceToSurface() method"}

search with new distanceToSurface() method

Definition at line 128 of file Navigator.h.

128 {
129 this, "SearchWithDistanceToSurface", true,
130 "search with new distanceToSurface() method"};

◆ m_trackingGeometryName

std::string Trk::Navigator::m_trackingGeometryName = "AtlasTrackingGeometry"
private

Name of the TrackingGeometry as given in Detector Store.

Definition at line 113 of file Navigator.h.

◆ m_trackingGeometryReadKey

SG::ReadCondHandleKey<TrackingGeometry> Trk::Navigator::m_trackingGeometryReadKey
private
Initial value:
{
this, "TrackingGeometryKey", "AtlasTrackingGeometry",
"Key of output of TrackingGeometry for ID"}

Definition at line 105 of file Navigator.h.

105 {
106 this, "TrackingGeometryKey", "AtlasTrackingGeometry",
107 "Key of output of TrackingGeometry for ID"};

◆ m_trackingGeometrySvc

ServiceHandle<Trk::ITrackingGeometrySvc> Trk::Navigator::m_trackingGeometrySvc
private
Initial value:
{
this, "TrackingGeometrySvc", ""}

ToolHandle to the TrackingGeometrySvc.

Definition at line 110 of file Navigator.h.

110 {
111 this, "TrackingGeometrySvc", ""};

◆ m_useConditions

bool Trk::Navigator::m_useConditions {}
private

Definition at line 122 of file Navigator.h.

122{};

◆ m_useStraightLineApproximation

BooleanProperty Trk::Navigator::m_useStraightLineApproximation
private
Initial value:
{
this, "UseStraightLineApproximation", false,
"use the straight line approximation for the next boundary sf"}

Definition at line 124 of file Navigator.h.

124 {
125 this, "UseStraightLineApproximation", false,
126 "use the straight line approximation for the next boundary sf"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: