File indexing completed on 2025-01-18 09:55:37
0001
0002
0003 #ifndef EDM4HEP_MutableSimPrimaryIonizationCluster_H
0004 #define EDM4HEP_MutableSimPrimaryIonizationCluster_H
0005
0006 #include "edm4hep/SimPrimaryIonizationClusterObj.h"
0007
0008 #include "edm4hep/SimPrimaryIonizationCluster.h"
0009
0010 #include "edm4hep/Vector3d.h"
0011 #include "podio/RelationRange.h"
0012 #include <cstdint>
0013 #include <vector>
0014
0015 #include "podio/utilities/MaybeSharedPtr.h"
0016
0017 #include <cstdint>
0018
0019 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0020 #include "nlohmann/json_fwd.hpp"
0021 #endif
0022
0023
0024 namespace edm4hep {
0025 class MCParticle;
0026 class MutableMCParticle;
0027 }
0028
0029 namespace edm4hep {
0030
0031
0032
0033
0034
0035 class MutableSimPrimaryIonizationCluster {
0036
0037 friend class SimPrimaryIonizationClusterCollection;
0038 friend class SimPrimaryIonizationClusterMutableCollectionIterator;
0039 friend class SimPrimaryIonizationCluster;
0040
0041 public:
0042 using object_type = SimPrimaryIonizationCluster;
0043 using collection_type = SimPrimaryIonizationClusterCollection;
0044
0045
0046 MutableSimPrimaryIonizationCluster();
0047
0048
0049 MutableSimPrimaryIonizationCluster(std::uint64_t cellID, float time, edm4hep::Vector3d position, std::int16_t type);
0050
0051
0052 MutableSimPrimaryIonizationCluster(const MutableSimPrimaryIonizationCluster& other) = default;
0053
0054
0055 MutableSimPrimaryIonizationCluster& operator=(MutableSimPrimaryIonizationCluster other);
0056
0057
0058
0059 MutableSimPrimaryIonizationCluster clone(bool cloneRelations = true) const;
0060
0061
0062 ~MutableSimPrimaryIonizationCluster() = default;
0063
0064 public:
0065
0066 std::uint64_t getCellID() const;
0067
0068
0069 float getTime() const;
0070
0071
0072 const edm4hep::Vector3d& getPosition() const;
0073
0074
0075 std::int16_t getType() const;
0076
0077
0078 const edm4hep::MCParticle getMCParticle() const;
0079
0080
0081 void setCellID(std::uint64_t value);
0082
0083 std::uint64_t& getCellID();
0084
0085 [[deprecated("use getCellID instead")]] std::uint64_t& cellID();
0086
0087
0088 void setTime(float value);
0089
0090 float& getTime();
0091
0092 [[deprecated("use getTime instead")]] float& time();
0093
0094
0095 void setPosition(edm4hep::Vector3d value);
0096
0097 edm4hep::Vector3d& getPosition();
0098
0099 [[deprecated("use getPosition instead")]] edm4hep::Vector3d& position();
0100
0101
0102 void setType(std::int16_t value);
0103
0104 std::int16_t& getType();
0105
0106 [[deprecated("use getType instead")]] std::int16_t& type();
0107
0108
0109 void setMCParticle(const edm4hep::MCParticle& value);
0110
0111 void addToElectronCellID(const std::uint64_t&);
0112 std::size_t electronCellID_size() const;
0113 std::uint64_t getElectronCellID(std::size_t) const;
0114 std::vector<std::uint64_t>::const_iterator electronCellID_begin() const;
0115 std::vector<std::uint64_t>::const_iterator electronCellID_end() const;
0116 podio::RelationRange<std::uint64_t> getElectronCellID() const;
0117 void addToElectronTime(const float&);
0118 std::size_t electronTime_size() const;
0119 float getElectronTime(std::size_t) const;
0120 std::vector<float>::const_iterator electronTime_begin() const;
0121 std::vector<float>::const_iterator electronTime_end() const;
0122 podio::RelationRange<float> getElectronTime() const;
0123 void addToElectronPosition(const edm4hep::Vector3d&);
0124 std::size_t electronPosition_size() const;
0125 edm4hep::Vector3d getElectronPosition(std::size_t) const;
0126 std::vector<edm4hep::Vector3d>::const_iterator electronPosition_begin() const;
0127 std::vector<edm4hep::Vector3d>::const_iterator electronPosition_end() const;
0128 podio::RelationRange<edm4hep::Vector3d> getElectronPosition() const;
0129 void addToPulseTime(const float&);
0130 std::size_t pulseTime_size() const;
0131 float getPulseTime(std::size_t) const;
0132 std::vector<float>::const_iterator pulseTime_begin() const;
0133 std::vector<float>::const_iterator pulseTime_end() const;
0134 podio::RelationRange<float> getPulseTime() const;
0135 void addToPulseAmplitude(const float&);
0136 std::size_t pulseAmplitude_size() const;
0137 float getPulseAmplitude(std::size_t) const;
0138 std::vector<float>::const_iterator pulseAmplitude_begin() const;
0139 std::vector<float>::const_iterator pulseAmplitude_end() const;
0140 podio::RelationRange<float> getPulseAmplitude() const;
0141
0142
0143 bool isAvailable() const;
0144
0145 void unlink() {
0146 m_obj = podio::utils::MaybeSharedPtr<SimPrimaryIonizationClusterObj>{nullptr};
0147 }
0148
0149 bool operator==(const MutableSimPrimaryIonizationCluster& other) const {
0150 return m_obj == other.m_obj;
0151 }
0152 bool operator==(const SimPrimaryIonizationCluster& other) const;
0153
0154 bool operator!=(const MutableSimPrimaryIonizationCluster& other) const {
0155 return !(*this == other);
0156 }
0157 bool operator!=(const SimPrimaryIonizationCluster& other) const {
0158 return !(*this == other);
0159 }
0160
0161
0162 bool operator<(const MutableSimPrimaryIonizationCluster& other) const {
0163 return m_obj < other.m_obj;
0164 }
0165
0166 podio::ObjectID id() const {
0167 return getObjectID();
0168 }
0169
0170 const podio::ObjectID getObjectID() const;
0171
0172 friend void swap(MutableSimPrimaryIonizationCluster& a, MutableSimPrimaryIonizationCluster& b) {
0173 using std::swap;
0174 swap(a.m_obj, b.m_obj);
0175 }
0176
0177 private:
0178
0179 explicit MutableSimPrimaryIonizationCluster(podio::utils::MaybeSharedPtr<SimPrimaryIonizationClusterObj> obj);
0180
0181 podio::utils::MaybeSharedPtr<SimPrimaryIonizationClusterObj> m_obj{nullptr};
0182 };
0183
0184 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0185 void to_json(nlohmann::json& j, const MutableSimPrimaryIonizationCluster& value);
0186 #endif
0187
0188 }
0189
0190 #endif