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