EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableSimPulse.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableSimPulse_H
4#define EDM4EIC_MutableSimPulse_H
5
7// Make the immutable class available from its mutable version but not vice versa
8#include "edm4eic/SimPulse.h"
9
10#include "edm4hep/MCParticle.h"
11#include "edm4hep/SimCalorimeterHit.h"
12#include "edm4hep/SimTrackerHit.h"
13#include "edm4hep/Vector3f.h"
14#include "podio/RelationRange.h"
15#include <cstdint>
16#include <vector>
17
18#include "podio/utilities/MaybeSharedPtr.h"
19
20#include <cstdint>
21
22#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
23#include "nlohmann/json_fwd.hpp"
24#endif
25
26// forward declarations
27namespace edm4eic {
29}
30
31
32namespace edm4eic {
33
34
35/** @class MutableSimPulse
36 * Simulated pulse prior to digitization.
37 * @author: D. Anderson, S. Gardner, S. Joosten., D. Kalinkin
38 */
40
41 friend class SimPulseCollection;
43 friend class SimPulse;
44
45public:
48
49 /// default constructor
51
52 /// Constructor initializing all members
53 MutableSimPulse(const std::uint64_t cellID, const float integral, const edm4hep::Vector3f& position, const float time, const float interval);
54
55 /// copy constructor
56 MutableSimPulse(const MutableSimPulse& other) = default;
57
58 /// copy-assignment operator
59 MutableSimPulse& operator=(MutableSimPulse other) &; // Rebind this to other's internal object
60 MutableSimPulse& operator=(MutableSimPulse other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
61
62 /// create a mutable deep-copy of the object with identical relations
63 /// if cloneRelations=false, the relations are not cloned and will be empty
64 MutableSimPulse clone(bool cloneRelations=true) const;
65
66 /// destructor
67 ~MutableSimPulse() = default;
68
69
70public:
71
72 /// Access the ID of the readout cell for this pulse.
73 std::uint64_t getCellID() const;
74
75 /// Access the Total pulse integral in relevant units.
76 float getIntegral() const;
77
78 /// Access the Position the pulse is evaluated in world coordinates [mm].
79 const edm4hep::Vector3f& getPosition() const;
80
81 /// Access the Start time for the pulse in [ns].
82 float getTime() const;
83
84 /// Access the Time interval between amplitude values [ns].
85 float getInterval() const;
86
87
88
89 /// Set the ID of the readout cell for this pulse.
90 void setCellID(const std::uint64_t cellID);
91 /// Get mutable reference to ID of the readout cell for this pulse.
92 std::uint64_t& getCellID();
93 /// Get reference to ID of the readout cell for this pulse.
94 [[deprecated("use getCellID instead")]]
95 std::uint64_t& cellID();
96
97 /// Set the Total pulse integral in relevant units.
98 void setIntegral(const float integral);
99 /// Get mutable reference to Total pulse integral in relevant units.
100 float& getIntegral();
101 /// Get reference to Total pulse integral in relevant units.
102 [[deprecated("use getIntegral instead")]]
103 float& integral();
104
105 /// Set the Position the pulse is evaluated in world coordinates [mm].
106 void setPosition(const edm4hep::Vector3f& position);
107 /// Get mutable reference to Position the pulse is evaluated in world coordinates [mm].
108 edm4hep::Vector3f& getPosition();
109 /// Get reference to Position the pulse is evaluated in world coordinates [mm].
110 [[deprecated("use getPosition instead")]]
111 edm4hep::Vector3f& position();
112
113 /// Set the Start time for the pulse in [ns].
114 void setTime(const float time);
115 /// Get mutable reference to Start time for the pulse in [ns].
116 float& getTime();
117 /// Get reference to Start time for the pulse in [ns].
118 [[deprecated("use getTime instead")]]
119 float& time();
120
121 /// Set the Time interval between amplitude values [ns].
122 void setInterval(const float interval);
123 /// Get mutable reference to Time interval between amplitude values [ns].
124 float& getInterval();
125 /// Get reference to Time interval between amplitude values [ns].
126 [[deprecated("use getInterval instead")]]
127 float& interval();
128
129
130
131 void addToCalorimeterHits(const edm4hep::SimCalorimeterHit&);
132 std::size_t calorimeterHits_size() const;
133 edm4hep::SimCalorimeterHit getCalorimeterHits(std::size_t) const;
134 std::vector<edm4hep::SimCalorimeterHit>::const_iterator calorimeterHits_begin() const;
135 std::vector<edm4hep::SimCalorimeterHit>::const_iterator calorimeterHits_end() const;
136 podio::RelationRange<edm4hep::SimCalorimeterHit> getCalorimeterHits() const;
137 void addToTrackerHits(const edm4hep::SimTrackerHit&);
138 std::size_t trackerHits_size() const;
139 edm4hep::SimTrackerHit getTrackerHits(std::size_t) const;
140 std::vector<edm4hep::SimTrackerHit>::const_iterator trackerHits_begin() const;
141 std::vector<edm4hep::SimTrackerHit>::const_iterator trackerHits_end() const;
142 podio::RelationRange<edm4hep::SimTrackerHit> getTrackerHits() const;
143 void addToPulses(const edm4eic::SimPulse&);
144 std::size_t pulses_size() const;
145 edm4eic::SimPulse getPulses(std::size_t) const;
146 std::vector<edm4eic::SimPulse>::const_iterator pulses_begin() const;
147 std::vector<edm4eic::SimPulse>::const_iterator pulses_end() const;
148 podio::RelationRange<edm4eic::SimPulse> getPulses() const;
149 void addToParticles(const edm4hep::MCParticle&);
150 std::size_t particles_size() const;
151 edm4hep::MCParticle getParticles(std::size_t) const;
152 std::vector<edm4hep::MCParticle>::const_iterator particles_begin() const;
153 std::vector<edm4hep::MCParticle>::const_iterator particles_end() const;
154 podio::RelationRange<edm4hep::MCParticle> getParticles() const;
155 void addToAmplitude(const float&);
156 std::size_t amplitude_size() const;
157 float getAmplitude(std::size_t) const;
158 std::vector<float>::const_iterator amplitude_begin() const;
159 std::vector<float>::const_iterator amplitude_end() const;
160 podio::RelationRange<float> getAmplitude() const;
161
162
163
164 /// check whether the object is actually available
165 bool isAvailable() const;
166 /// disconnect from SimPulseObj instance
167 void unlink() { m_obj = podio::utils::MaybeSharedPtr<SimPulseObj>{nullptr}; }
168
169 bool operator==(const MutableSimPulse& other) const { return m_obj == other.m_obj; }
170 bool operator==(const SimPulse& other) const;
171
172 bool operator!=(const MutableSimPulse& other) const { return !(*this == other); }
173 bool operator!=(const SimPulse& other) const { return !(*this == other); }
174
175 // less comparison operator, so that objects can be e.g. stored in sets.
176 bool operator<(const MutableSimPulse& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
177
178 podio::ObjectID id() const { return getObjectID(); }
179
180 const podio::ObjectID getObjectID() const;
181
182 friend std::hash<MutableSimPulse>;
183
185 using std::swap;
186 swap(a.m_obj, b.m_obj); // swap out the internal pointers
187 }
188
189private:
190 /// constructor from existing SimPulseObj
191 explicit MutableSimPulse(podio::utils::MaybeSharedPtr<SimPulseObj> obj);
192
193 podio::utils::MaybeSharedPtr<SimPulseObj> m_obj{nullptr};
194};
195
196#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
197void to_json(nlohmann::json& j, const MutableSimPulse& value);
198#endif
199
200
201} // namespace edm4eic
202
203
204
205template<>
206struct std::hash<edm4eic::MutableSimPulse> {
207 std::size_t operator()(const edm4eic::MutableSimPulse& obj) const {
208 return std::hash<edm4eic::SimPulseObj*>{}(obj.m_obj.get());
209 }
210};
211
212
213#endif
Definition MutableSimPulse.h:39
std::vector< edm4hep::SimCalorimeterHit >::const_iterator calorimeterHits_end() const
Definition MutableSimPulse.cc:95
bool operator!=(const SimPulse &other) const
Definition MutableSimPulse.h:173
podio::ObjectID id() const
Definition MutableSimPulse.h:178
void unlink()
disconnect from SimPulseObj instance
Definition MutableSimPulse.h:167
friend class SimPulse
Definition MutableSimPulse.h:43
SimPulseCollection collection_type
Definition MutableSimPulse.h:47
std::vector< float >::const_iterator amplitude_end() const
Definition MutableSimPulse.cc:239
void addToAmplitude(const float &)
Definition MutableSimPulse.cc:228
void addToParticles(const edm4hep::MCParticle &)
Definition MutableSimPulse.cc:192
const edm4hep::Vector3f & getPosition() const
Access the Position the pulse is evaluated in world coordinates [mm].
Definition MutableSimPulse.cc:62
float & time()
Get reference to Start time for the pulse in [ns].
Definition MutableSimPulse.cc:78
void setCellID(const std::uint64_t cellID)
Set the ID of the readout cell for this pulse.
Definition MutableSimPulse.cc:67
float getTime() const
Access the Start time for the pulse in [ns].
Definition MutableSimPulse.cc:63
podio::RelationRange< edm4hep::SimTrackerHit > getTrackerHits() const
Definition MutableSimPulse.cc:148
void addToTrackerHits(const edm4hep::SimTrackerHit &)
Definition MutableSimPulse.cc:120
friend class SimPulseCollection
Definition MutableSimPulse.h:41
void addToCalorimeterHits(const edm4hep::SimCalorimeterHit &)
Definition MutableSimPulse.cc:84
podio::RelationRange< edm4eic::SimPulse > getPulses() const
Definition MutableSimPulse.cc:184
std::uint64_t & cellID()
Get reference to ID of the readout cell for this pulse.
Definition MutableSimPulse.cc:69
bool operator!=(const MutableSimPulse &other) const
Definition MutableSimPulse.h:172
std::vector< edm4eic::SimPulse >::const_iterator pulses_begin() const
Definition MutableSimPulse.cc:161
std::vector< edm4hep::MCParticle >::const_iterator particles_begin() const
Definition MutableSimPulse.cc:197
bool operator<(const MutableSimPulse &other) const
Definition MutableSimPulse.h:176
podio::RelationRange< edm4hep::SimCalorimeterHit > getCalorimeterHits() const
Definition MutableSimPulse.cc:112
MutableSimPulse clone(bool cloneRelations=true) const
Definition MutableSimPulse.cc:35
std::size_t amplitude_size() const
Definition MutableSimPulse.cc:245
void addToPulses(const edm4eic::SimPulse &)
Definition MutableSimPulse.cc:156
const podio::ObjectID getObjectID() const
Definition MutableSimPulse.cc:273
std::size_t pulses_size() const
Definition MutableSimPulse.cc:173
std::size_t calorimeterHits_size() const
Definition MutableSimPulse.cc:101
float & integral()
Get reference to Total pulse integral in relevant units.
Definition MutableSimPulse.cc:72
std::vector< edm4hep::SimTrackerHit >::const_iterator trackerHits_begin() const
Definition MutableSimPulse.cc:125
float getIntegral() const
Access the Total pulse integral in relevant units.
Definition MutableSimPulse.cc:61
std::vector< float >::const_iterator amplitude_begin() const
Definition MutableSimPulse.cc:233
void setPosition(const edm4hep::Vector3f &position)
Set the Position the pulse is evaluated in world coordinates [mm].
Definition MutableSimPulse.cc:73
void setTime(const float time)
Set the Start time for the pulse in [ns].
Definition MutableSimPulse.cc:76
MutableSimPulse & operator=(MutableSimPulse other) &&=delete
podio::RelationRange< float > getAmplitude() const
Definition MutableSimPulse.cc:256
float & interval()
Get reference to Time interval between amplitude values [ns].
Definition MutableSimPulse.cc:81
std::vector< edm4hep::SimCalorimeterHit >::const_iterator calorimeterHits_begin() const
Definition MutableSimPulse.cc:89
std::vector< edm4hep::SimTrackerHit >::const_iterator trackerHits_end() const
Definition MutableSimPulse.cc:131
~MutableSimPulse()=default
destructor
MutableSimPulse()
default constructor
Definition MutableSimPulse.cc:18
void setIntegral(const float integral)
Set the Total pulse integral in relevant units.
Definition MutableSimPulse.cc:70
SimPulse object_type
Definition MutableSimPulse.h:46
std::vector< edm4hep::MCParticle >::const_iterator particles_end() const
Definition MutableSimPulse.cc:203
std::size_t particles_size() const
Definition MutableSimPulse.cc:209
void setInterval(const float interval)
Set the Time interval between amplitude values [ns].
Definition MutableSimPulse.cc:79
float getInterval() const
Access the Time interval between amplitude values [ns].
Definition MutableSimPulse.cc:64
bool isAvailable() const
check whether the object is actually available
Definition MutableSimPulse.cc:269
MutableSimPulse & operator=(MutableSimPulse other) &
copy-assignment operator
Definition MutableSimPulse.cc:30
std::size_t trackerHits_size() const
Definition MutableSimPulse.cc:137
std::vector< edm4eic::SimPulse >::const_iterator pulses_end() const
Definition MutableSimPulse.cc:167
bool operator==(const MutableSimPulse &other) const
Definition MutableSimPulse.h:169
friend void swap(MutableSimPulse &a, MutableSimPulse &b)
Definition MutableSimPulse.h:184
std::uint64_t getCellID() const
Access the ID of the readout cell for this pulse.
Definition MutableSimPulse.cc:60
podio::RelationRange< edm4hep::MCParticle > getParticles() const
Definition MutableSimPulse.cc:220
edm4hep::Vector3f & position()
Get reference to Position the pulse is evaluated in world coordinates [mm].
Definition MutableSimPulse.cc:75
MutableSimPulse(const MutableSimPulse &other)=default
copy constructor
friend class SimPulseMutableCollectionIterator
Definition MutableSimPulse.h:42
Definition SimPulseCollection.h:137
Definition SimPulse.h:47
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableSimPulse &obj) const
Definition MutableSimPulse.h:207