4#ifndef XAODMUONVIEWS_CONTAINERDECORATOR_H
5#define XAODMUONVIEWS_CONTAINERDECORATOR_H
11#include <unordered_set>
17 template<detail::PrimaryContainerConcept Cont_t,
typename dType>
31 const EventContext& ctx,
32 dType defValue = {}) {
49 const EventContext& ctx,
50 dType defValue = {}) {
66 THROW_EXCEPTION(
"No decorator has been defined. Please use initialize() beforhand");
95 std::unordered_set<const SG::AuxElement*>
m_seenAux{};
104 template<detail::PrimaryContainerConcept Cont_t,
typename dType>
106 const EventContext& ctx,
107 dType defValue = {}) {
108 std::vector<ContainerDecorator<Cont_t, dType>> retMe{};
109 for (
const SG::WriteDecorHandleKey<Cont_t>& key : keyArray) {
110 retMe.emplace_back(key, ctx, defValue);
Base class for elements of a container that can have aux data.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
void initDefault()
Decorate the default value to all elements in the container.
const Cont_t * container() const
Returns the underlying container.
dType & operator()(const SG::AuxElement &auxElem)
Access the decoration value.
constexpr bool isValid() const
Returns whether the handle is instantiated.
const Cont_t * operator->() const
Returns the pointer to the underlying container.
~ContainerDecorator()
Destructor.
ContainerDecorator()=default
Empty default constructor.
ContainerDecorator(ContainerDecorator &&other)=default
Default move constructor.
SG::WriteDecorHandle< Cont_t, dType > Handle_t
ContainerDecorator & operator=(ContainerDecorator &&other)=default
Default move assignment operator.
std::unique_ptr< Handle_t > m_decorHandle
ContainerDecorator(const SG::WriteDecorHandleKey< Cont_t > &key, const EventContext &ctx, dType defValue={})
Construct the decorator with an initialized decorHandleKey, and the current EventContext.
std::unordered_set< const SG::AuxElement * > m_seenAux
void initialize(const SG::WriteDecorHandleKey< Cont_t > &key, const EventContext &ctx, dType defValue={})
Instantiate the handle.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
std::vector< ContainerDecorator< Cont_t, dType > > createDecorators(const SG::WriteDecorHandleKeyArray< Cont_t > &keyArray, const EventContext &ctx, dType defValue={})
Factory method for a vector of ContainerDecorators instantiated from a WriteDecorHandleKeyArray.
setBGCode setTAP setLVL2ErrorBits bool
#define THROW_EXCEPTION(MESSAGE)