Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/edm4hep/GeneratorEventParameters.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_GeneratorEventParameters_H
0004 #define EDM4HEP_GeneratorEventParameters_H
0005 
0006 #include "edm4hep/GeneratorEventParametersObj.h"
0007 
0008 #include "edm4hep/MCParticle.h"
0009 #include "podio/RelationRange.h"
0010 #include <array>
0011 #include <vector>
0012 
0013 #include "podio/detail/OrderKey.h"
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
0016 #include <cstdint>
0017 #include <ostream>
0018 
0019 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0020 #include "nlohmann/json_fwd.hpp"
0021 #endif
0022 
0023 // forward declarations
0024 namespace edm4hep {
0025 class GeneratorEventParametersCollection;
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::GeneratorEventParameters& obj);
0031 }; // namespace podio::detail
0032 
0033 namespace edm4hep {
0034 
0035 class MutableGeneratorEventParameters;
0036 class GeneratorEventParametersCollection;
0037 class GeneratorEventParametersCollectionData;
0038 
0039 /** @class GeneratorEventParameters
0040  *  Generator Event Parameters and information
0041  *  @author: EDM4hep authors
0042  */
0043 class GeneratorEventParameters {
0044 
0045   friend class MutableGeneratorEventParameters;
0046   friend class GeneratorEventParametersCollection;
0047   friend class edm4hep::GeneratorEventParametersCollectionData;
0048   friend class GeneratorEventParametersCollectionIterator;
0049   friend podio::detail::OrderKey podio::detail::getOrderKey(const GeneratorEventParameters& obj);
0050 
0051 public:
0052   using mutable_type = MutableGeneratorEventParameters;
0053   using collection_type = GeneratorEventParametersCollection;
0054 
0055   /// default constructor
0056   GeneratorEventParameters() = default;
0057 
0058   /// Constructor initializing all members
0059   GeneratorEventParameters(const double sqrts, const std::array<double, 2>& beamsPz,
0060                            const std::array<int, 2>& partonIds, const std::array<float, 2>& beamPolarizations);
0061 
0062   /// copy constructor
0063   GeneratorEventParameters(const GeneratorEventParameters& other) = default;
0064 
0065   /// copy-assignment operator
0066   GeneratorEventParameters& operator=(GeneratorEventParameters other) &; // Rebind this to other's internal object
0067   GeneratorEventParameters&
0068   operator=(GeneratorEventParameters other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0069 
0070   /// create a mutable deep-copy of the object with identical relations
0071   /// if cloneRelations=false, the relations are not cloned and will be empty
0072   MutableGeneratorEventParameters clone(bool cloneRelations = true) const;
0073 
0074   /// destructor
0075   ~GeneratorEventParameters() = default;
0076 
0077   /// converting constructor from mutable object
0078   GeneratorEventParameters(const MutableGeneratorEventParameters& other);
0079 
0080   static GeneratorEventParameters makeEmpty();
0081 
0082 public:
0083   static constexpr std::string_view typeName = "edm4hep::GeneratorEventParameters";
0084 
0085   /// Access the sqrt(s) - The nominal beam center of mass energy [GeV]
0086   double getSqrts() const;
0087 
0088   /// Access the nominal z-momentum of the two incoming particle (beams) [GeV]
0089   const std::array<double, 2>& getBeamsPz() const;
0090   /// Access item i of the nominal z-momentum of the two incoming particle (beams) [GeV]
0091   double getBeamsPz(size_t i) const;
0092   /// Access the PDG id of the partons undergoing the hard scatter
0093   const std::array<int, 2>& getPartonIds() const;
0094   /// Access item i of the PDG id of the partons undergoing the hard scatter
0095   int getPartonIds(size_t i) const;
0096   /// Access the Polarization of the incoming beam particles
0097   const std::array<float, 2>& getBeamPolarizations() const;
0098   /// Access item i of the Polarization of the incoming beam particles
0099   float getBeamPolarizations(size_t i) const;
0100 
0101   std::size_t signalVertexParticles_size() const;
0102   edm4hep::MCParticle getSignalVertexParticles(std::size_t) const;
0103   std::vector<edm4hep::MCParticle>::const_iterator signalVertexParticles_begin() const;
0104   std::vector<edm4hep::MCParticle>::const_iterator signalVertexParticles_end() const;
0105   podio::RelationRange<edm4hep::MCParticle> getSignalVertexParticles() const;
0106   std::size_t crossSections_size() const;
0107   double getCrossSections(std::size_t) const;
0108   std::vector<double>::const_iterator crossSections_begin() const;
0109   std::vector<double>::const_iterator crossSections_end() const;
0110   podio::RelationRange<double> getCrossSections() const;
0111   std::size_t crossSectionErrors_size() const;
0112   double getCrossSectionErrors(std::size_t) const;
0113   std::vector<double>::const_iterator crossSectionErrors_begin() const;
0114   std::vector<double>::const_iterator crossSectionErrors_end() const;
0115   podio::RelationRange<double> getCrossSectionErrors() const;
0116   std::size_t weights_size() const;
0117   double getWeights(std::size_t) const;
0118   std::vector<double>::const_iterator weights_begin() const;
0119   std::vector<double>::const_iterator weights_end() const;
0120   podio::RelationRange<double> getWeights() const;
0121 
0122   /// check whether the object is actually available
0123   bool isAvailable() const;
0124   /// disconnect from GeneratorEventParametersObj instance
0125   void unlink() { m_obj = podio::utils::MaybeSharedPtr<GeneratorEventParametersObj>{nullptr}; }
0126 
0127   bool operator==(const GeneratorEventParameters& other) const { return m_obj == other.m_obj; }
0128   bool operator==(const MutableGeneratorEventParameters& other) const;
0129 
0130   bool operator!=(const GeneratorEventParameters& other) const { return !(*this == other); }
0131   bool operator!=(const MutableGeneratorEventParameters& other) const { return !(*this == other); }
0132 
0133   // less comparison operator, so that objects can be e.g. stored in sets.
0134   bool operator<(const GeneratorEventParameters& other) const {
0135     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0136   }
0137 
0138   podio::ObjectID id() const { return getObjectID(); }
0139 
0140   const podio::ObjectID getObjectID() const;
0141 
0142   friend std::hash<GeneratorEventParameters>;
0143 
0144   friend void swap(GeneratorEventParameters& a, GeneratorEventParameters& b) {
0145     using std::swap;
0146     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0147   }
0148 
0149 private:
0150   /// constructor from existing GeneratorEventParametersObj
0151   explicit GeneratorEventParameters(podio::utils::MaybeSharedPtr<GeneratorEventParametersObj> obj);
0152   GeneratorEventParameters(GeneratorEventParametersObj* obj);
0153 
0154   podio::utils::MaybeSharedPtr<GeneratorEventParametersObj> m_obj{new GeneratorEventParametersObj{},
0155                                                                   podio::utils::MarkOwned};
0156 };
0157 
0158 std::ostream& operator<<(std::ostream& o, const GeneratorEventParameters& value);
0159 
0160 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0161 void to_json(nlohmann::json& j, const GeneratorEventParameters& value);
0162 #endif
0163 
0164 } // namespace edm4hep
0165 
0166 template <>
0167 struct std::hash<edm4hep::GeneratorEventParameters> {
0168   std::size_t operator()(const edm4hep::GeneratorEventParameters& obj) const {
0169     return std::hash<edm4hep::GeneratorEventParametersObj*>{}(obj.m_obj.get());
0170   }
0171 };
0172 
0173 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0174 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0175 // and https://github.com/AIDASoft/podio/issues/770
0176 #if defined(__clang__)
0177 #pragma clang diagnostic push
0178 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0179 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0180 #pragma clang diagnostic ignored "-Wdeprecated"
0181 constexpr std::string_view edm4hep::GeneratorEventParameters::typeName;
0182 #pragma clang diagnostic pop
0183 #elif defined(__GNUC__)
0184 #pragma GCC diagnostic push
0185 #pragma GCC diagnostic ignored "-Wdeprecated"
0186 constexpr std::string_view edm4hep::GeneratorEventParameters::typeName;
0187 #pragma GCC diagnostic pop
0188 #endif
0189 
0190 #endif