Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:30

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