Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:05

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef ACTSPODIOEDM_Track_H
0004 #define ACTSPODIOEDM_Track_H
0005 
0006 #include "ActsPodioEdm/ParticleHypothesis.h"
0007 #include "ActsPodioEdm/Surface.h"
0008 #include "ActsPodioEdm/TrackInfo.h"
0009 #include "ActsPodioEdm/TrackObj.h"
0010 
0011 #include <cstdint>
0012 #include <ostream>
0013 
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019 
0020 namespace ActsPodioEdm {
0021 
0022 class MutableTrack;
0023 class TrackCollection;
0024 class TrackCollectionData;
0025 
0026 /** @class Track
0027  *  Reconstructed track
0028  *  @author: Paul Gessinger, CERN
0029  */
0030 class Track {
0031   friend class MutableTrack;
0032   friend class TrackCollection;
0033   friend class ActsPodioEdm::TrackCollectionData;
0034   friend class TrackCollectionIterator;
0035 
0036  public:
0037   using mutable_type = MutableTrack;
0038   using collection_type = TrackCollection;
0039 
0040   /// default constructor
0041   Track();
0042 
0043   /// Constructor initializing all members
0044   Track(ActsPodioEdm::TrackInfo data, ActsPodioEdm::Surface referenceSurface,
0045         ActsPodioEdm::ParticleHypothesis particleHypothesis);
0046 
0047   /// copy constructor
0048   Track(const Track& other) = default;
0049 
0050   /// copy-assignment operator
0051   Track& operator=(Track other);
0052 
0053   /// create a mutable deep-copy of the object with identical relations
0054   /// if cloneRelations=false, the relations are not cloned and will be empty
0055   MutableTrack clone(bool cloneRelations = true) const;
0056 
0057   /// destructor
0058   ~Track() = default;
0059 
0060   /// converting constructor from mutable object
0061   Track(const MutableTrack& other);
0062 
0063   static Track makeEmpty();
0064 
0065  public:
0066   /// Access the local parameters and covariance
0067   const ActsPodioEdm::TrackInfo& getData() const;
0068 
0069   /// Access the reference surface
0070   const ActsPodioEdm::Surface& getReferenceSurface() const;
0071 
0072   /// Access the particle hypothesis
0073   const ActsPodioEdm::ParticleHypothesis& getParticleHypothesis() const;
0074 
0075   /// check whether the object is actually available
0076   bool isAvailable() const;
0077   /// disconnect from TrackObj instance
0078   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackObj>{nullptr}; }
0079 
0080   bool operator==(const Track& other) const { return m_obj == other.m_obj; }
0081   bool operator==(const MutableTrack& other) const;
0082 
0083   bool operator!=(const Track& other) const { return !(*this == other); }
0084   bool operator!=(const MutableTrack& other) const { return !(*this == other); }
0085 
0086   // less comparison operator, so that objects can be e.g. stored in sets.
0087   bool operator<(const Track& other) const { return m_obj < other.m_obj; }
0088 
0089   podio::ObjectID id() const { return getObjectID(); }
0090 
0091   const podio::ObjectID getObjectID() const;
0092 
0093   friend void swap(Track& a, Track& b) {
0094     using std::swap;
0095     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0096   }
0097 
0098  private:
0099   /// constructor from existing TrackObj
0100   explicit Track(podio::utils::MaybeSharedPtr<TrackObj> obj);
0101   Track(TrackObj* obj);
0102 
0103   podio::utils::MaybeSharedPtr<TrackObj> m_obj{nullptr};
0104 };
0105 
0106 std::ostream& operator<<(std::ostream& o, const Track& value);
0107 
0108 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0109 void to_json(nlohmann::json& j, const Track& value);
0110 #endif
0111 
0112 }  // namespace ActsPodioEdm
0113 
0114 #endif