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
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 MutableMeasurement2D;
29class Measurement2DCollection;
30class Measurement2DCollectionData;
31
32/** @class Measurement2D
33 * 2D measurement (on an arbitrary surface)
34 * @author: W. Deconinck
35 */
37
42
43public:
46
47 /// default constructor
49
50 /// Constructor initializing all members
51 Measurement2D(std::uint64_t surface, edm4hep::Vector2f loc, float time, edm4eic::Cov3f covariance);
52
53 /// copy constructor
54 Measurement2D(const Measurement2D& other) = default;
55
56 /// copy-assignment operator
58
59 /// create a mutable deep-copy of the object with identical relations
61
62 /// destructor
63 ~Measurement2D() = default;
64
65
66 static Measurement2D makeEmpty();
67
68public:
69
70 /// Access the Surface for bound coordinates (geometryID)
71 std::uint64_t getSurface() const;
72
73 /// Access the 2D location on surface
74 const edm4hep::Vector2f& getLoc() const;
75
76 /// Access the Measurement time
77 float getTime() const;
78
79 /// Access the Covariance on location and time
80 const edm4eic::Cov3f& getCovariance() const;
81
82
83
84 std::size_t hits_size() const;
85 edm4eic::TrackerHit getHits(std::size_t) const;
86 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
87 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
88 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
89 std::size_t weights_size() const;
90 float getWeights(std::size_t) const;
91 std::vector<float>::const_iterator weights_begin() const;
92 std::vector<float>::const_iterator weights_end() const;
93 podio::RelationRange<float> getWeights() const;
94
95
96 /// check whether the object is actually available
97 bool isAvailable() const;
98 /// disconnect from Measurement2DObj instance
99 void unlink() { m_obj = podio::utils::MaybeSharedPtr<Measurement2DObj>{nullptr}; }
100
101 bool operator==(const Measurement2D& other) const { return m_obj == other.m_obj; }
102 bool operator==(const MutableMeasurement2D& other) const;
103
104 // less comparison operator, so that objects can be e.g. stored in sets.
105 bool operator<(const Measurement2D& other) const { return m_obj < other.m_obj; }
106
107 podio::ObjectID id() const { return getObjectID(); }
108
109 const podio::ObjectID getObjectID() const;
110
111 friend void swap(Measurement2D& a, Measurement2D& b) {
112 using std::swap;
113 swap(a.m_obj, b.m_obj); // swap out the internal pointers
114 }
115
116private:
117 /// constructor from existing Measurement2DObj
118 explicit Measurement2D(podio::utils::MaybeSharedPtr<Measurement2DObj> obj);
120
121 podio::utils::MaybeSharedPtr<Measurement2DObj> m_obj{nullptr};
122};
123
124std::ostream& operator<<(std::ostream& o, const Measurement2D& value);
125
126#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
127void to_json(nlohmann::json& j, const Measurement2D& value);
128#endif
129
130
131} // namespace edm4eic
132
133
134#endif
Definition Cov3f.h:18
Definition Measurement2DCollectionData.h:31
Definition Measurement2DCollection.h:95
Definition Measurement2DCollection.h:40
Definition Measurement2D.h:36
std::uint64_t getSurface() const
Access the Surface for bound coordinates (geometryID)
Definition Measurement2D.cc:49
const edm4eic::Cov3f & getCovariance() const
Access the Covariance on location and time.
Definition Measurement2D.cc:52
bool isAvailable() const
check whether the object is actually available
Definition Measurement2D.cc:123
friend class Measurement2DCollection
Definition Measurement2D.h:39
void unlink()
disconnect from Measurement2DObj instance
Definition Measurement2D.h:99
const edm4hep::Vector2f & getLoc() const
Access the 2D location on surface.
Definition Measurement2D.cc:50
std::vector< edm4eic::TrackerHit >::const_iterator hits_end() const
Definition Measurement2D.cc:62
std::size_t weights_size() const
Definition Measurement2D.cc:100
Measurement2D(const Measurement2D &other)=default
copy constructor
std::vector< float >::const_iterator weights_end() const
Definition Measurement2D.cc:94
podio::RelationRange< edm4eic::TrackerHit > getHits() const
Definition Measurement2D.cc:79
bool operator==(const Measurement2D &other) const
Definition Measurement2D.h:101
Measurement2D & operator=(Measurement2D other)
copy-assignment operator
Definition Measurement2D.cc:32
~Measurement2D()=default
destructor
podio::RelationRange< float > getWeights() const
Definition Measurement2D.cc:111
std::size_t hits_size() const
Definition Measurement2D.cc:68
std::vector< edm4eic::TrackerHit >::const_iterator hits_begin() const
Definition Measurement2D.cc:56
bool operator<(const Measurement2D &other) const
Definition Measurement2D.h:105
MutableMeasurement2D clone() const
create a mutable deep-copy of the object with identical relations
Definition Measurement2D.cc:37
float getTime() const
Access the Measurement time.
Definition Measurement2D.cc:51
const podio::ObjectID getObjectID() const
Definition Measurement2D.cc:130
static Measurement2D makeEmpty()
Definition Measurement2D.cc:45
Measurement2D()
default constructor
Definition Measurement2D.cc:21
friend void swap(Measurement2D &a, Measurement2D &b)
Definition Measurement2D.h:111
podio::ObjectID id() const
Definition Measurement2D.h:107
std::vector< float >::const_iterator weights_begin() const
Definition Measurement2D.cc:88
friend class MutableMeasurement2D
Definition Measurement2D.h:38
Definition Measurement2DObj.h:19
Definition MutableMeasurement2D.h:35
Definition TrackerHit.h:38
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97