ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::detail Namespace Reference

Hash functions to pack the source link into unordered_maps / unordered_sets. More...

Namespaces

namespace  GeoVolIds
 Define the volume parts of the GeometryIdentifier for each ATLAS subsystem centrally.
namespace  FitterHelperFunctions
namespace  MakeDerivedVariant

Classes

class  MeasurementCalibratorBase
 Base class providing the boiler code to fill the Acts multi trajectory track states. More...
class  TrkMeasSurfaceAccessor
 Helper class to access the Acts::Surface for a given Acts::SourceLink which is poiniting to a Trk::MeasurementBase. More...
class  TrkMeasurementCalibrator
 Calibrator class that links the legacy Trk::MeasurementBase objects with the Acts MultiTrajectory track state proxies without applying any further calibrating the measurement. More...
class  TrkPrepRawDataCalibrator
 Class to calibrate the Acts track states with uncalibrated Trk::PrepRaw data objects. More...
class  TrkPrepRawDataSurfaceAcc
 Helper class to access the Acts::surface associated with a Trk::PrepRawData measurement. More...
class  xAODUncalibMeasCalibrator
 Source link calibrator implementation for xAOD::Uncalibrated measurements. More...
class  xAODUncalibMeasSurfAcc
 Helper class to access the Acts::surface associated with an Uncalibrated xAOD measurement. More...
struct  Decoration
struct  accepted_decoration_types
struct  ExpectedLayerPatternHelper
 Helper functions to encode the expected layer patterns in separate columns. More...
class  HitSummaryData
 Helper class to gather hit summary information for e.g. More...
class  SumOfValues
 Helper class to gather statistics and compute the biased variance. More...
struct  TimeInfo
class  TransformStore
 The TransformStore provides a central place to outsource the alignable transforms of the sensitive detector elements and the alignable volumes. More...
class  TrfStoreTicketCounter
 In order that the TransformStore is able to provide enough memory to store the transform centrally, it needs to know how many clients are instantiated for a certain detector type. More...
class  AnalogueClusteringCalibrator
 the Analogue clustering calibrator More...
struct  AnalogueClusteringCalibratorOptions
 Options for the analogue clustering calibrator. More...
class  AnalogueClusteringToolImpl
 the tool to create the analogue clustering calibrator. More...
struct  MeasurementRange
class  GenMeasurementRangeList
class  GenMeasurementRangeListFlat
class  GenUncalibSourceLinkAccessor
 Accessor for the above source link container. More...
class  AtlasMeasurementContainerList
struct  CKF_config
class  DuplicateSeedDetector
class  MeasurementIndex
class  NNClusterCalibrator
 the NN clustering calibrator More...
struct  NNClusterCalibratorOptions
 Options for the NN clustering calibrator that is kind of Analogue calibrator. More...
class  NNClusterCalibratorToolImpl
 the tool to create NN calibrator. More...
class  OnTrackCalibrator
 Inner detector / ITk calibrator implementation used in the KalmanFilterTool. More...
struct  PixelClusterCalibratorOptionsBase
 the base options the options of the options of every PixelClusterCalibrator must be based on More...
class  PixelClusterCalibratorCommon
 the common base class of a PixelClusterCalibrator. More...
class  PixelClusterCalibratorBase
class  PixelClusterCalibrationToolBase
 base class of a Pixel cluster calibration tool In addition to some common functionality provied by PixelClusterCalibrationCommon this class implements the methods to connect the calibrator to the calibrator delegates, and the OnTrack and OnBoundState interfaces which will call a single calibrate method. More...
class  RefittingCalibrator
class  RefittingSurfaceAccesor
class  SharedHitCounter
class  StripCalibrator
class  StripCalibratorToolImpl
class  TrackFindingMeasurements

Typedefs

using SetterType
using GetterType
using CopierType
using TicketCounterArr = TrfStoreTicketCounter::TicketCounterArr
using ReturnedTicketArr = TrfStoreTicketCounter::ReturnedTicketArr
using ReturnedHintArr = TrfStoreTicketCounter::ReturnedHintArr
using MeasurementRangeList = GenMeasurementRangeList< AtlasMeasurementContainerList >
using MeasurementRangeListFlat = GenMeasurementRangeListFlat< AtlasMeasurementContainerList >
using UncalibSourceLinkAccessor = GenUncalibSourceLinkAccessor< MeasurementRangeList >
using RecoTrackContainer
using RecoTrackContainerProxy = RecoTrackContainer::TrackProxy
using RecoTrackStateContainer = Acts::VectorMultiTrajectory
using RecoTrackStateContainerProxy = RecoTrackStateContainer::TrackStateProxy
using RecoConstTrackStateContainerProxy = RecoTrackStateContainer::ConstTrackStateProxy
using Stepper = Acts::SympyStepper
 Adapted from Acts Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp.
using Navigator = Acts::Navigator
using Propagator = Acts::Propagator<Stepper, Navigator>
using CKF = Acts::CombinatorialKalmanFilter<Propagator, RecoTrackContainer>
using Extrapolator = Propagator

Enumerations

enum class  SourceLinkType { TrkMeasurement , TrkPrepRawData , xAODUnCalibMeas , nTypes }
 Enumeration to distinguish between the ATLAS EDM -> Acts::SourceLink variants. More...
enum class  HitCategory : std::uint8_t { DeadSensor , Hole , N }

Functions

std::ostream & operator<< (std::ostream &ostr, const SourceLinkType sl)
std::size_t sourceLinkHash (const Acts::SourceLink &sl)
 Calculates the source link hash which is evaluated to be the identifier of the underlying sourcelink.
bool sourceLinkEquality (const Acts::SourceLink &a, const Acts::SourceLink &b)
 Returns whether two source links are equal.
