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