ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ActsTrk::MutableTrackContainerHandlesHelper Class Reference

#include <TrackContainerHandlesHelper.h>

Collaboration diagram for ActsTrk::MutableTrackContainerHandlesHelper:

Public Member Functions

StatusCode initialize (const std::string &prefix)
 Sets up the handles. More...
 
std::unique_ptr< ActsTrk::TrackContainermoveToConst (ActsTrk::MutableTrackContainer &&tc, const Acts::GeometryContext &geoContext, const EventContext &evtContext) const
 produces ActsTrk::ConstTrackContainer with all backends stored in SG More...
 

Private Member Functions

std::unique_ptr< ActsTrk::MultiTrajectorymoveToConst (ActsTrk::MutableMultiTrajectory &&mmtj, const EventContext &context) const
 helper to record MTJ More...
 

Private Attributes

SG::WriteHandleKey< xAOD::TrackStateContainerm_statesKey
 
SG::WriteHandleKey< xAOD::TrackParametersContainerm_parametersKey
 
SG::WriteHandleKey< xAOD::TrackJacobianContainerm_jacobiansKey
 
SG::WriteHandleKey< xAOD::TrackMeasurementContainerm_measurementsKey
 
SG::WriteHandleKey< xAOD::TrackSurfaceContainerm_surfacesKey
 
SG::WriteHandleKey< ActsTrk::MultiTrajectorym_mtjKey
 
SG::WriteHandleKey< xAOD::TrackSummaryContainerm_xAODTrackSummaryKey
 
SG::WriteHandleKey< xAOD::TrackSurfaceContainerm_trackSurfacesKey
 
SG::WriteHandleKey< ActsTrk::TrackSummaryContainerm_trackSummaryKey
 

Detailed Description

Definition at line 33 of file TrackContainerHandlesHelper.h.

Member Function Documentation

◆ initialize()

StatusCode ActsTrk::MutableTrackContainerHandlesHelper::initialize ( const std::string &  prefix)

Sets up the handles.

  • prefix - common prefix for all the names the value would typically be taken from configurable string property

Definition at line 51 of file TrackContainerHandlesHelper.cxx.

52  {
53  m_statesKey = prefix + "TrackStates";
54  m_parametersKey = prefix + "TrackParameters";
55  m_jacobiansKey = prefix + "TrackJacobians";
56  m_measurementsKey = prefix + "TrackMeasurements";
57  m_surfacesKey = prefix + "TrackStateSurfaces";
58  m_mtjKey =
59  prefix + "MultiTrajectory"; // identical names, underlying types are distinct
60  INIT_CHECK(m_statesKey);
61  INIT_CHECK(m_parametersKey);
62  INIT_CHECK(m_jacobiansKey);
63  INIT_CHECK(m_measurementsKey);
64  INIT_CHECK(m_surfacesKey);
65  INIT_CHECK(m_mtjKey);
66 
67  // Track Container backends
68  m_xAODTrackSummaryKey = prefix + "TrackSummary";
69  m_trackSurfacesKey = prefix + "TrackSurfaces";
71  prefix +
72  "TrackSummary"; // identical names, underlying types are distinct
73 
74  INIT_CHECK(m_xAODTrackSummaryKey);
75  INIT_CHECK(m_trackSurfacesKey);
76  INIT_CHECK(m_trackSummaryKey);
77  return StatusCode::SUCCESS;
78 }

◆ moveToConst() [1/2]

std::unique_ptr< ActsTrk::MultiTrajectory > ActsTrk::MutableTrackContainerHandlesHelper::moveToConst ( ActsTrk::MutableMultiTrajectory &&  mmtj,
const EventContext &  context 
) const
private

helper to record MTJ

Definition at line 81 of file TrackContainerHandlesHelper.cxx.

