3#ifndef EDM4EIC_ProtoCluster_H
4#define EDM4EIC_ProtoCluster_H
9#include "podio/RelationRange.h"
12#include "podio/utilities/MaybeSharedPtr.h"
13#include "podio/detail/OrderKey.h"
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
30OrderKey
getOrderKey(
const edm4eic::ProtoCluster& obj);
80 static constexpr std::string_view
typeName =
"edm4eic::ProtoCluster";
86 std::vector<edm4eic::CalorimeterHit>::const_iterator
hits_begin()
const;
87 std::vector<edm4eic::CalorimeterHit>::const_iterator
hits_end()
const;
88 podio::RelationRange<edm4eic::CalorimeterHit>
getHits()
const;
92 std::vector<float>::const_iterator
weights_end()
const;
93 podio::RelationRange<float>
getWeights()
const;
99 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ProtoClusterObj>{
nullptr}; }
114 friend std::hash<ProtoCluster>;
118 swap(a.m_obj, b.m_obj);
123 explicit ProtoCluster(podio::utils::MaybeSharedPtr<ProtoClusterObj> obj);
126 podio::utils::MaybeSharedPtr<ProtoClusterObj> m_obj{
new ProtoClusterObj{}, podio::utils::MarkOwned};
131#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
132void to_json(nlohmann::json& j,
const ProtoCluster& value);
143 return std::hash<edm4eic::ProtoClusterObj*>{}(obj.m_obj.get());
151#if defined(__clang__)
152 #pragma clang diagnostic push
153 #pragma clang diagnostic ignored "-Wunknown-warning-option"
154 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
155 #pragma clang diagnostic ignored "-Wdeprecated"
157 #pragma clang diagnostic pop
158#elif defined(__GNUC__)
159 #pragma GCC diagnostic push
160 #pragma GCC diagnostic ignored "-Wdeprecated"
162 #pragma GCC diagnostic pop
Definition CalorimeterHit.h:46
Definition MutableProtoCluster.h:35
Definition ProtoClusterCollectionData.h:32
Definition ProtoClusterCollection.h:138
Definition ProtoCluster.h:43
const podio::ObjectID getObjectID() const
Definition ProtoCluster.cc:141
friend class ProtoClusterCollection
Definition ProtoCluster.h:46
friend class MutableProtoCluster
Definition ProtoCluster.h:45
ProtoCluster & operator=(ProtoCluster other) &&=delete
bool operator==(const ProtoCluster &other) const
Definition ProtoCluster.h:101
ProtoCluster & operator=(ProtoCluster other) &
copy-assignment operator
Definition ProtoCluster.cc:21
bool operator<(const ProtoCluster &other) const
Definition ProtoCluster.h:108
std::vector< float >::const_iterator weights_begin() const
Definition ProtoCluster.cc:102
podio::RelationRange< edm4eic::CalorimeterHit > getHits() const
Definition ProtoCluster.cc:93
ProtoCluster()=default
default constructor
friend void swap(ProtoCluster &a, ProtoCluster &b)
Definition ProtoCluster.h:116
ProtoCluster(const ProtoCluster &other)=default
copy constructor
bool isAvailable() const
check whether the object is actually available
Definition ProtoCluster.cc:137
std::size_t weights_size() const
Definition ProtoCluster.cc:114
bool operator!=(const MutableProtoCluster &other) const
Definition ProtoCluster.h:105
ProtoClusterCollection collection_type
Definition ProtoCluster.h:53
friend class ProtoClusterCollectionIterator
Definition ProtoCluster.h:48
podio::ObjectID id() const
Definition ProtoCluster.h:110
static constexpr std::string_view typeName
Definition ProtoCluster.h:80
MutableProtoCluster clone(bool cloneRelations=true) const
Definition ProtoCluster.cc:26
std::size_t hits_size() const
Definition ProtoCluster.cc:82
MutableProtoCluster mutable_type
Definition ProtoCluster.h:52
std::vector< float >::const_iterator weights_end() const
Definition ProtoCluster.cc:108
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_begin() const
Definition ProtoCluster.cc:70
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_end() const
Definition ProtoCluster.cc:76
~ProtoCluster()=default
destructor
bool operator!=(const ProtoCluster &other) const
Definition ProtoCluster.h:104
static ProtoCluster makeEmpty()
Definition ProtoCluster.cc:63
void unlink()
disconnect from ProtoClusterObj instance
Definition ProtoCluster.h:99
podio::RelationRange< float > getWeights() const
Definition ProtoCluster.cc:125
Definition ProtoClusterObj.h:20
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:99
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::ProtoCluster &obj) const
Definition ProtoCluster.h:142