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