Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableTrackParameters_H
0004 #define EDM4EIC_MutableTrackParameters_H
0005 
0006 #include "edm4eic/TrackParametersObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/TrackParameters.h"
0009 
0010 #include "edm4eic/Cov6f.h"
0011 #include "edm4hep/Vector2f.h"
0012 #include <cstdint>
0013 
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
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 edm4eic {
0029 
0030 
0031 /** @class MutableTrackParameters
0032  *  ACTS Bound Track parameters
0033  *  @author: W. Armstrong, S. Joosten, J. Osborn
0034  */
0035 class MutableTrackParameters {
0036 
0037   friend class TrackParametersCollection;
0038   friend class TrackParametersMutableCollectionIterator;
0039   friend class TrackParameters;
0040 
0041 public:
0042   using object_type = TrackParameters;
0043   using collection_type = TrackParametersCollection;
0044 
0045   /// default constructor
0046   MutableTrackParameters();
0047 
0048   /// Constructor initializing all members
0049   MutableTrackParameters(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);
0050 
0051   /// copy constructor
0052   MutableTrackParameters(const MutableTrackParameters& other) = default;
0053 
0054   /// copy-assignment operator
0055   MutableTrackParameters& operator=(MutableTrackParameters other) &; // Rebind this to other's internal object
0056   MutableTrackParameters& operator=(MutableTrackParameters other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
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   MutableTrackParameters clone(bool cloneRelations=true) const;
0061 
0062   /// destructor
0063   ~MutableTrackParameters() = default;
0064 
0065 
0066 public:
0067 
0068   /// Access the Type of track parameters (-1/seed, 0/head, ...)
0069   std::int32_t getType() const;
0070 
0071   /// Access the Surface for bound parameters (geometryID)
0072   std::uint64_t getSurface() const;
0073 
0074   /// Access the 2D location on surface
0075   const edm4hep::Vector2f& getLoc() const;
0076 
0077   /// Access the Track polar angle [rad]
0078   float getTheta() const;
0079 
0080   /// Access the Track azimuthal angle [rad]
0081   float getPhi() const;
0082 
0083   /// Access the [e/GeV]
0084   float getQOverP() const;
0085 
0086   /// Access the Track time [ns]
0087   float getTime() const;
0088 
0089   /// Access the pdg pid for these parameters
0090   std::int32_t getPdg() const;
0091 
0092   /// Access the Full covariance in basis [l0,l1,theta,phi,q/p,t]
0093   const edm4eic::Cov6f& getCovariance() const;
0094 
0095 
0096 
0097   /// Set the Type of track parameters (-1/seed, 0/head, ...)
0098   void setType(const std::int32_t type);
0099   /// Get mutable reference to Type of track parameters (-1/seed, 0/head, ...)
0100   std::int32_t& getType();
0101   /// Get reference to Type of track parameters (-1/seed, 0/head, ...)
0102   [[deprecated("use getType instead")]]
0103   std::int32_t& type();
0104 
0105   /// Set the Surface for bound parameters (geometryID)
0106   void setSurface(const std::uint64_t surface);
0107   /// Get mutable reference to Surface for bound parameters (geometryID)
0108   std::uint64_t& getSurface();
0109   /// Get reference to Surface for bound parameters (geometryID)
0110   [[deprecated("use getSurface instead")]]
0111   std::uint64_t& surface();
0112 
0113   /// Set the 2D location on surface
0114   void setLoc(const edm4hep::Vector2f& loc);
0115   /// Get mutable reference to 2D location on surface
0116   edm4hep::Vector2f& getLoc();
0117   /// Get reference to 2D location on surface
0118   [[deprecated("use getLoc instead")]]
0119   edm4hep::Vector2f& loc();
0120 
0121   /// Set the Track polar angle [rad]
0122   void setTheta(const float theta);
0123   /// Get mutable reference to Track polar angle [rad]
0124   float& getTheta();
0125   /// Get reference to Track polar angle [rad]
0126   [[deprecated("use getTheta instead")]]
0127   float& theta();
0128 
0129   /// Set the Track azimuthal angle [rad]
0130   void setPhi(const float phi);
0131   /// Get mutable reference to Track azimuthal angle [rad]
0132   float& getPhi();
0133   /// Get reference to Track azimuthal angle [rad]
0134   [[deprecated("use getPhi instead")]]
0135   float& phi();
0136 
0137   /// Set the [e/GeV]
0138   void setQOverP(const float qOverP);
0139   /// Get mutable reference to [e/GeV]
0140   float& getQOverP();
0141   /// Get reference to [e/GeV]
0142   [[deprecated("use getQOverP instead")]]
0143   float& qOverP();
0144 
0145   /// Set the Track time [ns]
0146   void setTime(const float time);
0147   /// Get mutable reference to Track time [ns]
0148   float& getTime();
0149   /// Get reference to Track time [ns]
0150   [[deprecated("use getTime instead")]]
0151   float& time();
0152 
0153   /// Set the pdg pid for these parameters
0154   void setPdg(const std::int32_t pdg);
0155   /// Get mutable reference to pdg pid for these parameters
0156   std::int32_t& getPdg();
0157   /// Get reference to pdg pid for these parameters
0158   [[deprecated("use getPdg instead")]]
0159   std::int32_t& pdg();
0160 
0161   /// Set the Full covariance in basis [l0,l1,theta,phi,q/p,t]
0162   void setCovariance(const edm4eic::Cov6f& covariance);
0163   /// Get mutable reference to Full covariance in basis [l0,l1,theta,phi,q/p,t]
0164   edm4eic::Cov6f& getCovariance();
0165   /// Get reference to Full covariance in basis [l0,l1,theta,phi,q/p,t]
0166   [[deprecated("use getCovariance instead")]]
0167   edm4eic::Cov6f& covariance();
0168 
0169 
0170 
0171 
0172 
0173 
0174   /// check whether the object is actually available
0175   bool isAvailable() const;
0176   /// disconnect from TrackParametersObj instance
0177   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackParametersObj>{nullptr}; }
0178 
0179   bool operator==(const MutableTrackParameters& other) const { return m_obj == other.m_obj; }
0180   bool operator==(const TrackParameters& other) const;
0181 
0182   bool operator!=(const MutableTrackParameters& other) const { return !(*this == other); }
0183   bool operator!=(const TrackParameters& other) const { return !(*this == other); }
0184 
0185   // less comparison operator, so that objects can be e.g. stored in sets.
0186   bool operator<(const MutableTrackParameters& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0187 
0188   podio::ObjectID id() const { return getObjectID(); }
0189 
0190   const podio::ObjectID getObjectID() const;
0191 
0192   friend std::hash<MutableTrackParameters>;
0193 
0194   friend void swap(MutableTrackParameters& a, MutableTrackParameters& b) {
0195     using std::swap;
0196     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0197   }
0198 
0199 private:
0200   /// constructor from existing TrackParametersObj
0201   explicit MutableTrackParameters(podio::utils::MaybeSharedPtr<TrackParametersObj> obj);
0202 
0203   podio::utils::MaybeSharedPtr<TrackParametersObj> m_obj{nullptr};
0204 };
0205 
0206 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0207 void to_json(nlohmann::json& j, const MutableTrackParameters& value);
0208 #endif
0209 
0210 
0211 } // namespace edm4eic
0212 
0213 
0214 
0215 template<>
0216 struct std::hash<edm4eic::MutableTrackParameters> {
0217   std::size_t operator()(const edm4eic::MutableTrackParameters& obj) const {
0218     return std::hash<edm4eic::TrackParametersObj*>{}(obj.m_obj.get());
0219   }
0220 };
0221 
0222 
0223 #endif