template<typename T>
const std::any constDecorationGetter (const SG::IConstAuxStore *container, ActsTrk::IndexType idx, SG::auxid_t decorationId)
template<typename T>
const std::any decorationGetter (const SG::IAuxStore *container, ActsTrk::IndexType idx, SG::auxid_t decorationId)
template<typename T>
std::any decorationSetter (SG::IAuxStore *container, ActsTrk::IndexType idx, SG::auxid_t decorationId)
template<typename T>
void decorationCopier (SG::IAuxStore *dst, ActsTrk::IndexType dst_idx, SG::auxid_t decorationId, const std::any &src_ptr)
template<typename T>
static Decoration decoration (std::string_view n, GetterType g, CopierType c, SetterType s=static_cast< SetterType >(nullptr))
std::vector< DecorationrestoreDecorations (const SG::IConstAuxStore *container, const std::set< std::string > &staticVariables)
std::array< unsigned int, 4 > expectedLayerPattern (const EventContext &ctx, const ActsTrk::IExtrapolationTool &extrapolator, const Acts::BoundTrackParameters &perigee_parameters, double pathLimit)
 Extrapolate from the perigee outwards and gather information which detector layers should have hits.
std::array< unsigned int, 4 > expectedLayerPattern (std::span< const ActsDetectorElement * > detectorElements)
 From a pre-computed set of detector elements, determine what the hit pattern is and which detector layers should have hits.
void addToExpectedLayerPattern (std::array< unsigned int, 4 > &pattern, const ActsDetectorElement &detElement)
template<typename T>
bool build (const std::type_info *typeInfo, const std::string &name, std::vector< Decoration > &decorations)
double computeDtDs (const Acts::ParticleHypothesis &hypothesis, double qop)
 Helper function to compute dt/ds Helper function to compute the derivative of the time as function of the path length.
Acts::FreeToPathMatrix computeFreeToPathDerivatives (const Acts::Vector3 &direction, double qop, const Acts::Vector3 &bfield, const Acts::ParticleHypothesis &particle_hypothesis)
 Compute the path length derivatives for the free/bound to curvilinear paramter transform.
std::optional< Acts::BoundMatrix > convertActsBoundCovToCurvilinearParam (const Acts::GeometryContext &tgContext, const Acts::BoundTrackParameters &param, const Acts::Vector3 &magnFieldVect, const Acts::ParticleHypothesis &particle_hypothesis)
 Convert the covariance of the given Acts track parameters into curvilinear parameterisation.
void gatherTrackSummaryData (const typename ActsTrk::TrackContainer::ConstTrackProxy &track, const std::array< unsigned short, Acts::toUnderlying(xAOD::UncalibMeasType::nTypes)> &measurement_to_summary_type, SumOfValues &chi2_stat_out, HitSummaryData &hit_info_out, std::vector< ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > &param_state_idx_out, std::array< std::array< uint8_t, Acts::toUnderlying(HitCategory::N)>, Acts::toUnderlying(xAOD::UncalibMeasType::nTypes)> &special_hit_counts_out, TimeInfo &time_info)
 Helper to gather track summary information from the track states of the specified track.
std::string toString (const DetectorType type)
std::string toString (const SystemEnvelope type)
std::tuple< std::vector< int >, std::vector< std::vector< int > >, std::vector< std::vector< float > > > getSDOInformation (const std::vector< Identifier > &rdoList, const InDetSimDataCollection &sdoCollection)
std::tuple< std::vector< float >, std::vector< float >, std::vector< int >, std::vector< int >, std::vector< float >, std::vector< float >, std::vector< float >, std::vector< float >, std::vector< float >, std::vector< float > > getSiHitInformation (const InDetDD::SiDetectorElement &element, const std::vector< SiHit > &matchingHits)
std::unique_ptr< ActsTrk::IMeasurementSelectorgetMeasurementSelector (const EventContext &ctx, const ActsTrk::IPixelOnTrackCalibratorTool< detail::RecoTrackStateContainer > *pixelOnTrackCalibratorTool, const ActsTrk::IStripOnTrackCalibratorTool< detail::RecoTrackStateContainer > *stripOnTrackCalibratorTool, const ActsTrk::IHGTDOnTrackCalibratorTool< detail::RecoTrackStateContainer > *hgtdOnTrackCalibratorTool, const ActsTrk::detail::MeasurementRangeList &measurementRanges, const std::vector< float > &etaBinsf, const std::vector< std::pair< float, float > > &chi2CutOffOutlier, const std::vector< size_t > &numMeasurementsCutOff, double edge_hole_border_width)
constexpr unsigned int setTrackStateFlag (Acts::TrackStateFlag flag)
constexpr bool testTrackStateFlag (Acts::TrackStateFlag flag, unsigned int flags)

Detailed Description

Hash functions to pack the source link into unordered_maps / unordered_sets.

Put first the GeoPrimitives.

Typedef Documentation

◆ CKF

using ActsTrk::detail::CKF = Acts::CombinatorialKalmanFilter<Propagator, RecoTrackContainer>

◆ CopierType

Initial value:
std::function<void(SG::IAuxStore*, ActsTrk::IndexType, SG::auxid_t, const std::any&)>
Interface for non-const operations on an auxiliary store.
Definition IAuxStore.h:51
std::uint32_t IndexType
Definition Decoration.h:18
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27

Definition at line 24 of file Decoration.h.

◆ Extrapolator

◆ GetterType

Initial value:
std::function<const std::any(
const SG::IConstAuxStore*, ActsTrk::IndexType, SG::auxid_t)>

Definition at line 22 of file Decoration.h.

◆ MeasurementRangeList

◆ MeasurementRangeListFlat

◆ Navigator

◆ Propagator

◆ RecoConstTrackStateContainerProxy

using ActsTrk::detail::RecoConstTrackStateContainerProxy = RecoTrackStateContainer::ConstTrackStateProxy

◆ RecoTrackContainer

Initial value:
Acts::TrackContainer<Acts::VectorTrackContainer,
Acts::VectorMultiTrajectory>

