EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableMeasurement2D.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableMeasurement2D_H
4#define EDM4EIC_MutableMeasurement2D_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include "edm4eic/Cov3f.h"
11#include "edm4eic/TrackerHit.h"
12#include "edm4hep/Vector2f.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 MutableMeasurement2D
32 * 2D measurement (on an arbitrary surface)
33 * @author: W. Deconinck
34 */
36
39 friend class Measurement2D;
40
41public:
44
45 /// default constructor
47
48 /// Constructor initializing all members
49 MutableMeasurement2D(std::uint64_t surface, edm4hep::Vector2f loc, float time, edm4eic::Cov3f covariance);
50
51 /// copy constructor
53
54 /// copy-assignment operator
56
57 /// create a mutable deep-copy of the object with identical relations
59
60 /// destructor
62
63
64 /// conversion to const object
65 operator Measurement2D() const;
66
67public:
68
69 /// Access the Surface for bound coordinates (geometryID)
70 std::uint64_t getSurface() const;
71
72 /// Access the 2D location on surface
73 const edm4hep::Vector2f& getLoc() const;
74
75 /// Access the Measurement time
76 float getTime() const;
77
78 /// Access the Covariance on location and time
79 const edm4eic::Cov3f& getCovariance() const;
80
81
82
83 /// Set the Surface for bound coordinates (geometryID)
84 void setSurface(std::uint64_t value);
85
86 /// Set the 2D location on surface
87 void setLoc(edm4hep::Vector2f value);
88 /// Get reference to 2D location on surface
89 edm4hep::Vector2f& loc();
90
91 /// Set the Measurement time
92 void setTime(float value);
93
94 /// Set the Covariance on location and time
95 void setCovariance(edm4eic::Cov3f value);
96 /// Get reference to Covariance on location and time
98
99
100
102 std::size_t hits_size() const;
103 edm4eic::TrackerHit getHits(std::size_t) const;
104 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
105 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
106 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
107 void addToWeights(float);
108 std::size_t weights_size() const;
109 float getWeights(std::size_t) const;
110 std::vector<float>::const_iterator weights_begin() const;
111 std::vector<float>::const_iterator weights_end() const;
112 podio::RelationRange<float> getWeights() const;
113
114
115
116 /// check whether the object is actually available
117 bool isAvailable() const;
118 /// disconnect from Measurement2DObj instance
119 void unlink() { m_obj = podio::utils::MaybeSharedPtr<Measurement2DObj>{nullptr}; }
120
121 bool operator==(const MutableMeasurement2D& other) const { return m_obj == other.m_obj; }
122 bool operator==(const Measurement2D& other) const;
123
124 // less comparison operator, so that objects can be e.g. stored in sets.
125 bool operator<(const MutableMeasurement2D& other) const { return m_obj < other.m_obj; }
126
127 podio::ObjectID id() const { return getObjectID(); }
128
129 const podio::ObjectID getObjectID() const;
130
132 using std::swap;
133 swap(a.m_obj, b.m_obj); // swap out the internal pointers
134 }
135
136private:
137 /// constructor from existing Measurement2DObj
138 explicit MutableMeasurement2D(podio::utils::MaybeSharedPtr<Measurement2DObj> obj);
139
140 podio::utils::MaybeSharedPtr<Measurement2DObj> m_obj{nullptr};
141};
142
143#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
144void to_json(nlohmann::json& j, const MutableMeasurement2D& value);
145#endif
146
147
148} // namespace edm4eic
149
150
151#endif
Definition Cov3f.h:18
Definition Measurement2DCollection.h:95
Definition Measurement2D.h:36
Definition Measurement2DCollection.h:66
Definition MutableMeasurement2D.h:35
std::size_t weights_size() const
Definition MutableMeasurement2D.cc:111
void setCovariance(edm4eic::Cov3f value)
Set the Covariance on location and time.
Definition MutableMeasurement2D.cc:54
friend class Measurement2D
Definition MutableMeasurement2D.h:39
MutableMeasurement2D & operator=(MutableMeasurement2D other)
copy-assignment operator
Definition MutableMeasurement2D.cc:32
void addToHits(edm4eic::TrackerHit)
Definition MutableMeasurement2D.cc:58
friend class Measurement2DCollection
Definition MutableMeasurement2D.h:37
MutableMeasurement2D()
default constructor
Definition MutableMeasurement2D.cc:21
friend void swap(MutableMeasurement2D &a, MutableMeasurement2D &b)
Definition MutableMeasurement2D.h:131
std::vector< edm4eic::TrackerHit >::const_iterator hits_begin() const
Definition MutableMeasurement2D.cc:63
edm4eic::Cov3f & covariance()
Get reference to Covariance on location and time.
Definition MutableMeasurement2D.cc:55
std::vector< edm4eic::TrackerHit >::const_iterator hits_end() const
Definition MutableMeasurement2D.cc:69
MutableMeasurement2D(const MutableMeasurement2D &other)=default
copy constructor
edm4hep::Vector2f & loc()
Get reference to 2D location on surface.
Definition MutableMeasurement2D.cc:52
bool isAvailable() const
check whether the object is actually available
Definition MutableMeasurement2D.cc:135
void setLoc(edm4hep::Vector2f value)
Set the 2D location on surface.
Definition MutableMeasurement2D.cc:51
podio::RelationRange< edm4eic::TrackerHit > getHits() const
Definition MutableMeasurement2D.cc:86
bool operator<(const MutableMeasurement2D &other) const
Definition MutableMeasurement2D.h:125
podio::RelationRange< float > getWeights() const
Definition MutableMeasurement2D.cc:122
std::vector< float >::const_iterator weights_begin() const
Definition MutableMeasurement2D.cc:99
const podio::ObjectID getObjectID() const
Definition MutableMeasurement2D.cc:142
const edm4hep::Vector2f & getLoc() const
Access the 2D location on surface.
Definition MutableMeasurement2D.cc:45
std::uint64_t getSurface() const
Access the Surface for bound coordinates (geometryID)
Definition MutableMeasurement2D.cc:44
void unlink()
disconnect from Measurement2DObj instance
Definition MutableMeasurement2D.h:119
podio::ObjectID id() const
Definition MutableMeasurement2D.h:127
const edm4eic::Cov3f & getCovariance() const
Access the Covariance on location and time.
Definition MutableMeasurement2D.cc:47
void setSurface(std::uint64_t value)
Set the Surface for bound coordinates (geometryID)
Definition MutableMeasurement2D.cc:50
bool operator==(const MutableMeasurement2D &other) const
Definition MutableMeasurement2D.h:121
MutableMeasurement2D clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableMeasurement2D.cc:37
void addToWeights(float)
Definition MutableMeasurement2D.cc:94
std::vector< float >::const_iterator weights_end() const
Definition MutableMeasurement2D.cc:105
void setTime(float value)
Set the Measurement time.
Definition MutableMeasurement2D.cc:53
~MutableMeasurement2D()=default
destructor
float getTime() const
Access the Measurement time.
Definition MutableMeasurement2D.cc:46
std::size_t hits_size() const
Definition MutableMeasurement2D.cc:75
Definition TrackerHit.h:38
Definition CalorimeterHit.cc:18