ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::AuxiliaryMeasurementHandler Class Reference

Utility class to handle the creation of the Auxiliary measurement used in an Acts track fit This class declares the additionally written xAOD::AuxiliaryMeasurementContainers to the AvalancheScheduler. More...

#include <AuxiliaryMeasurementHandler.h>

Collaboration diagram for ActsTrk::AuxiliaryMeasurementHandler:

Classes

class  MeasurementProvider
 Helper struct to create a new pseudo measurement. More...

Public Types

enum class  HandleStatus : std::uint8_t { ok = 0 , emptyKey = 1 , recordFail = 2 }
using SurfacePtr_t = xAOD::AuxiliaryMeasurement::SurfacePtr_t
using HandleReturn_t = Acts::Result<MeasurementProvider, HandleStatus>

Public Member Functions

template<class PropOwner>
 AuxiliaryMeasurementHandler (PropOwner *owner)
 Constructor taking the pointer to the class holding the object used to declare the data dependency from the WriteHandleKeys to the AvalancheScheduler.
StatusCode initialize (const std::string &preFix, bool used=true)
 Initialize the write handle keys.
HandleReturn_t makeHandle (const EventContext &ctx, const Acts::GeometryContext &gctx) const
 Creates a new MeasurementProvider and triggers the write of the container backend to StoreGate.

Private Types

using Key_t = SG::WriteHandleKey<xAOD::AuxiliaryMeasurementContainer>

Private Member Functions

MsgStream & msg (const MSG::Level lvl) const
 Return the reference to the msg logging stream.
bool msgLvl (const MSG::Level lvl) const
 Returns whether the stream satisfies the logging level.

Private Attributes

std::function< MsgStream &(const MSG::Level)> m_msgPrinter {}
 Lambda to access the parent's msg stream.
std::function< bool(const MSG::Level)> m_msgLevel {}
 Lambda to return the msg level from the parent's msg stream.
Key_t m_writeKey1D
 Key to write the 1D measurements.
Key_t m_writeKey2D
 Key to write the 2D measurements.
Key_t m_writeKey3D
 Key to write the 2D + time measurements.
SG::WriteHandleKey< xAOD::TrackSurfaceContainerm_surfaceKey
 Key to write the surfaces associated to the measurements.

Detailed Description

Utility class to handle the creation of the Auxiliary measurement used in an Acts track fit This class declares the additionally written xAOD::AuxiliaryMeasurementContainers to the AvalancheScheduler.

Per event, the user creates an instance of the MeasurementProvider which setups the storage backend for the measurements and writes the containers to StoreGate. Auxiliary measurements are created by calling the newMeasurement method.

Definition at line 22 of file AuxiliaryMeasurementHandler.h.

Member Typedef Documentation

◆ HandleReturn_t

◆ Key_t

◆ SurfacePtr_t

Member Enumeration Documentation

◆ HandleStatus

enum class ActsTrk::AuxiliaryMeasurementHandler::HandleStatus : std::uint8_t
strong
Enumerator
ok 
emptyKey 
recordFail 

Definition at line 93 of file AuxiliaryMeasurementHandler.h.

93 : std::uint8_t{
94 ok = 0,
95 emptyKey = 1,
96 recordFail = 2,
97 };

Constructor & Destructor Documentation

◆ AuxiliaryMeasurementHandler()

template<class PropOwner>
ActsTrk::AuxiliaryMeasurementHandler::AuxiliaryMeasurementHandler ( PropOwner * owner)

Constructor taking the pointer to the class holding the object used to declare the data dependency from the WriteHandleKeys to the AvalancheScheduler.

The object should be defined in the header like ActsTrk::AuxiliaryMeasurementHandler m_pseudoHandle{this};

Member Function Documentation

◆ initialize()

StatusCode ActsTrk::AuxiliaryMeasurementHandler::initialize ( const std::string & preFix,
bool used = true )

Initialize the write handle keys.

Parameters
preFixCommon prefix to be put in front of all keys
usedFlag indicating whether the auxiliary keys are used at all

Definition at line 25 of file AuxiliaryMeasurementHandler.cxx.

