Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-09 08:30:08

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MCRecoVertexParticleAssociation_H
0004 #define EDM4EIC_MCRecoVertexParticleAssociation_H
0005 
0006 #include "edm4eic/MCRecoVertexParticleAssociationObj.h"
0007 
0008 #include <cstdint>
0009 
0010 #include "podio/utilities/MaybeSharedPtr.h"
0011 #include "podio/detail/OrderKey.h"
0012 
0013 #include <ostream>
0014 #include <cstdint>
0015 
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019 
0020 // forward declarations
0021 namespace edm4eic {
0022 class MCRecoVertexParticleAssociationCollection;
0023 class Vertex;
0024 class MutableVertex;
0025 }
0026 namespace edm4hep {
0027 class MCParticle;
0028 class MutableMCParticle;
0029 }
0030 
0031 
0032 namespace podio::detail {
0033 // Internal function used in less comparison operators of the datatypes and interface types
0034 OrderKey getOrderKey(const edm4eic::MCRecoVertexParticleAssociation& obj);
0035 };
0036 
0037 namespace edm4eic {
0038 
0039 class MutableMCRecoVertexParticleAssociation;
0040 class MCRecoVertexParticleAssociationCollection;
0041 class MCRecoVertexParticleAssociationCollectionData;
0042 
0043 /** @class MCRecoVertexParticleAssociation
0044  *  Association between a Vertex and a MCParticle
0045  *  @author: S. Joosten
0046  */
0047 class MCRecoVertexParticleAssociation {
0048 
0049   friend class MutableMCRecoVertexParticleAssociation;
0050   friend class MCRecoVertexParticleAssociationCollection;
0051   friend class edm4eic::MCRecoVertexParticleAssociationCollectionData;
0052   friend class MCRecoVertexParticleAssociationCollectionIterator;
0053   friend podio::detail::OrderKey podio::detail::getOrderKey(const MCRecoVertexParticleAssociation & obj);
0054 
0055 public:
0056   using mutable_type = MutableMCRecoVertexParticleAssociation;
0057   using collection_type = MCRecoVertexParticleAssociationCollection;
0058 
0059   /// default constructor
0060   MCRecoVertexParticleAssociation();
0061 
0062   /// Constructor initializing all members
0063   MCRecoVertexParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
0064 
0065   /// copy constructor
0066   MCRecoVertexParticleAssociation(const MCRecoVertexParticleAssociation& other) = default;
0067 
0068   /// copy-assignment operator
0069   MCRecoVertexParticleAssociation& operator=(MCRecoVertexParticleAssociation other);
0070 
0071   /// create a mutable deep-copy of the object with identical relations
0072   /// if cloneRelations=false, the relations are not cloned and will be empty
0073   MutableMCRecoVertexParticleAssociation clone(bool cloneRelations=true) const;
0074 
0075   /// destructor
0076   ~MCRecoVertexParticleAssociation() = default;
0077 
0078   /// converting constructor from mutable object
0079   MCRecoVertexParticleAssociation(const MutableMCRecoVertexParticleAssociation& other);
0080 
0081   static MCRecoVertexParticleAssociation makeEmpty();
0082 
0083 public:
0084 
0085   static constexpr auto typeName = "edm4eic::MCRecoVertexParticleAssociation";
0086 
0087   /// Access the Index of corresponding MCParticle (position in MCParticles array)
0088   std::uint32_t getSimID() const;
0089 
0090   /// Access the Index of corresponding Vertex (position in Vertices array)
0091   std::uint32_t getRecID() const;
0092 
0093   /// Access the weight of this association
0094   float getWeight() const;
0095 
0096 
0097   /// Access the reference to the vertex
0098   const edm4eic::Vertex getRec() const;
0099   /// Access the reference to the Monte-Carlo particle
0100   const edm4hep::MCParticle getSim() const;
0101 
0102 
0103 
0104   /// check whether the object is actually available
0105   bool isAvailable() const;
0106   /// disconnect from MCRecoVertexParticleAssociationObj instance
0107   void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj>{nullptr}; }
0108 
0109   bool operator==(const MCRecoVertexParticleAssociation& other) const { return m_obj == other.m_obj; }
0110   bool operator==(const MutableMCRecoVertexParticleAssociation& other) const;
0111 
0112   bool operator!=(const MCRecoVertexParticleAssociation& other) const { return !(*this == other); }
0113   bool operator!=(const MutableMCRecoVertexParticleAssociation& other) const { return !(*this == other); }
0114 
0115   // less comparison operator, so that objects can be e.g. stored in sets.
0116   bool operator<(const MCRecoVertexParticleAssociation& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0117 
0118   podio::ObjectID id() const { return getObjectID(); }
0119 
0120   const podio::ObjectID getObjectID() const;
0121 
0122   friend void swap(MCRecoVertexParticleAssociation& a, MCRecoVertexParticleAssociation& b) {
0123     using std::swap;
0124     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0125   }
0126 
0127 private:
0128   /// constructor from existing MCRecoVertexParticleAssociationObj
0129   explicit MCRecoVertexParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> obj);
0130   MCRecoVertexParticleAssociation(MCRecoVertexParticleAssociationObj* obj);
0131 
0132   podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> m_obj{nullptr};
0133 };
0134 
0135 std::ostream& operator<<(std::ostream& o, const MCRecoVertexParticleAssociation& value);
0136 
0137 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0138 void to_json(nlohmann::json& j, const MCRecoVertexParticleAssociation& value);
0139 #endif
0140 
0141 
0142 } // namespace edm4eic
0143 
0144 
0145 #endif