EDM4eic
EIC data model
Loading...
Searching...
No Matches
SimPulse.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_SimPulse_H
4#define EDM4EIC_SimPulse_H
5
7
8#include "edm4hep/MCParticle.h"
9#include "edm4hep/SimCalorimeterHit.h"
10#include "edm4hep/SimTrackerHit.h"
11#include "edm4hep/Vector3f.h"
12#include "podio/RelationRange.h"
13#include <cstdint>
14#include <vector>
15
16#include "podio/utilities/MaybeSharedPtr.h"
17#include "podio/detail/OrderKey.h"
18
19#include <ostream>
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 podio::detail {
33// Internal function used in less comparison operators of the datatypes and interface types
34OrderKey getOrderKey(const edm4eic::SimPulse& obj);
35};
36
37namespace edm4eic {
38
39class MutableSimPulse;
40class SimPulseCollection;
41class SimPulseCollectionData;
42
43/** @class SimPulse
44 * Simulated pulse prior to digitization.
45 * @author: D. Anderson, S. Gardner, S. Joosten., D. Kalinkin
46 */
47class SimPulse {
48
49 friend class MutableSimPulse;
50 friend class SimPulseCollection;
53 friend podio::detail::OrderKey podio::detail::getOrderKey(const SimPulse & obj);
54
55public:
58
59 /// default constructor
60 SimPulse();
61
62 /// Constructor initializing all members
63 SimPulse(std::uint64_t cellID, float integral, edm4hep::Vector3f position, float time, float interval);
64
65 /// copy constructor
66 SimPulse(const SimPulse& other) = default;
67
68 /// copy-assignment operator
70
71 /// create a mutable deep-copy of the object with identical relations
72 /// if cloneRelations=false, the relations are not cloned and will be empty
73 MutableSimPulse clone(bool cloneRelations=true) const;
74
75 /// destructor
76 ~SimPulse() = default;
77
78 /// converting constructor from mutable object
79 SimPulse(const MutableSimPulse& other);
80
81 static SimPulse makeEmpty();
82
83public:
84
85 static constexpr auto typeName = "edm4eic::SimPulse";
86
87 /// Access the ID of the readout cell for this pulse.
88 std::uint64_t getCellID() const;
89
90 /// Access the Total pulse integral in relevant units.
91 float getIntegral() const;
92
93 /// Access the Position the pulse is evaluated in world coordinates [mm].
94 const edm4hep::Vector3f& getPosition() const;
95
96 /// Access the Start time for the pulse in [ns].
97 float getTime() const;
98
99 /// Access the Time interval between amplitude values [ns].
100 float getInterval() const;
101
102
103
104 std::size_t calorimeterHits_size() const;
105 edm4hep::SimCalorimeterHit getCalorimeterHits(std::size_t) const;
106 std::vector<edm4hep::SimCalorimeterHit>::const_iterator calorimeterHits_begin() const;
107 std::vector<edm4hep::SimCalorimeterHit>::const_iterator calorimeterHits_end() const;
108 podio::RelationRange<edm4hep::SimCalorimeterHit> getCalorimeterHits() const;
109 std::size_t trackerHits_size() const;
110 edm4hep::SimTrackerHit getTrackerHits(std::size_t) const;
111 std::vector<edm4hep::SimTrackerHit>::const_iterator trackerHits_begin() const;
112 std::vector<edm4hep::SimTrackerHit>::const_iterator trackerHits_end() const;
113 podio::RelationRange<edm4hep::SimTrackerHit> getTrackerHits() const;
114 std::size_t pulses_size() const;
115 edm4eic::SimPulse getPulses(std::size_t) const;
116 std::vector<edm4eic::SimPulse>::const_iterator pulses_begin() const;
117 std::vector<edm4eic::SimPulse>::const_iterator pulses_end() const;
118 podio::RelationRange<edm4eic::SimPulse> getPulses() const;
119 std::size_t particles_size() const;
120 edm4hep::MCParticle getParticles(std::size_t) const;
121 std::vector<edm4hep::MCParticle>::const_iterator particles_begin() const;
122 std::vector<edm4hep::MCParticle>::const_iterator particles_end() const;
123 podio::RelationRange<edm4hep::MCParticle> getParticles() const;
124 std::size_t amplitude_size() const;
125 float getAmplitude(std::size_t) const;
126 std::vector<float>::const_iterator amplitude_begin() const;
127 std::vector<float>::const_iterator amplitude_end() const;
128 podio::RelationRange<float> getAmplitude() const;
129
130
131 /// check whether the object is actually available
132 bool isAvailable() const;
133 /// disconnect from SimPulseObj instance
134 void unlink() { m_obj = podio::utils::MaybeSharedPtr<SimPulseObj>{nullptr}; }
135
136 bool operator==(const SimPulse& other) const { return m_obj == other.m_obj; }
137 bool operator==(const MutableSimPulse& other) const;
138
139 bool operator!=(const SimPulse& other) const { return !(*this == other); }
140 bool operator!=(const MutableSimPulse& other) const { return !(*this == other); }
141
142 // less comparison operator, so that objects can be e.g. stored in sets.
143 bool operator<(const SimPulse& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
144
145 podio::ObjectID id() const { return getObjectID(); }
146
147 const podio::ObjectID getObjectID() const;
148
149 friend void swap(SimPulse& a, SimPulse& b) {
150 using std::swap;
151 swap(a.m_obj, b.m_obj); // swap out the internal pointers
152 }
153
154private:
155 /// constructor from existing SimPulseObj
156 explicit SimPulse(podio::utils::MaybeSharedPtr<SimPulseObj> obj);
157 SimPulse(SimPulseObj* obj);
158
159 podio::utils::MaybeSharedPtr<SimPulseObj> m_obj{nullptr};
160};
161
162std::ostream& operator<<(std::ostream& o, const SimPulse& value);
163
164#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
165void to_json(nlohmann::json& j, const SimPulse& value);
166#endif
167
168
169} // namespace edm4eic
170
171
172#endif
Definition MutableSimPulse.h:39
Definition SimPulseCollectionData.h:33
Definition SimPulseCollection.h:91
Definition SimPulseCollection.h:36
Definition SimPulse.h:47
std::vector< edm4hep::SimCalorimeterHit >::const_iterator calorimeterHits_end() const
Definition SimPulse.cc:125
std::vector< edm4eic::SimPulse >::const_iterator pulses_begin() const
Definition SimPulse.cc:183
std::size_t amplitude_size() const
Definition SimPulse.cc:259
podio::RelationRange< edm4hep::MCParticle > getParticles() const
Definition SimPulse.cc:238
static constexpr auto typeName
Definition SimPulse.h:85
std::vector< float >::const_iterator amplitude_end() const
Definition SimPulse.cc:253
std::size_t pulses_size() const
Definition SimPulse.cc:195
podio::RelationRange< float > getAmplitude() const
Definition SimPulse.cc:270
SimPulse & operator=(SimPulse other)
copy-assignment operator
Definition SimPulse.cc:32
std::vector< edm4hep::MCParticle >::const_iterator particles_begin() const
Definition SimPulse.cc:215
bool operator==(const SimPulse &other) const
Definition SimPulse.h:136
static SimPulse makeEmpty()
Definition SimPulse.cc:107
float getTime() const
Access the Start time for the pulse in [ns].
Definition SimPulse.cc:114
std::vector< edm4hep::SimCalorimeterHit >::const_iterator calorimeterHits_begin() const
Definition SimPulse.cc:119
std::vector< edm4hep::MCParticle >::const_iterator particles_end() const
Definition SimPulse.cc:221
podio::RelationRange< edm4hep::SimTrackerHit > getTrackerHits() const
Definition SimPulse.cc:174
friend class MutableSimPulse
Definition SimPulse.h:49
friend class SimPulseCollection
Definition SimPulse.h:50
~SimPulse()=default
destructor
podio::RelationRange< edm4hep::SimCalorimeterHit > getCalorimeterHits() const
Definition SimPulse.cc:142
podio::RelationRange< edm4eic::SimPulse > getPulses() const
Definition SimPulse.cc:206
SimPulse(const SimPulse &other)=default
copy constructor
bool operator<(const SimPulse &other) const
Definition SimPulse.h:143
std::vector< edm4hep::SimTrackerHit >::const_iterator trackerHits_begin() const
Definition SimPulse.cc:151
std::vector< float >::const_iterator amplitude_begin() const
Definition SimPulse.cc:247
std::vector< edm4hep::SimTrackerHit >::const_iterator trackerHits_end() const
Definition SimPulse.cc:157
bool operator!=(const SimPulse &other) const
Definition SimPulse.h:139
std::size_t calorimeterHits_size() const
Definition SimPulse.cc:131
MutableSimPulse clone(bool cloneRelations=true) const
Definition SimPulse.cc:37
std::size_t particles_size() const
Definition SimPulse.cc:227
std::vector< edm4eic::SimPulse >::const_iterator pulses_end() const
Definition SimPulse.cc:189
friend void swap(SimPulse &a, SimPulse &b)
Definition SimPulse.h:149
void unlink()
disconnect from SimPulseObj instance
Definition SimPulse.h:134
float getIntegral() const
Access the Total pulse integral in relevant units.
Definition SimPulse.cc:112
std::uint64_t getCellID() const
Access the ID of the readout cell for this pulse.
Definition SimPulse.cc:111
bool operator!=(const MutableSimPulse &other) const
Definition SimPulse.h:140
podio::ObjectID id() const
Definition SimPulse.h:145
float getInterval() const
Access the Time interval between amplitude values [ns].
Definition SimPulse.cc:115
std::size_t trackerHits_size() const
Definition SimPulse.cc:163
const edm4hep::Vector3f & getPosition() const
Access the Position the pulse is evaluated in world coordinates [mm].
Definition SimPulse.cc:113
bool isAvailable() const
check whether the object is actually available
Definition SimPulse.cc:282
const podio::ObjectID getObjectID() const
Definition SimPulse.cc:286
SimPulse()
default constructor
Definition SimPulse.cc:20
Definition SimPulseObj.h:22
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150