26 {
27 if (preFix.empty()) {
28 ATH_MSG_ERROR("The prefix key of the auxiliary measurements must no be empty");
29 return StatusCode::FAILURE;
30 }
31 m_surfaceKey = std::format("{:}AuxiliarySurfaceContainer", preFix);
32 if (!m_surfaceKey.initialize(used).isSuccess()) {
33 ATH_MSG_ERROR("Failed to initialize "<<m_surfaceKey.fullKey());
34 return StatusCode::FAILURE;
35 }
36 unsigned counter{1};
37
38 for (auto& initMe : {&m_writeKey1D, &m_writeKey2D, &m_writeKey3D}){
39 (*initMe) = std::format("{:}AuxiliaryMeasContainer{:}D", preFix, counter++);
40 if (!initMe->initialize(used).isSuccess()) {
41 ATH_MSG_ERROR("Failed to initialize "<<(*initMe).fullKey());
42 return StatusCode::FAILURE;
43 }
44 }
45 return StatusCode::SUCCESS;
46 }
#define ATH_MSG_ERROR(x)
Key_t m_writeKey2D
Key to write the 2D measurements.
Key_t m_writeKey1D
Key to write the 1D measurements.
Key_t m_writeKey3D
Key to write the 2D + time measurements.
SG::WriteHandleKey< xAOD::TrackSurfaceContainer > m_surfaceKey
Key to write the surfaces associated to the measurements.

◆ makeHandle()

AuxiliaryMeasurementHandler::HandleReturn_t ActsTrk::AuxiliaryMeasurementHandler::makeHandle ( const EventContext & ctx,
const Acts::GeometryContext & gctx ) const

Creates a new MeasurementProvider and triggers the write of the container backend to StoreGate.

The user needs to provide a reference to a mutable xAOD::TrackSurfaceContainer where the persistified surfaces are appended to. The client needs to ensure that the lifetime of the surface container prevails the provider's lifetime.

Parameters
ctxEventContext to write the containers to store gate
gctxThe geometry context to place the surface in space

Definition at line 68 of file AuxiliaryMeasurementHandler.cxx.

69 {
70 if (m_surfaceKey.empty()) {
72 }
73 MeasurementProvider newHandle{ctx, gctx, this};
74 if (!newHandle.setupContainers().isSuccess()) {
76 }
77 return HandleReturn_t{std::move(newHandle)};
78 }
Helper struct to create a new pseudo measurement.
Acts::Result< MeasurementProvider, HandleStatus > HandleReturn_t

◆ msg()

MsgStream & ActsTrk::AuxiliaryMeasurementHandler::msg ( const MSG::Level lvl) const
private

Return the reference to the msg logging stream.

Parameters
lvlLogging level to be applied

Definition at line 18 of file AuxiliaryMeasurementHandler.cxx.

18 {
19 return m_msgPrinter(lvl);
20 }
std::function< MsgStream &(const MSG::Level)> m_msgPrinter
Lambda to access the parent's msg stream.

◆ msgLvl()

bool ActsTrk::AuxiliaryMeasurementHandler::msgLvl ( const MSG::Level lvl) const
private

Returns whether the stream satisfies the logging level.

Definition at line 22 of file AuxiliaryMeasurementHandler.cxx.

22 {
23 return m_msgLevel(lvl);
24 }
std::function< bool(const MSG::Level)> m_msgLevel
Lambda to return the msg level from the parent's msg stream.

Member Data Documentation

◆ m_msgLevel

std::function<bool(const MSG::Level)> ActsTrk::AuxiliaryMeasurementHandler::m_msgLevel {}
private

Lambda to return the msg level from the parent's msg stream.

Definition at line 116 of file AuxiliaryMeasurementHandler.h.

116{};

◆ m_msgPrinter

std::function<MsgStream&(const MSG::Level)> ActsTrk::AuxiliaryMeasurementHandler::m_msgPrinter {}
private

Lambda to access the parent's msg stream.

Definition at line 114 of file AuxiliaryMeasurementHandler.h.

114{};

◆ m_surfaceKey

SG::WriteHandleKey<xAOD::TrackSurfaceContainer> ActsTrk::AuxiliaryMeasurementHandler::m_surfaceKey
private

Key to write the surfaces associated to the measurements.

Definition at line 124 of file AuxiliaryMeasurementHandler.h.

◆ m_writeKey1D

Key_t ActsTrk::AuxiliaryMeasurementHandler::m_writeKey1D
private

Key to write the 1D measurements.

Definition at line 118 of file AuxiliaryMeasurementHandler.h.

◆ m_writeKey2D

Key_t ActsTrk::AuxiliaryMeasurementHandler::m_writeKey2D
private

Key to write the 2D measurements.

Definition at line 120 of file AuxiliaryMeasurementHandler.h.

◆ m_writeKey3D

Key_t ActsTrk::AuxiliaryMeasurementHandler::m_writeKey3D
private

Key to write the 2D + time measurements.

Definition at line 122 of file AuxiliaryMeasurementHandler.h.


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