Back to home page

EIC code displayed by LXR

 
 

    


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

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