Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-30 07:57:06

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef ACTSPODIOEDM_Measurement_H
0004 #define ACTSPODIOEDM_Measurement_H
0005 
0006 #include "ActsPodioEdm/MeasurementObj.h"
0007 
0008 #include <cstdint>
0009 #include <ostream>
0010 #include <vector>
0011 
0012 #include "podio/RelationRange.h"
0013 #include "podio/detail/OrderKey.h"
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019 
0020 // forward declarations
0021 namespace ActsPodioEdm {
0022 class MeasurementCollection;
0023 }
0024 namespace edm4hep {
0025 class SimTrackerHit;
0026 class MutableSimTrackerHit;
0027 }  // namespace edm4hep
0028 
0029 namespace podio::detail {
0030 // Internal function used in less comparison operators of the datatypes and
0031 // interface types
0032 OrderKey getOrderKey(const ActsPodioEdm::Measurement& obj);
0033 };  // namespace podio::detail
0034 
0035 namespace ActsPodioEdm {
0036 
0037 class MutableMeasurement;
0038 class MeasurementCollection;
0039 class MeasurementCollectionData;
0040 
0041 /** @class Measurement
0042  *  Local representation of a measurement
0043  *  @author: Paul Gessinger, CERN
0044  */
0045 class Measurement {
0046   friend class MutableMeasurement;
0047   friend class MeasurementCollection;
0048   friend class ActsPodioEdm::MeasurementCollectionData;
0049   friend class MeasurementCollectionIterator;
0050   friend podio::detail::OrderKey podio::detail::getOrderKey(
0051       const Measurement& obj);
0052 
0053  public:
0054   using mutable_type = MutableMeasurement;
0055   using collection_type = MeasurementCollection;
0056 
0057   /// default constructor
0058   Measurement() = default;
0059 
0060   /// Constructor initializing all members
0061   Measurement(const std::uint64_t geometryId);
0062 
0063   /// copy constructor
0064   Measurement(const Measurement& other) = default;
0065 
0066   /// copy-assignment operator
0067   Measurement& operator=(
0068       Measurement other) &;  // Rebind this to other's internal object
0069   Measurement& operator=(Measurement other) && =
0070       delete;  // Prevent rebinding temporary as the changes wouldn't persist
0071 
0072   /// create a mutable deep-copy of the object with identical relations
0073   /// if cloneRelations=false, the relations are not cloned and will be empty
0074   MutableMeasurement clone(bool cloneRelations = true) const;
0075 
0076   /// destructor
0077   ~Measurement() = default;
0078 
0079   /// converting constructor from mutable object
0080   Measurement(const MutableMeasurement& other);
0081 
0082   static Measurement makeEmpty();
0083 
0084  public:
0085   static constexpr std::string_view typeName = "ActsPodioEdm::Measurement";
0086 
0087   /// Access the the associated surface identifier
0088   std::uint64_t getGeometryId() const;
0089 
0090   /// Access the the associated simulated hit
0091   const edm4hep::SimTrackerHit getSimHit() const;
0092 
0093   std::size_t indices_size() const;
0094   std::uint16_t getIndices(std::size_t) const;
0095   std::vector<std::uint16_t>::const_iterator indices_begin() const;
0096   std::vector<std::uint16_t>::const_iterator indices_end() const;
0097   podio::RelationRange<std::uint16_t> getIndices() const;
0098   std::size_t parameterValues_size() const;
0099   double getParameterValues(std::size_t) const;
0100   std::vector<double>::const_iterator parameterValues_begin() const;
0101   std::vector<double>::const_iterator parameterValues_end() const;
0102   podio::RelationRange<double> getParameterValues() const;
0103   std::size_t covarianceValues_size() const;
0104   double getCovarianceValues(std::size_t) const;
0105   std::vector<double>::const_iterator covarianceValues_begin() const;
0106   std::vector<double>::const_iterator covarianceValues_end() const;
0107   podio::RelationRange<double> getCovarianceValues() const;
0108 
0109   std::size_t size() const { return indices_size(); }
0110 
0111   /// check whether the object is actually available
0112   bool isAvailable() const;
0113   /// disconnect from MeasurementObj instance
0114   void unlink() {
0115     m_obj = podio::utils::MaybeSharedPtr<MeasurementObj>{nullptr};
0116   }
0117 
0118   bool operator==(const Measurement& other) const {
0119     return m_obj == other.m_obj;
0120   }
0121   bool operator==(const MutableMeasurement& other) const;
0122 
0123   bool operator!=(const Measurement& other) const { return !(*this == other); }
0124   bool operator!=(const MutableMeasurement& other) const {
0125     return !(*this == other);
0126   }
0127 
0128   // less comparison operator, so that objects can be e.g. stored in sets.
0129   bool operator<(const Measurement& other) const {
0130     return podio::detail::getOrderKey(*this) <
0131            podio::detail::getOrderKey(other);
0132   }
0133 
0134   podio::ObjectID id() const { return getObjectID(); }
0135 
0136   const podio::ObjectID getObjectID() const;
0137 
0138   friend std::hash<Measurement>;
0139 
0140   friend void swap(Measurement& a, Measurement& b) {
0141     using std::swap;
0142     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0143   }
0144 
0145  private:
0146   /// constructor from existing MeasurementObj
0147   explicit Measurement(podio::utils::MaybeSharedPtr<MeasurementObj> obj);
0148   Measurement(MeasurementObj* obj);
0149 
0150   podio::utils::MaybeSharedPtr<MeasurementObj> m_obj{new MeasurementObj{},
0151                                                      podio::utils::MarkOwned};
0152 };
0153 
0154 std::ostream& operator<<(std::ostream& o, const Measurement& value);
0155 
0156 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0157 void to_json(nlohmann::json& j, const Measurement& value);
0158 #endif
0159 
0160 }  // namespace ActsPodioEdm
0161 
0162 template <>
0163 struct std::hash<ActsPodioEdm::Measurement> {
0164   std::size_t operator()(const ActsPodioEdm::Measurement& obj) const {
0165     return std::hash<ActsPodioEdm::MeasurementObj*>{}(obj.m_obj.get());
0166   }
0167 };
0168 
0169 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0170 // until it's fixed in ROOT. See
0171 // https://github.com/root-project/root/issues/18489 and
0172 // https://github.com/AIDASoft/podio/issues/770
0173 #if defined(__clang__)
0174 #pragma clang diagnostic push
0175 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0176 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0177 #pragma clang diagnostic ignored "-Wdeprecated"
0178 constexpr std::string_view ActsPodioEdm::Measurement::typeName;
0179 #pragma clang diagnostic pop
0180 #elif defined(__GNUC__)
0181 #pragma GCC diagnostic push
0182 #pragma GCC diagnostic ignored "-Wdeprecated"
0183 constexpr std::string_view ActsPodioEdm::Measurement::typeName;
0184 #pragma GCC diagnostic pop
0185 #endif
0186 
0187 #endif