3#ifndef EDM4EIC_MCRecoClusterParticleAssociationCollection_H
4#define EDM4EIC_MCRecoClusterParticleAssociationCollection_H
14#include "podio/ICollectionProvider.h"
15#include "podio/CollectionBase.h"
16#include "podio/CollectionIDTable.h"
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
48 return m_index != x.m_index;
52 return m_index == x.m_index;
74 return m_index != x.m_index;
78 return m_index == x.m_index;
112 constexpr static auto typeName =
"edm4eic::MCRecoClusterParticleAssociationCollection";
113 constexpr static auto valueTypeName =
"edm4eic::MCRecoClusterParticleAssociation";
114 constexpr static auto dataTypeName =
"edm4eic::MCRecoClusterParticleAssociationData";
119 void print(std::ostream& os=std::cout,
bool flush=true) const final;
129 template<
typename... Args>
133 std::size_t
size() const final;
136 bool empty() const final;
148 return m_isSubsetColl;
177 if (!m_isSubsetColl) {
186 return m_collectionID;
193 size_t getDatamodelRegistryIndex() const final;
197 return iterator(0, &m_storage.entries);
203 return iterator(m_storage.entries.size(), &m_storage.entries);
206 return const_iterator(m_storage.entries.size(), &m_storage.entries);
209 std::vector<std::uint32_t> simID(
const size_t nElem = 0)
const;
210 std::vector<std::uint32_t> recID(
const size_t nElem = 0)
const;
211 std::vector<float> weight(
const size_t nElem = 0)
const;
219 bool m_isValid{
false};
220 mutable bool m_isPrepared{
false};
221 bool m_isSubsetColl{
false};
222 uint32_t m_collectionID{0};
223 mutable std::unique_ptr<std::mutex> m_storageMtx{
nullptr};
224 mutable MCRecoClusterParticleAssociationCollectionData m_storage{};
227std::ostream&
operator<<(std::ostream& o,
const MCRecoClusterParticleAssociationCollection& v);
229template<
typename... Args>
231 if (m_isSubsetColl) {
232 throw std::logic_error(
"Cannot create new elements on a subset collection");
234 const int size = m_storage.entries.size();
236 m_storage.entries.push_back(obj);
241#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
Definition MCRecoClusterParticleAssociationCollectionData.h:32
MCRecoClusterParticleAssociationObjPointerContainer entries
Definition MCRecoClusterParticleAssociationCollectionData.h:37
Definition MCRecoClusterParticleAssociationCollection.h:95
const_iterator begin() const
Definition MCRecoClusterParticleAssociationCollection.h:199
bool isSubsetCollection() const final
Definition MCRecoClusterParticleAssociationCollection.h:147
MCRecoClusterParticleAssociationCollection(MCRecoClusterParticleAssociationCollection &&)=default
const_iterator end() const
Definition MCRecoClusterParticleAssociationCollection.h:205
MCRecoClusterParticleAssociationCollection & operator=(MCRecoClusterParticleAssociationCollection &&)=default
bool setReferences(const podio::ICollectionProvider *collectionProvider) final
Definition MCRecoClusterParticleAssociationCollection.cc:122
iterator end()
Definition MCRecoClusterParticleAssociationCollection.h:202
MCRecoClusterParticleAssociationCollection()
Definition MCRecoClusterParticleAssociationCollection.cc:24
bool empty() const final
Is the collection empty.
Definition MCRecoClusterParticleAssociationCollection.cc:55
void prepareAfterRead() final
Definition MCRecoClusterParticleAssociationCollection.cc:107
std::size_t size() const final
number of elements in the collection
Definition MCRecoClusterParticleAssociationCollection.cc:51
void setSubsetCollection(bool setSubset=true) final
Definition MCRecoClusterParticleAssociationCollection.cc:59
const std::string_view getDataTypeName() const final
fully qualified type name of stored POD elements - with namespace
Definition MCRecoClusterParticleAssociationCollection.h:143
bool isValid() const final
Definition MCRecoClusterParticleAssociationCollection.h:189
MCRecoClusterParticleAssociation at(std::size_t index) const
Returns the const object of given index.
Definition MCRecoClusterParticleAssociationCollection.cc:39
MutableMCRecoClusterParticleAssociation create()
Append a new object to the collection, and return this object.
Definition MCRecoClusterParticleAssociationCollection.cc:70
static constexpr auto valueTypeName
Definition MCRecoClusterParticleAssociationCollection.h:113
void prepareForWrite() const final
Definition MCRecoClusterParticleAssociationCollection.cc:86
void print(std::ostream &os=std::cout, bool flush=true) const final
Print this collection to the passed stream.
Definition MCRecoClusterParticleAssociationCollection.cc:353
MCRecoClusterParticleAssociationCollection(const MCRecoClusterParticleAssociationCollection &)=delete
uint32_t getID() const final
Definition MCRecoClusterParticleAssociationCollection.h:185
MCRecoClusterParticleAssociationCollection & operator=(const MCRecoClusterParticleAssociationCollection &)=delete
void clear() final
Definition MCRecoClusterParticleAssociationCollection.cc:81
void setID(uint32_t ID) final
Definition MCRecoClusterParticleAssociationCollection.h:175
podio::CollectionWriteBuffers getBuffers() final
Get the collection buffers for this collection.
Definition MCRecoClusterParticleAssociationCollection.cc:158
~MCRecoClusterParticleAssociationCollection()
Definition MCRecoClusterParticleAssociationCollection.cc:30
const std::string_view getValueTypeName() const final
fully qualified type name of elements - with namespace
Definition MCRecoClusterParticleAssociationCollection.h:141
void push_back(MutableMCRecoClusterParticleAssociation object)
Append object to the collection.
Definition MCRecoClusterParticleAssociationCollection.cc:126
const std::string_view getTypeName() const final
fully qualified type name
Definition MCRecoClusterParticleAssociationCollection.h:139
static constexpr auto dataTypeName
Definition MCRecoClusterParticleAssociationCollection.h:114
podio::SchemaVersionT getSchemaVersion() const final
schema version
Definition MCRecoClusterParticleAssociationCollection.cc:197
static constexpr auto typeName
Definition MCRecoClusterParticleAssociationCollection.h:112
Definition MCRecoClusterParticleAssociationCollection.h:40
MCRecoClusterParticleAssociation operator*()
Definition MCRecoClusterParticleAssociationCollection.cc:295
MCRecoClusterParticleAssociationCollectionIterator(size_t index, const MCRecoClusterParticleAssociationObjPointerContainer *collection)
Definition MCRecoClusterParticleAssociationCollection.h:42
MCRecoClusterParticleAssociationCollectionIterator & operator=(const MCRecoClusterParticleAssociationCollectionIterator &)=delete
MCRecoClusterParticleAssociationCollectionIterator & operator++()
Definition MCRecoClusterParticleAssociationCollection.cc:305
bool operator==(const MCRecoClusterParticleAssociationCollectionIterator &x) const
Definition MCRecoClusterParticleAssociationCollection.h:51
bool operator!=(const MCRecoClusterParticleAssociationCollectionIterator &x) const
Definition MCRecoClusterParticleAssociationCollection.h:47
MCRecoClusterParticleAssociation * operator->()
Definition MCRecoClusterParticleAssociationCollection.cc:300
MCRecoClusterParticleAssociationCollectionIterator(const MCRecoClusterParticleAssociationCollectionIterator &)=delete
Definition MCRecoClusterParticleAssociation.h:40
Definition MCRecoClusterParticleAssociationCollection.h:66
MCRecoClusterParticleAssociationMutableCollectionIterator & operator++()
Definition MCRecoClusterParticleAssociationCollection.cc:322
MutableMCRecoClusterParticleAssociation operator*()
Definition MCRecoClusterParticleAssociationCollection.cc:312
bool operator!=(const MCRecoClusterParticleAssociationMutableCollectionIterator &x) const
Definition MCRecoClusterParticleAssociationCollection.h:73
MutableMCRecoClusterParticleAssociation * operator->()
Definition MCRecoClusterParticleAssociationCollection.cc:317
MCRecoClusterParticleAssociationMutableCollectionIterator(const MCRecoClusterParticleAssociationMutableCollectionIterator &)=delete
bool operator==(const MCRecoClusterParticleAssociationMutableCollectionIterator &x) const
Definition MCRecoClusterParticleAssociationCollection.h:77
MCRecoClusterParticleAssociationMutableCollectionIterator & operator=(const MCRecoClusterParticleAssociationMutableCollectionIterator &)=delete
MCRecoClusterParticleAssociationMutableCollectionIterator(size_t index, const MCRecoClusterParticleAssociationObjPointerContainer *collection)
Definition MCRecoClusterParticleAssociationCollection.h:68
Definition MCRecoClusterParticleAssociationObj.h:24
Definition MutableMCRecoClusterParticleAssociation.h:39
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97
std::deque< MCRecoClusterParticleAssociationObj * > MCRecoClusterParticleAssociationObjPointerContainer
Definition MCRecoClusterParticleAssociationCollectionData.h:24
Definition CalorimeterHitCollection.h:32