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

#include <GsfExtrapolator.h>

Inheritance diagram for Trk::GsfExtrapolator:
Collaboration diagram for Trk::GsfExtrapolator:

Public Member Functions

 GsfExtrapolator (const std::string &, const std::string &, const IInterface *)
 Constructor with AlgTool parameters.
virtual ~GsfExtrapolator () override final
virtual StatusCode initialize () override final
virtual MultiComponentState extrapolate (const EventContext &ctx, Cache &, const MultiComponentState &, const Surface &, PropDirection direction, const BoundaryCheck &boundaryCheck) const override final
 Extrapolation method applying material affects.
virtual MultiComponentState extrapolateDirectly (const EventContext &ctx, const MultiComponentState &, const Surface &, PropDirection direction, const BoundaryCheck &boundaryCheck) const override final
 Extrapolation method without material effects.
virtual Trk::ParticleHypothesis particleHypothesis () const override final
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 interface method.

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

MultiComponentState extrapolateImpl (const EventContext &ctx, Cache &cache, const MultiComponentState &, const Surface &, PropDirection direction, const BoundaryCheck &boundaryCheck) const
 Implementation of main extrapolation method.
MultiComponentState extrapolateDirectlyImpl (const EventContext &ctx, const MultiComponentState &, const Surface &, PropDirection direction, const BoundaryCheck &boundaryCheck) const
 Implementation of extrapolation without material effects.
void extrapolateToVolumeBoundary (const EventContext &ctx, Cache &cache, const MultiComponentState &, const Layer *, const TrackingVolume &, PropDirection direction) const
 Two primary private extrapolation methods.
MultiComponentState extrapolateInsideVolume (const EventContext &ctx, Cache &cache, const MultiComponentState &, const Surface &, const Layer *, const TrackingVolume &, PropDirection direction, const BoundaryCheck &boundaryCheck) const
MultiComponentState extrapolateFromLayerToLayer (const EventContext &ctx, Cache &cache, const MultiComponentState &, const TrackingVolume &, const Layer *startLayer, const Layer *destinationLayer, PropDirection direction) const
 Layer stepping, stopping at the last layer before destination.
MultiComponentState extrapolateToIntermediateLayer (const EventContext &ctx, Cache &cache, const MultiComponentState &, const Layer &, const TrackingVolume &, PropDirection direction) const
 Single extrapolation step to an intermediate layer.
MultiComponentState extrapolateToDestinationLayer (const EventContext &ctx, Cache &cache, const MultiComponentState &, const Surface &, const Layer &, const Layer *, PropDirection direction, const BoundaryCheck &boundaryCheck) const
 Final extrapolation step to a destination layer.
std::unique_ptr< Trk::TrackParametersinitialiseNavigation (const EventContext &ctx, Cache &cache, const MultiComponentState &initialState, const Surface &surface, const Layer *&associatedLayer, const TrackingVolume *&currentVolume, const TrackingVolume *&destinationVolume, PropDirection &direction) const
 Method to initialise navigation parameters including starting state, layer and volume, and destination volume.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< IPropagatorm_propagator {this, "Propagator", "", ""}
ToolHandle< INavigatorm_navigator
ToolHandle< IMaterialMixtureConvolutionm_materialUpdator
BooleanProperty m_fastField {this, "UseFastField", false}
Trk::MagneticFieldProperties m_fieldProperties = Trk::FullField
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

Definition at line 50 of file GsfExtrapolator.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

◆ GsfExtrapolator()

Trk::GsfExtrapolator::GsfExtrapolator ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructor with AlgTool parameters.

Definition at line 141 of file GsfExtrapolator.cxx.

144 : AthAlgTool(type, name, parent)
145{
146 declareInterface<IMultiStateExtrapolator>(this);
147}
AthAlgTool()
Default constructor:

◆ ~GsfExtrapolator()

Trk::GsfExtrapolator::~GsfExtrapolator ( )
finaloverridevirtualdefault

Member Function Documentation

◆ 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

◆ extrapolate()

Trk::MultiComponentState Trk::GsfExtrapolator::extrapolate ( const EventContext & ctx,
Cache & cache,
const MultiComponentState & multiComponentState,
const Surface & surface,
Trk::PropDirection direction,
const BoundaryCheck & boundaryCheck ) const
finaloverridevirtual

Extrapolation method applying material affects.

Implements Trk::IMultiStateExtrapolator.

Definition at line 174 of file GsfExtrapolator.cxx.

