3#ifndef EDM4EIC_MCRecoCalorimeterHitAssociationCollection_H
4#define EDM4EIC_MCRecoCalorimeterHitAssociationCollection_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::MCRecoCalorimeterHitAssociationCollection";
113 constexpr static auto valueTypeName =
"edm4eic::MCRecoCalorimeterHitAssociation";
114 constexpr static auto dataTypeName =
"edm4eic::MCRecoCalorimeterHitAssociationData";
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<float> weight(
const size_t nElem = 0)
const;
217 bool m_isValid{
false};
218 mutable bool m_isPrepared{
false};
219 bool m_isSubsetColl{
false};
220 uint32_t m_collectionID{0};
221 mutable std::unique_ptr<std::mutex> m_storageMtx{
nullptr};
222 mutable MCRecoCalorimeterHitAssociationCollectionData m_storage{};
225std::ostream&
operator<<(std::ostream& o,
const MCRecoCalorimeterHitAssociationCollection& v);
227template<
typename... Args>
229 if (m_isSubsetColl) {
230 throw std::logic_error(
"Cannot create new elements on a subset collection");
232 const int size = m_storage.entries.size();
234 m_storage.entries.push_back(obj);
239#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
Definition MCRecoCalorimeterHitAssociationCollectionData.h:32
MCRecoCalorimeterHitAssociationObjPointerContainer entries
Definition MCRecoCalorimeterHitAssociationCollectionData.h:37
Definition MCRecoCalorimeterHitAssociationCollection.h:95
static constexpr auto dataTypeName
Definition MCRecoCalorimeterHitAssociationCollection.h:114
~MCRecoCalorimeterHitAssociationCollection()
Definition MCRecoCalorimeterHitAssociationCollection.cc:30
void push_back(MutableMCRecoCalorimeterHitAssociation object)
Append object to the collection.
Definition MCRecoCalorimeterHitAssociationCollection.cc:126
void setSubsetCollection(bool setSubset=true) final
Definition MCRecoCalorimeterHitAssociationCollection.cc:59
const std::string_view getTypeName() const final
fully qualified type name
Definition MCRecoCalorimeterHitAssociationCollection.h:139
MCRecoCalorimeterHitAssociationCollection()
Definition MCRecoCalorimeterHitAssociationCollection.cc:24
podio::CollectionWriteBuffers getBuffers() final
Get the collection buffers for this collection.
Definition MCRecoCalorimeterHitAssociationCollection.cc:158
podio::SchemaVersionT getSchemaVersion() const final
schema version
Definition MCRecoCalorimeterHitAssociationCollection.cc:177
bool isSubsetCollection() const final
Definition MCRecoCalorimeterHitAssociationCollection.h:147
MCRecoCalorimeterHitAssociationCollection & operator=(MCRecoCalorimeterHitAssociationCollection &&)=default
const_iterator begin() const
Definition MCRecoCalorimeterHitAssociationCollection.h:199
iterator end()
Definition MCRecoCalorimeterHitAssociationCollection.h:202
MutableMCRecoCalorimeterHitAssociation create()
Append a new object to the collection, and return this object.
Definition MCRecoCalorimeterHitAssociationCollection.cc:70
MCRecoCalorimeterHitAssociationCollection(const MCRecoCalorimeterHitAssociationCollection &)=delete
void prepareAfterRead() final
Definition MCRecoCalorimeterHitAssociationCollection.cc:107
static constexpr auto valueTypeName
Definition MCRecoCalorimeterHitAssociationCollection.h:113
static constexpr auto typeName
Definition MCRecoCalorimeterHitAssociationCollection.h:112
MCRecoCalorimeterHitAssociationCollection(MCRecoCalorimeterHitAssociationCollection &&)=default
bool empty() const final
Is the collection empty.
Definition MCRecoCalorimeterHitAssociationCollection.cc:55
std::size_t size() const final
number of elements in the collection
Definition MCRecoCalorimeterHitAssociationCollection.cc:51
MCRecoCalorimeterHitAssociationCollection & operator=(const MCRecoCalorimeterHitAssociationCollection &)=delete
const std::string_view getDataTypeName() const final
fully qualified type name of stored POD elements - with namespace
Definition MCRecoCalorimeterHitAssociationCollection.h:143
const_iterator end() const
Definition MCRecoCalorimeterHitAssociationCollection.h:205
bool setReferences(const podio::ICollectionProvider *collectionProvider) final
Definition MCRecoCalorimeterHitAssociationCollection.cc:122
void print(std::ostream &os=std::cout, bool flush=true) const final
Print this collection to the passed stream.
Definition MCRecoCalorimeterHitAssociationCollection.cc:331
bool isValid() const final
Definition MCRecoCalorimeterHitAssociationCollection.h:189
void setID(uint32_t ID) final
Definition MCRecoCalorimeterHitAssociationCollection.h:175
const std::string_view getValueTypeName() const final
fully qualified type name of elements - with namespace
Definition MCRecoCalorimeterHitAssociationCollection.h:141
void clear() final
Definition MCRecoCalorimeterHitAssociationCollection.cc:81
void prepareForWrite() const final
Definition MCRecoCalorimeterHitAssociationCollection.cc:86
uint32_t getID() const final
Definition MCRecoCalorimeterHitAssociationCollection.h:185
MCRecoCalorimeterHitAssociation at(std::size_t index) const
Returns the const object of given index.
Definition MCRecoCalorimeterHitAssociationCollection.cc:39
Definition MCRecoCalorimeterHitAssociationCollection.h:40
MCRecoCalorimeterHitAssociation operator*()
Definition MCRecoCalorimeterHitAssociationCollection.cc:275
MCRecoCalorimeterHitAssociationCollectionIterator(const MCRecoCalorimeterHitAssociationCollectionIterator &)=delete
MCRecoCalorimeterHitAssociationCollectionIterator & operator=(const MCRecoCalorimeterHitAssociationCollectionIterator &)=delete
MCRecoCalorimeterHitAssociation * operator->()
Definition MCRecoCalorimeterHitAssociationCollection.cc:280
bool operator!=(const MCRecoCalorimeterHitAssociationCollectionIterator &x) const
Definition MCRecoCalorimeterHitAssociationCollection.h:47
MCRecoCalorimeterHitAssociationCollectionIterator & operator++()
Definition MCRecoCalorimeterHitAssociationCollection.cc:285
MCRecoCalorimeterHitAssociationCollectionIterator(size_t index, const MCRecoCalorimeterHitAssociationObjPointerContainer *collection)
Definition MCRecoCalorimeterHitAssociationCollection.h:42
bool operator==(const MCRecoCalorimeterHitAssociationCollectionIterator &x) const
Definition MCRecoCalorimeterHitAssociationCollection.h:51
Definition MCRecoCalorimeterHitAssociation.h:37
Definition MCRecoCalorimeterHitAssociationCollection.h:66
bool operator==(const MCRecoCalorimeterHitAssociationMutableCollectionIterator &x) const
Definition MCRecoCalorimeterHitAssociationCollection.h:77
MCRecoCalorimeterHitAssociationMutableCollectionIterator & operator=(const MCRecoCalorimeterHitAssociationMutableCollectionIterator &)=delete
MutableMCRecoCalorimeterHitAssociation operator*()
Definition MCRecoCalorimeterHitAssociationCollection.cc:292
MCRecoCalorimeterHitAssociationMutableCollectionIterator(size_t index, const MCRecoCalorimeterHitAssociationObjPointerContainer *collection)
Definition MCRecoCalorimeterHitAssociationCollection.h:68
bool operator!=(const MCRecoCalorimeterHitAssociationMutableCollectionIterator &x) const
Definition MCRecoCalorimeterHitAssociationCollection.h:73
MCRecoCalorimeterHitAssociationMutableCollectionIterator & operator++()
Definition MCRecoCalorimeterHitAssociationCollection.cc:302
MutableMCRecoCalorimeterHitAssociation * operator->()
Definition MCRecoCalorimeterHitAssociationCollection.cc:297
MCRecoCalorimeterHitAssociationMutableCollectionIterator(const MCRecoCalorimeterHitAssociationMutableCollectionIterator &)=delete
Definition MCRecoCalorimeterHitAssociationObj.h:22
Definition MutableMCRecoCalorimeterHitAssociation.h:36
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97
std::deque< MCRecoCalorimeterHitAssociationObj * > MCRecoCalorimeterHitAssociationObjPointerContainer
Definition MCRecoCalorimeterHitAssociationCollectionData.h:24
Definition CalorimeterHitCollection.h:32