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
27
28namespace edm4eic {
29
30
31/** @class MutableSimPulse
32 * Simulated pulse prior to digitization.
33 * @author: D. Anderson, S. Gardner, S. Joosten., D. Kalinkin
34 */
36
37 friend class SimPulseCollection;
39 friend class SimPulse;
40
41public:
44
45 /// default constructor
47
48 /// Constructor initializing all members
49 MutableSimPulse(std::uint64_t cellID, float integral, edm4hep::Vector3f position, float time, float interval);
50
51 /// copy constructor
52 MutableSimPulse(const MutableSimPulse& other) = default;
53
54 /// copy-assignment operator
56
57 /// create a mutable deep-copy of the object with identical relations
58 /// if cloneRelations=false, the relations are not cloned and will be empty
59 MutableSimPulse clone(bool cloneRelations=true) const;
60
61 /// destructor
62 ~MutableSimPulse() = default;
63
64
65public:
66
67 /// Access the ID of the readout cell for this pulse.
68 std::uint64_t getCellID() const;
69
70 /// Access the Total pulse integral in relevant units.
71 float getIntegral() const;
72
73 /// Access the Position the pulse is evaluated in world coordinates [mm].
74 const edm4hep::Vector3f& getPosition() const;
75
76 /// Access the Start time for the pulse in [ns].
77 float getTime() const;
78
79 /// Access the Time interval between amplitude values [ns].
80 float getInterval() const;
81
82
83
84 /// Set the ID of the readout cell for this pulse.
85 void setCellID(std::uint64_t value);
86 /// Get mutable reference to ID of the readout cell for this pulse.
87 std::uint64_t& getCellID();
88 /// Get reference to ID of the readout cell for this pulse.
89 [[deprecated("use getCellID instead")]]
90 std::uint64_t& cellID();
91
92 /// Set the Total pulse integral in relevant units.
93 void setIntegral(float value);
94 /// Get mutable reference to Total pulse integral in relevant units.
95 float& getIntegral();
96 /// Get reference to Total pulse integral in relevant units.
97 [[deprecated("use getIntegral instead")]]
98 float& integral();
99
100 /// Set the Position the pulse is evaluated in world coordinates [mm].
101 void setPosition(edm4hep::Vector3f value);
102 /// Get mutable reference to Position the pulse is evaluated in world coordinates [mm].
103 edm4hep::Vector3f& getPosition();
104 /// Get reference to Position the pulse is evaluated in world coordinates [mm].
105 [[deprecated("use getPosition instead")]]
106 edm4hep::Vector3f& position();
107
108 /// Set the Start time for the pulse in [ns].
109 void setTime(float value);
110 /// Get mutable reference to Start time for the pulse in [ns].
111 float& getTime();
112 /// Get reference to Start time for the pulse in [ns].
113 [[deprecated("use getTime instead")]]
114 float& time();
115
116 /// Set the Time interval between amplitude values [ns].
117 void setInterval(float value);
118 /// Get mutable reference to Time interval between amplitude values [ns].
119 float& getInterval();
120 /// Get reference to Time interval between amplitude values [ns].
121 [[deprecated("use getInterval instead")]]
122 float& interval();
123
124
125
126 void addToCalorimeterHits(const edm4hep::SimCalorimeterHit&);
127 std::size_t calorimeterHits_size() const;
128 edm4hep::SimCalorimeterHit getCalorimeterHits(std::size_t) const;
129 std::vector<edm4hep::SimCalorimeterHit>::const_iterator calorimeterHits_begin() const;
130 std::vector<edm4hep::SimCalorimeterHit>::const_iterator calorimeterHits_end() const;
131 podio::RelationRange<edm4hep::SimCalorimeterHit> getCalorimeterHits() const;
132 void addToTrackerHits(const edm4hep::SimTrackerHit&);
133 std::size_t trackerHits_size() const;
134 edm4hep::SimTrackerHit getTrackerHits(std::size_t) const;
135 std::vector<edm4hep::SimTrackerHit>::const_iterator trackerHits_begin() const;
136 std::vector<edm4hep::SimTrackerHit>::const_iterator trackerHits_end() const;
137 podio::RelationRange<edm4hep::SimTrackerHit> getTrackerHits() const;
138 void addToPulses(const edm4eic::SimPulse&);
139 std::size_t pulses_size() const;
140 edm4eic::SimPulse getPulses(std::size_t) const;
141 std::vector<edm4eic::SimPulse>::const_iterator pulses_begin() const;
142 std::vector<edm4eic::SimPulse>::const_iterator pulses_end() const;
143 podio::RelationRange<edm4eic::SimPulse> getPulses() const;
144 void addToParticles(const edm4hep::MCParticle&);
145 std::size_t particles_size() const;
146 edm4hep::MCParticle getParticles(std::size_t) const;
147 std::vector<edm4hep::MCParticle>::const_iterator particles_begin() const;
148 std::vector<edm4hep::MCParticle>::const_iterator particles_end() const;
149 podio::RelationRange<edm4hep::MCParticle> getParticles() const;
150 void addToAmplitude(const float&);
151 std::size_t amplitude_size() const;
152 float getAmplitude(std::size_t) const;
153 std::vector<float>::const_iterator amplitude_begin() const;
154 std::vector<float>::const_iterator amplitude_end() const;
155 podio::RelationRange<float> getAmplitude() const;
156
157
158
159 /// check whether the object is actually available
160 bool isAvailable() const;
161 /// disconnect from SimPulseObj instance
162 void unlink() { m_obj = podio::utils::MaybeSharedPtr<SimPulseObj>{nullptr}; }
163
164 bool operator==(const MutableSimPulse& other) const { return m_obj == other.m_obj; }
165 bool operator==(const SimPulse& other) const;
166
167 bool operator!=(const MutableSimPulse& other) const { return !(*this == other); }
168 bool operator!=(const SimPulse& other) const { return !(*this == other); }
169
170 // less comparison operator, so that objects can be e.g. stored in sets.
171 bool operator<(const MutableSimPulse& other) const { return m_obj < other.m_obj; }
172
173 podio::ObjectID id() const { return getObjectID(); }
174
175 const podio::ObjectID getObjectID() const;
176
178 using std::swap;
179 swap(a.m_obj, b.m_obj); // swap out the internal pointers
180 }
181
182private:
183 /// constructor from existing SimPulseObj
184 explicit MutableSimPulse(podio::utils::MaybeSharedPtr<SimPulseObj> obj);
185
186 podio::utils::MaybeSharedPtr<SimPulseObj> m_obj{nullptr};
187};
188
189#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
190void to_json(nlohmann::json& j, const MutableSimPulse& value);
191#endif
192
193
194} // namespace edm4eic
195
196
197#endif
Definition MutableSimPulse.h:35
std::vector< edm4hep::SimCalorimeterHit >::const_iterator calorimeterHits_end() const
Definition MutableSimPulse.cc:95
bool operator!=(const SimPulse &other) const
Definition MutableSimPulse.h:168
MutableSimPulse & operator=(MutableSimPulse other)
copy-assignment operator
Definition MutableSimPulse.cc:30
podio::ObjectID id() const
Definition MutableSimPulse.h:173
void unlink()
disconnect from SimPulseObj instance
Definition MutableSimPulse.h:162
friend class SimPulse
Definition MutableSimPulse.h:39
std::vector< float >::const_iterator amplitude_end() const
Definition MutableSimPulse.cc:239
void setTime(float value)
Set the Start time for the pulse in [ns].
Definition MutableSimPulse.cc:76
void setCellID(std::uint64_t value)
Set the ID of the readout cell for this pulse.
Definition MutableSimPulse.cc:67
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 setIntegral(float value)
Set the Total pulse integral in relevant units.
Definition MutableSimPulse.cc:70
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:37
void addToCalorimeterHits(const edm4hep::SimCalorimeterHit &)
Definition MutableSimPulse.cc:84
podio::RelationRange< edm4eic::SimPulse > getPulses() const
Definition MutableSimPulse.cc:184
void setInterval(float value)
Set the Time interval between amplitude values [ns].
Definition MutableSimPulse.cc:79
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:167
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:171
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
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
std::vector< edm4hep::MCParticle >::const_iterator particles_end() const
Definition MutableSimPulse.cc:203
std::size_t particles_size() const
Definition MutableSimPulse.cc:209
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
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:164
friend void swap(MutableSimPulse &a, MutableSimPulse &b)
Definition MutableSimPulse.h:177
void setPosition(edm4hep::Vector3f value)
Set the Position the pulse is evaluated in world coordinates [mm].
Definition MutableSimPulse.cc:73
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
Definition SimPulseCollection.h:92
Definition SimPulse.h:37
Definition SimPulseCollection.h:63
Definition CalorimeterHit.cc:17