Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 08:20:50

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_IrtRadiatorInfo_H
0004 #define EDM4EIC_IrtRadiatorInfo_H
0005 
0006 #include "edm4eic/IrtRadiatorInfoObj.h"
0007 
0008 #include <cstdint>
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 edm4eic {
0022 class IrtRadiatorInfoCollection;
0023 }
0024 
0025 
0026 namespace podio::detail {
0027 // Internal function used in less comparison operators of the datatypes and interface types
0028 OrderKey getOrderKey(const edm4eic::IrtRadiatorInfo& obj);
0029 };
0030 
0031 namespace edm4eic {
0032 
0033 class MutableIrtRadiatorInfo;
0034 class IrtRadiatorInfoCollection;
0035 class IrtRadiatorInfoCollectionData;
0036 
0037 /** @class IrtRadiatorInfo
0038  *  IRT 2.1 output (radiator level)
0039  *  @author: A. Kiselev
0040  */
0041 class IrtRadiatorInfo {
0042 
0043   friend class MutableIrtRadiatorInfo;
0044   friend class IrtRadiatorInfoCollection;
0045   friend class edm4eic::IrtRadiatorInfoCollectionData;
0046   friend class IrtRadiatorInfoCollectionIterator;
0047   friend podio::detail::OrderKey podio::detail::getOrderKey(const IrtRadiatorInfo & obj);
0048 
0049 public:
0050   using mutable_type = MutableIrtRadiatorInfo;
0051   using collection_type = IrtRadiatorInfoCollection;
0052 
0053   /// default constructor
0054   IrtRadiatorInfo() = default;
0055 
0056   /// Constructor initializing all members
0057   IrtRadiatorInfo(const std::uint16_t npe, const std::uint16_t nhits, const float angle);
0058 
0059   /// copy constructor
0060   IrtRadiatorInfo(const IrtRadiatorInfo& other) = default;
0061 
0062   /// copy-assignment operator
0063   IrtRadiatorInfo& operator=(IrtRadiatorInfo other) &; // Rebind this to other's internal object
0064   IrtRadiatorInfo& operator=(IrtRadiatorInfo other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
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   MutableIrtRadiatorInfo clone(bool cloneRelations=true) const;
0069 
0070   /// destructor
0071   ~IrtRadiatorInfo() = default;
0072 
0073   /// converting constructor from mutable object
0074   IrtRadiatorInfo(const MutableIrtRadiatorInfo& other);
0075 
0076   static IrtRadiatorInfo makeEmpty();
0077 
0078 public:
0079 
0080   static constexpr std::string_view typeName = "edm4eic::IrtRadiatorInfo";
0081 
0082   /// Access the Detected photoelectron count
0083   std::uint16_t getNpe() const;
0084 
0085   /// Access the Hit count associated with this radiator by IRT engine
0086   std::uint16_t getNhits() const;
0087 
0088   /// Access the Reconstructed Cherenkov angle
0089   float getAngle() const;
0090 
0091 
0092 
0093 
0094 
0095   /// check whether the object is actually available
0096   bool isAvailable() const;
0097   /// disconnect from IrtRadiatorInfoObj instance
0098   void unlink() { m_obj = podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj>{nullptr}; }
0099 
0100   bool operator==(const IrtRadiatorInfo& other) const { return m_obj == other.m_obj; }
0101   bool operator==(const MutableIrtRadiatorInfo& other) const;
0102 
0103   bool operator!=(const IrtRadiatorInfo& other) const { return !(*this == other); }
0104   bool operator!=(const MutableIrtRadiatorInfo& other) const { return !(*this == other); }
0105 
0106   // less comparison operator, so that objects can be e.g. stored in sets.
0107   bool operator<(const IrtRadiatorInfo& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0108 
0109   podio::ObjectID id() const { return getObjectID(); }
0110 
0111   const podio::ObjectID getObjectID() const;
0112 
0113   friend std::hash<IrtRadiatorInfo>;
0114 
0115   friend void swap(IrtRadiatorInfo& a, IrtRadiatorInfo& b) {
0116     using std::swap;
0117     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0118   }
0119 
0120 private:
0121   /// constructor from existing IrtRadiatorInfoObj
0122   explicit IrtRadiatorInfo(podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> obj);
0123   IrtRadiatorInfo(IrtRadiatorInfoObj* obj);
0124 
0125   podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> m_obj{new IrtRadiatorInfoObj{}, podio::utils::MarkOwned};
0126 };
0127 
0128 std::ostream& operator<<(std::ostream& o, const IrtRadiatorInfo& value);
0129 
0130 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0131 void to_json(nlohmann::json& j, const IrtRadiatorInfo& value);
0132 #endif
0133 
0134 
0135 } // namespace edm4eic
0136 
0137 
0138 
0139 template<>
0140 struct std::hash<edm4eic::IrtRadiatorInfo> {
0141   std::size_t operator()(const edm4eic::IrtRadiatorInfo& obj) const {
0142     return std::hash<edm4eic::IrtRadiatorInfoObj*>{}(obj.m_obj.get());
0143   }
0144 };
0145 
0146 
0147 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0148 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0149 // and https://github.com/AIDASoft/podio/issues/770
0150 #if defined(__clang__)
0151   #pragma clang diagnostic push
0152   #pragma clang diagnostic ignored "-Wunknown-warning-option"
0153   #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0154   #pragma clang diagnostic ignored "-Wdeprecated"
0155 constexpr std::string_view edm4eic::IrtRadiatorInfo::typeName;
0156   #pragma clang diagnostic pop
0157 #elif defined(__GNUC__)
0158   #pragma GCC diagnostic push
0159   #pragma GCC diagnostic ignored "-Wdeprecated"
0160 constexpr std::string_view edm4eic::IrtRadiatorInfo::typeName;
0161   #pragma GCC diagnostic pop
0162 #endif
0163 
0164 
0165 #endif