181{
182 if (multiComponentState.empty()) {
183 return {};
184 }
185 return extrapolateImpl(ctx,
186 cache,
187 multiComponentState,
188 surface,
189 direction,
190 boundaryCheck);
191}
MultiComponentState extrapolateImpl(const EventContext &ctx, Cache &cache, const MultiComponentState &, const Surface &, PropDirection direction, const BoundaryCheck &boundaryCheck) const
Implementation of main extrapolation method.
const Amg::Vector3D & direction() const
Method to retrieve the direction at the Intersection.
const IIntersectionCache * cache() const
Retrieve the associated cache block, if it exists.

◆ extrapolateDirectly()

Trk::MultiComponentState Trk::GsfExtrapolator::extrapolateDirectly ( const EventContext & ctx,
const MultiComponentState & multiComponentState,
const Surface & surface,
Trk::PropDirection direction,
const BoundaryCheck & boundaryCheck ) const
finaloverridevirtual

Extrapolation method without material effects.

The particle hypothesis used.

Implements Trk::IMultiStateExtrapolator.

Definition at line 197 of file GsfExtrapolator.cxx.

203{
204 if (multiComponentState.empty()) {
205 return {};
206 }
207
208 const Trk::TrackingVolume* currentVolume = m_navigator->highestVolume(ctx);
209 if (!currentVolume) {
211 "Current tracking volume could not be determined... returning {}");
212 return {};
213 }
214 return extrapolateDirectlyImpl(ctx,
215 multiComponentState,
216 surface,
217 direction,
218 boundaryCheck);
219}
#define ATH_MSG_WARNING(x,...)
MultiComponentState extrapolateDirectlyImpl(const EventContext &ctx, const MultiComponentState &, const Surface &, PropDirection direction, const BoundaryCheck &boundaryCheck) const
Implementation of extrapolation without material effects.
ToolHandle< INavigator > m_navigator

◆ extrapolateDirectlyImpl()

Trk::MultiComponentState Trk::GsfExtrapolator::extrapolateDirectlyImpl ( const EventContext & ctx,
const MultiComponentState & multiComponentState,
const Surface & surface,
Trk::PropDirection direction,
const BoundaryCheck & boundaryCheck ) const
private

Implementation of extrapolation without material effects.

Definition at line 419 of file GsfExtrapolator.cxx.

