Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:54:59

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
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 // forward declarations
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 // Internal function used in less comparison operators of the datatypes and interface types
0033 OrderKey getOrderKey(const edm4eic::MCRecoCalorimeterHitAssociation& obj);
0034 };
0035 
0036 namespace edm4eic {
0037 
0038 class MutableMCRecoCalorimeterHitAssociation;
0039 class MCRecoCalorimeterHitAssociationCollection;
0040 class MCRecoCalorimeterHitAssociationCollectionData;
0041 
0042 /** @class MCRecoCalorimeterHitAssociation
0043  *  Association between a RawCalorimeterHit and a SimCalorimeterHit
0044  *  @author: S. Rahman
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   /// default constructor
0059   MCRecoCalorimeterHitAssociation();
0060 
0061   /// Constructor initializing all members
0062   MCRecoCalorimeterHitAssociation(const float weight);
0063 
0064   /// copy constructor
0065   MCRecoCalorimeterHitAssociation(const MCRecoCalorimeterHitAssociation& other) = default;
0066 
0067   /// copy-assignment operator
0068   MCRecoCalorimeterHitAssociation& operator=(MCRecoCalorimeterHitAssociation other) &; // Rebind this to other's internal object
0069   MCRecoCalorimeterHitAssociation& operator=(MCRecoCalorimeterHitAssociation other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0070 
0071   /// create a mutable deep-copy of the object with identical relations
0072   /// if cloneRelations=false, the relations are not cloned and will be empty
0073   MutableMCRecoCalorimeterHitAssociation clone(bool cloneRelations=true) const;
0074 
0075   /// destructor
0076   ~MCRecoCalorimeterHitAssociation() = default;
0077 
0078   /// converting constructor from mutable object
0079   MCRecoCalorimeterHitAssociation(const MutableMCRecoCalorimeterHitAssociation& other);
0080 
0081   static MCRecoCalorimeterHitAssociation makeEmpty();
0082 
0083 public:
0084 
0085   static constexpr std::string_view typeName = "edm4eic::MCRecoCalorimeterHitAssociation";
0086 
0087   /// Access the weight of this association
0088   float getWeight() const;
0089 
0090 
0091   /// Access the reference to the digitized calorimeter hit
0092   const edm4hep::RawCalorimeterHit getRawHit() const;
0093   /// Access the reference to the simulated calorimeter hit
0094   const edm4hep::SimCalorimeterHit getSimHit() const;
0095 
0096 
0097 
0098   /// check whether the object is actually available
0099   bool isAvailable() const;
0100   /// disconnect from MCRecoCalorimeterHitAssociationObj instance
0101   void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj>{nullptr}; }
0102 
0103   bool operator==(const MCRecoCalorimeterHitAssociation& other) const { return m_obj == other.m_obj; }
0104   bool operator==(const MutableMCRecoCalorimeterHitAssociation& other) const;
0105 
0106   bool operator!=(const MCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
0107   bool operator!=(const MutableMCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
0108 
0109   // less comparison operator, so that objects can be e.g. stored in sets.
0110   bool operator<(const MCRecoCalorimeterHitAssociation& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0111 
0112   podio::ObjectID id() const { return getObjectID(); }
0113 
0114   const podio::ObjectID getObjectID() const;
0115 
0116   friend std::hash<MCRecoCalorimeterHitAssociation>;
0117 
0118   friend void swap(MCRecoCalorimeterHitAssociation& a, MCRecoCalorimeterHitAssociation& b) {
0119     using std::swap;
0120     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0121   }
0122 
0123 private:
0124   /// constructor from existing MCRecoCalorimeterHitAssociationObj
0125   explicit MCRecoCalorimeterHitAssociation(podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> obj);
0126   MCRecoCalorimeterHitAssociation(MCRecoCalorimeterHitAssociationObj* obj);
0127 
0128   podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> m_obj{nullptr};
0129 };
0130 
0131 std::ostream& operator<<(std::ostream& o, const MCRecoCalorimeterHitAssociation& value);
0132 
0133 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0134 void to_json(nlohmann::json& j, const MCRecoCalorimeterHitAssociation& value);
0135 #endif
0136 
0137 
0138 } // namespace edm4eic
0139 
0140 
0141 
0142 template<>
0143 struct std::hash<edm4eic::MCRecoCalorimeterHitAssociation> {
0144   std::size_t operator()(const edm4eic::MCRecoCalorimeterHitAssociation& obj) const {
0145     return std::hash<edm4eic::MCRecoCalorimeterHitAssociationObj*>{}(obj.m_obj.get());
0146   }
0147 };
0148 
0149 
0150 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0151 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0152 // and https://github.com/AIDASoft/podio/issues/770
0153 #if defined(__clang__)
0154 #pragma clang diagnostic push
0155 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0156 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0157 #pragma clang diagnostic ignored "-Wdeprecated"
0158 constexpr std::string_view edm4eic::MCRecoCalorimeterHitAssociation::typeName;
0159 #pragma clang diagnostic pop
0160 #elif defined(__GNUC__)
0161 #pragma GCC diagnostic push
0162 #pragma GCC diagnostic ignored "-Wdeprecated"
0163 constexpr std::string_view edm4eic::MCRecoCalorimeterHitAssociation::typeName;
0164 #pragma GCC diagnostic pop
0165 #endif
0166 
0167 #endif