Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-05 08:52:27

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