EDM4eic
EIC data model
Loading...
Searching...
No Matches
ProtoCluster.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_ProtoCluster_H
4#define EDM4EIC_ProtoCluster_H
5
7
9#include "podio/RelationRange.h"
10#include <vector>
11
12#include "podio/utilities/MaybeSharedPtr.h"
13
14#include <ostream>
15#include <cstddef>
16
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
19#endif
20
21
22
23namespace edm4eic {
24
25class MutableProtoCluster;
26class ProtoClusterCollection;
27class ProtoClusterCollectionData;
28
29/** @class ProtoCluster
30 * Collection of hits identified by the clustering algorithm to belong together
31 * @author: S. Joosten
32 */
34
35 friend class MutableProtoCluster;
39
40public:
43
44 /// default constructor
46
47
48 /// copy constructor
49 ProtoCluster(const ProtoCluster& other) = default;
50
51 /// copy-assignment operator
53
54 /// create a mutable deep-copy of the object with identical relations
56
57 /// destructor
58 ~ProtoCluster() = default;
59
60
61 static ProtoCluster makeEmpty();
62
63public:
64
65
66
67 std::size_t hits_size() const;
68 edm4eic::CalorimeterHit getHits(std::size_t) const;
69 std::vector<edm4eic::CalorimeterHit>::const_iterator hits_begin() const;
70 std::vector<edm4eic::CalorimeterHit>::const_iterator hits_end() const;
71 podio::RelationRange<edm4eic::CalorimeterHit> getHits() const;
72 std::size_t weights_size() const;
73 float getWeights(std::size_t) const;
74 std::vector<float>::const_iterator weights_begin() const;
75 std::vector<float>::const_iterator weights_end() const;
76 podio::RelationRange<float> getWeights() const;
77
78
79 /// check whether the object is actually available
80 bool isAvailable() const;
81 /// disconnect from ProtoClusterObj instance
82 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ProtoClusterObj>{nullptr}; }
83
84 bool operator==(const ProtoCluster& other) const { return m_obj == other.m_obj; }
85 bool operator==(const MutableProtoCluster& other) const;
86
87 // less comparison operator, so that objects can be e.g. stored in sets.
88 bool operator<(const ProtoCluster& other) const { return m_obj < other.m_obj; }
89
90 podio::ObjectID id() const { return getObjectID(); }
91
92 const podio::ObjectID getObjectID() const;
93
94 friend void swap(ProtoCluster& a, ProtoCluster& b) {
95 using std::swap;
96 swap(a.m_obj, b.m_obj); // swap out the internal pointers
97 }
98
99private:
100 /// constructor from existing ProtoClusterObj
101 explicit ProtoCluster(podio::utils::MaybeSharedPtr<ProtoClusterObj> obj);
103
104 podio::utils::MaybeSharedPtr<ProtoClusterObj> m_obj{nullptr};
105};
106
107std::ostream& operator<<(std::ostream& o, const ProtoCluster& value);
108
109#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
110void to_json(nlohmann::json& j, const ProtoCluster& value);
111#endif
112
113
114} // namespace edm4eic
115
116
117#endif
Definition CalorimeterHit.h:37
Definition MutableProtoCluster.h:32
Definition ProtoClusterCollectionData.h:31
Definition ProtoClusterCollection.h:95
Definition ProtoClusterCollection.h:40
Definition ProtoCluster.h:33
const podio::ObjectID getObjectID() const
Definition ProtoCluster.cc:119
friend class ProtoClusterCollection
Definition ProtoCluster.h:36
friend class MutableProtoCluster
Definition ProtoCluster.h:35
bool operator==(const ProtoCluster &other) const
Definition ProtoCluster.h:84
bool operator<(const ProtoCluster &other) const
Definition ProtoCluster.h:88
std::vector< float >::const_iterator weights_begin() const
Definition ProtoCluster.cc:77
podio::RelationRange< edm4eic::CalorimeterHit > getHits() const
Definition ProtoCluster.cc:68
friend void swap(ProtoCluster &a, ProtoCluster &b)
Definition ProtoCluster.h:94
ProtoCluster(const ProtoCluster &other)=default
copy constructor
bool isAvailable() const
check whether the object is actually available
Definition ProtoCluster.cc:112
std::size_t weights_size() const
Definition ProtoCluster.cc:89
podio::ObjectID id() const
Definition ProtoCluster.h:90
ProtoCluster()
default constructor
Definition ProtoCluster.cc:21
std::size_t hits_size() const
Definition ProtoCluster.cc:57
MutableProtoCluster clone() const
create a mutable deep-copy of the object with identical relations
Definition ProtoCluster.cc:30
std::vector< float >::const_iterator weights_end() const
Definition ProtoCluster.cc:83
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_begin() const
Definition ProtoCluster.cc:45
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_end() const
Definition ProtoCluster.cc:51
~ProtoCluster()=default
destructor
ProtoCluster & operator=(ProtoCluster other)
copy-assignment operator
Definition ProtoCluster.cc:25
static ProtoCluster makeEmpty()
Definition ProtoCluster.cc:38
void unlink()
disconnect from ProtoClusterObj instance
Definition ProtoCluster.h:82
podio::RelationRange< float > getWeights() const
Definition ProtoCluster.cc:100
Definition ProtoClusterObj.h:19
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97