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