82  {
83 
84  mmtj.trim();
85 
86  auto statesBackendHandle = SG::makeHandle(m_statesKey, evtContext);
87  auto statesInterface =
88  ActsTrk::makeInterfaceContainer<xAOD::TrackStateContainer>(
89  mmtj.trackStatesAux());
90  recordxAOD(m_statesKey, statesInterface, mmtj.m_trackStatesAux, evtContext);
91 
92  auto parametersInterface =
93  ActsTrk::makeInterfaceContainer<xAOD::TrackParametersContainer>(
94  mmtj.trackParametersAux());
95  recordxAOD(m_parametersKey, parametersInterface, mmtj.m_trackParametersAux, evtContext);
96 
97  auto jacobiansInterface =
98  ActsTrk::makeInterfaceContainer<xAOD::TrackJacobianContainer>(
99  mmtj.trackJacobiansAux());
100  recordxAOD(m_jacobiansKey, jacobiansInterface, mmtj.m_trackJacobiansAux, evtContext);
101 
102  auto measurementsInterface =
103  ActsTrk::makeInterfaceContainer<xAOD::TrackMeasurementContainer>(
104  mmtj.trackMeasurementsAux());
105  recordxAOD(m_measurementsKey, measurementsInterface, mmtj.m_trackMeasurementsAux, evtContext);
106 
107  auto surfacesBackendHandle = SG::makeHandle(m_surfacesKey, evtContext);
109 
110  // construct const MTJ version
111  auto cmtj = std::make_unique<ActsTrk::MultiTrajectory>(
113  evtContext),
115  m_parametersKey.key() + "Aux.", evtContext),
117  m_jacobiansKey.key() + "Aux.", evtContext),
119  m_measurementsKey.key() + "Aux.", evtContext),
121  m_surfacesKey.key() + "Aux.", evtContext)
122  );
123  cmtj->moveSurfaces(&mmtj);
124  cmtj->moveLinks(&mmtj);
125 
126  return cmtj;
127 }

◆ moveToConst() [2/2]

std::unique_ptr< ActsTrk::TrackContainer > ActsTrk::MutableTrackContainerHandlesHelper::moveToConst ( ActsTrk::MutableTrackContainer &&  tc,
const Acts::GeometryContext &  geoContext,
const EventContext &  evtContext 
) const

produces ActsTrk::ConstTrackContainer with all backends stored in SG

  • tc - MutableTrackContainer the source (will be disassembled after the operation)
  • - geoContext - geometry context, needed in surfaces conversion
  • evtContext - event context (needed for SG operations)

Definition at line 130 of file TrackContainerHandlesHelper.cxx.

131  {
132 
133 
134  std::unique_ptr<ActsTrk::MultiTrajectory> constMtj =
135  moveToConst(std::move(tc.trackStateContainer()), evtContext);
136 
137  auto constMtjHandle = SG::makeHandle(m_mtjKey, evtContext);
138  if (constMtjHandle.record(std::move(constMtj)).isFailure()) {
139  throw std::runtime_error(
140  "MutableTrackContainerHandlesHelper::moveToConst, can't record "
141  "ConstMultiTrajectory");
142  }
143 
144  auto trackSurfacesAux = std::make_unique<xAOD::TrackSurfaceAuxContainer>();
145  tc.container().encodeSurfaces(trackSurfacesAux.get(), geoContext);
146 
147  auto interfaceTrackSummaryContainer =
148  ActsTrk::makeInterfaceContainer<xAOD::TrackSummaryContainer>(
149  tc.container().m_mutableTrackBackendAux.get());
150  recordxAOD(m_xAODTrackSummaryKey, interfaceTrackSummaryContainer, tc.container().m_mutableTrackBackendAux, evtContext);
151 
152  auto trackSurfaces = ActsTrk::makeInterfaceContainer<xAOD::TrackSurfaceContainer>(
153  trackSurfacesAux.get());
154  recordxAOD(m_trackSurfacesKey, trackSurfaces, trackSurfacesAux, evtContext);
155 
156  auto constTrackSummary = std::make_unique<ActsTrk::TrackSummaryContainer>(
158  evtContext));
159  constTrackSummary->restoreDecorations();
160  constTrackSummary->fillFrom(tc.container());
161 
162  auto constTrackSummaryHandle = SG::makeHandle(m_trackSummaryKey, evtContext);
163  if (constTrackSummaryHandle.record(std::move(constTrackSummary))
164  .isFailure()) {
165  throw std::runtime_error(
166  "MutableTrackContainerHandlesHelper::moveToConst, can't record "
167  "TrackSummary");
168  }
169  auto constTrack = std::make_unique<ActsTrk::TrackContainer>(
171  evtContext),
173  return constTrack;
174 }

