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_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 
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 Vertex;
0022 class MutableVertex;
0023 }
0024 namespace edm4hep {
0025 class MCParticle;
0026 class MutableMCParticle;
0027 }
0028 
0029 
0030 namespace edm4eic {
0031 
0032 class MutableMCRecoVertexParticleAssociation;
0033 class MCRecoVertexParticleAssociationCollection;
0034 class MCRecoVertexParticleAssociationCollectionData;
0035 
0036 /** @class MCRecoVertexParticleAssociation
0037  *  Association between a Vertex and a MCParticle
0038  *  @author: S. Joosten
0039  */
0040 class MCRecoVertexParticleAssociation {
0041 
0042   friend class MutableMCRecoVertexParticleAssociation;
0043   friend class MCRecoVertexParticleAssociationCollection;
0044   friend class edm4eic::MCRecoVertexParticleAssociationCollectionData;
0045   friend class MCRecoVertexParticleAssociationCollectionIterator;
0046 
0047 public:
0048   using mutable_type = MutableMCRecoVertexParticleAssociation;
0049   using collection_type = MCRecoVertexParticleAssociationCollection;
0050 
0051   /// default constructor
0052   MCRecoVertexParticleAssociation();
0053 
0054   /// Constructor initializing all members
0055   MCRecoVertexParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
0056 
0057   /// copy constructor
0058   MCRecoVertexParticleAssociation(const MCRecoVertexParticleAssociation& other) = default;
0059 
0060   /// copy-assignment operator
0061   MCRecoVertexParticleAssociation& operator=(MCRecoVertexParticleAssociation other);
0062 
0063   /// create a mutable deep-copy of the object with identical relations
0064   /// if cloneRelations=false, the relations are not cloned and will be empty
0065   MutableMCRecoVertexParticleAssociation clone(bool cloneRelations=true) const;
0066 
0067   /// destructor
0068   ~MCRecoVertexParticleAssociation() = default;
0069 
0070   /// converting constructor from mutable object
0071   MCRecoVertexParticleAssociation(const MutableMCRecoVertexParticleAssociation& other);
0072 
0073   static MCRecoVertexParticleAssociation makeEmpty();
0074 
0075 public:
0076 
0077   /// Access the Index of corresponding MCParticle (position in MCParticles array)
0078   std::uint32_t getSimID() const;
0079 
0080   /// Access the Index of corresponding Vertex (position in Vertices array)
0081   std::uint32_t getRecID() const;
0082 
0083   /// Access the weight of this association
0084   float getWeight() const;
0085 
0086 
0087   /// Access the reference to the vertex
0088   const edm4eic::Vertex getRec() const;
0089   /// Access the reference to the Monte-Carlo particle
0090   const edm4hep::MCParticle getSim() const;
0091 
0092 
0093 
0094   /// check whether the object is actually available
0095   bool isAvailable() const;
0096   /// disconnect from MCRecoVertexParticleAssociationObj instance
0097   void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj>{nullptr}; }
0098 
0099   bool operator==(const MCRecoVertexParticleAssociation& other) const { return m_obj == other.m_obj; }
0100   bool operator==(const MutableMCRecoVertexParticleAssociation& other) const;
0101 
0102   bool operator!=(const MCRecoVertexParticleAssociation& other) const { return !(*this == other); }
0103   bool operator!=(const MutableMCRecoVertexParticleAssociation& other) const { return !(*this == other); }
0104 
0105   // less comparison operator, so that objects can be e.g. stored in sets.
0106   bool operator<(const MCRecoVertexParticleAssociation& other) const { return m_obj < other.m_obj; }
0107 
0108   podio::ObjectID id() const { return getObjectID(); }
0109 
0110   const podio::ObjectID getObjectID() const;
0111 
0112   friend void swap(MCRecoVertexParticleAssociation& a, MCRecoVertexParticleAssociation& 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 MCRecoVertexParticleAssociationObj
0119   explicit MCRecoVertexParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> obj);
0120   MCRecoVertexParticleAssociation(MCRecoVertexParticleAssociationObj* obj);
0121 
0122   podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> m_obj{nullptr};
0123 };
0124 
0125 std::ostream& operator<<(std::ostream& o, const MCRecoVertexParticleAssociation& value);
0126 
0127 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0128 void to_json(nlohmann::json& j, const MCRecoVertexParticleAssociation& value);
0129 #endif
0130 
0131 
0132 } // namespace edm4eic
0133 
0134 
0135 #endif