Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ActsTrk::TrackParamsEstimationTool Class Reference

#include <TrackParamsEstimationTool.h>

Inheritance diagram for ActsTrk::TrackParamsEstimationTool:
Collaboration diagram for ActsTrk::TrackParamsEstimationTool:

Public Member Functions

 TrackParamsEstimationTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~TrackParamsEstimationTool ()=default
 
virtual StatusCode initialize () override
 
virtual std::optional< Acts::BoundTrackParameters > estimateTrackParameters (const ActsTrk::Seed &seed, bool useTopSp, const Acts::GeometryContext &geoContext, const Acts::MagneticFieldContext &magFieldContext, std::function< const Acts::Surface &(const ActsTrk::Seed &seed, bool useTopSp)> retrieveSurface) const override
 
virtual std::optional< Acts::BoundTrackParameters > estimateTrackParameters (const ActsTrk::Seed &seed, bool useTopSp, const Acts::GeometryContext &geoContext, const Acts::MagneticFieldContext &magFieldContext, const Acts::Surface &surface, const Acts::Vector3 &bField) const override
 

Private Types

using Stepper = Acts::SympyStepper
 
using Navigator = Acts::VoidNavigator
 
using Extrapolator = Acts::Propagator< Stepper >
 

Private Member Functions

const Acts::Logger & logger () const
 Private access to the logger. More...
 

Private Attributes

Gaudi::Property< double > m_sigmaLoc0
 
Gaudi::Property< double > m_sigmaLoc1
 
Gaudi::Property< double > m_sigmaPhi
 
Gaudi::Property< double > m_sigmaTheta
 
Gaudi::Property< double > m_sigmaQOverP
 
Gaudi::Property< double > m_sigmaT0
 
Gaudi::Property< double > m_initialSigmaPtRel
 
Gaudi::Property< std::vector< double > > m_initialVarInflation
 
std::optional< Extrapolatorm_extrapolator
 
std::unique_ptr< const Acts::Logger > m_logger
 logging instance More...
 

Detailed Description

Definition at line 19 of file TrackParamsEstimationTool.h.

Member Typedef Documentation

◆ Extrapolator

using ActsTrk::TrackParamsEstimationTool::Extrapolator = Acts::Propagator<Stepper>
private

Definition at line 71 of file TrackParamsEstimationTool.h.

◆ Navigator

using ActsTrk::TrackParamsEstimationTool::Navigator = Acts::VoidNavigator
private

Definition at line 70 of file TrackParamsEstimationTool.h.

◆ Stepper

using ActsTrk::TrackParamsEstimationTool::Stepper = Acts::SympyStepper
private

Definition at line 69 of file TrackParamsEstimationTool.h.

Constructor & Destructor Documentation

◆ TrackParamsEstimationTool()

ActsTrk::TrackParamsEstimationTool::TrackParamsEstimationTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 11 of file TrackParamsEstimationTool.cxx.

14  : base_class(type, name, parent)
15  {}

◆ ~TrackParamsEstimationTool()

virtual ActsTrk::TrackParamsEstimationTool::~TrackParamsEstimationTool ( )
virtualdefault

Member Function Documentation

◆ estimateTrackParameters() [1/2]

std::optional< Acts::BoundTrackParameters > ActsTrk::TrackParamsEstimationTool::estimateTrackParameters ( const ActsTrk::Seed seed,
bool  useTopSp,
const Acts::GeometryContext &  geoContext,
const Acts::MagneticFieldContext &  magFieldContext,
const Acts::Surface &  surface,
const Acts::Vector3 &  bField 
) const
overridevirtual

Definition at line 68 of file TrackParamsEstimationTool.cxx.

