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