Definition at line 21 of file Tracking/Acts/ActsTrackReconstruction/src/detail/Definitions.h.

◆ RecoTrackContainerProxy

using ActsTrk::detail::RecoTrackContainerProxy = RecoTrackContainer::TrackProxy

◆ RecoTrackStateContainer

◆ RecoTrackStateContainerProxy

using ActsTrk::detail::RecoTrackStateContainerProxy = RecoTrackStateContainer::TrackStateProxy

◆ ReturnedHintArr

◆ ReturnedTicketArr

◆ SetterType

Initial value:
std::function<std::any(SG::IAuxStore*, ActsTrk::IndexType, SG::auxid_t)>

Definition at line 20 of file Decoration.h.

◆ Stepper

using ActsTrk::detail::Stepper = Acts::SympyStepper

Adapted from Acts Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp.

Definition at line 30 of file Tracking/Acts/ActsTrackReconstruction/src/detail/Definitions.h.

◆ TicketCounterArr

◆ UncalibSourceLinkAccessor

Enumeration Type Documentation

◆ HitCategory

enum class ActsTrk::detail::HitCategory : std::uint8_t
strong
Enumerator
DeadSensor 
Hole 

Definition at line 20 of file HitSummaryDataUtils.h.

20 : std::uint8_t {
22 Hole,
23 N
24 };
constexpr std::size_t N

◆ SourceLinkType

Enumeration to distinguish between the ATLAS EDM -> Acts::SourceLink variants.

Enumerator
TrkMeasurement 
TrkPrepRawData 

Calibrated Trk::MeasurementBase objects.

xAODUnCalibMeas 

UnCalibrated Trk::PrepRawData objects.

nTypes 

Uncalbirated xAOD::UnCalibratedMeasurement objects.

Number of source link types

Definition at line 12 of file SourceLinkType.h.

12 {
16 nTypes
17 };
@ xAODUnCalibMeas
UnCalibrated Trk::PrepRawData objects.
@ TrkPrepRawData
Calibrated Trk::MeasurementBase objects.

Function Documentation

◆ addToExpectedLayerPattern()

void ActsTrk::detail::addToExpectedLayerPattern ( std::array< unsigned int, 4 > & pattern,
const ActsDetectorElement & detElement )

Definition at line 43 of file ExpectedHitUtils.cxx.

43 {
45 detEl = dynamic_cast<const InDetDD::SiDetectorElement *>(detElement.upstreamDetectorElement());
46 if (detEl) {
47 if (detEl->isPixel()) {
49 unsigned int pattern_idx = type==InDetDD::PixelBarrel ? 0 : 1;
50 const PixelID* pixel_id = static_cast<const PixelID *>(detEl->getIdHelper());
51 pattern[pattern_idx] |= (1<< pixel_id->layer_disk(detEl->identify()) );
52 }
53 else if (detEl->isSCT()) {
54 // @TODO SCT/strip layer number should be shifted by total number of pixel layers ...
55 const SCT_ID* sct_id = static_cast<const SCT_ID *>(detEl->getIdHelper());
56 unsigned int pattern_idx = detEl->isBarrel() ? 2 : 3;
57 pattern[pattern_idx] |= (1<< sct_id->layer_disk(detEl->identify()) );
58 }
59 }
60 }
const GeoVDetectorElement * upstreamDetectorElement() const
Returns the underllying GeoModel detectorelement that this one is based on.
virtual DetectorType type() const
Type of element.
Class to hold geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
virtual Identifier identify() const override final
identifier of this detector element (inline)
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline).
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
int layer_disk(const Identifier &id) const
Definition PixelID.h:602
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
int layer_disk(const Identifier &id) const
Definition SCT_ID.h:687

◆ build()

template<typename T>
bool ActsTrk::detail::build ( const std::type_info * typeInfo,
const std::string & name,
std::vector< Decoration > & decorations )

Definition at line 78 of file Decoration.cxx.

