Back to home page

EIC code displayed by LXR

 
 

    


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

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 
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 Cluster;
0021 class MutableCluster;
0022 class Track;
0023 class MutableTrack;
0024 }
0025 
0026 
0027 namespace edm4eic {
0028 
0029 class MutableTrackClusterMatch;
0030 class TrackClusterMatchCollection;
0031 class TrackClusterMatchCollectionData;
0032 
0033 /** @class TrackClusterMatch
0034  *  Match between a Cluster and a Track
0035  *  @author: D. Anderson, D. Brandenburg, D. Kalinkin, S. Joosten
0036  */
0037 class TrackClusterMatch {
0038 
0039   friend class MutableTrackClusterMatch;
0040   friend class TrackClusterMatchCollection;
0041   friend class edm4eic::TrackClusterMatchCollectionData;
0042   friend class TrackClusterMatchCollectionIterator;
0043 
0044 public:
0045   using mutable_type = MutableTrackClusterMatch;
0046   using collection_type = TrackClusterMatchCollection;
0047 
0048   /// default constructor
0049   TrackClusterMatch();
0050 
0051   /// Constructor initializing all members
0052   TrackClusterMatch(float weight);
0053 
0054   /// copy constructor
0055   TrackClusterMatch(const TrackClusterMatch& other) = default;
0056 
0057   /// copy-assignment operator
0058   TrackClusterMatch& operator=(TrackClusterMatch 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   MutableTrackClusterMatch clone(bool cloneRelations=true) const;
0063 
0064   /// destructor
0065   ~TrackClusterMatch() = default;
0066 
0067   /// converting constructor from mutable object
0068   TrackClusterMatch(const MutableTrackClusterMatch& other);
0069 
0070   static TrackClusterMatch makeEmpty();
0071 
0072 public:
0073 
0074   /// Access the weight of this association
0075   float getWeight() const;
0076 
0077 
0078   /// Access the reference to the cluster
0079   const edm4eic::Cluster getCluster() const;
0080   /// Access the reference to the track
0081   const edm4eic::Track getTrack() const;
0082 
0083 
0084 
0085   /// check whether the object is actually available
0086   bool isAvailable() const;
0087   /// disconnect from TrackClusterMatchObj instance
0088   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
0089 
0090   bool operator==(const TrackClusterMatch& other) const { return m_obj == other.m_obj; }
0091   bool operator==(const MutableTrackClusterMatch& other) const;
0092 
0093   bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
0094   bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
0095 
0096   // less comparison operator, so that objects can be e.g. stored in sets.
0097   bool operator<(const TrackClusterMatch& 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(TrackClusterMatch& a, TrackClusterMatch& 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 TrackClusterMatchObj
0110   explicit TrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
0111   TrackClusterMatch(TrackClusterMatchObj* obj);
0112 
0113   podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
0114 };
0115 
0116 std::ostream& operator<<(std::ostream& o, const TrackClusterMatch& value);
0117 
0118 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0119 void to_json(nlohmann::json& j, const TrackClusterMatch& value);
0120 #endif
0121 
0122 
0123 } // namespace edm4eic
0124 
0125 
0126 #endif