EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableVertex.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableVertex_H
4#define EDM4EIC_MutableVertex_H
5
6#include "edm4eic/VertexObj.h"
7// Make the immutable class available from its mutable version but not vice versa
8#include "edm4eic/Vertex.h"
9
10#include "edm4eic/Cov4f.h"
12#include "edm4hep/Vector4f.h"
13#include "podio/RelationRange.h"
14#include <cstdint>
15#include <vector>
16
17#include "podio/utilities/MaybeSharedPtr.h"
18
19#include <ostream>
20#include <cstddef>
21
22#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
23#include "nlohmann/json_fwd.hpp"
24#endif
25
26
27
28namespace edm4eic {
29
30
31/** @class MutableVertex
32 * EIC vertex
33 * @author: J. Osborn
34 */
36
37 friend class VertexCollection;
39 friend class Vertex;
40
41public:
44
45 /// default constructor
47
48 /// Constructor initializing all members
49 MutableVertex(std::int32_t type, float chi2, int ndf, edm4hep::Vector4f position, edm4eic::Cov4f positionError);
50
51 /// copy constructor
52 MutableVertex(const MutableVertex& other) = default;
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
61 ~MutableVertex() = default;
62
63
64 /// conversion to const object
65 operator Vertex() const;
66
67public:
68
69 /// Access the Type flag, to identify what type of vertex it is (e.g. primary, secondary, generated, etc.)
70 std::int32_t getType() const;
71
72 /// Access the Chi-squared of the vertex fit
73 float getChi2() const;
74
75 /// Access the NDF of the vertex fit
76 int getNdf() const;
77
78 /// Access the position [mm] + time t0 [ns] of the vertex. Time is 4th component in vector
79 const edm4hep::Vector4f& getPosition() const;
80
81 /// Access the Covariance matrix of the position+time. Time is 4th component, similarly to 4vector
82 const edm4eic::Cov4f& getPositionError() const;
83
84
85
86 /// Set the Type flag, to identify what type of vertex it is (e.g. primary, secondary, generated, etc.)
87 void setType(std::int32_t value);
88
89 /// Set the Chi-squared of the vertex fit
90 void setChi2(float value);
91
92 /// Set the NDF of the vertex fit
93 void setNdf(int value);
94
95 /// Set the position [mm] + time t0 [ns] of the vertex. Time is 4th component in vector
96 void setPosition(edm4hep::Vector4f value);
97 /// Get reference to position [mm] + time t0 [ns] of the vertex. Time is 4th component in vector
98 edm4hep::Vector4f& position();
99
100 /// Set the Covariance matrix of the position+time. Time is 4th component, similarly to 4vector
102 /// Get reference to Covariance matrix of the position+time. Time is 4th component, similarly to 4vector
104
105
106
108 std::size_t associatedParticles_size() const;
110 std::vector<edm4eic::ReconstructedParticle>::const_iterator associatedParticles_begin() const;
111 std::vector<edm4eic::ReconstructedParticle>::const_iterator associatedParticles_end() const;
112 podio::RelationRange<edm4eic::ReconstructedParticle> getAssociatedParticles() const;
113
114
115
116 /// check whether the object is actually available
117 bool isAvailable() const;
118 /// disconnect from VertexObj instance
119 void unlink() { m_obj = podio::utils::MaybeSharedPtr<VertexObj>{nullptr}; }
120
121 bool operator==(const MutableVertex& other) const { return m_obj == other.m_obj; }
122 bool operator==(const Vertex& other) const;
123
124 // less comparison operator, so that objects can be e.g. stored in sets.
125 bool operator<(const MutableVertex& other) const { return m_obj < other.m_obj; }
126
127 podio::ObjectID id() const { return getObjectID(); }
128
129 const podio::ObjectID getObjectID() const;
130
131 friend void swap(MutableVertex& a, MutableVertex& b) {
132 using std::swap;
133 swap(a.m_obj, b.m_obj); // swap out the internal pointers
134 }
135
136private:
137 /// constructor from existing VertexObj
138 explicit MutableVertex(podio::utils::MaybeSharedPtr<VertexObj> obj);
139
140 podio::utils::MaybeSharedPtr<VertexObj> m_obj{nullptr};
141};
142
143#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
144void to_json(nlohmann::json& j, const MutableVertex& value);
145#endif
146
147
148} // namespace edm4eic
149
150
151#endif
Definition Cov4f.h:18
Definition MutableVertex.h:35
friend class Vertex
Definition MutableVertex.h:39
void unlink()
disconnect from VertexObj instance
Definition MutableVertex.h:119
void setPosition(edm4hep::Vector4f value)
Set the position [mm] + time t0 [ns] of the vertex. Time is 4th component in vector.
Definition MutableVertex.cc:55
MutableVertex & operator=(MutableVertex other)
copy-assignment operator
Definition MutableVertex.cc:33
const podio::ObjectID getObjectID() const
Definition MutableVertex.cc:109
const edm4eic::Cov4f & getPositionError() const
Access the Covariance matrix of the position+time. Time is 4th component, similarly to 4vector.
Definition MutableVertex.cc:49
bool operator<(const MutableVertex &other) const
Definition MutableVertex.h:125
edm4eic::Cov4f & positionError()
Get reference to Covariance matrix of the position+time. Time is 4th component, similarly to 4vector.
Definition MutableVertex.cc:58
friend class VertexCollection
Definition MutableVertex.h:37
std::vector< edm4eic::ReconstructedParticle >::const_iterator associatedParticles_end() const
Definition MutableVertex.cc:72
edm4hep::Vector4f & position()
Get reference to position [mm] + time t0 [ns] of the vertex. Time is 4th component in vector.
Definition MutableVertex.cc:56
podio::ObjectID id() const
Definition MutableVertex.h:127
float getChi2() const
Access the Chi-squared of the vertex fit.
Definition MutableVertex.cc:46
int getNdf() const
Access the NDF of the vertex fit.
Definition MutableVertex.cc:47
~MutableVertex()=default
destructor
MutableVertex(const MutableVertex &other)=default
copy constructor
void addToAssociatedParticles(edm4eic::ReconstructedParticle)
Definition MutableVertex.cc:61
MutableVertex clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableVertex.cc:38
friend void swap(MutableVertex &a, MutableVertex &b)
Definition MutableVertex.h:131
const edm4hep::Vector4f & getPosition() const
Access the position [mm] + time t0 [ns] of the vertex. Time is 4th component in vector.
Definition MutableVertex.cc:48
std::size_t associatedParticles_size() const
Definition MutableVertex.cc:78
bool isAvailable() const
check whether the object is actually available
Definition MutableVertex.cc:102
std::vector< edm4eic::ReconstructedParticle >::const_iterator associatedParticles_begin() const
Definition MutableVertex.cc:66
void setChi2(float value)
Set the Chi-squared of the vertex fit.
Definition MutableVertex.cc:53
void setNdf(int value)
Set the NDF of the vertex fit.
Definition MutableVertex.cc:54
bool operator==(const MutableVertex &other) const
Definition MutableVertex.h:121
void setPositionError(edm4eic::Cov4f value)
Set the Covariance matrix of the position+time. Time is 4th component, similarly to 4vector.
Definition MutableVertex.cc:57
podio::RelationRange< edm4eic::ReconstructedParticle > getAssociatedParticles() const
Definition MutableVertex.cc:89
MutableVertex()
default constructor
Definition MutableVertex.cc:21
void setType(std::int32_t value)
Set the Type flag, to identify what type of vertex it is (e.g. primary, secondary,...
Definition MutableVertex.cc:52
std::int32_t getType() const
Access the Type flag, to identify what type of vertex it is (e.g. primary, secondary,...
Definition MutableVertex.cc:45
Definition ReconstructedParticle.h:47
Definition VertexCollection.h:95
Definition Vertex.h:36
Definition VertexCollection.h:66
Definition CalorimeterHit.cc:18