Member Data Documentation

◆ m_jacobiansKey

SG::WriteHandleKey<xAOD::TrackJacobianContainer> ActsTrk::MutableTrackContainerHandlesHelper::m_jacobiansKey
private

Definition at line 58 of file TrackContainerHandlesHelper.h.

◆ m_measurementsKey

SG::WriteHandleKey<xAOD::TrackMeasurementContainer> ActsTrk::MutableTrackContainerHandlesHelper::m_measurementsKey
private

Definition at line 59 of file TrackContainerHandlesHelper.h.

◆ m_mtjKey

SG::WriteHandleKey<ActsTrk::MultiTrajectory> ActsTrk::MutableTrackContainerHandlesHelper::m_mtjKey
private

Definition at line 61 of file TrackContainerHandlesHelper.h.

◆ m_parametersKey

SG::WriteHandleKey<xAOD::TrackParametersContainer> ActsTrk::MutableTrackContainerHandlesHelper::m_parametersKey
private

Definition at line 57 of file TrackContainerHandlesHelper.h.

◆ m_statesKey

SG::WriteHandleKey<xAOD::TrackStateContainer> ActsTrk::MutableTrackContainerHandlesHelper::m_statesKey
private

Definition at line 56 of file TrackContainerHandlesHelper.h.

◆ m_surfacesKey

SG::WriteHandleKey<xAOD::TrackSurfaceContainer> ActsTrk::MutableTrackContainerHandlesHelper::m_surfacesKey
private

Definition at line 60 of file TrackContainerHandlesHelper.h.

◆ m_trackSummaryKey

SG::WriteHandleKey<ActsTrk::TrackSummaryContainer> ActsTrk::MutableTrackContainerHandlesHelper::m_trackSummaryKey
private

Definition at line 73 of file TrackContainerHandlesHelper.h.

◆ m_trackSurfacesKey

SG::WriteHandleKey<xAOD::TrackSurfaceContainer> ActsTrk::MutableTrackContainerHandlesHelper::m_trackSurfacesKey
private

Definition at line 72 of file TrackContainerHandlesHelper.h.

◆ m_xAODTrackSummaryKey

SG::WriteHandleKey<xAOD::TrackSummaryContainer> ActsTrk::MutableTrackContainerHandlesHelper::m_xAODTrackSummaryKey
private

Definition at line 71 of file TrackContainerHandlesHelper.h.


