14#include "AthLinks/ElementLink.h"
22 ATH_MSG_DEBUG(
"Initializing xAODTrackStateAuxContainerCnv ...");
29 using const_span = std::span<T const>;
31 template <
typename T,
typename T_AuxContainer>
32 const_span<T> getElementVector(
const T_AuxContainer &aux_container,
const SG::ConstAccessor<T> &accessor) {
33 const T *
data =
static_cast<const T *
>(aux_container.getData (accessor.auxid()));
34 const_span<T> ret(
data, aux_container.size() );
37 template <
typename T,
typename T_AuxContainer>
38 std::span<T> createDecoration(T_AuxContainer &aux_container,
const SG::Decorator<T> &decor) {
39 std::size_t
sz=aux_container.size();
40 T *
data =
static_cast<T *
>(aux_container.getDecoration(decor.
auxid(),
sz,
sz));
41 return std::span<T>(
data,
sz );
46 const std::string& key )
49 static char const*
const NAME =
50 "std::vector<ElementLink<xAOD::UncalibratedMeasurementContainer> >";
51 static TClass
const*
const cls = TClass::GetClass( NAME );
53 ATH_MSG_ERROR(
"Couldn't load dictionary for type: " << NAME );
57 std::unique_ptr< xAOD::TrackStateAuxContainer >
result
64 const_span<const xAOD::UncalibratedMeasurement*>
65 uncalibratedMeasurements = getElementVector(*trans, uncalibMeasurement_acc);
68 std::span<
decltype(link_decor)::element_type> links = createDecoration(*
result, link_decor);
70 assert( links.size() == uncalibratedMeasurements.size() );
72 for (
unsigned int index =0;
index < uncalibratedMeasurements.size(); ++
index) {
77 measurement->
index());
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
bool test(bit_t bit) const
Test to see if a bit is set.
const SG::AuxVectorData * container() const
Return the container holding this element.
size_t index() const
Return the index of this element within its container.
Helper class to provide constant type-safe access to aux data.
SG::auxid_t auxid() const
Return the aux id for this variable.
Helper class to provide type-safe access to aux data.
SG::auxid_t auxid() const
Return the aux id for this variable.
virtual xAOD::TrackStateAuxContainer * createPersistentWithKey(xAOD::TrackStateAuxContainer *trans, const std::string &key) override
virtual StatusCode initialize()
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
xAODTrackStateAuxContainerCnv(ISvcLocator *svcLoc)
virtual xAOD::TrackStateAuxContainer * createPersistentWithKey(xAOD::TrackStateAuxContainer *trans, const std::string &key) override
Convert a transient object to persistent form.
virtual const auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.
TrackStateAuxContainer_v1 TrackStateAuxContainer
UncalibratedMeasurementContainer_v1 UncalibratedMeasurementContainer
Define the version of the uncalibrated measurement container.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
T_AthenaPoolAuxContainerCnv< xAOD::TrackStateAuxContainer > xAODTrackStateAuxContainerCnvBase