Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/edm4eic/MutableTrackSegment.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableTrackSegment_H
0004 #define EDM4EIC_MutableTrackSegment_H
0005 
0006 #include "edm4eic/TrackSegmentObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/TrackSegment.h"
0009 
0010 #include "edm4eic/TrackPoint.h"
0011 #include "podio/RelationRange.h"
0012 #include <vector>
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 TrackSegmentCollection;
0025 class Track;
0026 class MutableTrack;
0027 }
0028 
0029 
0030 namespace edm4eic {
0031 
0032 
0033 /** @class MutableTrackSegment
0034  *  A track segment defined by one or more points along a track.
0035  *  @author: S. Joosten
0036  */
0037 class MutableTrackSegment {
0038 
0039   friend class TrackSegmentCollection;
0040   friend class TrackSegmentMutableCollectionIterator;
0041   friend class TrackSegment;
0042 
0043 public:
0044   using object_type = TrackSegment;
0045   using collection_type = TrackSegmentCollection;
0046 
0047   /// default constructor
0048   MutableTrackSegment();
0049 
0050   /// Constructor initializing all members
0051   MutableTrackSegment(float length, float lengthError);
0052 
0053   /// copy constructor
0054   MutableTrackSegment(const MutableTrackSegment& other) = default;
0055 
0056   /// copy-assignment operator
0057   MutableTrackSegment& operator=(MutableTrackSegment other);
0058 
0059   /// create a mutable deep-copy of the object with identical relations
0060   /// if cloneRelations=false, the relations are not cloned and will be empty
0061   MutableTrackSegment clone(bool cloneRelations=true) const;
0062 
0063   /// destructor
0064   ~MutableTrackSegment() = default;
0065 
0066 
0067 public:
0068 
0069   /// Access the Pathlength from the first to the last point
0070   float getLength() const;
0071 
0072   /// Access the Error on the segment length
0073   float getLengthError() const;
0074 
0075 
0076   /// Access the Track used for this projection
0077   const edm4eic::Track getTrack() const;
0078 
0079   /// Set the Pathlength from the first to the last point
0080   void setLength(float value);
0081   /// Get mutable reference to Pathlength from the first to the last point
0082   float& getLength();
0083   /// Get reference to Pathlength from the first to the last point
0084   [[deprecated("use getLength instead")]]
0085   float& length();
0086 
0087   /// Set the Error on the segment length
0088   void setLengthError(float value);
0089   /// Get mutable reference to Error on the segment length
0090   float& getLengthError();
0091   /// Get reference to Error on the segment length
0092   [[deprecated("use getLengthError instead")]]
0093   float& lengthError();
0094 
0095 
0096   /// Set the Track used for this projection
0097   void setTrack(const edm4eic::Track& value);
0098 
0099   void addToPoints(const edm4eic::TrackPoint&);
0100   std::size_t points_size() const;
0101   edm4eic::TrackPoint getPoints(std::size_t) const;
0102   std::vector<edm4eic::TrackPoint>::const_iterator points_begin() const;
0103   std::vector<edm4eic::TrackPoint>::const_iterator points_end() const;
0104   podio::RelationRange<edm4eic::TrackPoint> getPoints() const;
0105 
0106 
0107 
0108   /// check whether the object is actually available
0109   bool isAvailable() const;
0110   /// disconnect from TrackSegmentObj instance
0111   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSegmentObj>{nullptr}; }
0112 
0113   bool operator==(const MutableTrackSegment& other) const { return m_obj == other.m_obj; }
0114   bool operator==(const TrackSegment& other) const;
0115 
0116   bool operator!=(const MutableTrackSegment& other) const { return !(*this == other); }
0117   bool operator!=(const TrackSegment& other) const { return !(*this == other); }
0118 
0119   // less comparison operator, so that objects can be e.g. stored in sets.
0120   bool operator<(const MutableTrackSegment& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0121 
0122   podio::ObjectID id() const { return getObjectID(); }
0123 
0124   const podio::ObjectID getObjectID() const;
0125 
0126   friend void swap(MutableTrackSegment& a, MutableTrackSegment& b) {
0127     using std::swap;
0128     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0129   }
0130 
0131 private:
0132   /// constructor from existing TrackSegmentObj
0133   explicit MutableTrackSegment(podio::utils::MaybeSharedPtr<TrackSegmentObj> obj);
0134 
0135   podio::utils::MaybeSharedPtr<TrackSegmentObj> m_obj{nullptr};
0136 };
0137 
0138 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0139 void to_json(nlohmann::json& j, const MutableTrackSegment& value);
0140 #endif
0141 
0142 
0143 } // namespace edm4eic
0144 
0145 
0146 #endif