Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_MutableTrack_H
0004 #define EDM4HEP_MutableTrack_H
0005 
0006 #include "edm4hep/TrackObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/Track.h"
0009 
0010 #include "edm4hep/Quantity.h"
0011 #include "edm4hep/TrackState.h"
0012 #include "edm4hep/TrackerHit.h"
0013 #include "podio/RelationRange.h"
0014 #include <cstdint>
0015 #include <vector>
0016 
0017 #include "podio/utilities/MaybeSharedPtr.h"
0018 
0019 #include <cstdint>
0020 
0021 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0022 #include "nlohmann/json_fwd.hpp"
0023 #endif
0024 
0025 namespace edm4hep {
0026 
0027 /** @class MutableTrack
0028  *  Reconstructed track
0029  *  @author: F.Gaede, DESY
0030  */
0031 class MutableTrack {
0032 
0033   friend class TrackCollection;
0034   friend class TrackMutableCollectionIterator;
0035   friend class Track;
0036 
0037 public:
0038   using object_type = Track;
0039   using collection_type = TrackCollection;
0040 
0041   /// default constructor
0042   MutableTrack();
0043 
0044   /// Constructor initializing all members
0045   MutableTrack(std::int32_t type, float chi2, std::int32_t ndf, float dEdx, float dEdxError,
0046                float radiusOfInnermostHit);
0047 
0048   /// copy constructor
0049   MutableTrack(const MutableTrack& other) = default;
0050 
0051   /// copy-assignment operator
0052   MutableTrack& operator=(MutableTrack other);
0053 
0054   /// create a mutable deep-copy of the object with identical relations
0055   /// if cloneRelations=false, the relations are not cloned and will be empty
0056   MutableTrack clone(bool cloneRelations = true) const;
0057 
0058   /// destructor
0059   ~MutableTrack() = default;
0060 
0061 public:
0062   /// Access the flagword that defines the type of track.Bits 16-31 are used internally
0063   std::int32_t getType() const;
0064 
0065   /// Access the Chi^2 of the track fit
0066   float getChi2() const;
0067 
0068   /// Access the number of degrees of freedom of the track fit
0069   std::int32_t getNdf() const;
0070 
0071   /// Access the dEdx of the track.
0072   float getDEdx() const;
0073 
0074   /// Access the error of dEdx.
0075   float getDEdxError() const;
0076 
0077   /// Access the radius of the innermost hit that has been used in the track fit
0078   float getRadiusOfInnermostHit() const;
0079 
0080   /// Set the flagword that defines the type of track.Bits 16-31 are used internally
0081   void setType(std::int32_t value);
0082   /// Get mutable reference to flagword that defines the type of track.Bits 16-31 are used internally
0083   std::int32_t& getType();
0084   /// Get reference to flagword that defines the type of track.Bits 16-31 are used internally
0085   [[deprecated("use getType instead")]] std::int32_t& type();
0086 
0087   /// Set the Chi^2 of the track fit
0088   void setChi2(float value);
0089   /// Get mutable reference to Chi^2 of the track fit
0090   float& getChi2();
0091   /// Get reference to Chi^2 of the track fit
0092   [[deprecated("use getChi2 instead")]] float& chi2();
0093 
0094   /// Set the number of degrees of freedom of the track fit
0095   void setNdf(std::int32_t value);
0096   /// Get mutable reference to number of degrees of freedom of the track fit
0097   std::int32_t& getNdf();
0098   /// Get reference to number of degrees of freedom of the track fit
0099   [[deprecated("use getNdf instead")]] std::int32_t& ndf();
0100 
0101   /// Set the dEdx of the track.
0102   void setDEdx(float value);
0103   /// Get mutable reference to dEdx of the track.
0104   float& getDEdx();
0105   /// Get reference to dEdx of the track.
0106   [[deprecated("use getDEdx instead")]] float& dEdx();
0107 
0108   /// Set the error of dEdx.
0109   void setDEdxError(float value);
0110   /// Get mutable reference to error of dEdx.
0111   float& getDEdxError();
0112   /// Get reference to error of dEdx.
0113   [[deprecated("use getDEdxError instead")]] float& dEdxError();
0114 
0115   /// Set the radius of the innermost hit that has been used in the track fit
0116   void setRadiusOfInnermostHit(float value);
0117   /// Get mutable reference to radius of the innermost hit that has been used in the track fit
0118   float& getRadiusOfInnermostHit();
0119   /// Get reference to radius of the innermost hit that has been used in the track fit
0120   [[deprecated("use getRadiusOfInnermostHit instead")]] float& radiusOfInnermostHit();
0121 
0122   void addToTrackerHits(const edm4hep::TrackerHit&);
0123   std::size_t trackerHits_size() const;
0124   edm4hep::TrackerHit getTrackerHits(std::size_t) const;
0125   std::vector<edm4hep::TrackerHit>::const_iterator trackerHits_begin() const;
0126   std::vector<edm4hep::TrackerHit>::const_iterator trackerHits_end() const;
0127   podio::RelationRange<edm4hep::TrackerHit> getTrackerHits() const;
0128   void addToTracks(const edm4hep::Track&);
0129   std::size_t tracks_size() const;
0130   edm4hep::Track getTracks(std::size_t) const;
0131   std::vector<edm4hep::Track>::const_iterator tracks_begin() const;
0132   std::vector<edm4hep::Track>::const_iterator tracks_end() const;
0133   podio::RelationRange<edm4hep::Track> getTracks() const;
0134   void addToSubdetectorHitNumbers(const std::int32_t&);
0135   std::size_t subdetectorHitNumbers_size() const;
0136   std::int32_t getSubdetectorHitNumbers(std::size_t) const;
0137   std::vector<std::int32_t>::const_iterator subdetectorHitNumbers_begin() const;
0138   std::vector<std::int32_t>::const_iterator subdetectorHitNumbers_end() const;
0139   podio::RelationRange<std::int32_t> getSubdetectorHitNumbers() const;
0140   void addToTrackStates(const edm4hep::TrackState&);
0141   std::size_t trackStates_size() const;
0142   edm4hep::TrackState getTrackStates(std::size_t) const;
0143   std::vector<edm4hep::TrackState>::const_iterator trackStates_begin() const;
0144   std::vector<edm4hep::TrackState>::const_iterator trackStates_end() const;
0145   podio::RelationRange<edm4hep::TrackState> getTrackStates() const;
0146   void addToDxQuantities(const edm4hep::Quantity&);
0147   std::size_t dxQuantities_size() const;
0148   edm4hep::Quantity getDxQuantities(std::size_t) const;
0149   std::vector<edm4hep::Quantity>::const_iterator dxQuantities_begin() const;
0150   std::vector<edm4hep::Quantity>::const_iterator dxQuantities_end() const;
0151   podio::RelationRange<edm4hep::Quantity> getDxQuantities() const;
0152 
0153   /// check whether the object is actually available
0154   bool isAvailable() const;
0155   /// disconnect from TrackObj instance
0156   void unlink() {
0157     m_obj = podio::utils::MaybeSharedPtr<TrackObj>{nullptr};
0158   }
0159 
0160   bool operator==(const MutableTrack& other) const {
0161     return m_obj == other.m_obj;
0162   }
0163   bool operator==(const Track& other) const;
0164 
0165   bool operator!=(const MutableTrack& other) const {
0166     return !(*this == other);
0167   }
0168   bool operator!=(const Track& other) const {
0169     return !(*this == other);
0170   }
0171 
0172   // less comparison operator, so that objects can be e.g. stored in sets.
0173   bool operator<(const MutableTrack& other) const {
0174     return m_obj < other.m_obj;
0175   }
0176 
0177   podio::ObjectID id() const {
0178     return getObjectID();
0179   }
0180 
0181   const podio::ObjectID getObjectID() const;
0182 
0183   friend void swap(MutableTrack& a, MutableTrack& b) {
0184     using std::swap;
0185     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0186   }
0187 
0188 private:
0189   /// constructor from existing TrackObj
0190   explicit MutableTrack(podio::utils::MaybeSharedPtr<TrackObj> obj);
0191 
0192   podio::utils::MaybeSharedPtr<TrackObj> m_obj{nullptr};
0193 };
0194 
0195 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0196 void to_json(nlohmann::json& j, const MutableTrack& value);
0197 #endif
0198 
0199 } // namespace edm4hep
0200 
0201 #endif