75  {
76  // Get SPs
77  const auto& sp_collection = seed.sp();
78  if ( sp_collection.size() < 3 ) return std::nullopt;
79 
80  // Compute free parameters
81  Acts::FreeVector freeParams = useTopSp ?
82  Acts::estimateTrackParamsFromSeed(std::ranges::views::reverse(sp_collection),
83  bField) :
84  Acts::estimateTrackParamsFromSeed(sp_collection,
85  bField);
86 
87  if (useTopSp) {
88  // reverse direction so momentum vector pointing outwards
89  freeParams = Acts::reflectFreeParameters(freeParams);
90  }
91 
92  // Convert free params to curvilinear params for extrapolation
93  Acts::BoundTrackParameters curvilinearParams = Acts::BoundTrackParameters::createCurvilinear(
94  freeParams.segment<4>(Acts::eFreePos0),
95  freeParams.segment<3>(Acts::eFreeDir0),
96  freeParams[Acts::eFreeQOverP],
97  std::nullopt,
99 
100  // Extrapolate to surface
101  Acts::PropagatorPlainOptions propOptions(geoContext, magFieldContext);
102  propOptions.direction = Acts::Direction::fromScalarZeroAsPositive(
103  surface.intersect(
104  geoContext,
105  freeParams.segment<3>(Acts::eFreePos0),
106  freeParams.segment<3>(Acts::eFreeDir0)
107  ).closest().pathLength());
108  auto boundParamsResult = m_extrapolator->propagateToSurface(curvilinearParams, surface, propOptions);
109  if (!boundParamsResult.ok()) {
110  ATH_MSG_DEBUG("Extrapolation failed");
111  return std::nullopt;
112  }
113 
114  // Get extrapolated parameters
115  Acts::BoundTrackParameters boundParams = *boundParamsResult;
116 
117  // Estimate covariance
118  Acts::EstimateTrackParamCovarianceConfig covarianceEstimationConfig = {
120  .initialSigmaPtRel = m_initialSigmaPtRel,
121  .initialVarInflation = Eigen::Map<const Acts::BoundVector>(m_initialVarInflation.value().data()),
122  .noTimeVarInflation = 1.0,
123  };
124  boundParams.covariance() = Acts::estimateTrackParamCovariance(
125  covarianceEstimationConfig,
126  boundParams.parameters(),
127  false);
128 
129  return boundParams;
130  }

◆ estimateTrackParameters() [2/2]

std::optional< Acts::BoundTrackParameters > ActsTrk::TrackParamsEstimationTool::estimateTrackParameters ( const ActsTrk::Seed seed,
bool  useTopSp,
const Acts::GeometryContext &  geoContext,
const Acts::MagneticFieldContext &  magFieldContext,
std::function< const Acts::Surface &(const ActsTrk::Seed &seed, bool useTopSp)>  retrieveSurface 
) const
overridevirtual

Definition at line 38 of file TrackParamsEstimationTool.cxx.

44  {
45  const auto& sp_collection = seed.sp();
46  if ( sp_collection.size() < 3 ) return std::nullopt;
47  const auto& bottom_sp = useTopSp ? sp_collection.back() : sp_collection.front();
48 
49  // Magnetic Field
50  ATLASMagneticFieldWrapper magneticField;
51  Acts::MagneticFieldProvider::Cache magFieldCache = magneticField.makeCache( magFieldContext );
52  Acts::Vector3 bField = *magneticField.getField( Acts::Vector3(bottom_sp->x(), bottom_sp->y(), bottom_sp->z()),
53  magFieldCache );
54 
55  // Get the surface
56  const Acts::Surface& surface = retrieveSurface(seed, useTopSp);
57 
59  seed,
60  useTopSp,
61  geoContext,
62  magFieldContext,
63  surface,
64  bField);
65  }

◆ initialize()

StatusCode ActsTrk::TrackParamsEstimationTool::initialize ( )
overridevirtual

Definition at line 17 of file TrackParamsEstimationTool.cxx.

