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