78 {
79 if (*typeInfo == typeid(T)) {
80 decorations.emplace_back(
83 return true;
84 }
85 return false;
86}
void decorationCopier(SG::IAuxStore *dst, ActsTrk::IndexType dst_idx, SG::auxid_t decorationId, const std::any &src_ptr)
Definition Decoration.h:80
const std::any constDecorationGetter(const SG::IConstAuxStore *container, ActsTrk::IndexType idx, SG::auxid_t decorationId)
Definition Decoration.h:53
static Decoration decoration(std::string_view n, GetterType g, CopierType c, SetterType s=static_cast< SetterType >(nullptr))
Definition Decoration.h:87

◆ computeDtDs()

double ActsTrk::detail::computeDtDs ( const Acts::ParticleHypothesis & hypothesis,
double qop )
inline

Helper function to compute dt/ds Helper function to compute the derivative of the time as function of the path length.

Definition at line 16 of file CurvilinearCovarianceHelper.h.

16 {
17 return std::hypot(1.,hypothesis.mass() / hypothesis.extractMomentum(qop));
18 }

◆ computeFreeToPathDerivatives()

Acts::FreeToPathMatrix ActsTrk::detail::computeFreeToPathDerivatives ( const Acts::Vector3 & direction,
double qop,
const Acts::Vector3 & bfield,
const Acts::ParticleHypothesis & particle_hypothesis )
inline

Compute the path length derivatives for the free/bound to curvilinear paramter transform.

Parameters
directionthe direction of trajectory at the location in question
qopq/p of the particle at the location in question in Acts units
bfieldthe magnetic field at the location in question in Acts units
particle_hypothesisthe particle hypothesis e.g. Acts::ParticleHypothesis::pion()
Returns
path length derivatives ( dr(...)/ds, dt/ds, dr(...)/ds2, d qop/ds [== 0] )

Definition at line 27 of file CurvilinearCovarianceHelper.h.

31 {
32 Acts::FreeToPathMatrix path_length_deriv;
33 static_assert(path_length_deriv.cols() == 8); // ensure that all elements are initialized
34 path_length_deriv.segment<3>(Acts::eFreePos0) = direction;
35 path_length_deriv(0,Acts::eFreeTime) = computeDtDs(particle_hypothesis,qop);
36 path_length_deriv.segment<3>(Acts::eFreeDir0) = (qop * direction.cross(bfield)).transpose();
37 path_length_deriv(0,Acts::eFreeQOverP) = 0.;
38 return path_length_deriv;
39 }
double computeDtDs(const Acts::ParticleHypothesis &hypothesis, double qop)
Helper function to compute dt/ds Helper function to compute the derivative of the time as function of...

◆ constDecorationGetter()

template<typename T>
const std::any ActsTrk::detail::constDecorationGetter ( const SG::IConstAuxStore * container,
ActsTrk::IndexType idx,
SG::auxid_t decorationId )

Definition at line 53 of file Decoration.h.

55 {
56 const void* data = container->getData(decorationId);
57 return &(static_cast<const T*>(data)[idx]);
58}
AuxDataTraits< T >::reference_type getData(SG::auxid_t auxid, size_t ndx)
Return reference to an aux data item.

◆ convertActsBoundCovToCurvilinearParam()

std::optional< Acts::BoundMatrix > ActsTrk::detail::convertActsBoundCovToCurvilinearParam ( const Acts::GeometryContext & tgContext,
const Acts::BoundTrackParameters & param,
const Acts::Vector3 & magnFieldVect,
const Acts::ParticleHypothesis & particle_hypothesis )
inline

Convert the covariance of the given Acts track parameters into curvilinear parameterisation.

Parameters
tgContextthe current geometry context
paramthe Acts track parameters
magnFieldVectthe vector of the magnetic field at the position of the track parameters in Acts units
particle_hypothesisthe particle hypothesis e.g. Acts::ParticleHypothesis::pion() Usage:
  
     using namespace Acts::UnitLiterals;
     MagField::AtlasFieldCache fieldCache;
     ...
     Amg::Vector3D magnFieldVect;
     fieldCache.getField(param.position(tgContext).data(), magnFieldVect.data());
     magnFieldVect *= 1000_T;
     auto cov = convertActsBoundCovToCurvilinearParam(tgContext, param, magnFieldVect);
     if (cov.has_value()) { ... }
   

Definition at line 61 of file CurvilinearCovarianceHelper.h.

65 {
66 if (param.covariance().has_value()) {
67 Acts::FreeVector freeParams = Acts::transformBoundToFreeParameters(
68 param.referenceSurface(), tgContext, param.parameters());
69 Acts::Vector3 position = freeParams.segment<3>(Acts::eFreePos0);
70 Acts::Vector3 direction = freeParams.segment<3>(Acts::eFreeDir0);
71
72 Acts::BoundToFreeMatrix boundToFreeJacobian = param.referenceSurface().boundToFreeJacobian(tgContext, position, direction);
73 Acts::FreeMatrix freeTransportJacobian = Acts::FreeMatrix::Identity();
74 Acts::FreeToBoundMatrix freeToBoundJacobian;
75 Acts::FreeVector freeToPathDerivatives = computeFreeToPathDerivatives(direction,
76 param.parameters()[Acts::eBoundQOverP],
77 magnFieldVect,
78 particle_hypothesis);
79 Acts::BoundMatrix fullTransportJacobian;
80 Acts::detail::boundToCurvilinearTransportJacobian(direction,
81 boundToFreeJacobian,
82 freeTransportJacobian,
83 freeToBoundJacobian,
84 freeToPathDerivatives,
85 fullTransportJacobian);
86
87 return fullTransportJacobian * param.covariance().value() * fullTransportJacobian.transpose();
88 }
89 else {
90 return {};
91 }
92 }
Acts::FreeToPathMatrix computeFreeToPathDerivatives(const Acts::Vector3 &direction, double qop, const Acts::Vector3 &bfield, const Acts::ParticleHypothesis &particle_hypothesis)
Compute the path length derivatives for the free/bound to curvilinear paramter transform.

◆ decoration()

template<typename T>
Decoration ActsTrk::detail::decoration ( std::string_view n,
GetterType g,
CopierType c,
SetterType s = static_cast<SetterType>(nullptr) )
static

Definition at line 87 of file Decoration.h.

88 {
89 Decoration dec;
90 dec.name = n;
91 dec.hash = Acts::hashStringDynamic(n);
93 if (dec.auxid == SG::null_auxid)
94 throw std::runtime_error("ActsTrk::Decoration Aux ID for " + dec.name +
95 " could not be found");
96 dec.getter = std::move(g);
97 dec.copier = std::move(c);
98 dec.setter = std::move(s);
99 return dec;
100}
SG::auxid_t getAuxID(const std::string &name, const std::string &clsname="", const Flags flags=Flags::None, const SG::auxid_t linkedVariable=SG::null_auxid)
Look up a name -> auxid_t mapping.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
static const auxid_t null_auxid
To signal no aux data item.
Definition AuxTypes.h:30

◆ decorationCopier()

template<typename T>
void ActsTrk::detail::decorationCopier ( SG::IAuxStore * dst,
ActsTrk::IndexType dst_idx,
SG::auxid_t decorationId,
const std::any & src_ptr )

Definition at line 80 of file Decoration.h.

81 {
82 *std::any_cast<T*>(decorationSetter<T>(dst, dst_idx, decorationId)) =
83 *std::any_cast<const T*>(src_ptr);
84}
std::any decorationSetter(SG::IAuxStore *container, ActsTrk::IndexType idx, SG::auxid_t decorationId)
Definition Decoration.h:71

◆ decorationGetter()

template<typename T>
const std::any ActsTrk::detail::decorationGetter ( const SG::IAuxStore * container,
ActsTrk::IndexType idx,
SG::auxid_t decorationId )

Definition at line 61 of file Decoration.h.

63 {
64 const void* data = container->getData(decorationId);
65 return &(static_cast<T*>(data)[idx]);
66}

◆ decorationSetter()

template<typename T>
std::any ActsTrk::detail::decorationSetter ( SG::IAuxStore * container,
ActsTrk::IndexType idx,
SG::auxid_t decorationId )

Definition at line 71 of file Decoration.h.

72 {
73 assert (idx < container->size());
74 // The size requested for the decoration must match the size of the container.
75 void* data = container->getData(decorationId, container->size(), container->size());
76 return &(static_cast<T*>(data)[idx]);
77}
size_t size() const
Number of registered mappings.

◆ expectedLayerPattern() [1/2]

std::array< unsigned int, 4 > ActsTrk::detail::expectedLayerPattern ( const EventContext & ctx,
const ActsTrk::IExtrapolationTool & extrapolator,
const Acts::BoundTrackParameters & perigee_parameters,
double pathLimit )

Extrapolate from the perigee outwards and gather information which detector layers should have hits.

Parameters
ctxthe current athena EvetContext @paran extrapolator referece to the Acts extrapolation tool
perigee_parametersthe Acts defining track parameters (parameters at the perigee).
pathLimitthe maximum path length to extrapolate to.
Returns
array of layer pattern words: two pairs for pixel and strips containing the barrel and end caps bit pattern with one bit per detector layer. Will extrapolate from the perigee to the given cylinder volume surface and gather the layers which are crossed and on which hits are expected.

Definition at line 14 of file ExpectedHitUtils.cxx.

17 {
18 std::array<unsigned int,4> expected_layer_pattern {0u,0u,0u,0u};
19 auto result = extrapolator.propagationSteps(ctx,
20 perigee_parameters,
21 Acts::Direction::Forward(),
22 pathLimit);
23 if (!result.ok()) {
24 return expected_layer_pattern;
25 }
26 for (const Acts::detail::Step &step : result->first ) {
27 // @TODO boundary check ?, does layer number match layer numbering in athena ?
28 // @TODO filter out dead modules
29 if (!step.geoID.sensitive()) {
30 continue;
31 }
32 const auto* actsDetEl = getActsDetectorElement(step.surface);
33 if (actsDetEl) {
34 addToExpectedLayerPattern(expected_layer_pattern, *actsDetEl);
35 }
36
37 }
38
39
40 return expected_layer_pattern;
41 }
const ActsDetectorElement * getActsDetectorElement(const Acts::Surface &surf)
Attempts to retrieve the ActsDetectorElement associated to the passed ActsSurface.
virtual Acts::Result< PropagationOutput > propagationSteps(const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, Acts::Direction navDir=Acts::Direction::Forward(), double pathLimit=1._km) const =0
Extrapolate the track parameters until the end of the world and record the performed steps & the allo...
void addToExpectedLayerPattern(std::array< unsigned int, 4 > &pattern, const ActsDetectorElement &detElement)

◆ expectedLayerPattern() [2/2]

std::array< unsigned int, 4 > ActsTrk::detail::expectedLayerPattern ( std::span< const ActsDetectorElement * > detectorElements)

From a pre-computed set of detector elements, determine what the hit pattern is and which detector layers should have hits.

Parameters
detectorElementsA set of detector elements to consider

◆ gatherTrackSummaryData()

void ActsTrk::detail::gatherTrackSummaryData ( const typename ActsTrk::TrackContainer::ConstTrackProxy & track,
const std::array< unsigned short, Acts::toUnderlying(xAOD::UncalibMeasType::nTypes)> & measurement_to_summary_type,
SumOfValues & chi2_stat_out,
HitSummaryData & hit_info_out,
std::vector< ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > & param_state_idx_out,
std::array< std::array< uint8_t, Acts::toUnderlying(HitCategory::N)>, Acts::toUnderlying(xAOD::UncalibMeasType::nTypes)> & special_hit_counts_out,
TimeInfo & time_info )

Helper to gather track summary information from the track states of the specified track.

Parameters
tracka track of the given acts track container for which the summary information is to be gathered
measurement_to_summary_typea LUT to map measurement types to the corresponding summary type for the measurement counts
chi2_stat_outoutput of the per track state chi-squared sums and squared sums to compute the per state chi2 variance.
hit_info_outoutput of the gathered measurement statistics per detector region, layer, ... .
param_state_idx_outoutput vector to be filled with the state index of all track states which are not holes.
special_hit_counts_outarrays to count holes (and @TODO dead sensors) per measurement type.
time_infowill be filled with the mean time and the time resolution, provided at least one hit provides time information.

Definition at line 14 of file HitSummaryDataUtils.cxx.

23 {
24 chi2_stat_out.reset();
25
26 struct TimeInfoHelper { double sum{}; double sumInv2{}; double chi2{}; unsigned int n=0u;};
27 TimeInfoHelper time_info_helper;
28
29 hit_info_out.reset();
30 param_state_idx_out.clear();
31
32 const auto lastMeasurementIndex = track.tipIndex();
33 track.container().trackStateContainer().visitBackwards(
34 lastMeasurementIndex,
35 [&measurement_to_summary_type,
36 &chi2_stat_out,
37 &hit_info_out,
38 &param_state_idx_out,
39 &special_hit_counts_out,
40 &time_info_helper
41 ](const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) -> void
42 {
43
44 auto flag = state.typeFlags();
45 if (!state.hasReferenceSurface()) {
46 return;
47 }
49 const auto* placement = dynamic_cast<const ISurfacePlacement*>(state.referenceSurface().surfacePlacement());
50 if (placement != nullptr) {
51 det_type = toMeasType(placement->detectorType());
52 }
53
54 if (flag.hasNoExpectedHit()) {
55 // @TODO includes holes at sensor edges
56 ++special_hit_counts_out.at(Acts::toUnderlying(det_type)).at(Acts::toUnderlying(HitCategory::DeadSensor));
57 return;
58
59 }
60 if (flag.isHole()) {
61 const Amg::Vector2D localPos{state.parameters()[Acts::eBoundLoc0],
62 state.parameters()[Acts::eBoundLoc1]};
63 if (state.referenceSurface().insideBounds(localPos)) {
64 // @TODO check whether detector element is dead..
65 ++special_hit_counts_out.at(Acts::toUnderlying(det_type)).at(Acts::toUnderlying(HitCategory::Hole));
66 }
67 return;
68
69 }
70 // do not consider material states
71 if (!flag.hasMeasurement() || !state.hasUncalibratedSourceLink()) {
72 return;
73 }
74 param_state_idx_out.push_back(state.index());
75
76 // @TODO dead elements
77 auto uncalibMeas = detail::xAODUncalibMeasCalibrator::unpack(state.getUncalibratedSourceLink());
78 assert( uncalibMeas != nullptr );
79 assert( det_type == uncalibMeas->type());
80
81 if (measurement_to_summary_type.at(Acts::toUnderlying(uncalibMeas->type())) <
83 HitSummaryData::EHitSelection hit_selection = (flag.isOutlier()
86 if (flag.isSharedHit()) {
87 hit_selection = HitSummaryData::EHitSelection(hit_selection | HitSummaryData::SharedHit);
88 }
89 if (const auto* idDetEl = getActsDetectorElement(state.referenceSurface()); idDetEl != nullptr) {
90 const auto* siDet = dynamic_cast<const InDetDD::SolidStateDetectorElementBase*>(idDetEl->upstreamDetectorElement());
91 hit_info_out.addHit(det_type, siDet, hit_selection);
92 }
93
95 if (!flag.isOutlier() && state.hasCalibrated()) {
96 // compute HGTD calibrated
97 assert( state.calibratedSize()==3);
98 auto pos = state.calibrated<3>();
99 auto cov = state.calibratedCovariance<3>();
100 time_info_helper.sum += pos[2]; // Acts time
101 time_info_helper.sumInv2 += 1./cov(2,2); // Acts time
102 time_info_helper.chi2 += state.chi2();
103 ++time_info_helper.n;
104 }
105 }
106
107 if (state.calibratedSize()>0 && !flag.isOutlier()) {
108 // from Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
109 // processTrackState
110 double chi2add = std::min(state.chi2(),1e5f) / state.calibratedSize();
111 chi2_stat_out.add(chi2add );
112 }
113 }
114
115 });
116 hit_info_out.computeSummaries();
117 if (time_info_helper.n>1) {
118 time_info.mean = static_cast<float>(ActsTrk::timeToAthena( time_info_helper.sum / time_info_helper.n));
119 time_info.resolution = static_cast<float>(ActsTrk::timeToAthena(std::sqrt(1./time_info_helper.sumInv2)));
120 time_info.chi2 = time_info_helper.chi2;
121 }
122 else {
123 time_info.mean = static_cast<float>(ActsTrk::timeToAthena(time_info_helper.sum));
124 time_info.resolution = time_info_helper.n>0 ? static_cast<float>(ActsTrk::timeToAthena(std::sqrt(1./time_info_helper.sumInv2))) : 0.f;
125 time_info.chi2 = time_info_helper.chi2;
126 }
127 }
void reset()
reset all summary counters to zero.
void computeSummaries()
Compute the varius summaries.
bool addHit(xAOD::UncalibMeasType det_type, const InDetDD::SolidStateDetectorElementBase *detEl, EHitSelection hit_selection)
update summaries to take the given hit into account.
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
double chi2(TH1 *h0, TH1 *h1)
constexpr double timeToAthena(T actsT)
Converts a time unit from Acts to Athena units.
xAOD::UncalibMeasType toMeasType(const DetectorType dType)
Conversts the detector type to an uncalibrated measurement type.
Eigen::Matrix< double, 2, 1 > Vector2D
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77
bool flag
Definition master.py:29
UncalibMeasType
Define the type of the uncalibrated measurement.
@ numberOfTrackSummaryTypes

◆ getMeasurementSelector()

std::unique_ptr< ActsTrk::IMeasurementSelector > ActsTrk::detail::getMeasurementSelector ( const EventContext & ctx,
const ActsTrk::IPixelOnTrackCalibratorTool< detail::RecoTrackStateContainer > * pixelOnTrackCalibratorTool,
const ActsTrk::IStripOnTrackCalibratorTool< detail::RecoTrackStateContainer > * stripOnTrackCalibratorTool,
const ActsTrk::IHGTDOnTrackCalibratorTool< detail::RecoTrackStateContainer > * hgtdOnTrackCalibratorTool,
const ActsTrk::detail::MeasurementRangeList & measurementRanges,
const std::vector< float > & etaBinsf,
const std::vector< std::pair< float, float > > & chi2CutOffOutlier,
const std::vector< size_t > & numMeasurementsCutOff,
double edge_hole_border_width )

Definition at line 397 of file AtlasMeasurementSelector.cxx.

405 {
406
407 // set calibrators per measurement container type (order does not matter);
409 pixelOnTrackCalibratorTool,
410 stripOnTrackCalibratorTool,
411 hgtdOnTrackCalibratorTool);
412 using AtlMeasurementSelectorCuts = AtlasMeasurementSelectorCuts;
413
414 using AtlMeasurementSelector = AtlasActsMeasurmentSelector<detail::RecoTrackStateContainer>;
415 using AtlMeasurementSelectorConfig = AtlMeasurementSelector::TheAtlasMeasurementSelector::Config;
416
417 std::unique_ptr<ActsTrk::IMeasurementSelector>
418 selector(new AtlMeasurementSelector(
419 std::move(atl_measurement_calibrator),
420 measurementRanges,
421 AtlMeasurementSelectorConfig{
422 {Acts::GeometryIdentifier(),
423 AtlMeasurementSelectorCuts{ etaBinsf,
424 chi2CutOffOutlier,
425 numMeasurementsCutOff,
426 edge_hole_border_width==0.
427 ? std::optional<Acts::BoundaryTolerance>{}
428 : std::optional{Acts::BoundaryTolerance::AbsoluteEuclidean(-std::abs(edge_hole_border_width))}
429 }
430 }}));
431 return selector;
432}