18  {
19  ATH_MSG_INFO( "Initializing " << name() << "..." );
20 
21  ATH_MSG_DEBUG( "Properties Summary:" );
22  ATH_MSG_DEBUG( " " << m_sigmaLoc0 );
23  ATH_MSG_DEBUG( " " << m_sigmaLoc1 );
24  ATH_MSG_DEBUG( " " << m_sigmaPhi );
25  ATH_MSG_DEBUG( " " << m_sigmaTheta );
26  ATH_MSG_DEBUG( " " << m_sigmaQOverP );
27  ATH_MSG_DEBUG( " " << m_sigmaT0 );
29 
30  m_logger = makeActsAthenaLogger(this, "Acts");
31 
32  m_extrapolator = Extrapolator(Stepper(std::make_shared<ATLASMagneticFieldWrapper>()), Navigator(), logger().cloneWithSuffix("Prop"));
33 
34  return StatusCode::SUCCESS;
35  }

◆ logger()

const Acts::Logger& ActsTrk::TrackParamsEstimationTool::logger ( ) const
inlineprivate

Private access to the logger.

Definition at line 76 of file TrackParamsEstimationTool.h.

77  {
78  return *m_logger;
79  }

Member Data Documentation

◆ m_extrapolator

std::optional<Extrapolator> ActsTrk::TrackParamsEstimationTool::m_extrapolator
private

Definition at line 73 of file TrackParamsEstimationTool.h.

◆ m_initialSigmaPtRel

Gaudi::Property< double > ActsTrk::TrackParamsEstimationTool::m_initialSigmaPtRel
private
Initial value:
{this, "initialSigmaPtRel", 0.1,
"Initial relative pT resolution"}

Definition at line 64 of file TrackParamsEstimationTool.h.

◆ m_initialVarInflation

Gaudi::Property< std::vector<double> > ActsTrk::TrackParamsEstimationTool::m_initialVarInflation
private
Initial value:
{this, "initialVarInflation", {1., 1., 1., 1., 1., 1.},
"Inflate tracks"}

Definition at line 66 of file TrackParamsEstimationTool.h.

◆ m_logger

std::unique_ptr<const Acts::Logger> ActsTrk::TrackParamsEstimationTool::m_logger
private

logging instance

Definition at line 82 of file TrackParamsEstimationTool.h.

◆ m_sigmaLoc0

Gaudi::Property< double > ActsTrk::TrackParamsEstimationTool::m_sigmaLoc0
private
Initial value:
{this, "sigmaLoc0", 1 * Acts::UnitConstants::mm,
"Constant term of the loc0 resolution"}

Definition at line 52 of file TrackParamsEstimationTool.h.

◆ m_sigmaLoc1

Gaudi::Property< double > ActsTrk::TrackParamsEstimationTool::m_sigmaLoc1
private
Initial value:
{this, "sigmaLoc1", 1 * Acts::UnitConstants::mm,
"Constant term of the loc1 resolution"}

Definition at line 54 of file TrackParamsEstimationTool.h.

◆ m_sigmaPhi

Gaudi::Property< double > ActsTrk::TrackParamsEstimationTool::m_sigmaPhi
private
Initial value:
{this, "sigmaPhi", 0.1 * Acts::UnitConstants::degree,
"Phi angular resolution"}

Definition at line 56 of file TrackParamsEstimationTool.h.

◆ m_sigmaQOverP

Gaudi::Property< double > ActsTrk::TrackParamsEstimationTool::m_sigmaQOverP
private
Initial value:
{this, "sigmaQOverP", 0.1 * Acts::UnitConstants::e / Acts::UnitConstants::GeV,
"q/p resolution"}

Definition at line 60 of file TrackParamsEstimationTool.h.

◆ m_sigmaT0

Gaudi::Property< double > ActsTrk::TrackParamsEstimationTool::m_sigmaT0
private
Initial value:
{this, "sigmaT0", 1 * Acts::UnitConstants::ns,
"Time resolution"}

Definition at line 62 of file TrackParamsEstimationTool.h.

◆ m_sigmaTheta

Gaudi::Property< double > ActsTrk::TrackParamsEstimationTool::m_sigmaTheta
private
Initial value:
{this, "sigmaTheta", 0.1 * Acts::UnitConstants::degree,
"Theta angular resolution"}

Definition at line 58 of file TrackParamsEstimationTool.h.