425{
426 return m_propagator->multiStatePropagate(ctx,
427 multiComponentState,
428 surface,
430 direction,
431 boundaryCheck,
433}
ToolHandle< IPropagator > m_propagator
Trk::MagneticFieldProperties m_fieldProperties

◆ extrapolateFromLayerToLayer()

Trk::MultiComponentState Trk::GsfExtrapolator::extrapolateFromLayerToLayer ( const EventContext & ctx,
Cache & cache,
const MultiComponentState & multiComponentState,
const TrackingVolume & trackingVolume,
const Layer * startLayer,
const Layer * destinationLayer,
PropDirection direction ) const
private

Layer stepping, stopping at the last layer before destination.

Definition at line 686 of file GsfExtrapolator.cxx.

694{
695
696 const Trk::Layer* currentLayer = startLayer;
697 Trk::MultiComponentState currentState{};
698
699 const Trk::TrackParameters* combinedState =
700 multiComponentState.begin()->params.get();
701 Amg::Vector3D currentPosition = combinedState->position();
702 Amg::Vector3D currentDirection = direction * combinedState->momentum().unit();
703
704 // No need to extrapolate to start layer, find the next one
705 const Trk::Layer* nextLayer =
706 currentLayer->nextLayer(currentPosition, currentDirection);
707
708 using LayerSet = std::flat_set<
709 const Trk::Layer*,
710 std::less<const Trk::Layer*>,
711 boost::container::small_vector<const Trk::Layer*, 8>>;
712 LayerSet layersHit;
713
714 layersHit.insert(currentLayer);
715
716 // Begin while loop over all intermediate layers
717 while (nextLayer && nextLayer != destinationLayer) {
718 layersHit.insert(nextLayer);
719 // Only extrapolate to an intermediate layer if it requires material
720 // update. Otherwise step over it
721 if (nextLayer->layerMaterialProperties()) {
722 currentState = extrapolateToIntermediateLayer(
723 ctx,
724 cache,
725 !currentState.empty() ? currentState : multiComponentState,
726 *nextLayer,
727 trackingVolume,
728 direction);
729 }
730
731 if (!currentState.empty()) {
732 combinedState = currentState.begin()->params.get();
733 currentPosition = combinedState->position();
734 currentDirection = direction * combinedState->momentum().unit();
735 }
736
737 // Find the next layer
738 currentLayer = nextLayer;
739 nextLayer = currentLayer->nextLayer(currentPosition, currentDirection);
740 if (layersHit.find(nextLayer) != layersHit.end()) {
741 break;
742 }
743 }
744
745 if (destinationLayer && nextLayer != destinationLayer &&
746 !currentState.empty()) {
747 currentState.clear();
748 }
749
750 return currentState;
751}
static int layersHit(FPGATrackSimRoad &r)
MultiComponentState extrapolateToIntermediateLayer(const EventContext &ctx, Cache &cache, const MultiComponentState &, const Layer &, const TrackingVolume &, PropDirection direction) const
Single extrapolation step to an intermediate layer.
const Layer * nextLayer(const Amg::Vector3D &gp, const Amg::Vector3D &udir) const
getting the next/previous Layer if registered - unit for direction vector required
Definition Layer.cxx:161
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
Eigen::Matrix< double, 3, 1 > Vector3D
std::vector< ComponentParameters > MultiComponentState
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ extrapolateImpl()

Trk::MultiComponentState Trk::GsfExtrapolator::extrapolateImpl ( const EventContext & ctx,
Cache & cache,
const MultiComponentState & multiComponentState,
const Surface & surface,
Trk::PropDirection direction,
const BoundaryCheck & boundaryCheck ) const
private

Implementation of main extrapolation method.

Definition at line 232 of file GsfExtrapolator.cxx.

239{
240
241 // Empty the garbage bin
242 emptyRecycleBins(cache);
243 const Trk::Layer* associatedLayer = nullptr;
244 const Trk::TrackingVolume* startVolume = nullptr;
245 const Trk::TrackingVolume* destinationVolume = nullptr;
246 std::unique_ptr<Trk::TrackParameters> referenceParameters =
247 initialiseNavigation(ctx, cache, multiComponentState, surface,
248 associatedLayer, startVolume, destinationVolume,
249 direction);
250
251 // Bail to direct extrapolation if the direction cannot be determined
253 return extrapolateDirectlyImpl(ctx,
254 multiComponentState,
255 surface,
256 direction,
257 boundaryCheck);
258 }
259
260 const Trk::TrackParameters* combinedState =
261 multiComponentState.begin()->params.get();
262
263 const Trk::MultiComponentState* currentState = &multiComponentState;
264
265 /* Define the initial distance between destination and current position.
266 Destination should be determined from either
267 - reference parameters (prefered if they exist) or
268 - destination surface
269 */
270 const Amg::Vector3D globalSeparation =
271 referenceParameters
272 ? referenceParameters->position() - combinedState->position()
273 : surface.globalReferencePoint() - combinedState->position();
274 const double initialDistance = globalSeparation.mag();
275 // Clean up memory from combiner. It is no longer needed
276 combinedState = nullptr;
277
278 /* There are two parts to the extrapolation:
279 - Extrapolate from start point to volume boundary
280 - Extrapolate from volume boundary to destination surface
281 */
282 /*
283 * Extrapolation to destination volume boundary
284 */
285 bool foundFinalBoundary(true);
286 int fallbackOscillationCounter(0);
287 const Trk::TrackingVolume* currentVolume = startVolume;
288 const Trk::TrackingVolume* previousVolume = nullptr;
289
290 while (currentVolume && currentVolume != destinationVolume) {
291 // Extrapolate to volume boundary
293 cache,
294 *currentState,
295 associatedLayer,
296 *currentVolume,
297 direction);
298
299 // New current state is the state extrapolated to the tracking volume
300 // boundary.
301 currentState = cache.m_stateAtBoundary;
302 // The volume that the extrapolation is about to enter into is called the
303 // nextVolume
304 const Trk::TrackingVolume* nextVolume = cache.m_trackingVolume;
305 // Break the loop if the next tracking volume is the same as the current one
306 if (!nextVolume || nextVolume == currentVolume) {
307 foundFinalBoundary = false;
308 break;
309 }
310 // Break the loop if an oscillation is detected
311 if (previousVolume == nextVolume) {
312 ++fallbackOscillationCounter;
313 }
314 if (fallbackOscillationCounter > 10) {
315 foundFinalBoundary = false;
316 break;
317 }
318 // Break the loop if the distance between the surface and the track
319 // parameters has increased
320 combinedState = currentState->begin()->params.get();
321
322 auto parametersAtDestination =
323 m_propagator->propagateParameters(ctx,
324 *combinedState,
325 surface,
326 direction,
327 false,
330 Amg::Vector3D newDestination;
331 if (parametersAtDestination) {
332 newDestination = parametersAtDestination->position();
333 // delete parametersAtDestination;
334 } else {
335 newDestination = surface.center();
336 }
337
338 const double revisedDistance =
339 (cache.m_navigationParameters->position() - newDestination).mag();
340
341 const double distanceChange = std::abs(revisedDistance - initialDistance);
342
343 if (revisedDistance > initialDistance && distanceChange > 0.01) {
344 foundFinalBoundary = false;
345 break;
346 }
347
348 // Initialise the oscillation checker
349 previousVolume = currentVolume;
350 // As the extrapolation is moving into the next volume, the next volume ->
351 // current volume
352 currentVolume = nextVolume;
353 // Associated layer now needs to be reset
354 // if(!entryLayerFound)
355 associatedLayer = nullptr;
356 } // end while loop
357
358 // catch failures now
359 if (!currentState || (currentVolume != destinationVolume)) {
360 currentState = &multiComponentState;
361 foundFinalBoundary = false;
362 }
363
364 if (!foundFinalBoundary) {
365 Trk::MultiComponentState bailOutState =
366 m_propagator->multiStatePropagate(ctx,
367 *currentState,
368 surface,
371 boundaryCheck,
373
374 emptyRecycleBins(cache);
375 return bailOutState;
376 }
377
378 /*
379 * Extrapolation from volume boundary to surface
380 */
381
382 // extrapolate inside destination volume
383 Trk::MultiComponentState destinationState =
385 cache,
386 *currentState,
387 surface,
388 associatedLayer,
389 *currentVolume,
390 direction,
391 boundaryCheck);
392
393 // FALLBACK POINT: Crisis if extrapolation fails here... As per extrapolation
394 // to volume boundary, in emergency revert to extrapolateDirectly
395
396 // or we failed to reach the target
397 if (!destinationState.empty() &&
398 &((*(destinationState.begin())).params->associatedSurface()) != &surface) {
399 destinationState.clear();
400 }
401
402 if (destinationState.empty()) {
403 destinationState = m_propagator->multiStatePropagate(ctx,
404 *currentState,
405 surface,
408 boundaryCheck,
410 }
411 emptyRecycleBins(cache);
412 return destinationState;
413}
std::unique_ptr< Trk::TrackParameters > initialiseNavigation(const EventContext &ctx, Cache &cache, const MultiComponentState &initialState, const Surface &surface, const Layer *&associatedLayer, const TrackingVolume *&currentVolume, const TrackingVolume *&destinationVolume, PropDirection &direction) const
Method to initialise navigation parameters including starting state, layer and volume,...
void extrapolateToVolumeBoundary(const EventContext &ctx, Cache &cache, const MultiComponentState &, const Layer *, const TrackingVolume &, PropDirection direction) const
Two primary private extrapolation methods.
MultiComponentState extrapolateInsideVolume(const EventContext &ctx, Cache &cache, const MultiComponentState &, const Surface &, const Layer *, const TrackingVolume &, PropDirection direction, const BoundaryCheck &boundaryCheck) const
@ anyDirection

◆ extrapolateInsideVolume()

Trk::MultiComponentState Trk::GsfExtrapolator::extrapolateInsideVolume ( const EventContext & ctx,
Cache & cache,
const MultiComponentState & multiComponentState,
const Surface & surface,
const Layer * layer,
const TrackingVolume & trackingVolume,
Trk::PropDirection direction,
const BoundaryCheck & boundaryCheck ) const
private

Definition at line 568 of file GsfExtrapolator.cxx.

577{
578 //curent state is a plainn ptr to keep track
579 const Trk::MultiComponentState* currentState = &multiComponentState;
580
581 // Retrieve the destination layer
582 // 1. Association
583 const Trk::Layer* destinationLayer = surface.associatedLayer();
584
585 // 2. Recall and Global Search
586 if (!destinationLayer) {
587 destinationLayer =
588 (&surface == cache.m_recallSurface)
589 ? cache.m_recallLayer
590 : trackingVolume.associatedLayer(surface.globalReferencePoint());
591 }
592
593 // Retrieve the current layer
594 // Produce a combined state
595 const Trk::TrackParameters* combinedState =
596 currentState->begin()->params.get();
597
598 const Trk::Layer* associatedLayer = layer;
599
600 Trk::MultiComponentState updatedState{};
601 if (!associatedLayer) {
602 // Get entry layer but do not use it as it should have already be hit if it
603 // was desired
604 associatedLayer = trackingVolume.associatedLayer(combinedState->position());
605 associatedLayer =
606 associatedLayer
607 ? associatedLayer
608 : trackingVolume.nextLayer(combinedState->position(),
609 direction * combinedState->momentum().unit(),
610 associatedLayer);
611 }
612
613 else if (associatedLayer != destinationLayer &&
614 trackingVolume.confinedLayers() &&
615 associatedLayer->layerMaterialProperties()) {
616
617 updatedState = m_materialUpdator->postUpdate(cache.m_materialEffectsCaches,
618 *currentState,
619 *associatedLayer,
620 direction);
621
622 if (!updatedState.empty()) {
623 // Refresh the current state pointer
624 currentState = &updatedState;
625 }
626 }
627
628 // Reset combined state target
629 combinedState = nullptr;
631 if (destinationLayer) {
632 // If there are intermediate layers then additional extrapolations need to
633 // be done
634 if (associatedLayer && associatedLayer != destinationLayer) {
636 cache,
637 *currentState,
638 trackingVolume,
639 associatedLayer,
640 destinationLayer,
641 direction);
642
643 // currentState is now the next
644 if (!nextState.empty()) {
645 // Refresh the current state pointer
646 currentState = &nextState;
647 }
648 }
649 // Final extrapolation to destination surface
650 Trk::MultiComponentState returnState =
652 cache,
653 *currentState,
654 surface,
655 *destinationLayer,
656 associatedLayer,
657 direction,
658 boundaryCheck);
659 // Set the information for the current layer, surface, tracking volume
660 setRecallInformation(cache, surface, *destinationLayer, trackingVolume);
661 return returnState;
662 }
663
664 // FALLBACK POINT: If no destination layer is found fall-back and extrapolate
665 // directly
666 Trk::MultiComponentState returnState =
667 m_propagator->multiStatePropagate(ctx,
668 *currentState,
669 surface,
671 direction,
672 boundaryCheck,
674
675 // No destination layer exists so layer recall method cannot be used and
676 // should be reset
677 resetRecallInformation(cache);
678
679 return returnState;
680}
static JobState::Enum nextState(JobState::Enum state, Status::Enum status)
MultiComponentState extrapolateFromLayerToLayer(const EventContext &ctx, Cache &cache, const MultiComponentState &, const TrackingVolume &, const Layer *startLayer, const Layer *destinationLayer, PropDirection direction) const
Layer stepping, stopping at the last layer before destination.
ToolHandle< IMaterialMixtureConvolution > m_materialUpdator
MultiComponentState extrapolateToDestinationLayer(const EventContext &ctx, Cache &cache, const MultiComponentState &, const Surface &, const Layer &, const Layer *, PropDirection direction, const BoundaryCheck &boundaryCheck) const
Final extrapolation step to a destination layer.
@ layer
Definition HitInfo.h:79

