Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-14 08:50:41

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(float weight);
0061 
0062   /// copy constructor
0063   TrackClusterMatch(const TrackClusterMatch& other) = default;
0064 
0065   /// copy-assignment operator
0066   TrackClusterMatch& operator=(TrackClusterMatch other);
0067 
0068   /// create a mutable deep-copy of the object with identical relations
0069   /// if cloneRelations=false, the relations are not cloned and will be empty
0070   MutableTrackClusterMatch clone(bool cloneRelations=true) const;
0071 
0072   /// destructor
0073   ~TrackClusterMatch() = default;
0074 
0075   /// converting constructor from mutable object
0076   TrackClusterMatch(const MutableTrackClusterMatch& other);
0077 
0078   static TrackClusterMatch makeEmpty();
0079 
0080 public:
0081 
0082   static constexpr auto typeName = "edm4eic::TrackClusterMatch";
0083 
0084   /// Access the weight of this association
0085   float getWeight() const;
0086 
0087 
0088   /// Access the reference to the cluster
0089   const edm4eic::Cluster getCluster() const;
0090   /// Access the reference to the track
0091   const edm4eic::Track getTrack() const;
0092 
0093 
0094 
0095   /// check whether the object is actually available
0096   bool isAvailable() const;
0097   /// disconnect from TrackClusterMatchObj instance
0098   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
0099 
0100   bool operator==(const TrackClusterMatch& other) const { return m_obj == other.m_obj; }
0101   bool operator==(const MutableTrackClusterMatch& other) const;
0102 
0103   bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
0104   bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
0105 
0106   // less comparison operator, so that objects can be e.g. stored in sets.
0107   bool operator<(const TrackClusterMatch& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0108 
0109   podio::ObjectID id() const { return getObjectID(); }
0110 
0111   const podio::ObjectID getObjectID() const;
0112 
0113   friend void swap(TrackClusterMatch& a, TrackClusterMatch& b) {
0114     using std::swap;
0115     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0116   }
0117 
0118 private:
0119   /// constructor from existing TrackClusterMatchObj
0120   explicit TrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
0121   TrackClusterMatch(TrackClusterMatchObj* obj);
0122 
0123   podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
0124 };
0125 
0126 std::ostream& operator<<(std::ostream& o, const TrackClusterMatch& value);
0127 
0128 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0129 void to_json(nlohmann::json& j, const TrackClusterMatch& value);
0130 #endif
0131 
0132 
0133 } // namespace edm4eic
0134 
0135 
0136 #endif