3#ifndef EDM4EIC_MCRecoClusterParticleAssociationCollection_H
4#define EDM4EIC_MCRecoClusterParticleAssociationCollection_H
13#include "podio/ICollectionProvider.h"
14#include "podio/CollectionBase.h"
16#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
17#include "nlohmann/json_fwd.hpp"
45 return m_index != x.m_index;
49 return m_index == x.m_index;
71 return m_index != x.m_index;
75 return m_index == x.m_index;
111 constexpr static auto typeName =
"edm4eic::MCRecoClusterParticleAssociationCollection";
112 constexpr static auto valueTypeName =
"edm4eic::MCRecoClusterParticleAssociation";
113 constexpr static auto dataTypeName =
"edm4eic::MCRecoClusterParticleAssociationData";
118 void print(std::ostream& os=std::cout,
bool flush=true) const final;
128 template<
typename... Args>
132 std::size_t
size() const final;
138 bool empty() const final;
150 return m_isSubsetColl;
179 if (!m_isSubsetColl) {
188 return m_collectionID;
195 size_t getDatamodelRegistryIndex() const final;
199 return iterator(0, &m_storage.entries);
208 return iterator(m_storage.entries.size(), &m_storage.entries);
211 return const_iterator(m_storage.entries.size(), &m_storage.entries);
217 std::vector<std::uint32_t> simID(
const size_t nElem = 0)
const;
218 std::vector<std::uint32_t> recID(
const size_t nElem = 0)
const;
219 std::vector<float> weight(
const size_t nElem = 0)
const;
227 bool m_isValid{
false};
228 mutable bool m_isPrepared{
false};
229 bool m_isSubsetColl{
false};
230 uint32_t m_collectionID{0};
231 mutable std::unique_ptr<std::mutex> m_storageMtx{
nullptr};
232 mutable MCRecoClusterParticleAssociationCollectionData m_storage{};
235std::ostream&
operator<<(std::ostream& o,
const MCRecoClusterParticleAssociationCollection& v);
237template<
typename... Args>
239 if (m_isSubsetColl) {
240 throw std::logic_error(
"Cannot create new elements on a subset collection");
242 const int size = m_storage.entries.size();
244 m_storage.entries.push_back(obj);
249#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
Definition MCRecoClusterParticleAssociationCollectionData.h:32
MCRecoClusterParticleAssociationObjPointerContainer entries
Definition MCRecoClusterParticleAssociationCollectionData.h:37
Definition MCRecoClusterParticleAssociationCollection.h:92
const_iterator begin() const
Definition MCRecoClusterParticleAssociationCollection.h:201
bool isSubsetCollection() const final
Definition MCRecoClusterParticleAssociationCollection.h:149
MCRecoClusterParticleAssociationCollection(MCRecoClusterParticleAssociationCollection &&)=default
const_iterator cbegin() const
Definition MCRecoClusterParticleAssociationCollection.h:204
size_t size_type
Definition MCRecoClusterParticleAssociationCollection.h:98
void push_back(const MutableMCRecoClusterParticleAssociation &object)
Append object to the collection.
Definition MCRecoClusterParticleAssociationCollection.cc:130
const_iterator end() const
Definition MCRecoClusterParticleAssociationCollection.h:210
MCRecoClusterParticleAssociationCollection & operator=(MCRecoClusterParticleAssociationCollection &&)=default
bool setReferences(const podio::ICollectionProvider *collectionProvider) final
Definition MCRecoClusterParticleAssociationCollection.cc:126
iterator end()
Definition MCRecoClusterParticleAssociationCollection.h:207
MCRecoClusterParticleAssociationCollection()
Definition MCRecoClusterParticleAssociationCollection.cc:24
bool empty() const final
Is the collection empty.
Definition MCRecoClusterParticleAssociationCollection.cc:59
void prepareAfterRead() final
Definition MCRecoClusterParticleAssociationCollection.cc:111
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:63
const std::string_view getDataTypeName() const final
fully qualified type name of stored POD elements - with namespace
Definition MCRecoClusterParticleAssociationCollection.h:145
bool isValid() const final
Definition MCRecoClusterParticleAssociationCollection.h:191
ptrdiff_t difference_type
Definition MCRecoClusterParticleAssociationCollection.h:97
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:74
static constexpr auto valueTypeName
Definition MCRecoClusterParticleAssociationCollection.h:112
void prepareForWrite() const final
Definition MCRecoClusterParticleAssociationCollection.cc:90
void print(std::ostream &os=std::cout, bool flush=true) const final
Print this collection to the passed stream.
Definition MCRecoClusterParticleAssociationCollection.cc:362
const_iterator cend() const
Definition MCRecoClusterParticleAssociationCollection.h:213
MCRecoClusterParticleAssociationCollection(const MCRecoClusterParticleAssociationCollection &)=delete
uint32_t getID() const final
Definition MCRecoClusterParticleAssociationCollection.h:187
MCRecoClusterParticleAssociationCollection & operator=(const MCRecoClusterParticleAssociationCollection &)=delete
std::size_t max_size() const final
maximal number of elements in the collection
Definition MCRecoClusterParticleAssociationCollection.cc:55
void clear() final
Definition MCRecoClusterParticleAssociationCollection.cc:85
void setID(uint32_t ID) final
Definition MCRecoClusterParticleAssociationCollection.h:177
podio::CollectionWriteBuffers getBuffers() final
Get the collection buffers for this collection.
Definition MCRecoClusterParticleAssociationCollection.cc:162
~MCRecoClusterParticleAssociationCollection()
Definition MCRecoClusterParticleAssociationCollection.cc:30
const std::string_view getValueTypeName() const final
fully qualified type name of elements - with namespace
Definition MCRecoClusterParticleAssociationCollection.h:143
const std::string_view getTypeName() const final
fully qualified type name
Definition MCRecoClusterParticleAssociationCollection.h:141
static constexpr auto dataTypeName
Definition MCRecoClusterParticleAssociationCollection.h:113
podio::SchemaVersionT getSchemaVersion() const final
schema version
Definition MCRecoClusterParticleAssociationCollection.cc:201
static constexpr auto typeName
Definition MCRecoClusterParticleAssociationCollection.h:111
Definition MCRecoClusterParticleAssociationCollection.h:37
MCRecoClusterParticleAssociation operator*()
Definition MCRecoClusterParticleAssociationCollection.cc:304
MCRecoClusterParticleAssociationCollectionIterator(size_t index, const MCRecoClusterParticleAssociationObjPointerContainer *collection)
Definition MCRecoClusterParticleAssociationCollection.h:39
MCRecoClusterParticleAssociationCollectionIterator & operator=(const MCRecoClusterParticleAssociationCollectionIterator &)=delete
MCRecoClusterParticleAssociationCollectionIterator & operator++()
Definition MCRecoClusterParticleAssociationCollection.cc:314
bool operator==(const MCRecoClusterParticleAssociationCollectionIterator &x) const
Definition MCRecoClusterParticleAssociationCollection.h:48
bool operator!=(const MCRecoClusterParticleAssociationCollectionIterator &x) const
Definition MCRecoClusterParticleAssociationCollection.h:44
MCRecoClusterParticleAssociation * operator->()
Definition MCRecoClusterParticleAssociationCollection.cc:309
MCRecoClusterParticleAssociationCollectionIterator(const MCRecoClusterParticleAssociationCollectionIterator &)=delete
Definition MCRecoClusterParticleAssociation.h:40
Definition MCRecoClusterParticleAssociationCollection.h:63
MCRecoClusterParticleAssociationMutableCollectionIterator & operator++()
Definition MCRecoClusterParticleAssociationCollection.cc:331
MutableMCRecoClusterParticleAssociation operator*()
Definition MCRecoClusterParticleAssociationCollection.cc:321
bool operator!=(const MCRecoClusterParticleAssociationMutableCollectionIterator &x) const
Definition MCRecoClusterParticleAssociationCollection.h:70
MutableMCRecoClusterParticleAssociation * operator->()
Definition MCRecoClusterParticleAssociationCollection.cc:326
MCRecoClusterParticleAssociationMutableCollectionIterator(const MCRecoClusterParticleAssociationMutableCollectionIterator &)=delete
bool operator==(const MCRecoClusterParticleAssociationMutableCollectionIterator &x) const
Definition MCRecoClusterParticleAssociationCollection.h:74
MCRecoClusterParticleAssociationMutableCollectionIterator & operator=(const MCRecoClusterParticleAssociationMutableCollectionIterator &)=delete
MCRecoClusterParticleAssociationMutableCollectionIterator(size_t index, const MCRecoClusterParticleAssociationObjPointerContainer *collection)
Definition MCRecoClusterParticleAssociationCollection.h:65
Definition MCRecoClusterParticleAssociationObj.h:24
Definition MutableMCRecoClusterParticleAssociation.h:38
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
std::deque< MCRecoClusterParticleAssociationObj * > MCRecoClusterParticleAssociationObjPointerContainer
Definition MCRecoClusterParticleAssociationCollectionData.h:24
Definition CalorimeterHitCollection.h:29