Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-09 08:30:09

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableTrajectory_H
0004 #define EDM4EIC_MutableTrajectory_H
0005 
0006 #include "edm4eic/TrajectoryObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/Trajectory.h"
0009 
0010 #include "edm4eic/Measurement2D.h"
0011 #include "edm4eic/TrackParameters.h"
0012 #include "podio/RelationRange.h"
0013 #include <cstdint>
0014 #include <vector>
0015 
0016 #include "podio/utilities/MaybeSharedPtr.h"
0017 
0018 #include <cstdint>
0019 
0020 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0021 #include "nlohmann/json_fwd.hpp"
0022 #endif
0023 
0024 // forward declarations
0025 namespace edm4eic {
0026 class TrajectoryCollection;
0027 class TrackSeed;
0028 class MutableTrackSeed;
0029 }
0030 
0031 
0032 namespace edm4eic {
0033 
0034 
0035 /** @class MutableTrajectory
0036  *  Raw trajectory from the tracking algorithm. What is called hit here is 2d measurement indeed.
0037  *  @author: S. Joosten, S. Li
0038  */
0039 class MutableTrajectory {
0040 
0041   friend class TrajectoryCollection;
0042   friend class TrajectoryMutableCollectionIterator;
0043   friend class Trajectory;
0044 
0045 public:
0046   using object_type = Trajectory;
0047   using collection_type = TrajectoryCollection;
0048 
0049   /// default constructor
0050   MutableTrajectory();
0051 
0052   /// Constructor initializing all members
0053   MutableTrajectory(std::uint32_t type, std::uint32_t nStates, std::uint32_t nMeasurements, std::uint32_t nOutliers, std::uint32_t nHoles, std::uint32_t nSharedHits);
0054 
0055   /// copy constructor
0056   MutableTrajectory(const MutableTrajectory& other) = default;
0057 
0058   /// copy-assignment operator
0059   MutableTrajectory& operator=(MutableTrajectory other);
0060 
0061   /// create a mutable deep-copy of the object with identical relations
0062   /// if cloneRelations=false, the relations are not cloned and will be empty
0063   MutableTrajectory clone(bool cloneRelations=true) const;
0064 
0065   /// destructor
0066   ~MutableTrajectory() = default;
0067 
0068 
0069 public:
0070 
0071   /// Access the 0 (does not have good track fit), 1 (has good track fit)
0072   std::uint32_t getType() const;
0073 
0074   /// Access the Number of tracking steps
0075   std::uint32_t getNStates() const;
0076 
0077   /// Access the Number of hits used
0078   std::uint32_t getNMeasurements() const;
0079 
0080   /// Access the Number of hits not considered
0081   std::uint32_t getNOutliers() const;
0082 
0083   /// Access the Number of missing hits
0084   std::uint32_t getNHoles() const;
0085 
0086   /// Access the Number of shared hits with other trajectories
0087   std::uint32_t getNSharedHits() const;
0088 
0089 
0090   /// Access the Corresponding track seed
0091   const edm4eic::TrackSeed getSeed() const;
0092 
0093   /// Set the 0 (does not have good track fit), 1 (has good track fit)
0094   void setType(std::uint32_t value);
0095   /// Get mutable reference to 0 (does not have good track fit), 1 (has good track fit)
0096   std::uint32_t& getType();
0097   /// Get reference to 0 (does not have good track fit), 1 (has good track fit)
0098   [[deprecated("use getType instead")]]
0099   std::uint32_t& type();
0100 
0101   /// Set the Number of tracking steps
0102   void setNStates(std::uint32_t value);
0103   /// Get mutable reference to Number of tracking steps
0104   std::uint32_t& getNStates();
0105   /// Get reference to Number of tracking steps
0106   [[deprecated("use getNStates instead")]]
0107   std::uint32_t& nStates();
0108 
0109   /// Set the Number of hits used
0110   void setNMeasurements(std::uint32_t value);
0111   /// Get mutable reference to Number of hits used
0112   std::uint32_t& getNMeasurements();
0113   /// Get reference to Number of hits used
0114   [[deprecated("use getNMeasurements instead")]]
0115   std::uint32_t& nMeasurements();
0116 
0117   /// Set the Number of hits not considered
0118   void setNOutliers(std::uint32_t value);
0119   /// Get mutable reference to Number of hits not considered
0120   std::uint32_t& getNOutliers();
0121   /// Get reference to Number of hits not considered
0122   [[deprecated("use getNOutliers instead")]]
0123   std::uint32_t& nOutliers();
0124 
0125   /// Set the Number of missing hits
0126   void setNHoles(std::uint32_t value);
0127   /// Get mutable reference to Number of missing hits
0128   std::uint32_t& getNHoles();
0129   /// Get reference to Number of missing hits
0130   [[deprecated("use getNHoles instead")]]
0131   std::uint32_t& nHoles();
0132 
0133   /// Set the Number of shared hits with other trajectories
0134   void setNSharedHits(std::uint32_t value);
0135   /// Get mutable reference to Number of shared hits with other trajectories
0136   std::uint32_t& getNSharedHits();
0137   /// Get reference to Number of shared hits with other trajectories
0138   [[deprecated("use getNSharedHits instead")]]
0139   std::uint32_t& nSharedHits();
0140 
0141 
0142   /// Set the Corresponding track seed
0143   void setSeed(const edm4eic::TrackSeed& value);
0144 
0145   void addToTrackParameters(const edm4eic::TrackParameters&);
0146   std::size_t trackParameters_size() const;
0147   edm4eic::TrackParameters getTrackParameters(std::size_t) const;
0148   std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_begin() const;
0149   std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_end() const;
0150   podio::RelationRange<edm4eic::TrackParameters> getTrackParameters() const;
0151   void addToMeasurements_deprecated(const edm4eic::Measurement2D&);
0152   std::size_t measurements_deprecated_size() const;
0153   edm4eic::Measurement2D getMeasurements_deprecated(std::size_t) const;
0154   std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_begin() const;
0155   std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_end() const;
0156   podio::RelationRange<edm4eic::Measurement2D> getMeasurements_deprecated() const;
0157   void addToOutliers_deprecated(const edm4eic::Measurement2D&);
0158   std::size_t outliers_deprecated_size() const;
0159   edm4eic::Measurement2D getOutliers_deprecated(std::size_t) const;
0160   std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_begin() const;
0161   std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_end() const;
0162   podio::RelationRange<edm4eic::Measurement2D> getOutliers_deprecated() const;
0163   void addToMeasurementChi2(const float&);
0164   std::size_t measurementChi2_size() const;
0165   float getMeasurementChi2(std::size_t) const;
0166   std::vector<float>::const_iterator measurementChi2_begin() const;
0167   std::vector<float>::const_iterator measurementChi2_end() const;
0168   podio::RelationRange<float> getMeasurementChi2() const;
0169   void addToOutlierChi2(const float&);
0170   std::size_t outlierChi2_size() const;
0171   float getOutlierChi2(std::size_t) const;
0172   std::vector<float>::const_iterator outlierChi2_begin() const;
0173   std::vector<float>::const_iterator outlierChi2_end() const;
0174   podio::RelationRange<float> getOutlierChi2() const;
0175 
0176 
0177 
0178   /// check whether the object is actually available
0179   bool isAvailable() const;
0180   /// disconnect from TrajectoryObj instance
0181   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrajectoryObj>{nullptr}; }
0182 
0183   bool operator==(const MutableTrajectory& other) const { return m_obj == other.m_obj; }
0184   bool operator==(const Trajectory& other) const;
0185 
0186   bool operator!=(const MutableTrajectory& other) const { return !(*this == other); }
0187   bool operator!=(const Trajectory& other) const { return !(*this == other); }
0188 
0189   // less comparison operator, so that objects can be e.g. stored in sets.
0190   bool operator<(const MutableTrajectory& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0191 
0192   podio::ObjectID id() const { return getObjectID(); }
0193 
0194   const podio::ObjectID getObjectID() const;
0195 
0196   friend void swap(MutableTrajectory& a, MutableTrajectory& b) {
0197     using std::swap;
0198     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0199   }
0200 
0201 private:
0202   /// constructor from existing TrajectoryObj
0203   explicit MutableTrajectory(podio::utils::MaybeSharedPtr<TrajectoryObj> obj);
0204 
0205   podio::utils::MaybeSharedPtr<TrajectoryObj> m_obj{nullptr};
0206 };
0207 
0208 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0209 void to_json(nlohmann::json& j, const MutableTrajectory& value);
0210 #endif
0211 
0212 
0213 } // namespace edm4eic
0214 
0215 
0216 #endif