File indexing completed on 2025-01-18 09:55:37
0001
0002
0003 #ifndef EDM4HEP_MutableRecIonizationCluster_H
0004 #define EDM4HEP_MutableRecIonizationCluster_H
0005
0006 #include "edm4hep/RecIonizationClusterObj.h"
0007
0008 #include "edm4hep/RecIonizationCluster.h"
0009
0010 #include "edm4hep/TrackerPulse.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 namespace edm4hep {
0024
0025
0026
0027
0028
0029 class MutableRecIonizationCluster {
0030
0031 friend class RecIonizationClusterCollection;
0032 friend class RecIonizationClusterMutableCollectionIterator;
0033 friend class RecIonizationCluster;
0034
0035 public:
0036 using object_type = RecIonizationCluster;
0037 using collection_type = RecIonizationClusterCollection;
0038
0039
0040 MutableRecIonizationCluster();
0041
0042
0043 MutableRecIonizationCluster(std::uint64_t cellID, float significance, std::int16_t type);
0044
0045
0046 MutableRecIonizationCluster(const MutableRecIonizationCluster& other) = default;
0047
0048
0049 MutableRecIonizationCluster& operator=(MutableRecIonizationCluster other);
0050
0051
0052
0053 MutableRecIonizationCluster clone(bool cloneRelations = true) const;
0054
0055
0056 ~MutableRecIonizationCluster() = default;
0057
0058 public:
0059
0060 std::uint64_t getCellID() const;
0061
0062
0063 float getSignificance() const;
0064
0065
0066 std::int16_t getType() const;
0067
0068
0069 void setCellID(std::uint64_t value);
0070
0071 std::uint64_t& getCellID();
0072
0073 [[deprecated("use getCellID instead")]] std::uint64_t& cellID();
0074
0075
0076 void setSignificance(float value);
0077
0078 float& getSignificance();
0079
0080 [[deprecated("use getSignificance instead")]] float& significance();
0081
0082
0083 void setType(std::int16_t value);
0084
0085 std::int16_t& getType();
0086
0087 [[deprecated("use getType instead")]] std::int16_t& type();
0088
0089 void addToTrackerPulse(const edm4hep::TrackerPulse&);
0090 std::size_t trackerPulse_size() const;
0091 edm4hep::TrackerPulse getTrackerPulse(std::size_t) const;
0092 std::vector<edm4hep::TrackerPulse>::const_iterator trackerPulse_begin() const;
0093 std::vector<edm4hep::TrackerPulse>::const_iterator trackerPulse_end() const;
0094 podio::RelationRange<edm4hep::TrackerPulse> getTrackerPulse() const;
0095
0096
0097 bool isAvailable() const;
0098
0099 void unlink() {
0100 m_obj = podio::utils::MaybeSharedPtr<RecIonizationClusterObj>{nullptr};
0101 }
0102
0103 bool operator==(const MutableRecIonizationCluster& other) const {
0104 return m_obj == other.m_obj;
0105 }
0106 bool operator==(const RecIonizationCluster& other) const;
0107
0108 bool operator!=(const MutableRecIonizationCluster& other) const {
0109 return !(*this == other);
0110 }
0111 bool operator!=(const RecIonizationCluster& other) const {
0112 return !(*this == other);
0113 }
0114
0115
0116 bool operator<(const MutableRecIonizationCluster& other) const {
0117 return m_obj < other.m_obj;
0118 }
0119
0120 podio::ObjectID id() const {
0121 return getObjectID();
0122 }
0123
0124 const podio::ObjectID getObjectID() const;
0125
0126 friend void swap(MutableRecIonizationCluster& a, MutableRecIonizationCluster& b) {
0127 using std::swap;
0128 swap(a.m_obj, b.m_obj);
0129 }
0130
0131 private:
0132
0133 explicit MutableRecIonizationCluster(podio::utils::MaybeSharedPtr<RecIonizationClusterObj> obj);
0134
0135 podio::utils::MaybeSharedPtr<RecIonizationClusterObj> m_obj{nullptr};
0136 };
0137
0138 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0139 void to_json(nlohmann::json& j, const MutableRecIonizationCluster& value);
0140 #endif
0141
0142 }
0143
0144 #endif