◆ getSDOInformation()

std::tuple< std::vector< int >, std::vector< std::vector< int > >, std::vector< std::vector< float > > > ActsTrk::detail::getSDOInformation ( const std::vector< Identifier > & rdoList,
const InDetSimDataCollection & sdoCollection )

Definition at line 13 of file Tracking/Acts/ActsObjectDecoration/src/detail/Utilities.cxx.

15 {
16 std::vector<int> sdo_word {};
17 std::vector< std::vector< int > > sdo_depositsUniqueID {};
18 std::vector< std::vector< float > > sdo_depositsEnergy {};
19
20 for (const Identifier hitIdentifier : rdoList) {
21 auto pos = sdoCollection.find(hitIdentifier);
22 if( pos == sdoCollection.end() ) continue;
23
24 sdo_word.push_back( pos->second.word() ) ;
25
26 std::vector<int> sdoDepUID(pos->second.getdeposits().size(), HepMC::INVALID_PARTICLE_ID);
27 std::vector<float> sdoDepEnergy(pos->second.getdeposits().size());
28
29 unsigned int nDepos {0};
30 for (const auto& deposit: pos->second.getdeposits()) {
31 if (deposit.first) sdoDepUID[nDepos] = HepMC::uniqueID(deposit.first);
32 sdoDepEnergy[nDepos] = deposit.second;
33 ++nDepos;
34 }
35
36 sdo_depositsUniqueID.push_back( std::move(sdoDepUID) );
37 sdo_depositsEnergy.push_back( std::move(sdoDepEnergy) );
38 }
39
40 return std::make_tuple(std::move(sdo_word),
41 std::move(sdo_depositsUniqueID),
42 std::move(sdo_depositsEnergy));
43 }
constexpr int INVALID_PARTICLE_ID
int uniqueID(const T &p)

