Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-03 08:33:28

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_VertexRecoParticleLink_H
0004 #define EDM4HEP_VertexRecoParticleLink_H
0005 
0006 #include "edm4hep/VertexRecoParticleLinkObj.h"
0007 
0008 #include "podio/detail/OrderKey.h"
0009 #include "podio/utilities/MaybeSharedPtr.h"
0010 
0011 #include <cstdint>
0012 #include <ostream>
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 VertexRecoParticleLinkCollection;
0021 class ReconstructedParticle;
0022 class MutableReconstructedParticle;
0023 class Vertex;
0024 class MutableVertex;
0025 } // namespace edm4hep
0026 
0027 namespace podio::detail {
0028 // Internal function used in less comparison operators of the datatypes and interface types
0029 OrderKey getOrderKey(const edm4hep::VertexRecoParticleLink& obj);
0030 }; // namespace podio::detail
0031 
0032 namespace edm4hep {
0033 
0034 class MutableVertexRecoParticleLink;
0035 class VertexRecoParticleLinkCollection;
0036 class VertexRecoParticleLinkCollectionData;
0037 
0038 /** @class VertexRecoParticleLink
0039  *  Link between a Vertex and a ReconstructedParticle
0040  *  @author: EDM4hep authors
0041  */
0042 class VertexRecoParticleLink {
0043 
0044   friend class MutableVertexRecoParticleLink;
0045   friend class VertexRecoParticleLinkCollection;
0046   friend class edm4hep::VertexRecoParticleLinkCollectionData;
0047   friend class VertexRecoParticleLinkCollectionIterator;
0048   friend podio::detail::OrderKey podio::detail::getOrderKey(const VertexRecoParticleLink& obj);
0049 
0050 public:
0051   using mutable_type = MutableVertexRecoParticleLink;
0052   using collection_type = VertexRecoParticleLinkCollection;
0053 
0054   /// default constructor
0055   VertexRecoParticleLink();
0056 
0057   /// Constructor initializing all members
0058   VertexRecoParticleLink(float weight);
0059 
0060   /// copy constructor
0061   VertexRecoParticleLink(const VertexRecoParticleLink& other) = default;
0062 
0063   /// copy-assignment operator
0064   VertexRecoParticleLink& operator=(VertexRecoParticleLink other);
0065 
0066   /// create a mutable deep-copy of the object with identical relations
0067   /// if cloneRelations=false, the relations are not cloned and will be empty
0068   MutableVertexRecoParticleLink clone(bool cloneRelations = true) const;
0069 
0070   /// destructor
0071   ~VertexRecoParticleLink() = default;
0072 
0073   /// converting constructor from mutable object
0074   VertexRecoParticleLink(const MutableVertexRecoParticleLink& other);
0075 
0076   static VertexRecoParticleLink makeEmpty();
0077 
0078 public:
0079   static constexpr auto typeName = "edm4hep::VertexRecoParticleLink";
0080 
0081   /// Access the weight of this link
0082   float getWeight() const;
0083 
0084   /// Access the reference to the reconstructed particle
0085   const edm4hep::ReconstructedParticle getTo() const;
0086   /// Access the reference to the vertex
0087   const edm4hep::Vertex getFrom() const;
0088 
0089   [[deprecated("use getTo instead")]] edm4hep::ReconstructedParticle getRec() const;
0090   [[deprecated("use getFrom instead")]] edm4hep::Vertex getVertex() const;
0091 
0092   /// check whether the object is actually available
0093   bool isAvailable() const;
0094   /// disconnect from VertexRecoParticleLinkObj instance
0095   void unlink() {
0096     m_obj = podio::utils::MaybeSharedPtr<VertexRecoParticleLinkObj>{nullptr};
0097   }
0098 
0099   bool operator==(const VertexRecoParticleLink& other) const {
0100     return m_obj == other.m_obj;
0101   }
0102   bool operator==(const MutableVertexRecoParticleLink& other) const;
0103 
0104   bool operator!=(const VertexRecoParticleLink& other) const {
0105     return !(*this == other);
0106   }
0107   bool operator!=(const MutableVertexRecoParticleLink& other) const {
0108     return !(*this == other);
0109   }
0110 
0111   // less comparison operator, so that objects can be e.g. stored in sets.
0112   bool operator<(const VertexRecoParticleLink& other) const {
0113     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0114   }
0115 
0116   podio::ObjectID id() const {
0117     return getObjectID();
0118   }
0119 
0120   const podio::ObjectID getObjectID() const;
0121 
0122   friend void swap(VertexRecoParticleLink& a, VertexRecoParticleLink& 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 VertexRecoParticleLinkObj
0129   explicit VertexRecoParticleLink(podio::utils::MaybeSharedPtr<VertexRecoParticleLinkObj> obj);
0130   VertexRecoParticleLink(VertexRecoParticleLinkObj* obj);
0131 
0132   podio::utils::MaybeSharedPtr<VertexRecoParticleLinkObj> m_obj{nullptr};
0133 };
0134 
0135 std::ostream& operator<<(std::ostream& o, const VertexRecoParticleLink& value);
0136 
0137 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0138 void to_json(nlohmann::json& j, const VertexRecoParticleLink& value);
0139 #endif
0140 
0141 } // namespace edm4hep
0142 
0143 #endif