Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:10:47

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(const std::int32_t type, const std::uint64_t surface, const edm4hep::Vector2f& loc, const float theta, const float phi, const float qOverP, const float time, const std::int32_t pdg, const edm4eic::Cov6f& covariance);
0060 
0061   /// copy constructor
0062   TrackParameters(const TrackParameters& other) = default;
0063 
0064   /// copy-assignment operator
0065   TrackParameters& operator=(TrackParameters other) &; // Rebind this to other's internal object
0066   TrackParameters& operator=(TrackParameters other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
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   MutableTrackParameters clone(bool cloneRelations=true) const;
0071 
0072   /// destructor
0073   ~TrackParameters() = default;
0074 
0075   /// converting constructor from mutable object
0076   TrackParameters(const MutableTrackParameters& other);
0077 
0078   static TrackParameters makeEmpty();
0079 
0080 public:
0081 
0082   static constexpr std::string_view typeName = "edm4eic::TrackParameters";
0083 
0084   /// Access the Type of track parameters (-1/seed, 0/head, ...)
0085   std::int32_t getType() const;
0086 
0087   /// Access the Surface for bound parameters (geometryID)
0088   std::uint64_t getSurface() const;
0089 
0090   /// Access the 2D location on surface
0091   const edm4hep::Vector2f& getLoc() const;
0092 
0093   /// Access the Track polar angle [rad]
0094   float getTheta() const;
0095 
0096   /// Access the Track azimuthal angle [rad]
0097   float getPhi() const;
0098 
0099   /// Access the [e/GeV]
0100   float getQOverP() const;
0101 
0102   /// Access the Track time [ns]
0103   float getTime() const;
0104 
0105   /// Access the pdg pid for these parameters
0106   std::int32_t getPdg() const;
0107 
0108   /// Access the Full covariance in basis [l0,l1,theta,phi,q/p,t]
0109   const edm4eic::Cov6f& getCovariance() const;
0110 
0111 
0112 
0113 
0114 
0115   /// check whether the object is actually available
0116   bool isAvailable() const;
0117   /// disconnect from TrackParametersObj instance
0118   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackParametersObj>{nullptr}; }
0119 
0120   bool operator==(const TrackParameters& other) const { return m_obj == other.m_obj; }
0121   bool operator==(const MutableTrackParameters& other) const;
0122 
0123   bool operator!=(const TrackParameters& other) const { return !(*this == other); }
0124   bool operator!=(const MutableTrackParameters& other) const { return !(*this == other); }
0125 
0126   // less comparison operator, so that objects can be e.g. stored in sets.
0127   bool operator<(const TrackParameters& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0128 
0129   podio::ObjectID id() const { return getObjectID(); }
0130 
0131   const podio::ObjectID getObjectID() const;
0132 
0133   friend std::hash<TrackParameters>;
0134 
0135   friend void swap(TrackParameters& a, TrackParameters& b) {
0136     using std::swap;
0137     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0138   }
0139 
0140 private:
0141   /// constructor from existing TrackParametersObj
0142   explicit TrackParameters(podio::utils::MaybeSharedPtr<TrackParametersObj> obj);
0143   TrackParameters(TrackParametersObj* obj);
0144 
0145   podio::utils::MaybeSharedPtr<TrackParametersObj> m_obj{nullptr};
0146 };
0147 
0148 std::ostream& operator<<(std::ostream& o, const TrackParameters& value);
0149 
0150 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0151 void to_json(nlohmann::json& j, const TrackParameters& value);
0152 #endif
0153 
0154 
0155 } // namespace edm4eic
0156 
0157 
0158 
0159 template<>
0160 struct std::hash<edm4eic::TrackParameters> {
0161   std::size_t operator()(const edm4eic::TrackParameters& obj) const {
0162     return std::hash<edm4eic::TrackParametersObj*>{}(obj.m_obj.get());
0163   }
0164 };
0165 
0166 
0167 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0168 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0169 // and https://github.com/AIDASoft/podio/issues/770
0170 #if defined(__clang__)
0171 #pragma clang diagnostic push
0172 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0173 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0174 #pragma clang diagnostic ignored "-Wdeprecated"
0175 constexpr std::string_view edm4eic::TrackParameters::typeName;
0176 #pragma clang diagnostic pop
0177 #elif defined(__GNUC__)
0178 #pragma GCC diagnostic push
0179 #pragma GCC diagnostic ignored "-Wdeprecated"
0180 constexpr std::string_view edm4eic::TrackParameters::typeName;
0181 #pragma GCC diagnostic pop
0182 #endif
0183 
0184 #endif