Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 08:35:17

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableMCRecoCalorimeterHitAssociation_H
0004 #define EDM4EIC_MutableMCRecoCalorimeterHitAssociation_H
0005 
0006 #include "edm4eic/MCRecoCalorimeterHitAssociationObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/MCRecoCalorimeterHitAssociation.h"
0009 
0010 
0011 #include "podio/utilities/MaybeSharedPtr.h"
0012 
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 edm4eic {
0032 
0033 
0034 /** @class MutableMCRecoCalorimeterHitAssociation
0035  *  Association between a RawCalorimeterHit and a SimCalorimeterHit
0036  *  @author: S. Rahman
0037  */
0038 class MutableMCRecoCalorimeterHitAssociation {
0039 
0040   friend class MCRecoCalorimeterHitAssociationCollection;
0041   friend class MCRecoCalorimeterHitAssociationMutableCollectionIterator;
0042   friend class MCRecoCalorimeterHitAssociation;
0043 
0044 public:
0045   using object_type = MCRecoCalorimeterHitAssociation;
0046   using collection_type = MCRecoCalorimeterHitAssociationCollection;
0047 
0048   /// default constructor
0049   MutableMCRecoCalorimeterHitAssociation();
0050 
0051   /// Constructor initializing all members
0052   MutableMCRecoCalorimeterHitAssociation(float weight);
0053 
0054   /// copy constructor
0055   MutableMCRecoCalorimeterHitAssociation(const MutableMCRecoCalorimeterHitAssociation& other) = default;
0056 
0057   /// copy-assignment operator
0058   MutableMCRecoCalorimeterHitAssociation& operator=(MutableMCRecoCalorimeterHitAssociation other);
0059 
0060   /// create a mutable deep-copy of the object with identical relations
0061   /// if cloneRelations=false, the relations are not cloned and will be empty
0062   MutableMCRecoCalorimeterHitAssociation clone(bool cloneRelations=true) const;
0063 
0064   /// destructor
0065   ~MutableMCRecoCalorimeterHitAssociation() = default;
0066 
0067 
0068 public:
0069 
0070   /// Access the weight of this association
0071   float getWeight() const;
0072 
0073 
0074   /// Access the reference to the digitized calorimeter hit
0075   const edm4hep::RawCalorimeterHit getRawHit() const;
0076   /// Access the reference to the simulated calorimeter hit
0077   const edm4hep::SimCalorimeterHit getSimHit() const;
0078 
0079   /// Set the weight of this association
0080   void setWeight(float value);
0081   /// Get mutable reference to weight of this association
0082   float& getWeight();
0083   /// Get reference to weight of this association
0084   [[deprecated("use getWeight instead")]]
0085   float& weight();
0086 
0087 
0088   /// Set the reference to the digitized calorimeter hit
0089   void setRawHit(const edm4hep::RawCalorimeterHit& value);
0090   /// Set the reference to the simulated calorimeter hit
0091   void setSimHit(const edm4hep::SimCalorimeterHit& value);
0092 
0093 
0094 
0095 
0096   /// check whether the object is actually available
0097   bool isAvailable() const;
0098   /// disconnect from MCRecoCalorimeterHitAssociationObj instance
0099   void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj>{nullptr}; }
0100 
0101   bool operator==(const MutableMCRecoCalorimeterHitAssociation& other) const { return m_obj == other.m_obj; }
0102   bool operator==(const MCRecoCalorimeterHitAssociation& other) const;
0103 
0104   bool operator!=(const MutableMCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
0105   bool operator!=(const MCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
0106 
0107   // less comparison operator, so that objects can be e.g. stored in sets.
0108   bool operator<(const MutableMCRecoCalorimeterHitAssociation& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0109 
0110   podio::ObjectID id() const { return getObjectID(); }
0111 
0112   const podio::ObjectID getObjectID() const;
0113 
0114   friend void swap(MutableMCRecoCalorimeterHitAssociation& a, MutableMCRecoCalorimeterHitAssociation& b) {
0115     using std::swap;
0116     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0117   }
0118 
0119 private:
0120   /// constructor from existing MCRecoCalorimeterHitAssociationObj
0121   explicit MutableMCRecoCalorimeterHitAssociation(podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> obj);
0122 
0123   podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> m_obj{nullptr};
0124 };
0125 
0126 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0127 void to_json(nlohmann::json& j, const MutableMCRecoCalorimeterHitAssociation& value);
0128 #endif
0129 
0130 
0131 } // namespace edm4eic
0132 
0133 
0134 #endif