The documentation for this class was generated from the following files:
ActsTrk::TrackParamsEstimationTool::m_sigmaLoc0
Gaudi::Property< double > m_sigmaLoc0
Definition: TrackParamsEstimationTool.h:52
ActsTrk::TrackParamsEstimationTool::m_extrapolator
std::optional< Extrapolator > m_extrapolator
Definition: TrackParamsEstimationTool.h:73
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
ATLASMagneticFieldWrapper
Definition: ATLASMagneticFieldWrapper.h:15
ActsTrk::TrackParamsEstimationTool::m_initialSigmaPtRel
Gaudi::Property< double > m_initialSigmaPtRel
Definition: TrackParamsEstimationTool.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ActsTrk::TrackParamsEstimationTool::m_initialVarInflation
Gaudi::Property< std::vector< double > > m_initialVarInflation
Definition: TrackParamsEstimationTool.h:66
ActsTrk::TrackParamsEstimationTool::Extrapolator
Acts::Propagator< Stepper > Extrapolator
Definition: TrackParamsEstimationTool.h:71
ActsTrk::TrackParamsEstimationTool::m_sigmaTheta
Gaudi::Property< double > m_sigmaTheta
Definition: TrackParamsEstimationTool.h:58
xAOD::pion
@ pion
Definition: TrackingPrimitives.h:197
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
ATLASMagneticFieldWrapper::makeCache
MagneticFieldProvider::Cache makeCache(const Acts::MagneticFieldContext &mctx) const override
Definition: ATLASMagneticFieldWrapper.h:34
ActsTrk::TrackParamsEstimationTool::estimateTrackParameters
virtual std::optional< Acts::BoundTrackParameters > estimateTrackParameters(const ActsTrk::Seed &seed, bool useTopSp, const Acts::GeometryContext &geoContext, const Acts::MagneticFieldContext &magFieldContext, std::function< const Acts::Surface &(const ActsTrk::Seed &seed, bool useTopSp)> retrieveSurface) const override
Definition: TrackParamsEstimationTool.cxx:38
DeMoUpdate.reverse
reverse
Definition: DeMoUpdate.py:563
ActsTrk::TrackParamsEstimationTool::m_sigmaLoc1
Gaudi::Property< double > m_sigmaLoc1
Definition: TrackParamsEstimationTool.h:54
ActsTrk::TrackParamsEstimationTool::Navigator
Acts::VoidNavigator Navigator
Definition: TrackParamsEstimationTool.h:70
makeActsAthenaLogger
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Definition: Tracking/Acts/ActsInterop/src/Logger.cxx:64
ActsTrk::TrackParamsEstimationTool::m_sigmaPhi
Gaudi::Property< double > m_sigmaPhi
Definition: TrackParamsEstimationTool.h:56
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
Acts
Definition: ChamberAssembleTool.h:18
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ActsTrk::TrackParamsEstimationTool::Stepper
Acts::SympyStepper Stepper
Definition: TrackParamsEstimationTool.h:69
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::TrackParamsEstimationTool::m_logger
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Definition: TrackParamsEstimationTool.h:82
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
ATLASMagneticFieldWrapper::getField
Acts::Result< Acts::Vector3 > getField(const Acts::Vector3 &position, Acts::MagneticFieldProvider::Cache &gcache) const override
Definition: ATLASMagneticFieldWrapper.h:39
ActsTrk::TrackParamsEstimationTool::m_sigmaT0
Gaudi::Property< double > m_sigmaT0
Definition: TrackParamsEstimationTool.h:62
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
ActsTrk::TrackParamsEstimationTool::logger
const Acts::Logger & logger() const
Private access to the logger.
Definition: TrackParamsEstimationTool.h:76
ActsTrk::TrackParamsEstimationTool::m_sigmaQOverP
Gaudi::Property< double > m_sigmaQOverP
Definition: TrackParamsEstimationTool.h:60
python.SystemOfUnits.degree
tuple degree
Definition: SystemOfUnits.py:106