Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-12 08:33:55

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/detail/OrderKey.h"
0011 #include "podio/utilities/MaybeSharedPtr.h"
0012 
0013 #include <cstdint>
0014 #include <ostream>
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 } // namespace edm4hep
0026 
0027 namespace podio::detail {
0028 // Internal function used in less comparison operators of the datatypes and interface types
0029 OrderKey getOrderKey(const edm4hep::RecDqdx& obj);
0030 }; // namespace podio::detail
0031 
0032 namespace edm4hep {
0033 
0034 class MutableRecDqdx;
0035 class RecDqdxCollection;
0036 class RecDqdxCollectionData;
0037 
0038 /** @class RecDqdx
0039  *  dN/dx or dE/dx info of a Track
0040  *  @author: EDM4hep authors
0041  */
0042 class RecDqdx {
0043 
0044   friend class MutableRecDqdx;
0045   friend class RecDqdxCollection;
0046   friend class edm4hep::RecDqdxCollectionData;
0047   friend class RecDqdxCollectionIterator;
0048   friend podio::detail::OrderKey podio::detail::getOrderKey(const RecDqdx& obj);
0049 
0050 public:
0051   using mutable_type = MutableRecDqdx;
0052   using collection_type = RecDqdxCollection;
0053 
0054   /// default constructor
0055   RecDqdx();
0056 
0057   /// Constructor initializing all members
0058   RecDqdx(edm4hep::Quantity dQdx);
0059 
0060   /// copy constructor
0061   RecDqdx(const RecDqdx& other) = default;
0062 
0063   /// copy-assignment operator
0064   RecDqdx& operator=(RecDqdx other);
0065 
0066   /// create a mutable deep-copy of the object with identical relations
0067   /// if cloneRelations=false, the relations are not cloned and will be empty
0068   MutableRecDqdx clone(bool cloneRelations = true) const;
0069 
0070   /// destructor
0071   ~RecDqdx() = default;
0072 
0073   /// converting constructor from mutable object
0074   RecDqdx(const MutableRecDqdx& other);
0075 
0076   static RecDqdx makeEmpty();
0077 
0078 public:
0079   static constexpr auto typeName = "edm4hep::RecDqdx";
0080 
0081   /// Access the the reconstructed dEdx or dNdx and its error
0082   const edm4hep::Quantity& getDQdx() const;
0083 
0084   /// Access the the corresponding track
0085   const edm4hep::Track getTrack() const;
0086 
0087   /// check whether the object is actually available
0088   bool isAvailable() const;
0089   /// disconnect from RecDqdxObj instance
0090   void unlink() {
0091     m_obj = podio::utils::MaybeSharedPtr<RecDqdxObj>{nullptr};
0092   }
0093 
0094   bool operator==(const RecDqdx& other) const {
0095     return m_obj == other.m_obj;
0096   }
0097   bool operator==(const MutableRecDqdx& other) const;
0098 
0099   bool operator!=(const RecDqdx& other) const {
0100     return !(*this == other);
0101   }
0102   bool operator!=(const MutableRecDqdx& other) const {
0103     return !(*this == other);
0104   }
0105 
0106   // less comparison operator, so that objects can be e.g. stored in sets.
0107   bool operator<(const RecDqdx& other) const {
0108     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0109   }
0110 
0111   podio::ObjectID id() const {
0112     return getObjectID();
0113   }
0114 
0115   const podio::ObjectID getObjectID() const;
0116 
0117   friend void swap(RecDqdx& a, RecDqdx& b) {
0118     using std::swap;
0119     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0120   }
0121 
0122 private:
0123   /// constructor from existing RecDqdxObj
0124   explicit RecDqdx(podio::utils::MaybeSharedPtr<RecDqdxObj> obj);
0125   RecDqdx(RecDqdxObj* obj);
0126 
0127   podio::utils::MaybeSharedPtr<RecDqdxObj> m_obj{nullptr};
0128 };
0129 
0130 std::ostream& operator<<(std::ostream& o, const RecDqdx& value);
0131 
0132 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0133 void to_json(nlohmann::json& j, const RecDqdx& value);
0134 #endif
0135 
0136 } // namespace edm4hep
0137 
0138 #endif