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