◆ extrapolateToDestinationLayer()

Trk::MultiComponentState Trk::GsfExtrapolator::extrapolateToDestinationLayer ( const EventContext & ctx,
Cache & cache,
const MultiComponentState & multiComponentState,
const Surface & surface,
const Layer & layer,
const Layer * startLayer,
Trk::PropDirection direction,
const BoundaryCheck & boundaryCheck ) const
private

Final extrapolation step to a destination layer.

Definition at line 824 of file GsfExtrapolator.cxx.

833{
834
835 const Trk::MultiComponentState* initialState = &multiComponentState;
836 const Trk::TrackParameters* combinedState = nullptr;
837
838 // Propagate over all components
839 Trk::MultiComponentState destinationState =
840 m_propagator->multiStatePropagate(ctx,
841 multiComponentState,
842 surface,
844 direction,
845 boundaryCheck,
847
848 // Require a fall-back if the initial state is close to the destination
849 // surface then a fall-back solution is required
850
851 if (destinationState.empty()) {
852 combinedState = initialState->begin()->params.get();
853 if (surface.isOnSurface(
854 combinedState->position(), true, 0.5 * layer.thickness())) {
855 destinationState = m_propagator->multiStatePropagate(ctx,
856 *initialState,
857 surface,
860 boundaryCheck,
862 }
863 combinedState = nullptr;
864 if (destinationState.empty()) {
865 return {};
866 }
867 }
868
869 /* ----------------------------------------
870 Material effects
871 ---------------------------------------- */
872
873 Trk::MultiComponentState updatedState{};
874 if (startLayer != &layer) {
875 updatedState = m_materialUpdator->preUpdate(cache.m_materialEffectsCaches,
876 destinationState,
877 layer,
878 direction);
879 }
880
881 if (updatedState.empty()) {
882 return destinationState;
883 }
884
885 return updatedState;
886}

◆ extrapolateToIntermediateLayer()

Trk::MultiComponentState Trk::GsfExtrapolator::extrapolateToIntermediateLayer ( const EventContext & ctx,
Cache & cache,
const MultiComponentState & multiComponentState,
const Layer & layer,
const TrackingVolume & trackingVolume,
Trk::PropDirection direction ) const
private

Single extrapolation step to an intermediate layer.

Definition at line 757 of file GsfExtrapolator.cxx.

764{
765 const Trk::MultiComponentState* initialState = &multiComponentState;
766
767 // Propagate over all components
768 Trk::MultiComponentState destinationState =
769 m_propagator->multiStatePropagate(ctx,
770 *initialState,
771 layer.surfaceRepresentation(),
773 direction,
774 true,
776
777 if (destinationState.empty()) {
778 return {};
779 }
780
781 // the layer has been intersected
782 // ------------------------------------------------------------------------
783 // check for radial direction change
784 // ---------------------------------------------------------------------
785 const int rDirection = radialDirection(multiComponentState, direction);
786 const int newrDirection = radialDirection(destinationState, direction);
787 if (newrDirection != rDirection) {
788 // it is unfortunate that the cancelling could invalidate the material
789 // collection
790 // reset the nextParameters if the radial change is not allowed
791 // resetting is ok - since the parameters are in the garbage bin already
792 if (!radialDirectionCheck(ctx,
794 multiComponentState,
795 destinationState,
796 trackingVolume,
798 direction)) {
799 return {};
800 }
801 }
802
803 /* -------------------------------------
804 Material effects
805 ------------------------------------- */
806
807 Trk::MultiComponentState updatedState =
808 m_materialUpdator->update(cache.m_materialEffectsCaches,
809 destinationState,
810 layer,
811 direction);
812
813 if (updatedState.empty()) {
814 return destinationState;
815 }
816
817 return updatedState;
818}

◆ extrapolateToVolumeBoundary()

void Trk::GsfExtrapolator::extrapolateToVolumeBoundary ( const EventContext & ctx,
Cache & cache,
const MultiComponentState & multiComponentState,
const Layer * layer,
const TrackingVolume & trackingVolume,
Trk::PropDirection direction ) const
private

Two primary private extrapolation methods.

  • extrapolateToVolumeBoundary : extrapolates to the exit of the destination tracking volume The exit layer surface will be hit in this method.
  • extrapolateInsideVolume : extrapolates to the destination surface in the final tracking volume

Definition at line 439 of file GsfExtrapolator.cxx.

446{
447
448 //We 1st point to the input.
449 //As we move on we might change to point to the
450 //last element held by
451 //cache.m_mcsRecycleBin
452 cache.m_stateAtBoundary = &multiComponentState;
453
454 const Trk::TrackParameters* combinedState =
455 cache.m_stateAtBoundary->begin()->params.get();
456 const Trk::Layer* associatedLayer = layer;
457
458 if (!associatedLayer) {
459 // Get entry layer but do not use it as it should have already be hit if it
460 // was desired
461 associatedLayer = trackingVolume.associatedLayer(combinedState->position());
462 associatedLayer = associatedLayer
463 ? associatedLayer
464 : trackingVolume.nextLayer(
465 combinedState->position(),
466 direction * combinedState->momentum().unit(),
467 associatedLayer);
468 }
469 // Only loop over layers if they can be found within the tracking volume
470 else if (trackingVolume.confinedLayers() &&
471 associatedLayer->layerMaterialProperties()) {
472 Trk::MultiComponentState updatedState = m_materialUpdator->postUpdate(
473 cache.m_materialEffectsCaches,
474 *(cache.m_stateAtBoundary),
475 *layer,
476 direction);
477
478 if (!updatedState.empty()) {
479 addMultiComponentToCache(cache,std::move(updatedState));
480 }
481 }
482
483 // If an associated surface can be found, extrapolation within the tracking
484 // volume is mandatory This will take extrapolate to the last layer in the
485 // volume
486 if (associatedLayer) {
488 ctx,
489 cache,
490 *(cache.m_stateAtBoundary),
491 trackingVolume,
492 associatedLayer,
493 nullptr,
494 direction);
495 // if we have a next State update the currentState
496 if (!nextState.empty()) {
497 addMultiComponentToCache(cache,std::move(nextState));
498 }
499 }
500
501 /* =============================================
502 Find the boundary surface using the navigator
503 ============================================= */
504
505 Trk::NavigationCell nextNavigationCell(nullptr, nullptr);
506
507 combinedState = cache.m_stateAtBoundary->begin()->params.get();
508
509 const Trk::TrackingVolume* nextVolume = nullptr;
510 const Trk::TrackParameters* navigationParameters =
511 cache.m_navigationParameters
512 ? cache.m_navigationParameters.get()
513 : combinedState;
514
515 nextNavigationCell = m_navigator->nextTrackingVolume(
516 ctx, *m_propagator, *navigationParameters, direction, trackingVolume);
517
518 nextVolume = nextNavigationCell.nextVolume;
519
520 std::unique_ptr<Trk::TrackParameters> nextNavigationParameters =
521 std::move(nextNavigationCell.parametersOnBoundary);
522
523 if (!nextVolume) {
524 // Reset the layer recall
525 resetRecallInformation(cache);
526 }
527
528 if (useBoundaryMaterialUpdate) {
529 // Check for two things:
530 // 1. If the next volume was found
531 // 2. If there is material associated with the boundary layer.
532 // If so, apply material effects update.
533
534 // Get layer associated with boundary surface.
535 const Trk::MaterialLayer * layerAtBoundary =
536 (nextNavigationCell.parametersOnBoundary)
537 ? (nextNavigationCell.parametersOnBoundary->associatedSurface())
538 .materialLayer()
539 : nullptr;
540 Trk::MultiComponentState matUpdatedState{};
541 if (nextVolume && layerAtBoundary) {
542 if (layerAtBoundary->layerMaterialProperties()) {
543 matUpdatedState = m_materialUpdator->postUpdate(
544 cache.m_materialEffectsCaches,
545 *(cache.m_stateAtBoundary),
546 *layerAtBoundary,
547 direction);
548 }
549 }
550
551 // If state has changed due to boundary material, modify state, parameters
552 // accordingly.
553 if (!matUpdatedState.empty()) {
554 addMultiComponentToCache(cache, std::move(matUpdatedState));
555 nextNavigationParameters =
556 cache.m_stateAtBoundary->begin()->params->uniqueClone();
557 }
558 }
559 // Update the rest of the boundary information in the cache
560 cache.m_navigationParameters = std::move(nextNavigationParameters);
561 cache.m_trackingVolume = nextVolume;
562}
const TrackingVolume * nextVolume(const Amg::Vector3D &gp, const Amg::Vector3D &dir, PropDirection pDir=alongMomentum) const
Return the next volume along the navigation stream.

◆ initialiseNavigation()

std::unique_ptr< Trk::TrackParameters > Trk::GsfExtrapolator::initialiseNavigation ( const EventContext & ctx,
Cache & cache,
const MultiComponentState & initialState,
const Surface & surface,
const Layer *& associatedLayer,
const TrackingVolume *& currentVolume,
const TrackingVolume *& destinationVolume,
Trk::PropDirection & direction ) const
private

Method to initialise navigation parameters including starting state, layer and volume, and destination volume.

Definition at line 892 of file GsfExtrapolator.cxx.

901{
902 //Get the highest weight parameters. We will just use those
903 const Trk::TrackParameters* combinedState = multiComponentState.begin()->params.get();
904 /* =============================================
905 Look for current volume
906 ============================================= */
907 // 1. See if the current layer is associated with a tracking volume
908 const Trk::Surface* associatedSurface = &(combinedState->associatedSurface());
909 currentLayer = associatedSurface ? associatedSurface->associatedLayer() : currentLayer;
910 currentVolume = currentLayer ? currentLayer->enclosingTrackingVolume() : currentVolume;
911 // If the association method failed
912 if (!currentVolume) {
913 //Try the recall in case the associatedSurface is the recall one
914 if (associatedSurface == cache.m_recallSurface) {
915 currentVolume = cache.m_recallTrackingVolume;
916 currentLayer = cache.m_recallLayer;
917 }
918 // Global search method if this fails
919 else {
920 // If the recall method fails reset the cache
921 resetRecallInformation(cache);
922 currentVolume = m_navigator->volume(ctx, combinedState->position());
923 currentLayer = currentVolume
924 ? currentVolume->associatedLayer(combinedState->position())
925 : nullptr;
926 }
927 }
928 /* =============================================
929 Determine the resolved direction
930 ============================================= */
931 std::unique_ptr<Trk::TrackParameters> referenceParameters =
932 currentVolume ? m_propagator->propagateParameters(
933 ctx, *combinedState, surface, direction, false,
935 : nullptr;
936 // Find concrete direction based on reference parameters
937 if (direction == Trk::anyDirection && referenceParameters) {
938 const Amg::Vector3D surfaceDirection(referenceParameters->position() -
939 combinedState->position());
940 direction = (surfaceDirection.dot(combinedState->momentum()) > 0.)
943 }
944 /* =============================================
945 Look for destination volume
946 ============================================= */
947 // See if the destination layer is associated with a tracking volume
948 destinationVolume = surface.associatedLayer()
949 ? surface.associatedLayer()->enclosingTrackingVolume()
950 : nullptr;
951 // Association failed
952 if (!destinationVolume) {
953 // See if the cached recall surface is the destination one
954 if (&surface == cache.m_recallSurface) {
955 destinationVolume = cache.m_recallTrackingVolume;
956 } else {
957 // Global search of tracking geometry to find the destination volume
958 destinationVolume = m_navigator->volume(
959 ctx, referenceParameters ? referenceParameters->position()
960 : surface.globalReferencePoint());
961 }
962 }
963 return referenceParameters;
964}
const TrackingVolume * enclosingTrackingVolume() const
get the confining TrackingVolume
virtual const Surface & associatedSurface() const =0
Access to the Surface associated to the Parameters.
const Trk::Layer * associatedLayer() const
return the associated Layer
@ oppositeMomentum
@ alongMomentum

◆ initialize()

StatusCode Trk::GsfExtrapolator::initialize ( )
finaloverridevirtual

Definition at line 152 of file GsfExtrapolator.cxx.

153{
154
155 ATH_CHECK(m_propagator.retrieve());
156 ATH_CHECK(m_navigator.retrieve());
157 ATH_CHECK(m_materialUpdator.retrieve());
159 ? Trk::MagneticFieldProperties(Trk::FastField)
160 : Trk::MagneticFieldProperties(Trk::FullField);
161
162 return StatusCode::SUCCESS;
163}
#define ATH_CHECK
Evaluate an expression and check for errors.
BooleanProperty m_fastField
@ 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::IMultiStateExtrapolator::interfaceID ( )
inlinestaticinherited

AlgTool interface method.

Definition at line 75 of file IMultiStateExtrapolator.h.

76 {
78 };
static const InterfaceID IID_IMultiStateExtrapolator("IMultiStateExtrapolator", 1, 0)

◆ 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 }

◆ 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.

◆ particleHypothesis()

virtual Trk::ParticleHypothesis Trk::GsfExtrapolator::particleHypothesis ( ) const
inlinefinaloverridevirtual

Implements Trk::IMultiStateExtrapolator.

Definition at line 79 of file GsfExtrapolator.h.

79 {
80 return m_materialUpdator->particleHypothesis();
81 }

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

◆ 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.

◆ 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

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::GsfExtrapolator::m_fastField {this, "UseFastField", false}
private

Definition at line 174 of file GsfExtrapolator.h.

174{this, "UseFastField", false};

◆ m_fieldProperties

Trk::MagneticFieldProperties Trk::GsfExtrapolator::m_fieldProperties = Trk::FullField
private

Definition at line 176 of file GsfExtrapolator.h.

◆ m_materialUpdator

ToolHandle<IMaterialMixtureConvolution> Trk::GsfExtrapolator::m_materialUpdator
private
Initial value:
{
this, "GsfMaterialConvolution", "", "Gsf Material effects"}

Definition at line 172 of file GsfExtrapolator.h.

172 {
173 this, "GsfMaterialConvolution", "", "Gsf Material effects"};

◆ m_navigator

ToolHandle<INavigator> Trk::GsfExtrapolator::m_navigator
private
Initial value:
{this, "Navigator",
"Trk::Navigator/Navigator", ""}

Definition at line 170 of file GsfExtrapolator.h.

170 {this, "Navigator",
171 "Trk::Navigator/Navigator", ""};

◆ m_propagator

ToolHandle<IPropagator> Trk::GsfExtrapolator::m_propagator {this, "Propagator", "", ""}
private

Definition at line 169 of file GsfExtrapolator.h.

169{this, "Propagator", "", ""};

◆ 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: