EICd
EIC data model
MutableVertex.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableVertex_H
4#define EICD_MutableVertex_H
5
6#include "eicd/VertexObj.h"
7// Make the immutable class available from its mutable version but not vice versa
8#include "eicd/Vertex.h"
9
10#include "eicd/Cov3f.h"
11#include "edm4hep/Vector3f.h"
12#include "podio/RelationRange.h"
13#include <cstdint>
14#include <vector>
15#include "podio/ObjectID.h"
16#include <ostream>
17
18#ifdef PODIO_JSON_OUTPUT
19#include "nlohmann/json.hpp"
20#endif
21
22// forward declarations
23namespace eicd {
24class ReconstructedParticle;
25class MutableReconstructedParticle;
26}
27
28
29namespace eicd {
30
31
32/** @class MutableVertex
33 * EIC vertex
34 * @author: W. Armstrong, S. Joosten, based off EDM4hep
35 */
37
38 friend class VertexCollection;
40 friend class Vertex;
41
42public:
43
44 /// default constructor
46 MutableVertex(std::int32_t primary, float chi2, float probability, edm4hep::Vector3f position, eicd::Cov3f positionError, std::int32_t algorithmType, float time);
47
48 /// constructor from existing VertexObj
50
51 /// copy constructor
52 MutableVertex(const MutableVertex& other);
53
54 /// copy-assignment operator
56
57 /// create a mutable deep-copy of the object with identical relations
58 MutableVertex clone() const;
59
60 /// destructor
62
63 /// conversion to const object
64 operator Vertex() const;
65
66public:
67
68 /// Access the Boolean flag, if vertex is the primary vertex of the event
69 const std::int32_t& getPrimary() const;
70
71 /// Access the Chi-squared of the vertex fit
72 const float& getChi2() const;
73
74 /// Access the Probability of the vertex fit
75 const float& getProbability() const;
76
77 /// Access the [mm] position of the vertex.
78 const edm4hep::Vector3f& getPosition() const;
79
80 /// Access the Covariance matrix of the position
81 const eicd::Cov3f& getPositionError() const;
82
83 /// Access the Type code for the algorithm that has been used to create the vertex - check/set the collection parameters AlgorithmName and AlgorithmType.
84 const std::int32_t& getAlgorithmType() const;
85
86 /// Access the Vertex time
87 const float& getTime() const;
88
89
90 /// Access the reconstructed particle associated to this vertex.
92
93 /// Set the Boolean flag, if vertex is the primary vertex of the event
94 void setPrimary(std::int32_t value);
95
96 /// Set the Chi-squared of the vertex fit
97 void setChi2(float value);
98
99 /// Set the Probability of the vertex fit
100 void setProbability(float value);
101
102 /// Set the [mm] position of the vertex.
103 void setPosition(edm4hep::Vector3f value);
104 /// Get reference to [mm] position of the vertex.
105 edm4hep::Vector3f& position();
106
107 /// Set the Covariance matrix of the position
108 void setPositionError(eicd::Cov3f value);
109 /// Get reference to Covariance matrix of the position
111
112 /// Set the Type code for the algorithm that has been used to create the vertex - check/set the collection parameters AlgorithmName and AlgorithmType.
113 void setAlgorithmType(std::int32_t value);
114
115 /// Set the Vertex time
116 void setTime(float value);
117
118
119 /// Set the reconstructed particle associated to this vertex.
121
122 void addToParameters(float);
123 unsigned int parameters_size() const;
124 float getParameters(unsigned int) const;
125 std::vector<float>::const_iterator parameters_begin() const;
126 std::vector<float>::const_iterator parameters_end() const;
127 podio::RelationRange<float> getParameters() const;
128
129
130
131 /// check whether the object is actually available
132 bool isAvailable() const;
133 /// disconnect from VertexObj instance
134 void unlink() { m_obj = nullptr; }
135
136 bool operator==(const MutableVertex& other) const { return m_obj == other.m_obj; }
137 bool operator==(const Vertex& other) const;
138
139 // less comparison operator, so that objects can be e.g. stored in sets.
140 bool operator<(const MutableVertex& other) const { return m_obj < other.m_obj; }
141
142 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
143
144 const podio::ObjectID getObjectID() const;
145
146 friend void swap(MutableVertex& a, MutableVertex& b) {
147 using std::swap;
148 swap(a.m_obj, b.m_obj); // swap out the internal pointers
149 }
150
151private:
152 VertexObj* m_obj;
153};
154
155#ifdef PODIO_JSON_OUTPUT
156void to_json(nlohmann::json& j, const MutableVertex& value);
157#endif
158
159
160} // namespace eicd
161
162
163#endif
Definition: Cov3f.h:15
Definition: MutableVertex.h:36
MutableVertex clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableVertex.cc:47
friend class Vertex
Definition: MutableVertex.h:40
const edm4hep::Vector3f & getPosition() const
Access the [mm] position of the vertex.
Definition: MutableVertex.cc:61
bool isAvailable() const
check whether the object is actually available
Definition: MutableVertex.cc:133
const eicd::ReconstructedParticle getAssociatedParticle() const
Access the reconstructed particle associated to this vertex.
Definition: MutableVertex.cc:66
edm4hep::Vector3f & position()
Get reference to [mm] position of the vertex.
Definition: MutableVertex.cc:78
void setPositionError(eicd::Cov3f value)
Set the Covariance matrix of the position.
Definition: MutableVertex.cc:79
void unlink()
disconnect from VertexObj instance
Definition: MutableVertex.h:134
const eicd::Cov3f & getPositionError() const
Access the Covariance matrix of the position.
Definition: MutableVertex.cc:62
~MutableVertex()
destructor
Definition: MutableVertex.cc:51
const float & getTime() const
Access the Vertex time.
Definition: MutableVertex.cc:64
void addToParameters(float)
Definition: MutableVertex.cc:92
podio::RelationRange< float > getParameters() const
Definition: MutableVertex.cc:120
const float & getProbability() const
Access the Probability of the vertex fit.
Definition: MutableVertex.cc:60
MutableVertex()
default constructor
Definition: MutableVertex.cc:17
unsigned int id() const
Definition: MutableVertex.h:142
void setChi2(float value)
Set the Chi-squared of the vertex fit.
Definition: MutableVertex.cc:75
void setPrimary(std::int32_t value)
Set the Boolean flag, if vertex is the primary vertex of the event.
Definition: MutableVertex.cc:74
const std::int32_t & getPrimary() const
Access the Boolean flag, if vertex is the primary vertex of the event.
Definition: MutableVertex.cc:58
const std::int32_t & getAlgorithmType() const
Access the Type code for the algorithm that has been used to create the vertex - check/set the collec...
Definition: MutableVertex.cc:63
unsigned int parameters_size() const
Definition: MutableVertex.cc:109
bool operator==(const MutableVertex &other) const
Definition: MutableVertex.h:136
void setTime(float value)
Set the Vertex time.
Definition: MutableVertex.cc:82
MutableVertex & operator=(MutableVertex other)
copy-assignment operator
Definition: MutableVertex.cc:36
const float & getChi2() const
Access the Chi-squared of the vertex fit.
Definition: MutableVertex.cc:59
void setPosition(edm4hep::Vector3f value)
Set the [mm] position of the vertex.
Definition: MutableVertex.cc:77
friend void swap(MutableVertex &a, MutableVertex &b)
Definition: MutableVertex.h:146
const podio::ObjectID getObjectID() const
Definition: MutableVertex.cc:140
void setProbability(float value)
Set the Probability of the vertex fit.
Definition: MutableVertex.cc:76
bool operator<(const MutableVertex &other) const
Definition: MutableVertex.h:140
void setAlgorithmType(std::int32_t value)
Set the Type code for the algorithm that has been used to create the vertex - check/set the collectio...
Definition: MutableVertex.cc:81
std::vector< float >::const_iterator parameters_end() const
Definition: MutableVertex.cc:103
eicd::Cov3f & positionError()
Get reference to Covariance matrix of the position.
Definition: MutableVertex.cc:80
std::vector< float >::const_iterator parameters_begin() const
Definition: MutableVertex.cc:97
void setAssociatedParticle(eicd::ReconstructedParticle value)
Set the reconstructed particle associated to this vertex.
Definition: MutableVertex.cc:84
Definition: ReconstructedParticle.h:42
Definition: VertexCollection.h:82
Definition: Vertex.h:35
Definition: VertexCollection.h:57
Definition: VertexObj.h:22
Definition: CalorimeterHit.cc:13