Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 08:35:18

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableTrackClusterMatch_H
0004 #define EDM4EIC_MutableTrackClusterMatch_H
0005 
0006 #include "edm4eic/TrackClusterMatchObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/TrackClusterMatch.h"
0009 
0010 
0011 #include "podio/utilities/MaybeSharedPtr.h"
0012 
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 edm4eic {
0030 
0031 
0032 /** @class MutableTrackClusterMatch
0033  *  Match between a Cluster and a Track
0034  *  @author: D. Anderson, D. Brandenburg, D. Kalinkin, S. Joosten
0035  */
0036 class MutableTrackClusterMatch {
0037 
0038   friend class TrackClusterMatchCollection;
0039   friend class TrackClusterMatchMutableCollectionIterator;
0040   friend class TrackClusterMatch;
0041 
0042 public:
0043   using object_type = TrackClusterMatch;
0044   using collection_type = TrackClusterMatchCollection;
0045 
0046   /// default constructor
0047   MutableTrackClusterMatch();
0048 
0049   /// Constructor initializing all members
0050   MutableTrackClusterMatch(float weight);
0051 
0052   /// copy constructor
0053   MutableTrackClusterMatch(const MutableTrackClusterMatch& other) = default;
0054 
0055   /// copy-assignment operator
0056   MutableTrackClusterMatch& operator=(MutableTrackClusterMatch 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   MutableTrackClusterMatch clone(bool cloneRelations=true) const;
0061 
0062   /// destructor
0063   ~MutableTrackClusterMatch() = default;
0064 
0065 
0066 public:
0067 
0068   /// Access the weight of this association
0069   float getWeight() const;
0070 
0071 
0072   /// Access the reference to the cluster
0073   const edm4eic::Cluster getCluster() const;
0074   /// Access the reference to the track
0075   const edm4eic::Track getTrack() const;
0076 
0077   /// Set the weight of this association
0078   void setWeight(float value);
0079   /// Get mutable reference to weight of this association
0080   float& getWeight();
0081   /// Get reference to weight of this association
0082   [[deprecated("use getWeight instead")]]
0083   float& weight();
0084 
0085 
0086   /// Set the reference to the cluster
0087   void setCluster(const edm4eic::Cluster& value);
0088   /// Set the reference to the track
0089   void setTrack(const edm4eic::Track& value);
0090 
0091 
0092 
0093 
0094   /// check whether the object is actually available
0095   bool isAvailable() const;
0096   /// disconnect from TrackClusterMatchObj instance
0097   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
0098 
0099   bool operator==(const MutableTrackClusterMatch& other) const { return m_obj == other.m_obj; }
0100   bool operator==(const TrackClusterMatch& other) const;
0101 
0102   bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
0103   bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
0104 
0105   // less comparison operator, so that objects can be e.g. stored in sets.
0106   bool operator<(const MutableTrackClusterMatch& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0107 
0108   podio::ObjectID id() const { return getObjectID(); }
0109 
0110   const podio::ObjectID getObjectID() const;
0111 
0112   friend void swap(MutableTrackClusterMatch& a, MutableTrackClusterMatch& b) {
0113     using std::swap;
0114     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0115   }
0116 
0117 private:
0118   /// constructor from existing TrackClusterMatchObj
0119   explicit MutableTrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
0120 
0121   podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
0122 };
0123 
0124 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0125 void to_json(nlohmann::json& j, const MutableTrackClusterMatch& value);
0126 #endif
0127 
0128 
0129 } // namespace edm4eic
0130 
0131 
0132 #endif