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