Back to home page

EIC code displayed by LXR

 
 

    


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

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