Back to home page

EIC code displayed by LXR

 
 

    


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

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