◆ getSiHitInformation()

std::tuple< std::vector< float >, std::vector< float >, std::vector< int >, std::vector< int >, std::vector< float >, std::vector< float >, std::vector< float >, std::vector< float >, std::vector< float >, std::vector< float > > ActsTrk::detail::getSiHitInformation ( const InDetDD::SiDetectorElement & element,
const std::vector< SiHit > & matchingHits )

Definition at line 57 of file Tracking/Acts/ActsObjectDecoration/src/detail/Utilities.cxx.

59 {
60 int numHits = matchingHits.size();
61
62 std::vector<float> sihit_energyDeposit(numHits, 0);
63 std::vector<float> sihit_meanTime(numHits, 0);
64 std::vector<int> sihit_uniqueID(numHits, 0);
65 std::vector<int> sihit_pdgid(numHits, 0);
66
67 std::vector<float> sihit_startPosX(numHits, 0);
68 std::vector<float> sihit_startPosY(numHits, 0);
69 std::vector<float> sihit_startPosZ(numHits, 0);
70
71 std::vector<float> sihit_endPosX(numHits, 0);
72 std::vector<float> sihit_endPosY(numHits, 0);
73 std::vector<float> sihit_endPosZ(numHits, 0);
74
75 int hitNumber {0};
76 for ( const SiHit& sihit : matchingHits ) {
77 sihit_energyDeposit[hitNumber] = sihit.energyLoss() ;
78 sihit_meanTime[hitNumber] = sihit.meanTime() ;
79
80 const HepMcParticleLink& HMPL = sihit.particleLink();
81 sihit_uniqueID[hitNumber] = HepMC::uniqueID(HMPL);
82 if( HMPL.isValid() ){
83 sihit_pdgid[hitNumber] = HMPL->pdg_id();
84 }
85
86 // Convert Simulation frame into reco frame
87 const HepGeom::Point3D<double>& startPos=sihit.localStartPosition();
88
89 Amg::Vector2D pos = element.hitLocalToLocal( startPos.z(), startPos.y() );
90 sihit_startPosX[hitNumber] = pos[0];
91 sihit_startPosY[hitNumber] = pos[1];
92 sihit_startPosZ[hitNumber] = startPos.x();
93
94 const HepGeom::Point3D<double>& endPos=sihit.localEndPosition();
95 pos = element.hitLocalToLocal( endPos.z(), endPos.y() );
96 sihit_endPosX[hitNumber] = pos[0];
97 sihit_endPosY[hitNumber] = pos[1];
98 sihit_endPosZ[hitNumber] = endPos.x();
99 ++hitNumber;
100 }
101
102 return std::make_tuple(std::move(sihit_energyDeposit), std::move(sihit_meanTime), std::move(sihit_uniqueID), std::move(sihit_pdgid),
103 std::move(sihit_startPosX), std::move(sihit_startPosY), std::move(sihit_startPosZ),
104 std::move(sihit_endPosX), std::move(sihit_endPosY), std::move(sihit_endPosZ));
105 }
Amg::Vector2D hitLocalToLocal(double xEta, double xPhi) const
Simulation/Hit local frame to reconstruction local frame.
Definition SiHit.h:19

