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;
84 using namespace MetDef;
86 dec_constitObjLinks(
met.getXAODObject()) = std::vector<iplink_t>(0);
87 m_uniqueLinks = &dec_constitObjLinks(
met.getXAODObject());
88 m_uniqueLinks->reserve (container.size());
89 if (decorator.writeWeights)
91 dec_constitObjWeights(
met.getXAODObject()) = std::vector<float>(0);
92 m_uniqueWeights = &dec_constitObjWeights(
met.getXAODObject());
93 m_uniqueWeights->reserve (container.size());
97 m_collectionSgKey =
tool.getKey(&container.getXAODObject());
98 if(m_collectionSgKey == 0) {
100 message <<
"Could not get the SG key for the collection with pointer: "
101 << &container.getXAODObject();
102 throw std::runtime_error(
message.str());
108 return m_uniqueLinks->size();}
114 if(m_collectionSgKey == 0) {
120 emplace_back (objLink,
weight);
130 std::vector<iplink_t>* m_uniqueLinks =
nullptr;
131 std::vector<float>* m_uniqueWeights =
nullptr;
134 return *m_uniqueLinks;}
136 if (!m_uniqueWeights)
137 throw std::runtime_error (
"weights not enabled");
138 return *m_uniqueWeights;}
141 m_uniqueLinks->emplace_back (link);
143 m_uniqueWeights->emplace_back (
weight);}
158 if (!decorator.weightDec.isAvailable(container))
159 throw std::runtime_error (
"weights column not provided");
161 m_weights = decorator.weightDec(container);
162 for (
auto&
weight : m_weights)
164 m_offset = container.beginIndex();
170 for (
auto weight : m_weights)
188 std::size_t m_offset = 0;