Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_MutableMCRecoTrackerHitPlaneAssociation_H
0004 #define EDM4HEP_MutableMCRecoTrackerHitPlaneAssociation_H
0005 
0006 #include "edm4hep/MCRecoTrackerHitPlaneAssociationObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/MCRecoTrackerHitPlaneAssociation.h"
0009 
0010 #include "podio/utilities/MaybeSharedPtr.h"
0011 
0012 #include <cstdint>
0013 
0014 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0015 #include "nlohmann/json_fwd.hpp"
0016 #endif
0017 
0018 // forward declarations
0019 namespace edm4hep {
0020 class TrackerHitPlane;
0021 class MutableTrackerHitPlane;
0022 class SimTrackerHit;
0023 class MutableSimTrackerHit;
0024 } // namespace edm4hep
0025 
0026 namespace edm4hep {
0027 
0028 /** @class MutableMCRecoTrackerHitPlaneAssociation
0029  *  Association between a TrackerHitPlane and the corresponding simulated TrackerHit
0030  *  @author: Placido Fernandez Declara
0031  */
0032 class MutableMCRecoTrackerHitPlaneAssociation {
0033 
0034   friend class MCRecoTrackerHitPlaneAssociationCollection;
0035   friend class MCRecoTrackerHitPlaneAssociationMutableCollectionIterator;
0036   friend class MCRecoTrackerHitPlaneAssociation;
0037 
0038 public:
0039   using object_type = MCRecoTrackerHitPlaneAssociation;
0040   using collection_type = MCRecoTrackerHitPlaneAssociationCollection;
0041 
0042   /// default constructor
0043   MutableMCRecoTrackerHitPlaneAssociation();
0044 
0045   /// Constructor initializing all members
0046   MutableMCRecoTrackerHitPlaneAssociation(float weight);
0047 
0048   /// copy constructor
0049   MutableMCRecoTrackerHitPlaneAssociation(const MutableMCRecoTrackerHitPlaneAssociation& other) = default;
0050 
0051   /// copy-assignment operator
0052   MutableMCRecoTrackerHitPlaneAssociation& operator=(MutableMCRecoTrackerHitPlaneAssociation other);
0053 
0054   /// create a mutable deep-copy of the object with identical relations
0055   /// if cloneRelations=false, the relations are not cloned and will be empty
0056   MutableMCRecoTrackerHitPlaneAssociation clone(bool cloneRelations = true) const;
0057 
0058   /// destructor
0059   ~MutableMCRecoTrackerHitPlaneAssociation() = default;
0060 
0061 public:
0062   /// Access the weight of this association
0063   float getWeight() const;
0064 
0065   /// Access the reference to the reconstructed hit
0066   const edm4hep::TrackerHitPlane getRec() const;
0067   /// Access the reference to the simulated hit
0068   const edm4hep::SimTrackerHit getSim() const;
0069 
0070   /// Set the weight of this association
0071   void setWeight(float value);
0072   /// Get mutable reference to weight of this association
0073   float& getWeight();
0074   /// Get reference to weight of this association
0075   [[deprecated("use getWeight instead")]] float& weight();
0076 
0077   /// Set the reference to the reconstructed hit
0078   void setRec(const edm4hep::TrackerHitPlane& value);
0079   /// Set the reference to the simulated hit
0080   void setSim(const edm4hep::SimTrackerHit& value);
0081 
0082   /// check whether the object is actually available
0083   bool isAvailable() const;
0084   /// disconnect from MCRecoTrackerHitPlaneAssociationObj instance
0085   void unlink() {
0086     m_obj = podio::utils::MaybeSharedPtr<MCRecoTrackerHitPlaneAssociationObj>{nullptr};
0087   }
0088 
0089   bool operator==(const MutableMCRecoTrackerHitPlaneAssociation& other) const {
0090     return m_obj == other.m_obj;
0091   }
0092   bool operator==(const MCRecoTrackerHitPlaneAssociation& other) const;
0093 
0094   bool operator!=(const MutableMCRecoTrackerHitPlaneAssociation& other) const {
0095     return !(*this == other);
0096   }
0097   bool operator!=(const MCRecoTrackerHitPlaneAssociation& other) const {
0098     return !(*this == other);
0099   }
0100 
0101   // less comparison operator, so that objects can be e.g. stored in sets.
0102   bool operator<(const MutableMCRecoTrackerHitPlaneAssociation& other) const {
0103     return m_obj < other.m_obj;
0104   }
0105 
0106   podio::ObjectID id() const {
0107     return getObjectID();
0108   }
0109 
0110   const podio::ObjectID getObjectID() const;
0111 
0112   friend void swap(MutableMCRecoTrackerHitPlaneAssociation& a, MutableMCRecoTrackerHitPlaneAssociation& b) {
0113     using std::swap;
0114     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0115   }
0116 
0117 private:
0118   /// constructor from existing MCRecoTrackerHitPlaneAssociationObj
0119   explicit MutableMCRecoTrackerHitPlaneAssociation(
0120       podio::utils::MaybeSharedPtr<MCRecoTrackerHitPlaneAssociationObj> obj);
0121 
0122   podio::utils::MaybeSharedPtr<MCRecoTrackerHitPlaneAssociationObj> m_obj{nullptr};
0123 };
0124 
0125 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0126 void to_json(nlohmann::json& j, const MutableMCRecoTrackerHitPlaneAssociation& value);
0127 #endif
0128 
0129 } // namespace edm4hep
0130 
0131 #endif