8#ifndef COLUMNAR_MET_MET_OUTPUT_H
9#define COLUMNAR_MET_MET_OUTPUT_H
31 template<ContainerIdConcept CI_MET=ContainerId::mutableMet,ContainerIdConcept CI_OBJ=ContainerId::particle,
typename CM=ColumnarModeDefault>
class ObjectWeightDecorator;
70 template<ContainerIdConcept CI_MET=ContainerId::mutableMet,ContainerIdConcept CI_OBJ=ContainerId::particle,
typename CM=ColumnarModeDefault>
class ObjectWeightHandle;
86 dec_constitObjLinks(
met.getXAODObject()) = std::vector<iplink_t>(0);
89 if (decorator.writeWeights)
91 dec_constitObjWeights(
met.getXAODObject()) = std::vector<float>(0);
99 std::ostringstream message;
100 message <<
"Could not get the SG key for the collection with pointer: "
102 throw std::runtime_error(message.str());
116 objLink =
iplink_t(*ipc, particle.getXAODObject().index());
137 throw std::runtime_error (
"weights not enabled");
158 if (!decorator.weightDec.isAvailable(
container))
159 throw std::runtime_error (
"weights column not provided");
ElementLink< xAOD::IParticleContainer > iplink_t
ElementLink implementation for ROOT usage.
ObjectWeightDecorator(ColumnarTool< CM > &columnarBase, const std::string &weightSuffix, bool)
ColumnDecorator< CI_OBJ, float, CM > weightDec
ObjectWeightDecorator(ColumnarTool< CM > &, const std::string &, bool val_writeWeights)
a special "decorator" for decorating the weight an object contributes to a MET term
void emplace_back(const ObjectId< CI_OBJ, CM > &particle, float weight)
std::span< float > m_weights
std::size_t size() const noexcept
ObjectWeightHandle(const asg::AsgTool &, const ObjectWeightDecorator< CI_MET, CI_OBJ, CM > &decorator, ObjectId< CI_MET, CM >, const ObjectRange< CI_OBJ, CM > &container)
MetDef::iplink_t iplink_t
void emplace_back(const iplink_t &link, float weight)
std::vector< iplink_t > * m_uniqueLinks
void emplace_back(const ObjectId< CI_OBJ, CM > &particle, float weight)
std::vector< float > * m_uniqueWeights
ObjectWeightHandle(const asg::AsgTool &tool, const ObjectWeightDecorator< CI_MET, CI_OBJ, CM > &decorator, ObjectId< CI_MET, CM > met, const ObjectRange< CI_OBJ, CM > &container)
std::vector< float > & uniqueWeights()
std::size_t size() const noexcept
SG::sgkey_t m_collectionSgKey
std::vector< iplink_t > & uniqueLinks() noexcept
a "handle" for recording object weights via ObjectWeightDecorator
a class representing a single object (electron, muons, etc.)
a class representing a continuous sequence of objects (a.k.a. a container)
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
@ OWN_ELEMENTS
this data object owns its elements
ElementLink< xAOD::IParticleContainer > iplink_t
AccessorTemplate< CI, CT, ColumnAccessMode::output, CM > ColumnDecorator
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.