Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:55:05

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_TrackClusterMatch_H
0004 #define EDM4EIC_TrackClusterMatch_H
0005 
0006 #include "edm4eic/TrackClusterMatchObj.h"
0007 
0008 
0009 #include "podio/utilities/MaybeSharedPtr.h"
0010 #include "podio/detail/OrderKey.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 TrackClusterMatchCollection;
0022 class Cluster;
0023 class MutableCluster;
0024 class Track;
0025 class MutableTrack;
0026 }
0027 
0028 
0029 namespace podio::detail {
0030 // Internal function used in less comparison operators of the datatypes and interface types
0031 OrderKey getOrderKey(const edm4eic::TrackClusterMatch& obj);
0032 };
0033 
0034 namespace edm4eic {
0035 
0036 class MutableTrackClusterMatch;
0037 class TrackClusterMatchCollection;
0038 class TrackClusterMatchCollectionData;
0039 
0040 /** @class TrackClusterMatch
0041  *  Match between a Cluster and a Track
0042  *  @author: D. Anderson, D. Brandenburg, D. Kalinkin, S. Joosten
0043  */
0044 class TrackClusterMatch {
0045 
0046   friend class MutableTrackClusterMatch;
0047   friend class TrackClusterMatchCollection;
0048   friend class edm4eic::TrackClusterMatchCollectionData;
0049   friend class TrackClusterMatchCollectionIterator;
0050   friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackClusterMatch & obj);
0051 
0052 public:
0053   using mutable_type = MutableTrackClusterMatch;
0054   using collection_type = TrackClusterMatchCollection;
0055 
0056   /// default constructor
0057   TrackClusterMatch();
0058 
0059   /// Constructor initializing all members
0060   TrackClusterMatch(const float weight);
0061 
0062   /// copy constructor
0063   TrackClusterMatch(const TrackClusterMatch& other) = default;
0064 
0065   /// copy-assignment operator
0066   TrackClusterMatch& operator=(TrackClusterMatch other) &; // Rebind this to other's internal object
0067   TrackClusterMatch& operator=(TrackClusterMatch other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0068 
0069   /// create a mutable deep-copy of the object with identical relations
0070   /// if cloneRelations=false, the relations are not cloned and will be empty
0071   MutableTrackClusterMatch clone(bool cloneRelations=true) const;
0072 
0073   /// destructor
0074   ~TrackClusterMatch() = default;
0075 
0076   /// converting constructor from mutable object
0077   TrackClusterMatch(const MutableTrackClusterMatch& other);
0078 
0079   static TrackClusterMatch makeEmpty();
0080 
0081 public:
0082 
0083   static constexpr std::string_view typeName = "edm4eic::TrackClusterMatch";
0084 
0085   /// Access the weight of this association
0086   float getWeight() const;
0087 
0088 
0089   /// Access the reference to the cluster
0090   const edm4eic::Cluster getCluster() const;
0091   /// Access the reference to the track
0092   const edm4eic::Track getTrack() const;
0093 
0094 
0095 
0096   /// check whether the object is actually available
0097   bool isAvailable() const;
0098   /// disconnect from TrackClusterMatchObj instance
0099   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
0100 
0101   bool operator==(const TrackClusterMatch& other) const { return m_obj == other.m_obj; }
0102   bool operator==(const MutableTrackClusterMatch& other) const;
0103 
0104   bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
0105   bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
0106 
0107   // less comparison operator, so that objects can be e.g. stored in sets.
0108   bool operator<(const TrackClusterMatch& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0109 
0110   podio::ObjectID id() const { return getObjectID(); }
0111 
0112   const podio::ObjectID getObjectID() const;
0113 
0114   friend std::hash<TrackClusterMatch>;
0115 
0116   friend void swap(TrackClusterMatch& a, TrackClusterMatch& b) {
0117     using std::swap;
0118     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0119   }
0120 
0121 private:
0122   /// constructor from existing TrackClusterMatchObj
0123   explicit TrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
0124   TrackClusterMatch(TrackClusterMatchObj* obj);
0125 
0126   podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
0127 };
0128 
0129 std::ostream& operator<<(std::ostream& o, const TrackClusterMatch& value);
0130 
0131 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0132 void to_json(nlohmann::json& j, const TrackClusterMatch& value);
0133 #endif
0134 
0135 
0136 } // namespace edm4eic
0137 
0138 
0139 
0140 template<>
0141 struct std::hash<edm4eic::TrackClusterMatch> {
0142   std::size_t operator()(const edm4eic::TrackClusterMatch& obj) const {
0143     return std::hash<edm4eic::TrackClusterMatchObj*>{}(obj.m_obj.get());
0144   }
0145 };
0146 
0147 
0148 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0149 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0150 // and https://github.com/AIDASoft/podio/issues/770
0151 #if defined(__clang__)
0152 #pragma clang diagnostic push
0153 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0154 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0155 #pragma clang diagnostic ignored "-Wdeprecated"
0156 constexpr std::string_view edm4eic::TrackClusterMatch::typeName;
0157 #pragma clang diagnostic pop
0158 #elif defined(__GNUC__)
0159 #pragma GCC diagnostic push
0160 #pragma GCC diagnostic ignored "-Wdeprecated"
0161 constexpr std::string_view edm4eic::TrackClusterMatch::typeName;
0162 #pragma GCC diagnostic pop
0163 #endif
0164 
0165 #endif