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 #include "eicd/ProtoClusterObj.h"
8 
9 #include "eicd/Index.h"
10 #include "eicd/Weight.h"
11 #include "podio/ObjectID.h"
12 #include <ostream>
13 
14 
15 
16 namespace eic {
17 
18 
19 /** @class ProtoCluster
20  * Relational info linking hits to their associated cluster
21  * @author: S. Joosten
22  */
23 class ProtoCluster {
24 
25  friend class ProtoClusterCollection;
27  friend class ConstProtoCluster;
28 
29 public:
30 
31  /// default constructor
32  ProtoCluster();
34 
35  /// constructor from existing ProtoClusterObj
37 
38  /// copy constructor
39  ProtoCluster(const ProtoCluster& other);
40 
41  /// copy-assignment operator
42  ProtoCluster& operator=(const ProtoCluster& other);
43 
44  /// support cloning (deep-copy)
45  ProtoCluster clone() const;
46 
47  /// destructor
48  ~ProtoCluster();
49 
50  /// conversion to const object
51  operator ConstProtoCluster() const;
52 
53 public:
54 
55  /// Access the Hit ID
56  const eic::Index& hitID() const;
57 
58  /// Access the ID of the cluster associated with this hit (-1 if none)
59  const eic::Index& clusterID() const;
60 
61  /// Access the How much of this hit belongs to the cluster? [0->1]
62  const eic::Weight& weight() const;
63 
64 
65 
66  /// Set the Hit ID
67  void hitID(eic::Index value);
68  /// Get reference to Hit ID
69  eic::Index& hitID();
70 
71  /// Set the ID of the cluster associated with this hit (-1 if none)
72  void clusterID(eic::Index value);
73  /// Get reference to ID of the cluster associated with this hit (-1 if none)
75 
76  /// Set the How much of this hit belongs to the cluster? [0->1]
77  void weight(eic::Weight value);
78  /// Get reference to How much of this hit belongs to the cluster? [0->1]
80 
81 
82 
83 
84 
85 
86  /// check whether the object is actually available
87  bool isAvailable() const;
88  /// disconnect from ProtoClusterObj instance
89  void unlink() { m_obj = nullptr; }
90 
91  bool operator==(const ProtoCluster& other) const { return m_obj == other.m_obj; }
92  bool operator==(const ConstProtoCluster& other) const;
93 
94  // less comparison operator, so that objects can be e.g. stored in sets.
95  bool operator<(const ProtoCluster& other) const { return m_obj < other.m_obj; }
96 
97  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
98 
99  const podio::ObjectID getObjectID() const;
100 
101 private:
102  ProtoClusterObj* m_obj;
103 };
104 
105 std::ostream& operator<<(std::ostream& o, const ConstProtoCluster& value);
106 
107 } // namespace eic
108 
109 
110 #endif
eic::operator<<
std::ostream & operator<<(std::ostream &o, const ConstBasicParticle &value)
Definition: BasicParticle.cc:102
eic::Index
Definition: Index.h:11
eic::ProtoCluster::clone
ProtoCluster clone() const
support cloning (deep-copy)
Definition: ProtoCluster.cc:41
eic::ProtoCluster::isAvailable
bool isAvailable() const
check whether the object is actually available
Definition: ProtoCluster.cc:68
eic::ProtoCluster::unlink
void unlink()
disconnect from ProtoClusterObj instance
Definition: ProtoCluster.h:89
eic::ProtoCluster::weight
const eic::Weight & weight() const
Access the How much of this hit belongs to the cluster? [0->1].
Definition: ProtoCluster.cc:52
eic::ProtoCluster::ConstProtoCluster
friend class ConstProtoCluster
Definition: ProtoCluster.h:27
eic
Definition: BasicParticle.cc:13
eic::ProtoCluster::ProtoCluster
ProtoCluster()
default constructor
Definition: ProtoCluster.cc:16
eic::ProtoCluster
Definition: ProtoCluster.h:23
ProtoClusterConst.h
eic::ConstProtoCluster
Definition: ProtoClusterConst.h:21
eic::ProtoCluster::hitID
const eic::Index & hitID() const
Access the Hit ID.
Definition: ProtoCluster.cc:50
eic::ProtoCluster::getObjectID
const podio::ObjectID getObjectID() const
Definition: ProtoCluster.cc:75
eic::Weight
Definition: Weight.h:11
eic::ProtoClusterCollectionIterator
Definition: ProtoClusterCollection.h:29
Weight.h
eic::ProtoClusterCollection
Definition: ProtoClusterCollection.h:76
eic::ProtoCluster::operator=
ProtoCluster & operator=(const ProtoCluster &other)
copy-assignment operator
Definition: ProtoCluster.cc:31
eic::ProtoCluster::operator==
bool operator==(const ProtoCluster &other) const
Definition: ProtoCluster.h:91
eic::ProtoClusterObj
Definition: ProtoClusterObj.h:18
eic::ProtoCluster::operator<
bool operator<(const ProtoCluster &other) const
Definition: ProtoCluster.h:95
eic::ProtoCluster::id
unsigned int id() const
Definition: ProtoCluster.h:97
eic::ProtoCluster::~ProtoCluster
~ProtoCluster()
destructor
Definition: ProtoCluster.cc:45
Index.h
eic::ProtoCluster::clusterID
const eic::Index & clusterID() const
Access the ID of the cluster associated with this hit (-1 if none)
Definition: ProtoCluster.cc:51
ProtoClusterObj.h