Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_MutableTrackerHitPlane_H
0004 #define EDM4HEP_MutableTrackerHitPlane_H
0005 
0006 #include "edm4hep/TrackerHitPlaneObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/TrackerHitPlane.h"
0009 
0010 #include "edm4hep/ObjectID.h"
0011 #include "edm4hep/Vector2f.h"
0012 #include "edm4hep/Vector3d.h"
0013 #include "podio/RelationRange.h"
0014 #include <array>
0015 #include <cstdint>
0016 #include <vector>
0017 
0018 #include "podio/utilities/MaybeSharedPtr.h"
0019 
0020 #include <cstdint>
0021 
0022 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0023 #include "nlohmann/json_fwd.hpp"
0024 #endif
0025 
0026 namespace edm4hep {
0027 
0028 /** @class MutableTrackerHitPlane
0029  *  Tracker hit plane
0030  *  @author: Placido Fernandez Declara, CERN
0031  */
0032 class MutableTrackerHitPlane {
0033 
0034   friend class TrackerHitPlaneCollection;
0035   friend class TrackerHitPlaneMutableCollectionIterator;
0036   friend class TrackerHitPlane;
0037 
0038 public:
0039   using object_type = TrackerHitPlane;
0040   using collection_type = TrackerHitPlaneCollection;
0041 
0042   /// default constructor
0043   MutableTrackerHitPlane();
0044 
0045   /// Constructor initializing all members
0046   MutableTrackerHitPlane(std::uint64_t cellID, std::int32_t type, std::int32_t quality, float time, float eDep,
0047                          float eDepError, edm4hep::Vector2f u, edm4hep::Vector2f v, float du, float dv,
0048                          edm4hep::Vector3d position, std::array<float, 6> covMatrix);
0049 
0050   /// copy constructor
0051   MutableTrackerHitPlane(const MutableTrackerHitPlane& other) = default;
0052 
0053   /// copy-assignment operator
0054   MutableTrackerHitPlane& operator=(MutableTrackerHitPlane other);
0055 
0056   /// create a mutable deep-copy of the object with identical relations
0057   /// if cloneRelations=false, the relations are not cloned and will be empty
0058   MutableTrackerHitPlane clone(bool cloneRelations = true) const;
0059 
0060   /// destructor
0061   ~MutableTrackerHitPlane() = default;
0062 
0063 public:
0064   /// Access the ID of the sensor that created this hit
0065   std::uint64_t getCellID() const;
0066 
0067   /// Access the type of raw data hit, either one of edm4hep::RawTimeSeries, edm4hep::SIMTRACKERHIT - see collection
0068   /// parameters "TrackerHitTypeNames" and "TrackerHitTypeValues".
0069   std::int32_t getType() const;
0070 
0071   /// Access the quality bit flag of the hit.
0072   std::int32_t getQuality() const;
0073 
0074   /// Access the time of the hit [ns].
0075   float getTime() const;
0076 
0077   /// Access the energy deposited on the hit [GeV].
0078   float getEDep() const;
0079 
0080   /// Access the error measured on EDep [GeV].
0081   float getEDepError() const;
0082 
0083   /// Access the measurement direction vector, u lies in the x-y plane
0084   const edm4hep::Vector2f& getU() const;
0085 
0086   /// Access the measurement direction vector, v is along z
0087   const edm4hep::Vector2f& getV() const;
0088 
0089   /// Access the measurement error along the direction
0090   float getDu() const;
0091 
0092   /// Access the measurement error along the direction
0093   float getDv() const;
0094 
0095   /// Access the hit position in [mm].
0096   const edm4hep::Vector3d& getPosition() const;
0097 
0098   /// Access the covariance of the position (x,y,z), stored as lower triangle matrix. i.e. cov(x,x) , cov(y,x) ,
0099   /// cov(y,y) , cov(z,x) , cov(z,y) , cov(z,z)
0100   const std::array<float, 6>& getCovMatrix() const;
0101   /// Access item i of the covariance of the position (x,y,z), stored as lower triangle matrix. i.e. cov(x,x) , cov(y,x)
0102   /// , cov(y,y) , cov(z,x) , cov(z,y) , cov(z,z)
0103   float getCovMatrix(size_t i) const;
0104 
0105   /// Set the ID of the sensor that created this hit
0106   void setCellID(std::uint64_t value);
0107   /// Get mutable reference to ID of the sensor that created this hit
0108   std::uint64_t& getCellID();
0109   /// Get reference to ID of the sensor that created this hit
0110   [[deprecated("use getCellID instead")]] std::uint64_t& cellID();
0111 
0112   /// Set the type of raw data hit, either one of edm4hep::RawTimeSeries, edm4hep::SIMTRACKERHIT - see collection
0113   /// parameters "TrackerHitTypeNames" and "TrackerHitTypeValues".
0114   void setType(std::int32_t value);
0115   /// Get mutable reference to type of raw data hit, either one of edm4hep::RawTimeSeries, edm4hep::SIMTRACKERHIT - see
0116   /// collection parameters "TrackerHitTypeNames" and "TrackerHitTypeValues".
0117   std::int32_t& getType();
0118   /// Get reference to type of raw data hit, either one of edm4hep::RawTimeSeries, edm4hep::SIMTRACKERHIT - see
0119   /// collection parameters "TrackerHitTypeNames" and "TrackerHitTypeValues".
0120   [[deprecated("use getType instead")]] std::int32_t& type();
0121 
0122   /// Set the quality bit flag of the hit.
0123   void setQuality(std::int32_t value);
0124   /// Get mutable reference to quality bit flag of the hit.
0125   std::int32_t& getQuality();
0126   /// Get reference to quality bit flag of the hit.
0127   [[deprecated("use getQuality instead")]] std::int32_t& quality();
0128 
0129   /// Set the time of the hit [ns].
0130   void setTime(float value);
0131   /// Get mutable reference to time of the hit [ns].
0132   float& getTime();
0133   /// Get reference to time of the hit [ns].
0134   [[deprecated("use getTime instead")]] float& time();
0135 
0136   /// Set the energy deposited on the hit [GeV].
0137   void setEDep(float value);
0138   /// Get mutable reference to energy deposited on the hit [GeV].
0139   float& getEDep();
0140   /// Get reference to energy deposited on the hit [GeV].
0141   [[deprecated("use getEDep instead")]] float& eDep();
0142 
0143   /// Set the error measured on EDep [GeV].
0144   void setEDepError(float value);
0145   /// Get mutable reference to error measured on EDep [GeV].
0146   float& getEDepError();
0147   /// Get reference to error measured on EDep [GeV].
0148   [[deprecated("use getEDepError instead")]] float& eDepError();
0149 
0150   /// Set the measurement direction vector, u lies in the x-y plane
0151   void setU(edm4hep::Vector2f value);
0152   /// Get mutable reference to measurement direction vector, u lies in the x-y plane
0153   edm4hep::Vector2f& getU();
0154   /// Get reference to measurement direction vector, u lies in the x-y plane
0155   [[deprecated("use getU instead")]] edm4hep::Vector2f& u();
0156 
0157   /// Set the measurement direction vector, v is along z
0158   void setV(edm4hep::Vector2f value);
0159   /// Get mutable reference to measurement direction vector, v is along z
0160   edm4hep::Vector2f& getV();
0161   /// Get reference to measurement direction vector, v is along z
0162   [[deprecated("use getV instead")]] edm4hep::Vector2f& v();
0163 
0164   /// Set the measurement error along the direction
0165   void setDu(float value);
0166   /// Get mutable reference to measurement error along the direction
0167   float& getDu();
0168   /// Get reference to measurement error along the direction
0169   [[deprecated("use getDu instead")]] float& du();
0170 
0171   /// Set the measurement error along the direction
0172   void setDv(float value);
0173   /// Get mutable reference to measurement error along the direction
0174   float& getDv();
0175   /// Get reference to measurement error along the direction
0176   [[deprecated("use getDv instead")]] float& dv();
0177 
0178   /// Set the hit position in [mm].
0179   void setPosition(edm4hep::Vector3d value);
0180   /// Get mutable reference to hit position in [mm].
0181   edm4hep::Vector3d& getPosition();
0182   /// Get reference to hit position in [mm].
0183   [[deprecated("use getPosition instead")]] edm4hep::Vector3d& position();
0184 
0185   /// Set the covariance of the position (x,y,z), stored as lower triangle matrix. i.e. cov(x,x) , cov(y,x) , cov(y,y) ,
0186   /// cov(z,x) , cov(z,y) , cov(z,z)
0187   void setCovMatrix(std::array<float, 6> value);
0188   void setCovMatrix(size_t i, float value);
0189   /// Get mutable reference to covariance of the position (x,y,z), stored as lower triangle matrix. i.e. cov(x,x) ,
0190   /// cov(y,x) , cov(y,y) , cov(z,x) , cov(z,y) , cov(z,z)
0191   std::array<float, 6>& getCovMatrix();
0192   /// Get reference to covariance of the position (x,y,z), stored as lower triangle matrix. i.e. cov(x,x) , cov(y,x) ,
0193   /// cov(y,y) , cov(z,x) , cov(z,y) , cov(z,z)
0194   [[deprecated("use getCovMatrix instead")]] std::array<float, 6>& covMatrix();
0195 
0196   void addToRawHits(const edm4hep::ObjectID&);
0197   std::size_t rawHits_size() const;
0198   edm4hep::ObjectID getRawHits(std::size_t) const;
0199   std::vector<edm4hep::ObjectID>::const_iterator rawHits_begin() const;
0200   std::vector<edm4hep::ObjectID>::const_iterator rawHits_end() const;
0201   podio::RelationRange<edm4hep::ObjectID> getRawHits() const;
0202 
0203   /// check whether the object is actually available
0204   bool isAvailable() const;
0205   /// disconnect from TrackerHitPlaneObj instance
0206   void unlink() {
0207     m_obj = podio::utils::MaybeSharedPtr<TrackerHitPlaneObj>{nullptr};
0208   }
0209 
0210   bool operator==(const MutableTrackerHitPlane& other) const {
0211     return m_obj == other.m_obj;
0212   }
0213   bool operator==(const TrackerHitPlane& other) const;
0214 
0215   bool operator!=(const MutableTrackerHitPlane& other) const {
0216     return !(*this == other);
0217   }
0218   bool operator!=(const TrackerHitPlane& other) const {
0219     return !(*this == other);
0220   }
0221 
0222   // less comparison operator, so that objects can be e.g. stored in sets.
0223   bool operator<(const MutableTrackerHitPlane& other) const {
0224     return m_obj < other.m_obj;
0225   }
0226 
0227   podio::ObjectID id() const {
0228     return getObjectID();
0229   }
0230 
0231   const podio::ObjectID getObjectID() const;
0232 
0233   friend void swap(MutableTrackerHitPlane& a, MutableTrackerHitPlane& b) {
0234     using std::swap;
0235     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0236   }
0237 
0238 private:
0239   /// constructor from existing TrackerHitPlaneObj
0240   explicit MutableTrackerHitPlane(podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> obj);
0241 
0242   podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> m_obj{nullptr};
0243 };
0244 
0245 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0246 void to_json(nlohmann::json& j, const MutableTrackerHitPlane& value);
0247 #endif
0248 
0249 } // namespace edm4hep
0250 
0251 #endif