3#ifndef EDM4EIC_MCRecoVertexParticleAssociationCollection_H
4#define EDM4EIC_MCRecoVertexParticleAssociationCollection_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::MCRecoVertexParticleAssociationCollection";
113 constexpr static auto valueTypeName =
"edm4eic::MCRecoVertexParticleAssociation";
114 constexpr static auto dataTypeName =
"edm4eic::MCRecoVertexParticleAssociationData";
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 MCRecoVertexParticleAssociationCollectionData m_storage{};
227std::ostream&
operator<<(std::ostream& o,
const MCRecoVertexParticleAssociationCollection& 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 MCRecoVertexParticleAssociationCollectionData.h:32
MCRecoVertexParticleAssociationObjPointerContainer entries
Definition MCRecoVertexParticleAssociationCollectionData.h:37
Definition MCRecoVertexParticleAssociationCollection.h:95
const std::string_view getDataTypeName() const final
fully qualified type name of stored POD elements - with namespace
Definition MCRecoVertexParticleAssociationCollection.h:143
bool empty() const final
Is the collection empty.
Definition MCRecoVertexParticleAssociationCollection.cc:55
static constexpr auto typeName
Definition MCRecoVertexParticleAssociationCollection.h:112
void clear() final
Definition MCRecoVertexParticleAssociationCollection.cc:81
void setID(uint32_t ID) final
Definition MCRecoVertexParticleAssociationCollection.h:175
static constexpr auto valueTypeName
Definition MCRecoVertexParticleAssociationCollection.h:113
void print(std::ostream &os=std::cout, bool flush=true) const final
Print this collection to the passed stream.
Definition MCRecoVertexParticleAssociationCollection.cc:353
~MCRecoVertexParticleAssociationCollection()
Definition MCRecoVertexParticleAssociationCollection.cc:30
void prepareAfterRead() final
Definition MCRecoVertexParticleAssociationCollection.cc:107
MCRecoVertexParticleAssociation at(std::size_t index) const
Returns the const object of given index.
Definition MCRecoVertexParticleAssociationCollection.cc:39
const std::string_view getTypeName() const final
fully qualified type name
Definition MCRecoVertexParticleAssociationCollection.h:139
static constexpr auto dataTypeName
Definition MCRecoVertexParticleAssociationCollection.h:114
MCRecoVertexParticleAssociationCollection & operator=(MCRecoVertexParticleAssociationCollection &&)=default
bool isSubsetCollection() const final
Definition MCRecoVertexParticleAssociationCollection.h:147
uint32_t getID() const final
Definition MCRecoVertexParticleAssociationCollection.h:185
void prepareForWrite() const final
Definition MCRecoVertexParticleAssociationCollection.cc:86
void push_back(MutableMCRecoVertexParticleAssociation object)
Append object to the collection.
Definition MCRecoVertexParticleAssociationCollection.cc:126
MCRecoVertexParticleAssociationCollection(MCRecoVertexParticleAssociationCollection &&)=default
MCRecoVertexParticleAssociationCollection(const MCRecoVertexParticleAssociationCollection &)=delete
podio::CollectionWriteBuffers getBuffers() final
Get the collection buffers for this collection.
Definition MCRecoVertexParticleAssociationCollection.cc:158
const_iterator end() const
Definition MCRecoVertexParticleAssociationCollection.h:205
MutableMCRecoVertexParticleAssociation create()
Append a new object to the collection, and return this object.
Definition MCRecoVertexParticleAssociationCollection.cc:70
bool isValid() const final
Definition MCRecoVertexParticleAssociationCollection.h:189
podio::SchemaVersionT getSchemaVersion() const final
schema version
Definition MCRecoVertexParticleAssociationCollection.cc:197
MCRecoVertexParticleAssociationCollection()
Definition MCRecoVertexParticleAssociationCollection.cc:24
void setSubsetCollection(bool setSubset=true) final
Definition MCRecoVertexParticleAssociationCollection.cc:59
bool setReferences(const podio::ICollectionProvider *collectionProvider) final
Definition MCRecoVertexParticleAssociationCollection.cc:122
MCRecoVertexParticleAssociationCollection & operator=(const MCRecoVertexParticleAssociationCollection &)=delete
const_iterator begin() const
Definition MCRecoVertexParticleAssociationCollection.h:199
const std::string_view getValueTypeName() const final
fully qualified type name of elements - with namespace
Definition MCRecoVertexParticleAssociationCollection.h:141
iterator end()
Definition MCRecoVertexParticleAssociationCollection.h:202
std::size_t size() const final
number of elements in the collection
Definition MCRecoVertexParticleAssociationCollection.cc:51
Definition MCRecoVertexParticleAssociationCollection.h:40
bool operator!=(const MCRecoVertexParticleAssociationCollectionIterator &x) const
Definition MCRecoVertexParticleAssociationCollection.h:47
bool operator==(const MCRecoVertexParticleAssociationCollectionIterator &x) const
Definition MCRecoVertexParticleAssociationCollection.h:51
MCRecoVertexParticleAssociation operator*()
Definition MCRecoVertexParticleAssociationCollection.cc:295
MCRecoVertexParticleAssociationCollectionIterator & operator=(const MCRecoVertexParticleAssociationCollectionIterator &)=delete
MCRecoVertexParticleAssociation * operator->()
Definition MCRecoVertexParticleAssociationCollection.cc:300
MCRecoVertexParticleAssociationCollectionIterator(const MCRecoVertexParticleAssociationCollectionIterator &)=delete
MCRecoVertexParticleAssociationCollectionIterator & operator++()
Definition MCRecoVertexParticleAssociationCollection.cc:305
MCRecoVertexParticleAssociationCollectionIterator(size_t index, const MCRecoVertexParticleAssociationObjPointerContainer *collection)
Definition MCRecoVertexParticleAssociationCollection.h:42
Definition MCRecoVertexParticleAssociation.h:40
Definition MCRecoVertexParticleAssociationCollection.h:66
MutableMCRecoVertexParticleAssociation * operator->()
Definition MCRecoVertexParticleAssociationCollection.cc:317
bool operator!=(const MCRecoVertexParticleAssociationMutableCollectionIterator &x) const
Definition MCRecoVertexParticleAssociationCollection.h:73
MCRecoVertexParticleAssociationMutableCollectionIterator(const MCRecoVertexParticleAssociationMutableCollectionIterator &)=delete
MutableMCRecoVertexParticleAssociation operator*()
Definition MCRecoVertexParticleAssociationCollection.cc:312
MCRecoVertexParticleAssociationMutableCollectionIterator & operator++()
Definition MCRecoVertexParticleAssociationCollection.cc:322
bool operator==(const MCRecoVertexParticleAssociationMutableCollectionIterator &x) const
Definition MCRecoVertexParticleAssociationCollection.h:77
MCRecoVertexParticleAssociationMutableCollectionIterator(size_t index, const MCRecoVertexParticleAssociationObjPointerContainer *collection)
Definition MCRecoVertexParticleAssociationCollection.h:68
MCRecoVertexParticleAssociationMutableCollectionIterator & operator=(const MCRecoVertexParticleAssociationMutableCollectionIterator &)=delete
Definition MCRecoVertexParticleAssociationObj.h:24
Definition MutableMCRecoVertexParticleAssociation.h:39
Definition CalorimeterHit.cc:18
std::deque< MCRecoVertexParticleAssociationObj * > MCRecoVertexParticleAssociationObjPointerContainer
Definition MCRecoVertexParticleAssociationCollectionData.h:24
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97
Definition CalorimeterHitCollection.h:32