Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:55:13

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_RecDqdx_H
0004 #define EDM4HEP_RecDqdx_H
0005 
0006 #include "edm4hep/RecDqdxObj.h"
0007 
0008 #include "edm4hep/Quantity.h"
0009 
0010 #include "podio/utilities/MaybeSharedPtr.h"
0011 #include "podio/detail/OrderKey.h"
0012 
0013 #include <ostream>
0014 #include <cstdint>
0015 
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019 
0020 // forward declarations
0021 namespace edm4hep {
0022 class RecDqdxCollection;
0023 class Track;
0024 class MutableTrack;
0025 }
0026 
0027 
0028 namespace podio::detail {
0029 // Internal function used in less comparison operators of the datatypes and interface types
0030 OrderKey getOrderKey(const edm4hep::RecDqdx& obj);
0031 };
0032 
0033 namespace edm4hep {
0034 
0035 class MutableRecDqdx;
0036 class RecDqdxCollection;
0037 class RecDqdxCollectionData;
0038 
0039 /** @class RecDqdx
0040  *  dN/dx or dE/dx info of a Track
0041  *  @author: EDM4hep authors
0042  */
0043 class RecDqdx {
0044 
0045   friend class MutableRecDqdx;
0046   friend class RecDqdxCollection;
0047   friend class edm4hep::RecDqdxCollectionData;
0048   friend class RecDqdxCollectionIterator;
0049   friend podio::detail::OrderKey podio::detail::getOrderKey(const RecDqdx & obj);
0050 
0051 public:
0052   using mutable_type = MutableRecDqdx;
0053   using collection_type = RecDqdxCollection;
0054 
0055   /// default constructor
0056   RecDqdx();
0057 
0058   /// Constructor initializing all members
0059   RecDqdx(const edm4hep::Quantity& dQdx);
0060 
0061   /// copy constructor
0062   RecDqdx(const RecDqdx& other) = default;
0063 
0064   /// copy-assignment operator
0065   RecDqdx& operator=(RecDqdx other) &; // Rebind this to other's internal object
0066   RecDqdx& operator=(RecDqdx other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0067 
0068   /// create a mutable deep-copy of the object with identical relations
0069   /// if cloneRelations=false, the relations are not cloned and will be empty
0070   MutableRecDqdx clone(bool cloneRelations=true) const;
0071 
0072   /// destructor
0073   ~RecDqdx() = default;
0074 
0075   /// converting constructor from mutable object
0076   RecDqdx(const MutableRecDqdx& other);
0077 
0078   static RecDqdx makeEmpty();
0079 
0080 public:
0081 
0082   static constexpr std::string_view typeName = "edm4hep::RecDqdx";
0083 
0084   /// Access the the reconstructed dEdx or dNdx and its error
0085   const edm4hep::Quantity& getDQdx() const;
0086 
0087 
0088   /// Access the the corresponding track
0089   const edm4hep::Track getTrack() const;
0090 
0091 
0092 
0093   /// check whether the object is actually available
0094   bool isAvailable() const;
0095   /// disconnect from RecDqdxObj instance
0096   void unlink() { m_obj = podio::utils::MaybeSharedPtr<RecDqdxObj>{nullptr}; }
0097 
0098   bool operator==(const RecDqdx& other) const { return m_obj == other.m_obj; }
0099   bool operator==(const MutableRecDqdx& other) const;
0100 
0101   bool operator!=(const RecDqdx& other) const { return !(*this == other); }
0102   bool operator!=(const MutableRecDqdx& other) const { return !(*this == other); }
0103 
0104   // less comparison operator, so that objects can be e.g. stored in sets.
0105   bool operator<(const RecDqdx& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0106 
0107   podio::ObjectID id() const { return getObjectID(); }
0108 
0109   const podio::ObjectID getObjectID() const;
0110 
0111   friend std::hash<RecDqdx>;
0112 
0113   friend void swap(RecDqdx& a, RecDqdx& b) {
0114     using std::swap;
0115     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0116   }
0117 
0118 private:
0119   /// constructor from existing RecDqdxObj
0120   explicit RecDqdx(podio::utils::MaybeSharedPtr<RecDqdxObj> obj);
0121   RecDqdx(RecDqdxObj* obj);
0122 
0123   podio::utils::MaybeSharedPtr<RecDqdxObj> m_obj{nullptr};
0124 };
0125 
0126 std::ostream& operator<<(std::ostream& o, const RecDqdx& value);
0127 
0128 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0129 void to_json(nlohmann::json& j, const RecDqdx& value);
0130 #endif
0131 
0132 
0133 } // namespace edm4hep
0134 
0135 
0136 
0137 template<>
0138 struct std::hash<edm4hep::RecDqdx> {
0139   std::size_t operator()(const edm4hep::RecDqdx& obj) const {
0140     return std::hash<edm4hep::RecDqdxObj*>{}(obj.m_obj.get());
0141   }
0142 };
0143 
0144 
0145 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0146 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0147 // and https://github.com/AIDASoft/podio/issues/770
0148 #if defined(__clang__)
0149 #pragma clang diagnostic push
0150 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0151 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0152 #pragma clang diagnostic ignored "-Wdeprecated"
0153 constexpr std::string_view edm4hep::RecDqdx::typeName;
0154 #pragma clang diagnostic pop
0155 #elif defined(__GNUC__)
0156 #pragma GCC diagnostic push
0157 #pragma GCC diagnostic ignored "-Wdeprecated"
0158 constexpr std::string_view edm4hep::RecDqdx::typeName;
0159 #pragma GCC diagnostic pop
0160 #endif
0161 
0162 #endif