Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/edm4eic/MutableMCRecoParticleAssociation.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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