The documentation for this class was generated from the following files:
ActsTrk::MutableTrackContainerHandlesHelper::m_trackSummaryKey
SG::WriteHandleKey< ActsTrk::TrackSummaryContainer > m_trackSummaryKey
Definition: TrackContainerHandlesHelper.h:73
ActsTrk::MutableMultiTrajectory::trackJacobiansAux
xAOD::TrackJacobianAuxContainer * trackJacobiansAux()
Definition: MultiTrajectory.h:364
ActsTrk::MutableTrackContainerHandlesHelper::moveToConst
std::unique_ptr< ActsTrk::TrackContainer > moveToConst(ActsTrk::MutableTrackContainer &&tc, const Acts::GeometryContext &geoContext, const EventContext &evtContext) const
produces ActsTrk::ConstTrackContainer with all backends stored in SG
Definition: TrackContainerHandlesHelper.cxx:130
ActsTrk::MutableTrackContainerHandlesHelper::m_mtjKey
SG::WriteHandleKey< ActsTrk::MultiTrajectory > m_mtjKey
Definition: TrackContainerHandlesHelper.h:61
ActsTrk::MutableMultiTrajectory::m_trackParametersAux
std::unique_ptr< xAOD::TrackParametersAuxContainer > m_trackParametersAux
Definition: MultiTrajectory.h:385
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
ActsTrk::recordxAOD
void recordxAOD(const SG::WriteHandleKey< T > &key, IFACE &iface, AUX &aux, const EventContext &evtContext)
Definition: TrackContainerHandlesHelper.cxx:32
ActsTrk::MutableTrackContainerHandlesHelper::m_trackSurfacesKey
SG::WriteHandleKey< xAOD::TrackSurfaceContainer > m_trackSurfacesKey
Definition: TrackContainerHandlesHelper.h:72
ActsTrk::MutableMultiTrajectory::trackMeasurementsAux
xAOD::TrackMeasurementAuxContainer * trackMeasurementsAux()
Definition: MultiTrajectory.h:368
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
ActsTrk::MutableMultiTrajectory::trackParametersAux
const xAOD::TrackParametersAuxContainer * trackParametersAux() const
Definition: MultiTrajectory.h:357
ActsTrk::MutableMultiTrajectory::m_trackMeasurementsAux
std::unique_ptr< xAOD::TrackMeasurementAuxContainer > m_trackMeasurementsAux
Definition: MultiTrajectory.h:391
ActsTrk::MutableTrackContainerHandlesHelper::m_parametersKey
SG::WriteHandleKey< xAOD::TrackParametersContainer > m_parametersKey
Definition: TrackContainerHandlesHelper.h:57
ActsTrk::MutableMultiTrajectory::m_surfacesBackendAux
std::unique_ptr< xAOD::TrackSurfaceAuxContainer > m_surfacesBackendAux
Definition: MultiTrajectory.h:395
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
ActsTrk::MutableMultiTrajectory::trim
void trim()
Definition: MultiTrajectory.cxx:562
ActsTrk::MutableTrackContainerHandlesHelper::m_xAODTrackSummaryKey
SG::WriteHandleKey< xAOD::TrackSummaryContainer > m_xAODTrackSummaryKey
Definition: TrackContainerHandlesHelper.h:71
ActsTrk::MutableTrackContainerHandlesHelper::m_surfacesKey
SG::WriteHandleKey< xAOD::TrackSurfaceContainer > m_surfacesKey
Definition: TrackContainerHandlesHelper.h:60
ActsTrk::MutableMultiTrajectory::m_trackStatesAux
std::unique_ptr< xAOD::TrackStateAuxContainer > m_trackStatesAux
Definition: MultiTrajectory.h:382
ActsTrk::MutableTrackContainerHandlesHelper::m_jacobiansKey
SG::WriteHandleKey< xAOD::TrackJacobianContainer > m_jacobiansKey
Definition: TrackContainerHandlesHelper.h:58
ActsTrk::MutableMultiTrajectory::m_surfacesBackend
std::unique_ptr< xAOD::TrackSurfaceContainer > m_surfacesBackend
Definition: MultiTrajectory.h:394
ActsTrk::MutableMultiTrajectory::trackStatesAux
xAOD::TrackStateAuxContainer * trackStatesAux()
Definition: MultiTrajectory.h:355
ActsTrk::MutableTrackContainerHandlesHelper::m_measurementsKey
SG::WriteHandleKey< xAOD::TrackMeasurementContainer > m_measurementsKey
Definition: TrackContainerHandlesHelper.h:59
ActsTrk::MutableMultiTrajectory::m_trackJacobiansAux
std::unique_ptr< xAOD::TrackJacobianAuxContainer > m_trackJacobiansAux
Definition: MultiTrajectory.h:388
ActsTrk::MutableTrackContainerHandlesHelper::m_statesKey
SG::WriteHandleKey< xAOD::TrackStateContainer > m_statesKey
Definition: TrackContainerHandlesHelper.h:56