◆ operator<<()

std::ostream & ActsTrk::detail::operator<< ( std::ostream & ostr,
const SourceLinkType sl )
inline

Definition at line 18 of file SourceLinkType.h.

18 {
19 switch (sl) {
20 using enum SourceLinkType;
21 case TrkMeasurement:
22 ostr<<"TrkMeasurement";
23 break;
24 case TrkPrepRawData:
25 ostr<<"TrkPrepRawData";
26 break;
27 case xAODUnCalibMeas:
28 ostr<<"xAODUnCalibMeas";
29 break;
30 case nTypes:
31 ostr<<"nTypes";
32 break;
33 }
34 return ostr;
35 }
SourceLinkType
Enumeration to distinguish between the ATLAS EDM -> Acts::SourceLink variants.
@ nTypes
Uncalbirated xAOD::UnCalibratedMeasurement objects.

◆ restoreDecorations()

std::vector< Decoration > ActsTrk::detail::restoreDecorations ( const SG::IConstAuxStore * container,
const std::set< std::string > & staticVariables )
  • container - source container to look for decorations
  • staticVariables - set of names of predefined variables for this container

Definition at line 89 of file Decoration.cxx.

91 {
92 std::vector<Decoration> decorations;
93 for (auto id : container->getAuxIDs()) {
94 const std::string name = SG::AuxTypeRegistry::instance().getName(id);
95 const std::type_info* typeInfo =
97 if (staticVariables.count(name) == 1) {
98 continue;
99 }
100
101 // try making decoration accessor of matching type
102 // there is a fixed set of supported types (as there is a fixed set
103 // available in MutableMTJ) setters are not needed so replaced by a
104 if ( build<float>(typeInfo, name, decorations) ||
105 build<double>(typeInfo, name, decorations) ||
106 build<short>(typeInfo, name, decorations) ||
107 build<int>(typeInfo, name, decorations) ||
108 build<uint8_t>(typeInfo, name, decorations) ||
109 build<uint16_t>(typeInfo, name, decorations) ||
110 build<uint32_t>(typeInfo, name, decorations) ||
111 build<uint64_t>(typeInfo, name, decorations) ||
112 build<int8_t>(typeInfo, name, decorations) ||
113 build<int16_t>(typeInfo, name, decorations) ||
114 build<int32_t>(typeInfo, name, decorations) ||
115 build<int64_t>(typeInfo, name, decorations)
116 ) {
117 continue;
118 }
119 throw std::runtime_error("Can't restore decoration of " + name +
120 " because it is of an unsupported type");
121 }
122 return decorations;
123}
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items in store associated with this object.
bool build(const std::type_info *typeInfo, const std::string &name, std::vector< Decoration > &decorations)

