Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:35

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