Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 08:30:10

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_TrackParameters_H
0004 #define EDM4EIC_TrackParameters_H
0005 
0006 #include "edm4eic/TrackParametersObj.h"
0007 
0008 #include "edm4eic/Cov6f.h"
0009 #include "edm4hep/Vector2f.h"
0010 #include <cstdint>
0011 
0012 #include "podio/utilities/MaybeSharedPtr.h"
0013 #include "podio/detail/OrderKey.h"
0014 
0015 #include <ostream>
0016 #include <cstdint>
0017 
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021 
0022 // forward declarations
0023 namespace edm4eic {
0024 class TrackParametersCollection;
0025 }
0026 
0027 
0028 namespace podio::detail {
0029 // Internal function used in less comparison operators of the datatypes and interface types
0030 OrderKey getOrderKey(const edm4eic::TrackParameters& obj);
0031 };
0032 
0033 namespace edm4eic {
0034 
0035 class MutableTrackParameters;
0036 class TrackParametersCollection;
0037 class TrackParametersCollectionData;
0038 
0039 /** @class TrackParameters
0040  *  ACTS Bound Track parameters
0041  *  @author: W. Armstrong, S. Joosten, J. Osborn
0042  */
0043 class TrackParameters {
0044 
0045   friend class MutableTrackParameters;
0046   friend class TrackParametersCollection;
0047   friend class edm4eic::TrackParametersCollectionData;
0048   friend class TrackParametersCollectionIterator;
0049   friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackParameters & obj);
0050 
0051 public:
0052   using mutable_type = MutableTrackParameters;
0053   using collection_type = TrackParametersCollection;
0054 
0055   /// default constructor
0056   TrackParameters();
0057 
0058   /// Constructor initializing all members
0059   TrackParameters(std::int32_t type, std::uint64_t surface, edm4hep::Vector2f loc, float theta, float phi, float qOverP, float time, std::int32_t pdg, edm4eic::Cov6f covariance);
0060 
0061   /// copy constructor
0062   TrackParameters(const TrackParameters& other) = default;
0063 
0064   /// copy-assignment operator
0065   TrackParameters& operator=(TrackParameters other);
0066 
0067   /// create a mutable deep-copy of the object with identical relations
0068   /// if cloneRelations=false, the relations are not cloned and will be empty
0069   MutableTrackParameters clone(bool cloneRelations=true) const;
0070 
0071   /// destructor
0072   ~TrackParameters() = default;
0073 
0074   /// converting constructor from mutable object
0075   TrackParameters(const MutableTrackParameters& other);
0076 
0077   static TrackParameters makeEmpty();
0078 
0079 public:
0080 
0081   static constexpr auto typeName = "edm4eic::TrackParameters";
0082 
0083   /// Access the Type of track parameters (-1/seed, 0/head, ...)
0084   std::int32_t getType() const;
0085 
0086   /// Access the Surface for bound parameters (geometryID)
0087   std::uint64_t getSurface() const;
0088 
0089   /// Access the 2D location on surface
0090   const edm4hep::Vector2f& getLoc() const;
0091 
0092   /// Access the Track polar angle [rad]
0093   float getTheta() const;
0094 
0095   /// Access the Track azimuthal angle [rad]
0096   float getPhi() const;
0097 
0098   /// Access the [e/GeV]
0099   float getQOverP() const;
0100 
0101   /// Access the Track time [ns]
0102   float getTime() const;
0103 
0104   /// Access the pdg pid for these parameters
0105   std::int32_t getPdg() const;
0106 
0107   /// Access the Full covariance in basis [l0,l1,theta,phi,q/p,t]
0108   const edm4eic::Cov6f& getCovariance() const;
0109 
0110 
0111 
0112 
0113 
0114   /// check whether the object is actually available
0115   bool isAvailable() const;
0116   /// disconnect from TrackParametersObj instance
0117   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackParametersObj>{nullptr}; }
0118 
0119   bool operator==(const TrackParameters& other) const { return m_obj == other.m_obj; }
0120   bool operator==(const MutableTrackParameters& other) const;
0121 
0122   bool operator!=(const TrackParameters& other) const { return !(*this == other); }
0123   bool operator!=(const MutableTrackParameters& other) const { return !(*this == other); }
0124 
0125   // less comparison operator, so that objects can be e.g. stored in sets.
0126   bool operator<(const TrackParameters& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0127 
0128   podio::ObjectID id() const { return getObjectID(); }
0129 
0130   const podio::ObjectID getObjectID() const;
0131 
0132   friend void swap(TrackParameters& a, TrackParameters& b) {
0133     using std::swap;
0134     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0135   }
0136 
0137 private:
0138   /// constructor from existing TrackParametersObj
0139   explicit TrackParameters(podio::utils::MaybeSharedPtr<TrackParametersObj> obj);
0140   TrackParameters(TrackParametersObj* obj);
0141 
0142   podio::utils::MaybeSharedPtr<TrackParametersObj> m_obj{nullptr};
0143 };
0144 
0145 std::ostream& operator<<(std::ostream& o, const TrackParameters& value);
0146 
0147 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0148 void to_json(nlohmann::json& j, const TrackParameters& value);
0149 #endif
0150 
0151 
0152 } // namespace edm4eic
0153 
0154 
0155 #endif