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