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 <cstdint>
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 /// if cloneRelations=false, the relations are not cloned and will be empty
61 MutableVertex clone(bool cloneRelations=true) const;
62
63 /// destructor
64 ~Vertex() = default;
65
66 /// converting constructor from mutable object
67 Vertex(const MutableVertex& other);
68
69 static Vertex makeEmpty();
70
71public:
72
73 /// Access the Type flag, to identify what type of vertex it is (e.g. primary, secondary, generated, etc.)
74 std::int32_t getType() const;
75
76 /// Access the Chi-squared of the vertex fit
77 float getChi2() const;
78
79 /// Access the NDF of the vertex fit
80 int getNdf() const;
81
82 /// Access the position [mm] + time t0 [ns] of the vertex. Time is 4th component in vector
83 const edm4hep::Vector4f& getPosition() const;
84
85 /// Access the Covariance matrix of the position+time. Time is 4th component, similarly to 4vector
86 const edm4eic::Cov4f& getPositionError() const;
87
88
89
90 std::size_t associatedParticles_size() const;
92 std::vector<edm4eic::ReconstructedParticle>::const_iterator associatedParticles_begin() const;
93 std::vector<edm4eic::ReconstructedParticle>::const_iterator associatedParticles_end() const;
94 podio::RelationRange<edm4eic::ReconstructedParticle> getAssociatedParticles() const;
95
96
97 /// check whether the object is actually available
98 bool isAvailable() const;
99 /// disconnect from VertexObj instance
100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<VertexObj>{nullptr}; }
101
102 bool operator==(const Vertex& other) const { return m_obj == other.m_obj; }
103 bool operator==(const MutableVertex& other) const;
104
105 bool operator!=(const Vertex& other) const { return !(*this == other); }
106 bool operator!=(const MutableVertex& other) const { return !(*this == other); }
107
108 // less comparison operator, so that objects can be e.g. stored in sets.
109 bool operator<(const Vertex& other) const { return m_obj < other.m_obj; }
110
111 podio::ObjectID id() const { return getObjectID(); }
112
113 const podio::ObjectID getObjectID() const;
114
115 friend void swap(Vertex& a, Vertex& b) {
116 using std::swap;
117 swap(a.m_obj, b.m_obj); // swap out the internal pointers
118 }
119
120private:
121 /// constructor from existing VertexObj
122 explicit Vertex(podio::utils::MaybeSharedPtr<VertexObj> obj);
123 Vertex(VertexObj* obj);
124
125 podio::utils::MaybeSharedPtr<VertexObj> m_obj{nullptr};
126};
127
128std::ostream& operator<<(std::ostream& o, const Vertex& value);
129
130#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
131void to_json(nlohmann::json& j, const Vertex& value);
132#endif
133
134
135} // namespace edm4eic
136
137
138#endif
Definition Cov4f.h:18
Definition MutableVertex.h:34
Definition ReconstructedParticle.h:47
Definition VertexCollectionData.h:31
Definition VertexCollection.h:92
Definition VertexCollection.h:37
Definition Vertex.h:36
bool operator<(const Vertex &other) const
Definition Vertex.h:109
int getNdf() const
Access the NDF of the vertex fit.
Definition Vertex.cc:69
const edm4hep::Vector4f & getPosition() const
Access the position [mm] + time t0 [ns] of the vertex. Time is 4th component in vector.
Definition Vertex.cc:70
friend class MutableVertex
Definition Vertex.h:38
podio::ObjectID id() const
Definition Vertex.h:111
void unlink()
disconnect from VertexObj instance
Definition Vertex.h:100
bool operator!=(const MutableVertex &other) const
Definition Vertex.h:106
podio::RelationRange< edm4eic::ReconstructedParticle > getAssociatedParticles() const
Definition Vertex.cc:98
const edm4eic::Cov4f & getPositionError() const
Access the Covariance matrix of the position+time. Time is 4th component, similarly to 4vector.
Definition Vertex.cc:71
const podio::ObjectID getObjectID() const
Definition Vertex.cc:114
friend class VertexCollection
Definition Vertex.h:39
friend void swap(Vertex &a, Vertex &b)
Definition Vertex.h:115
std::vector< edm4eic::ReconstructedParticle >::const_iterator associatedParticles_begin() const
Definition Vertex.cc:75
~Vertex()=default
destructor
Vertex()
default constructor
Definition Vertex.cc:20
std::vector< edm4eic::ReconstructedParticle >::const_iterator associatedParticles_end() const
Definition Vertex.cc:81
std::size_t associatedParticles_size() const
Definition Vertex.cc:87
float getChi2() const
Access the Chi-squared of the vertex fit.
Definition Vertex.cc:68
bool operator!=(const Vertex &other) const
Definition Vertex.h:105
static Vertex makeEmpty()
Definition Vertex.cc:63
Vertex(const Vertex &other)=default
copy constructor
Vertex & operator=(Vertex other)
copy-assignment operator
Definition Vertex.cc:32
MutableVertex clone(bool cloneRelations=true) const
Definition Vertex.cc:37
std::int32_t getType() const
Access the Type flag, to identify what type of vertex it is (e.g. primary, secondary,...
Definition Vertex.cc:67
bool isAvailable() const
check whether the object is actually available
Definition Vertex.cc:110
bool operator==(const Vertex &other) const
Definition Vertex.h:102
Definition VertexObj.h:19
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103