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_MutableTrackerHit_H
0004 #define EDM4EIC_MutableTrackerHit_H
0005 
0006 #include "edm4eic/TrackerHitObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/TrackerHit.h"
0009 
0010 #include "edm4eic/CovDiag3f.h"
0011 #include "edm4hep/Vector3f.h"
0012 #include <cstdint>
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 TrackerHitCollection;
0025 class RawTrackerHit;
0026 class MutableRawTrackerHit;
0027 }
0028 
0029 
0030 namespace edm4eic {
0031 
0032 
0033 /** @class MutableTrackerHit
0034  *  Tracker hit (reconstructed from Raw)
0035  *  @author: W. Armstrong, S. Joosten
0036  */
0037 class MutableTrackerHit {
0038 
0039   friend class TrackerHitCollection;
0040   friend class TrackerHitMutableCollectionIterator;
0041   friend class TrackerHit;
0042 
0043 public:
0044   using object_type = TrackerHit;
0045   using collection_type = TrackerHitCollection;
0046 
0047   /// default constructor
0048   MutableTrackerHit();
0049 
0050   /// Constructor initializing all members
0051   MutableTrackerHit(std::uint64_t cellID, edm4hep::Vector3f position, edm4eic::CovDiag3f positionError, float time, float timeError, float edep, float edepError);
0052 
0053   /// copy constructor
0054   MutableTrackerHit(const MutableTrackerHit& other) = default;
0055 
0056   /// copy-assignment operator
0057   MutableTrackerHit& operator=(MutableTrackerHit 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   MutableTrackerHit clone(bool cloneRelations=true) const;
0062 
0063   /// destructor
0064   ~MutableTrackerHit() = default;
0065 
0066 
0067 public:
0068 
0069   /// Access the The detector specific (geometrical) cell id.
0070   std::uint64_t getCellID() const;
0071 
0072   /// Access the Hit (cell) position [mm]
0073   const edm4hep::Vector3f& getPosition() const;
0074 
0075   /// Access the Covariance Matrix
0076   const edm4eic::CovDiag3f& getPositionError() const;
0077 
0078   /// Access the Hit time [ns]
0079   float getTime() const;
0080 
0081   /// Access the Error on the time
0082   float getTimeError() const;
0083 
0084   /// Access the Energy deposit in this hit [GeV]
0085   float getEdep() const;
0086 
0087   /// Access the Error on the energy deposit [GeV]
0088   float getEdepError() const;
0089 
0090 
0091   /// Access the Related raw tracker hit
0092   const edm4eic::RawTrackerHit getRawHit() const;
0093 
0094   /// Set the The detector specific (geometrical) cell id.
0095   void setCellID(std::uint64_t value);
0096   /// Get mutable reference to The detector specific (geometrical) cell id.
0097   std::uint64_t& getCellID();
0098   /// Get reference to The detector specific (geometrical) cell id.
0099   [[deprecated("use getCellID instead")]]
0100   std::uint64_t& cellID();
0101 
0102   /// Set the Hit (cell) position [mm]
0103   void setPosition(edm4hep::Vector3f value);
0104   /// Get mutable reference to Hit (cell) position [mm]
0105   edm4hep::Vector3f& getPosition();
0106   /// Get reference to Hit (cell) position [mm]
0107   [[deprecated("use getPosition instead")]]
0108   edm4hep::Vector3f& position();
0109 
0110   /// Set the Covariance Matrix
0111   void setPositionError(edm4eic::CovDiag3f value);
0112   /// Get mutable reference to Covariance Matrix
0113   edm4eic::CovDiag3f& getPositionError();
0114   /// Get reference to Covariance Matrix
0115   [[deprecated("use getPositionError instead")]]
0116   edm4eic::CovDiag3f& positionError();
0117 
0118   /// Set the Hit time [ns]
0119   void setTime(float value);
0120   /// Get mutable reference to Hit time [ns]
0121   float& getTime();
0122   /// Get reference to Hit time [ns]
0123   [[deprecated("use getTime instead")]]
0124   float& time();
0125 
0126   /// Set the Error on the time
0127   void setTimeError(float value);
0128   /// Get mutable reference to Error on the time
0129   float& getTimeError();
0130   /// Get reference to Error on the time
0131   [[deprecated("use getTimeError instead")]]
0132   float& timeError();
0133 
0134   /// Set the Energy deposit in this hit [GeV]
0135   void setEdep(float value);
0136   /// Get mutable reference to Energy deposit in this hit [GeV]
0137   float& getEdep();
0138   /// Get reference to Energy deposit in this hit [GeV]
0139   [[deprecated("use getEdep instead")]]
0140   float& edep();
0141 
0142   /// Set the Error on the energy deposit [GeV]
0143   void setEdepError(float value);
0144   /// Get mutable reference to Error on the energy deposit [GeV]
0145   float& getEdepError();
0146   /// Get reference to Error on the energy deposit [GeV]
0147   [[deprecated("use getEdepError instead")]]
0148   float& edepError();
0149 
0150 
0151   /// Set the Related raw tracker hit
0152   void setRawHit(const edm4eic::RawTrackerHit& value);
0153 
0154 
0155 
0156 
0157   /// check whether the object is actually available
0158   bool isAvailable() const;
0159   /// disconnect from TrackerHitObj instance
0160   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHitObj>{nullptr}; }
0161 
0162   bool operator==(const MutableTrackerHit& other) const { return m_obj == other.m_obj; }
0163   bool operator==(const TrackerHit& other) const;
0164 
0165   bool operator!=(const MutableTrackerHit& other) const { return !(*this == other); }
0166   bool operator!=(const TrackerHit& other) const { return !(*this == other); }
0167 
0168   // less comparison operator, so that objects can be e.g. stored in sets.
0169   bool operator<(const MutableTrackerHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0170 
0171   podio::ObjectID id() const { return getObjectID(); }
0172 
0173   const podio::ObjectID getObjectID() const;
0174 
0175   friend void swap(MutableTrackerHit& a, MutableTrackerHit& b) {
0176     using std::swap;
0177     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0178   }
0179 
0180 private:
0181   /// constructor from existing TrackerHitObj
0182   explicit MutableTrackerHit(podio::utils::MaybeSharedPtr<TrackerHitObj> obj);
0183 
0184   podio::utils::MaybeSharedPtr<TrackerHitObj> m_obj{nullptr};
0185 };
0186 
0187 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0188 void to_json(nlohmann::json& j, const MutableTrackerHit& value);
0189 #endif
0190 
0191 
0192 } // namespace edm4eic
0193 
0194 
0195 #endif