Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-04 08:12:04

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef ACTSPODIOEDM_MutableTrackerHitLocal_H
0004 #define ACTSPODIOEDM_MutableTrackerHitLocal_H
0005 
0006 #include "ActsPodioEdm/TrackerHitLocalObj.h"
0007 // Make the immutable class available from its mutable version but not vice
0008 // versa
0009 #include "ActsPodioEdm/TrackerHitLocal.h"
0010 
0011 #include <cstdint>
0012 #include <vector>
0013 
0014 #include "edm4hep/Vector3d.h"
0015 #include "podio/RelationRange.h"
0016 #include "podio/utilities/MaybeSharedPtr.h"
0017 
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021 
0022 // forward declarations
0023 namespace ActsPodioEdm {
0024 class TrackerHitLocalCollection;
0025 }
0026 
0027 namespace ActsPodioEdm {
0028 
0029 /** @class MutableTrackerHitLocal
0030  *  Sensor-local tracker hit
0031  *  @author: Paul Gessinger, CERN
0032  */
0033 class MutableTrackerHitLocal {
0034   friend class TrackerHitLocalCollection;
0035   friend class TrackerHitLocalMutableCollectionIterator;
0036   friend class TrackerHitLocal;
0037 
0038  public:
0039   using object_type = TrackerHitLocal;
0040   using collection_type = TrackerHitLocalCollection;
0041 
0042   /// default constructor
0043   MutableTrackerHitLocal() = default;
0044 
0045   /// Constructor initializing all members
0046   MutableTrackerHitLocal(const std::uint64_t cellID, const std::int32_t type,
0047                          const std::int32_t quality, const float time,
0048                          const float eDep, const float eDepError,
0049                          const edm4hep::Vector3d& position);
0050 
0051   /// copy constructor
0052   MutableTrackerHitLocal(const MutableTrackerHitLocal& other) = default;
0053 
0054   /// copy-assignment operator
0055   MutableTrackerHitLocal& operator=(
0056       MutableTrackerHitLocal
0057           other) &;  // Rebind this to other's internal object
0058   MutableTrackerHitLocal& operator=(MutableTrackerHitLocal other) && =
0059       delete;  // Prevent rebinding temporary as the changes wouldn't persist
0060 
0061   /// create a mutable deep-copy of the object with identical relations
0062   /// if cloneRelations=false, the relations are not cloned and will be empty
0063   MutableTrackerHitLocal clone(bool cloneRelations = true) const;
0064 
0065   /// destructor
0066   ~MutableTrackerHitLocal() = default;
0067 
0068  public:
0069   /// Access the ID of the sensor that created this hit
0070   std::uint64_t getCellID() const;
0071 
0072   /// Access the type of raw data hit, use depends on writer
0073   std::int32_t getType() const;
0074 
0075   /// Access the quality bit flag of the hit
0076   std::int32_t getQuality() const;
0077 
0078   /// Access the time of the hit (depends on measurement type) [ns]
0079   float getTime() const;
0080 
0081   /// Access the energy deposited on the hit (optional) [GeV]
0082   float getEDep() const;
0083 
0084   /// Access the error measured on EDep (optional) [GeV]
0085   float getEDepError() const;
0086 
0087   /// Access the global hit position (depends on measurement type) [mm]
0088   const edm4hep::Vector3d& getPosition() const;
0089 
0090   /// Set the ID of the sensor that created this hit
0091   void setCellID(const std::uint64_t cellID);
0092   /// Get mutable reference to ID of the sensor that created this hit
0093   std::uint64_t& getCellID();
0094   /// Get reference to ID of the sensor that created this hit
0095   [[deprecated("use getCellID instead")]]
0096   std::uint64_t& cellID();
0097 
0098   /// Set the type of raw data hit, use depends on writer
0099   void setType(const std::int32_t type);
0100   /// Get mutable reference to type of raw data hit, use depends on writer
0101   std::int32_t& getType();
0102   /// Get reference to type of raw data hit, use depends on writer
0103   [[deprecated("use getType instead")]]
0104   std::int32_t& type();
0105 
0106   /// Set the quality bit flag of the hit
0107   void setQuality(const std::int32_t quality);
0108   /// Get mutable reference to quality bit flag of the hit
0109   std::int32_t& getQuality();
0110   /// Get reference to quality bit flag of the hit
0111   [[deprecated("use getQuality instead")]]
0112   std::int32_t& quality();
0113 
0114   /// Set the time of the hit (depends on measurement type) [ns]
0115   void setTime(const float time);
0116   /// Get mutable reference to time of the hit (depends on measurement type)
0117   /// [ns]
0118   float& getTime();
0119   /// Get reference to time of the hit (depends on measurement type) [ns]
0120   [[deprecated("use getTime instead")]]
0121   float& time();
0122 
0123   /// Set the energy deposited on the hit (optional) [GeV]
0124   void setEDep(const float eDep);
0125   /// Get mutable reference to energy deposited on the hit (optional) [GeV]
0126   float& getEDep();
0127   /// Get reference to energy deposited on the hit (optional) [GeV]
0128   [[deprecated("use getEDep instead")]]
0129   float& eDep();
0130 
0131   /// Set the error measured on EDep (optional) [GeV]
0132   void setEDepError(const float eDepError);
0133   /// Get mutable reference to error measured on EDep (optional) [GeV]
0134   float& getEDepError();
0135   /// Get reference to error measured on EDep (optional) [GeV]
0136   [[deprecated("use getEDepError instead")]]
0137   float& eDepError();
0138 
0139   /// Set the global hit position (depends on measurement type) [mm]
0140   void setPosition(const edm4hep::Vector3d& position);
0141   /// Get mutable reference to global hit position (depends on measurement type)
0142   /// [mm]
0143   edm4hep::Vector3d& getPosition();
0144   /// Get reference to global hit position (depends on measurement type) [mm]
0145   [[deprecated("use getPosition instead")]]
0146   edm4hep::Vector3d& position();
0147 
0148   void addToMeasurement(const float&);
0149   std::size_t measurement_size() const;
0150   float getMeasurement(std::size_t) const;
0151   std::vector<float>::const_iterator measurement_begin() const;
0152   std::vector<float>::const_iterator measurement_end() const;
0153   podio::RelationRange<float> getMeasurement() const;
0154   void addToCovariance(const float&);
0155   std::size_t covariance_size() const;
0156   float getCovariance(std::size_t) const;
0157   std::vector<float>::const_iterator covariance_begin() const;
0158   std::vector<float>::const_iterator covariance_end() const;
0159   podio::RelationRange<float> getCovariance() const;
0160 
0161   /// check whether the object is actually available
0162   bool isAvailable() const;
0163   /// disconnect from TrackerHitLocalObj instance
0164   void unlink() {
0165     m_obj = podio::utils::MaybeSharedPtr<TrackerHitLocalObj>{nullptr};
0166   }
0167 
0168   bool operator==(const MutableTrackerHitLocal& other) const {
0169     return m_obj == other.m_obj;
0170   }
0171   bool operator==(const TrackerHitLocal& other) const;
0172 
0173   bool operator!=(const MutableTrackerHitLocal& other) const {
0174     return !(*this == other);
0175   }
0176   bool operator!=(const TrackerHitLocal& other) const {
0177     return !(*this == other);
0178   }
0179 
0180   // less comparison operator, so that objects can be e.g. stored in sets.
0181   bool operator<(const MutableTrackerHitLocal& other) const {
0182     return podio::detail::getOrderKey(*this) <
0183            podio::detail::getOrderKey(other);
0184   }
0185 
0186   podio::ObjectID id() const { return getObjectID(); }
0187 
0188   const podio::ObjectID getObjectID() const;
0189 
0190   friend std::hash<MutableTrackerHitLocal>;
0191 
0192   friend void swap(MutableTrackerHitLocal& a, MutableTrackerHitLocal& b) {
0193     using std::swap;
0194     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0195   }
0196 
0197  private:
0198   /// constructor from existing TrackerHitLocalObj
0199   explicit MutableTrackerHitLocal(
0200       podio::utils::MaybeSharedPtr<TrackerHitLocalObj> obj);
0201 
0202   podio::utils::MaybeSharedPtr<TrackerHitLocalObj> m_obj{
0203       new TrackerHitLocalObj{}, podio::utils::MarkOwned};
0204 };
0205 
0206 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0207 void to_json(nlohmann::json& j, const MutableTrackerHitLocal& value);
0208 #endif
0209 
0210 }  // namespace ActsPodioEdm
0211 
0212 template <>
0213 struct std::hash<ActsPodioEdm::MutableTrackerHitLocal> {
0214   std::size_t operator()(
0215       const ActsPodioEdm::MutableTrackerHitLocal& obj) const {
0216     return std::hash<ActsPodioEdm::TrackerHitLocalObj*>{}(obj.m_obj.get());
0217   }
0218 };
0219 
0220 #endif