◆ setTrackStateFlag()

unsigned int ActsTrk::detail::setTrackStateFlag ( Acts::TrackStateFlag flag)
constexpr

Definition at line 10 of file TrackStateFlagHelper.h.

10 {
11 return 1u<<static_cast<unsigned int>(flag);
12 }

◆ sourceLinkEquality()

bool ActsTrk::detail::sourceLinkEquality ( const Acts::SourceLink & a,
const Acts::SourceLink & b )

Returns whether two source links are equal.

Definition at line 31 of file SourceLinkHash.cxx.

31 {
32 return sourceLinkHash(a) == sourceLinkHash(b);
33}
static Double_t a
std::size_t sourceLinkHash(const Acts::SourceLink &sl)
Calculates the source link hash which is evaluated to be the identifier of the underlying sourcelink.

◆ sourceLinkHash()

std::size_t ActsTrk::detail::sourceLinkHash ( const Acts::SourceLink & sl)

Calculates the source link hash which is evaluated to be the identifier of the underlying sourcelink.

Definition at line 13 of file SourceLinkHash.cxx.

13 {
14 using namespace ActsTrk::detail;
16 using enum SourceLinkType;
17 case xAODUnCalibMeas:
19 case TrkMeasurement: {
20 const auto* rio = dynamic_cast<const Trk::RIO_OnTrack*>(TrkMeasurementCalibrator::unpack(slink));
21 assert(rio != nullptr);
22 return rio->identify().get_compact();
23 } case TrkPrepRawData: {
25 } default:
26 break;
27 }
28 return 0ul;
29}
static SourceLinkType getType(const Acts::SourceLink &sl)
Returns the enumeration corresponding to the object type cached within the Acts::SourceLink.
static const Trk::MeasurementBase * unpack(const Acts::SourceLink &sl)
Unpacks the Acts::SourceLink to a Trk measurement.
static const Trk::PrepRawData * unpack(const Acts::SourceLink &sl)
Unpack the prepraw data measurement from the source link.
value_type get_compact() const
Get the compact id.
Identifier identify() const
return the identifier
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
DetectorIdentType identifier() const
Returns the full Identifier of the measurement.
Hash functions to pack the source link into unordered_maps / unordered_sets.
unsigned long ul

◆ testTrackStateFlag()

bool ActsTrk::detail::testTrackStateFlag ( Acts::TrackStateFlag flag,
unsigned int flags )
constexpr

Definition at line 13 of file TrackStateFlagHelper.h.

13 {
14 return flags & setTrackStateFlag(flag);
15 }
constexpr unsigned int setTrackStateFlag(Acts::TrackStateFlag flag)

◆ toString() [1/2]

std::string ActsTrk::detail::toString ( const DetectorType type)
inline

Definition at line 69 of file GeometryDefs.h.

69 {
70 switch (type) {
71 using enum DetectorType;
83 }
84 return "Unknown";
85 }
#define ENUM_ITEM_STR(item)
Load ATLAS Eigen library with custom geometry functions.
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ sTgc
Micromegas (NSW).
@ Rpc
Monitored Drift Tubes.
@ Csc
Thin gap champers.
@ Mdt
MuonSpectrometer.
@ UnDefined
Small Thing Gap chambers (NSW).

◆ toString() [2/2]

std::string ActsTrk::detail::toString ( const SystemEnvelope type)
inline

Definition at line 86 of file GeometryDefs.h.

86 {
87 switch (type) {
88 using enum SystemEnvelope;
92 }
93 return "Unknown";
94 }
SystemEnvelope
Define an enumeration to retrieve the envelope tracking volume from.