Back to home page

EIC code displayed by LXR

 
 

    


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

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