File indexing completed on 2025-07-11 08:30:06
0001
0002
0003 #ifndef EDM4EIC_MCRecoCalorimeterHitAssociation_H
0004 #define EDM4EIC_MCRecoCalorimeterHitAssociation_H
0005
0006 #include "edm4eic/MCRecoCalorimeterHitAssociationObj.h"
0007
0008
0009 #include "podio/utilities/MaybeSharedPtr.h"
0010 #include "podio/detail/OrderKey.h"
0011
0012 #include <ostream>
0013 #include <cstdint>
0014
0015 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0016 #include "nlohmann/json_fwd.hpp"
0017 #endif
0018
0019
0020 namespace edm4eic {
0021 class MCRecoCalorimeterHitAssociationCollection;
0022 }
0023 namespace edm4hep {
0024 class RawCalorimeterHit;
0025 class MutableRawCalorimeterHit;
0026 class SimCalorimeterHit;
0027 class MutableSimCalorimeterHit;
0028 }
0029
0030
0031 namespace podio::detail {
0032
0033 OrderKey getOrderKey(const edm4eic::MCRecoCalorimeterHitAssociation& obj);
0034 };
0035
0036 namespace edm4eic {
0037
0038 class MutableMCRecoCalorimeterHitAssociation;
0039 class MCRecoCalorimeterHitAssociationCollection;
0040 class MCRecoCalorimeterHitAssociationCollectionData;
0041
0042
0043
0044
0045
0046 class MCRecoCalorimeterHitAssociation {
0047
0048 friend class MutableMCRecoCalorimeterHitAssociation;
0049 friend class MCRecoCalorimeterHitAssociationCollection;
0050 friend class edm4eic::MCRecoCalorimeterHitAssociationCollectionData;
0051 friend class MCRecoCalorimeterHitAssociationCollectionIterator;
0052 friend podio::detail::OrderKey podio::detail::getOrderKey(const MCRecoCalorimeterHitAssociation & obj);
0053
0054 public:
0055 using mutable_type = MutableMCRecoCalorimeterHitAssociation;
0056 using collection_type = MCRecoCalorimeterHitAssociationCollection;
0057
0058
0059 MCRecoCalorimeterHitAssociation();
0060
0061
0062 MCRecoCalorimeterHitAssociation(float weight);
0063
0064
0065 MCRecoCalorimeterHitAssociation(const MCRecoCalorimeterHitAssociation& other) = default;
0066
0067
0068 MCRecoCalorimeterHitAssociation& operator=(MCRecoCalorimeterHitAssociation other);
0069
0070
0071
0072 MutableMCRecoCalorimeterHitAssociation clone(bool cloneRelations=true) const;
0073
0074
0075 ~MCRecoCalorimeterHitAssociation() = default;
0076
0077
0078 MCRecoCalorimeterHitAssociation(const MutableMCRecoCalorimeterHitAssociation& other);
0079
0080 static MCRecoCalorimeterHitAssociation makeEmpty();
0081
0082 public:
0083
0084 static constexpr auto typeName = "edm4eic::MCRecoCalorimeterHitAssociation";
0085
0086
0087 float getWeight() const;
0088
0089
0090
0091 const edm4hep::RawCalorimeterHit getRawHit() const;
0092
0093 const edm4hep::SimCalorimeterHit getSimHit() const;
0094
0095
0096
0097
0098 bool isAvailable() const;
0099
0100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj>{nullptr}; }
0101
0102 bool operator==(const MCRecoCalorimeterHitAssociation& other) const { return m_obj == other.m_obj; }
0103 bool operator==(const MutableMCRecoCalorimeterHitAssociation& other) const;
0104
0105 bool operator!=(const MCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
0106 bool operator!=(const MutableMCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
0107
0108
0109 bool operator<(const MCRecoCalorimeterHitAssociation& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0110
0111 podio::ObjectID id() const { return getObjectID(); }
0112
0113 const podio::ObjectID getObjectID() const;
0114
0115 friend void swap(MCRecoCalorimeterHitAssociation& a, MCRecoCalorimeterHitAssociation& b) {
0116 using std::swap;
0117 swap(a.m_obj, b.m_obj);
0118 }
0119
0120 private:
0121
0122 explicit MCRecoCalorimeterHitAssociation(podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> obj);
0123 MCRecoCalorimeterHitAssociation(MCRecoCalorimeterHitAssociationObj* obj);
0124
0125 podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> m_obj{nullptr};
0126 };
0127
0128 std::ostream& operator<<(std::ostream& o, const MCRecoCalorimeterHitAssociation& value);
0129
0130 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0131 void to_json(nlohmann::json& j, const MCRecoCalorimeterHitAssociation& value);
0132 #endif
0133
0134
0135 }
0136
0137
0138 #endif