EDM4eic
EIC data model
Loading...
Searching...
No Matches
Measurement2D.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_Measurement2D_H
4#define EDM4EIC_Measurement2D_H
5
7
8#include "edm4eic/Cov3f.h"
10#include "edm4hep/Vector2f.h"
11#include "podio/RelationRange.h"
12#include <cstdint>
13#include <vector>
14
15#include "podio/utilities/MaybeSharedPtr.h"
16#include "podio/detail/OrderKey.h"
17
18#include <ostream>
19#include <cstdint>
20
21#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
22#include "nlohmann/json_fwd.hpp"
23#endif
24
25// forward declarations
26namespace edm4eic {
27class Measurement2DCollection;
28}
29
30
31namespace podio::detail {
32// Internal function used in less comparison operators of the datatypes and interface types
33OrderKey getOrderKey(const edm4eic::Measurement2D& obj);
34};
35
36namespace edm4eic {
37
38class MutableMeasurement2D;
39class Measurement2DCollection;
40class Measurement2DCollectionData;
41
42/** @class Measurement2D
43 * 2D measurement (on an arbitrary surface)
44 * @author: W. Deconinck
45 */
47
52 friend podio::detail::OrderKey podio::detail::getOrderKey(const Measurement2D & obj);
53
54public:
57
58 /// default constructor
60
61 /// Constructor initializing all members
62 Measurement2D(std::uint64_t surface, edm4hep::Vector2f loc, float time, edm4eic::Cov3f covariance);
63
64 /// copy constructor
65 Measurement2D(const Measurement2D& other) = default;
66
67 /// copy-assignment operator
69
70 /// create a mutable deep-copy of the object with identical relations
71 /// if cloneRelations=false, the relations are not cloned and will be empty
72 MutableMeasurement2D clone(bool cloneRelations=true) const;
73
74 /// destructor
75 ~Measurement2D() = default;
76
77 /// converting constructor from mutable object
79
80 static Measurement2D makeEmpty();
81
82public:
83
84 static constexpr auto typeName = "edm4eic::Measurement2D";
85
86 /// Access the Surface for bound coordinates (geometryID)
87 std::uint64_t getSurface() const;
88
89 /// Access the 2D location on surface
90 const edm4hep::Vector2f& getLoc() const;
91
92 /// Access the Measurement time
93 float getTime() const;
94
95 /// Access the Covariance on location and time
96 const edm4eic::Cov3f& getCovariance() const;
97
98
99
100 std::size_t hits_size() const;
101 edm4eic::TrackerHit getHits(std::size_t) const;
102 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
103 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
104 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
105 std::size_t weights_size() const;
106 float getWeights(std::size_t) const;
107 std::vector<float>::const_iterator weights_begin() const;
108 std::vector<float>::const_iterator weights_end() const;
109 podio::RelationRange<float> getWeights() const;
110
111
112 /// check whether the object is actually available
113 bool isAvailable() const;
114 /// disconnect from Measurement2DObj instance
115 void unlink() { m_obj = podio::utils::MaybeSharedPtr<Measurement2DObj>{nullptr}; }
116
117 bool operator==(const Measurement2D& other) const { return m_obj == other.m_obj; }
118 bool operator==(const MutableMeasurement2D& other) const;
119
120 bool operator!=(const Measurement2D& other) const { return !(*this == other); }
121 bool operator!=(const MutableMeasurement2D& other) const { return !(*this == other); }
122
123 // less comparison operator, so that objects can be e.g. stored in sets.
124 bool operator<(const Measurement2D& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
125
126 podio::ObjectID id() const { return getObjectID(); }
127
128 const podio::ObjectID getObjectID() const;
129
130 friend void swap(Measurement2D& a, Measurement2D& b) {
131 using std::swap;
132 swap(a.m_obj, b.m_obj); // swap out the internal pointers
133 }
134
135private:
136 /// constructor from existing Measurement2DObj
137 explicit Measurement2D(podio::utils::MaybeSharedPtr<Measurement2DObj> obj);
139
140 podio::utils::MaybeSharedPtr<Measurement2DObj> m_obj{nullptr};
141};
142
143std::ostream& operator<<(std::ostream& o, const Measurement2D& value);
144
145#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
146void to_json(nlohmann::json& j, const Measurement2D& value);
147#endif
148
149
150} // namespace edm4eic
151
152
153#endif
Definition Cov3f.h:18
Definition Measurement2DCollectionData.h:31
Definition Measurement2DCollection.h:91
Definition Measurement2DCollection.h:36
Definition Measurement2D.h:46
std::uint64_t getSurface() const
Access the Surface for bound coordinates (geometryID)
Definition Measurement2D.cc:77
const edm4eic::Cov3f & getCovariance() const
Access the Covariance on location and time.
Definition Measurement2D.cc:80
bool isAvailable() const
check whether the object is actually available
Definition Measurement2D.cc:151
friend class Measurement2DCollection
Definition Measurement2D.h:49
void unlink()
disconnect from Measurement2DObj instance
Definition Measurement2D.h:115
const edm4hep::Vector2f & getLoc() const
Access the 2D location on surface.
Definition Measurement2D.cc:78
std::vector< edm4eic::TrackerHit >::const_iterator hits_end() const
Definition Measurement2D.cc:90
MutableMeasurement2D clone(bool cloneRelations=true) const
Definition Measurement2D.cc:36
std::size_t weights_size() const
Definition Measurement2D.cc:128
Measurement2D(const Measurement2D &other)=default
copy constructor
std::vector< float >::const_iterator weights_end() const
Definition Measurement2D.cc:122
podio::RelationRange< edm4eic::TrackerHit > getHits() const
Definition Measurement2D.cc:107
bool operator==(const Measurement2D &other) const
Definition Measurement2D.h:117
Measurement2D & operator=(Measurement2D other)
copy-assignment operator
Definition Measurement2D.cc:31
~Measurement2D()=default
destructor
podio::RelationRange< float > getWeights() const
Definition Measurement2D.cc:139
std::size_t hits_size() const
Definition Measurement2D.cc:96
std::vector< edm4eic::TrackerHit >::const_iterator hits_begin() const
Definition Measurement2D.cc:84
bool operator<(const Measurement2D &other) const
Definition Measurement2D.h:124
float getTime() const
Access the Measurement time.
Definition Measurement2D.cc:79
const podio::ObjectID getObjectID() const
Definition Measurement2D.cc:155
static Measurement2D makeEmpty()
Definition Measurement2D.cc:73
Measurement2D()
default constructor
Definition Measurement2D.cc:20
friend void swap(Measurement2D &a, Measurement2D &b)
Definition Measurement2D.h:130
podio::ObjectID id() const
Definition Measurement2D.h:126
static constexpr auto typeName
Definition Measurement2D.h:84
bool operator!=(const Measurement2D &other) const
Definition Measurement2D.h:120
std::vector< float >::const_iterator weights_begin() const
Definition Measurement2D.cc:116
friend class MutableMeasurement2D
Definition Measurement2D.h:48
bool operator!=(const MutableMeasurement2D &other) const
Definition Measurement2D.h:121
Definition Measurement2DObj.h:20
Definition MutableMeasurement2D.h:38
Definition TrackerHit.h:45
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150