Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-03 08:33:23

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_GeneratorPdfInfo_H
0004 #define EDM4HEP_GeneratorPdfInfo_H
0005 
0006 #include "edm4hep/GeneratorPdfInfoObj.h"
0007 
0008 #include <array>
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 GeneratorPdfInfoCollection;
0023 }
0024 
0025 namespace podio::detail {
0026 // Internal function used in less comparison operators of the datatypes and interface types
0027 OrderKey getOrderKey(const edm4hep::GeneratorPdfInfo& obj);
0028 }; // namespace podio::detail
0029 
0030 namespace edm4hep {
0031 
0032 class MutableGeneratorPdfInfo;
0033 class GeneratorPdfInfoCollection;
0034 class GeneratorPdfInfoCollectionData;
0035 
0036 /** @class GeneratorPdfInfo
0037  *  Generator pdf information
0038  *  @author: EDM4hep authors
0039  */
0040 class GeneratorPdfInfo {
0041 
0042   friend class MutableGeneratorPdfInfo;
0043   friend class GeneratorPdfInfoCollection;
0044   friend class edm4hep::GeneratorPdfInfoCollectionData;
0045   friend class GeneratorPdfInfoCollectionIterator;
0046   friend podio::detail::OrderKey podio::detail::getOrderKey(const GeneratorPdfInfo& obj);
0047 
0048 public:
0049   using mutable_type = MutableGeneratorPdfInfo;
0050   using collection_type = GeneratorPdfInfoCollection;
0051 
0052   /// default constructor
0053   GeneratorPdfInfo();
0054 
0055   /// Constructor initializing all members
0056   GeneratorPdfInfo(std::array<int, 2> partonId, std::array<int, 2> lhapdfId, std::array<double, 2> x,
0057                    std::array<double, 2> xf, double scale);
0058 
0059   /// copy constructor
0060   GeneratorPdfInfo(const GeneratorPdfInfo& other) = default;
0061 
0062   /// copy-assignment operator
0063   GeneratorPdfInfo& operator=(GeneratorPdfInfo other);
0064 
0065   /// create a mutable deep-copy of the object with identical relations
0066   /// if cloneRelations=false, the relations are not cloned and will be empty
0067   MutableGeneratorPdfInfo clone(bool cloneRelations = true) const;
0068 
0069   /// destructor
0070   ~GeneratorPdfInfo() = default;
0071 
0072   /// converting constructor from mutable object
0073   GeneratorPdfInfo(const MutableGeneratorPdfInfo& other);
0074 
0075   static GeneratorPdfInfo makeEmpty();
0076 
0077 public:
0078   static constexpr auto typeName = "edm4hep::GeneratorPdfInfo";
0079 
0080   /// Access the Parton PDG id
0081   const std::array<int, 2>& getPartonId() const;
0082   /// Access item i of the Parton PDG id
0083   int getPartonId(size_t i) const;
0084   /// Access the LHAPDF PDF id (see https://lhapdf.hepforge.org/pdfsets.html)
0085   const std::array<int, 2>& getLhapdfId() const;
0086   /// Access item i of the LHAPDF PDF id (see https://lhapdf.hepforge.org/pdfsets.html)
0087   int getLhapdfId(size_t i) const;
0088   /// Access the Parton momentum fraction
0089   const std::array<double, 2>& getX() const;
0090   /// Access item i of the Parton momentum fraction
0091   double getX(size_t i) const;
0092   /// Access the PDF value
0093   const std::array<double, 2>& getXf() const;
0094   /// Access item i of the PDF value
0095   double getXf(size_t i) const;
0096   /// Access the Factorisation scale [GeV]
0097   double getScale() const;
0098 
0099   /// check whether the object is actually available
0100   bool isAvailable() const;
0101   /// disconnect from GeneratorPdfInfoObj instance
0102   void unlink() {
0103     m_obj = podio::utils::MaybeSharedPtr<GeneratorPdfInfoObj>{nullptr};
0104   }
0105 
0106   bool operator==(const GeneratorPdfInfo& other) const {
0107     return m_obj == other.m_obj;
0108   }
0109   bool operator==(const MutableGeneratorPdfInfo& other) const;
0110 
0111   bool operator!=(const GeneratorPdfInfo& other) const {
0112     return !(*this == other);
0113   }
0114   bool operator!=(const MutableGeneratorPdfInfo& other) const {
0115     return !(*this == other);
0116   }
0117 
0118   // less comparison operator, so that objects can be e.g. stored in sets.
0119   bool operator<(const GeneratorPdfInfo& other) const {
0120     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0121   }
0122 
0123   podio::ObjectID id() const {
0124     return getObjectID();
0125   }
0126 
0127   const podio::ObjectID getObjectID() const;
0128 
0129   friend void swap(GeneratorPdfInfo& a, GeneratorPdfInfo& b) {
0130     using std::swap;
0131     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0132   }
0133 
0134 private:
0135   /// constructor from existing GeneratorPdfInfoObj
0136   explicit GeneratorPdfInfo(podio::utils::MaybeSharedPtr<GeneratorPdfInfoObj> obj);
0137   GeneratorPdfInfo(GeneratorPdfInfoObj* obj);
0138 
0139   podio::utils::MaybeSharedPtr<GeneratorPdfInfoObj> m_obj{nullptr};
0140 };
0141 
0142 std::ostream& operator<<(std::ostream& o, const GeneratorPdfInfo& value);
0143 
0144 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0145 void to_json(nlohmann::json& j, const GeneratorPdfInfo& value);
0146 #endif
0147 
0148 } // namespace edm4hep
0149 
0150 #endif