EICd
EIC data model
ProtoClusterConst.h
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 #ifndef EICD_ConstProtoCluster_H
4 #define EICD_ConstProtoCluster_H
5 
6 #include "eicd/ProtoClusterObj.h"
7 
8 #include "eicd/Index.h"
9 #include "eicd/Weight.h"
10 #include "podio/ObjectID.h"
11 
12 
13 
14 namespace eic {
15 
16 
17 /** @class ConstProtoCluster
18  * Relational info linking hits to their associated cluster
19  * @author: S. Joosten
20  */
22 
23  friend class ProtoCluster;
24  friend class ProtoClusterCollection;
26 
27 public:
28  /// default constructor
31 
32  /// constructor from existing ProtoClusterObj
34 
35  /// copy constructor
37 
38  /// copy-assignment operator
40 
41  /// support cloning (deep-copy)
42  ConstProtoCluster clone() const;
43 
44  /// destructor
46 
47 
48 public:
49 
50  /// Access the Hit ID
51  const eic::Index& hitID() const;
52 
53  /// Access the ID of the cluster associated with this hit (-1 if none)
54  const eic::Index& clusterID() const;
55 
56  /// Access the How much of this hit belongs to the cluster? [0->1]
57  const eic::Weight& weight() const;
58 
59 
60 
61 
62 
63  /// check whether the object is actually available
64  bool isAvailable() const;
65  /// disconnect from ProtoClusterObj instance
66  void unlink() { m_obj = nullptr; }
67 
68  bool operator==(const ConstProtoCluster& other) const { return m_obj == other.m_obj; }
69  bool operator==(const ProtoCluster& other) const;
70 
71  // less comparison operator, so that objects can be e.g. stored in sets.
72  bool operator<(const ConstProtoCluster& other) const { return m_obj < other.m_obj; }
73 
74  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
75 
76  const podio::ObjectID getObjectID() const;
77 
78 private:
79  ProtoClusterObj* m_obj;
80 };
81 
82 } // namespace eic
83 
84 
85 #endif
eic::Index
Definition: Index.h:11
eic::ConstProtoCluster::operator=
ConstProtoCluster & operator=(const ConstProtoCluster &other)
copy-assignment operator
Definition: ProtoClusterConst.cc:31
eic::ConstProtoCluster::operator<
bool operator<(const ConstProtoCluster &other) const
Definition: ProtoClusterConst.h:72
eic::ProtoClusterConstCollectionIterator
Definition: ProtoClusterCollection.h:51
eic::ConstProtoCluster::~ConstProtoCluster
~ConstProtoCluster()
destructor
Definition: ProtoClusterConst.cc:45
eic
Definition: BasicParticle.cc:13
eic::ConstProtoCluster::id
unsigned int id() const
Definition: ProtoClusterConst.h:74
eic::ProtoCluster
Definition: ProtoCluster.h:23
eic::ConstProtoCluster::operator==
bool operator==(const ConstProtoCluster &other) const
Definition: ProtoClusterConst.h:68
eic::ConstProtoCluster
Definition: ProtoClusterConst.h:21
eic::ConstProtoCluster::clusterID
const eic::Index & clusterID() const
Access the ID of the cluster associated with this hit (-1 if none)
Definition: ProtoClusterConst.cc:49
eic::ConstProtoCluster::ConstProtoCluster
ConstProtoCluster()
default constructor
Definition: ProtoClusterConst.cc:16
eic::Weight
Definition: Weight.h:11
eic::ConstProtoCluster::clone
ConstProtoCluster clone() const
support cloning (deep-copy)
Definition: ProtoClusterConst.cc:41
Weight.h
eic::ProtoClusterCollection
Definition: ProtoClusterCollection.h:76
eic::ProtoClusterObj
Definition: ProtoClusterObj.h:18
eic::ConstProtoCluster::getObjectID
const podio::ObjectID getObjectID() const
Definition: ProtoClusterConst.cc:64
Index.h
eic::ConstProtoCluster::unlink
void unlink()
disconnect from ProtoClusterObj instance
Definition: ProtoClusterConst.h:66
ProtoClusterObj.h
eic::ConstProtoCluster::weight
const eic::Weight & weight() const
Access the How much of this hit belongs to the cluster? [0->1].
Definition: ProtoClusterConst.cc:50
eic::ConstProtoCluster::hitID
const eic::Index & hitID() const
Access the Hit ID.
Definition: ProtoClusterConst.cc:48
eic::ConstProtoCluster::isAvailable
bool isAvailable() const
check whether the object is actually available
Definition: ProtoClusterConst.cc:57