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 <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 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
60 /// if cloneRelations=false, the relations are not cloned and will be empty
61 MutableMeasurement2D clone(bool cloneRelations=true) const;
62
63 /// destructor
64 ~Measurement2D() = default;
65
66 /// converting constructor from mutable object
68
69 static Measurement2D makeEmpty();
70
71public:
72
73 /// Access the Surface for bound coordinates (geometryID)
74 std::uint64_t getSurface() const;
75
76 /// Access the 2D location on surface
77 const edm4hep::Vector2f& getLoc() const;
78
79 /// Access the Measurement time
80 float getTime() const;
81
82 /// Access the Covariance on location and time
83 const edm4eic::Cov3f& getCovariance() const;
84
85
86
87 std::size_t hits_size() const;
88 edm4eic::TrackerHit getHits(std::size_t) const;
89 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
90 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
91 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
92 std::size_t weights_size() const;
93 float getWeights(std::size_t) const;
94 std::vector<float>::const_iterator weights_begin() const;
95 std::vector<float>::const_iterator weights_end() const;
96 podio::RelationRange<float> getWeights() const;
97
98
99 /// check whether the object is actually available
100 bool isAvailable() const;
101 /// disconnect from Measurement2DObj instance
102 void unlink() { m_obj = podio::utils::MaybeSharedPtr<Measurement2DObj>{nullptr}; }
103
104 bool operator==(const Measurement2D& other) const { return m_obj == other.m_obj; }
105 bool operator==(const MutableMeasurement2D& other) const;
106
107 bool operator!=(const Measurement2D& other) const { return !(*this == other); }
108 bool operator!=(const MutableMeasurement2D& other) const { return !(*this == other); }
109
110 // less comparison operator, so that objects can be e.g. stored in sets.
111 bool operator<(const Measurement2D& other) const { return m_obj < other.m_obj; }
112
113 podio::ObjectID id() const { return getObjectID(); }
114
115 const podio::ObjectID getObjectID() const;
116
117 friend void swap(Measurement2D& a, Measurement2D& b) {
118 using std::swap;
119 swap(a.m_obj, b.m_obj); // swap out the internal pointers
120 }
121
122private:
123 /// constructor from existing Measurement2DObj
124 explicit Measurement2D(podio::utils::MaybeSharedPtr<Measurement2DObj> obj);
126
127 podio::utils::MaybeSharedPtr<Measurement2DObj> m_obj{nullptr};
128};
129
130std::ostream& operator<<(std::ostream& o, const Measurement2D& value);
131
132#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
133void to_json(nlohmann::json& j, const Measurement2D& value);
134#endif
135
136
137} // namespace edm4eic
138
139
140#endif
Definition Cov3f.h:18
Definition Measurement2DCollectionData.h:31
Definition Measurement2DCollection.h:92
Definition Measurement2DCollection.h:37
Definition Measurement2D.h:36
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:39
void unlink()
disconnect from Measurement2DObj instance
Definition Measurement2D.h:102
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:104
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:111
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:117
podio::ObjectID id() const
Definition Measurement2D.h:113
bool operator!=(const Measurement2D &other) const
Definition Measurement2D.h:107
std::vector< float >::const_iterator weights_begin() const
Definition Measurement2D.cc:116
friend class MutableMeasurement2D
Definition Measurement2D.h:38
bool operator!=(const MutableMeasurement2D &other) const
Definition Measurement2D.h:108
Definition Measurement2DObj.h:19
Definition MutableMeasurement2D.h:34
Definition TrackerHit.h:38
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103