File indexing completed on 2025-06-03 08:33:23
0001
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 <vector>
0011
0012 #include "podio/detail/OrderKey.h"
0013 #include "podio/utilities/MaybeSharedPtr.h"
0014
0015 #include <cstdint>
0016 #include <ostream>
0017
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021
0022
0023 namespace edm4hep {
0024 class GeneratorEventParametersCollection;
0025 }
0026
0027 namespace podio::detail {
0028
0029 OrderKey getOrderKey(const edm4hep::GeneratorEventParameters& obj);
0030 };
0031
0032 namespace edm4hep {
0033
0034 class MutableGeneratorEventParameters;
0035 class GeneratorEventParametersCollection;
0036 class GeneratorEventParametersCollectionData;
0037
0038
0039
0040
0041
0042 class GeneratorEventParameters {
0043
0044 friend class MutableGeneratorEventParameters;
0045 friend class GeneratorEventParametersCollection;
0046 friend class edm4hep::GeneratorEventParametersCollectionData;
0047 friend class GeneratorEventParametersCollectionIterator;
0048 friend podio::detail::OrderKey podio::detail::getOrderKey(const GeneratorEventParameters& obj);
0049
0050 public:
0051 using mutable_type = MutableGeneratorEventParameters;
0052 using collection_type = GeneratorEventParametersCollection;
0053
0054
0055 GeneratorEventParameters();
0056
0057
0058 GeneratorEventParameters(double eventScale, double alphaQED, double alphaQCD, int signalProcessId, double sqrts);
0059
0060
0061 GeneratorEventParameters(const GeneratorEventParameters& other) = default;
0062
0063
0064 GeneratorEventParameters& operator=(GeneratorEventParameters other);
0065
0066
0067
0068 MutableGeneratorEventParameters clone(bool cloneRelations = true) const;
0069
0070
0071 ~GeneratorEventParameters() = default;
0072
0073
0074 GeneratorEventParameters(const MutableGeneratorEventParameters& other);
0075
0076 static GeneratorEventParameters makeEmpty();
0077
0078 public:
0079 static constexpr auto typeName = "edm4hep::GeneratorEventParameters";
0080
0081
0082 double getEventScale() const;
0083
0084
0085 double getAlphaQED() const;
0086
0087
0088 double getAlphaQCD() const;
0089
0090
0091 int getSignalProcessId() const;
0092
0093
0094 double getSqrts() const;
0095
0096 std::size_t signalVertex_size() const;
0097 edm4hep::MCParticle getSignalVertex(std::size_t) const;
0098 std::vector<edm4hep::MCParticle>::const_iterator signalVertex_begin() const;
0099 std::vector<edm4hep::MCParticle>::const_iterator signalVertex_end() const;
0100 podio::RelationRange<edm4hep::MCParticle> getSignalVertex() const;
0101 std::size_t crossSections_size() const;
0102 double getCrossSections(std::size_t) const;
0103 std::vector<double>::const_iterator crossSections_begin() const;
0104 std::vector<double>::const_iterator crossSections_end() const;
0105 podio::RelationRange<double> getCrossSections() const;
0106 std::size_t crossSectionErrors_size() const;
0107 double getCrossSectionErrors(std::size_t) const;
0108 std::vector<double>::const_iterator crossSectionErrors_begin() const;
0109 std::vector<double>::const_iterator crossSectionErrors_end() const;
0110 podio::RelationRange<double> getCrossSectionErrors() const;
0111
0112
0113 bool isAvailable() const;
0114
0115 void unlink() {
0116 m_obj = podio::utils::MaybeSharedPtr<GeneratorEventParametersObj>{nullptr};
0117 }
0118
0119 bool operator==(const GeneratorEventParameters& other) const {
0120 return m_obj == other.m_obj;
0121 }
0122 bool operator==(const MutableGeneratorEventParameters& other) const;
0123
0124 bool operator!=(const GeneratorEventParameters& other) const {
0125 return !(*this == other);
0126 }
0127 bool operator!=(const MutableGeneratorEventParameters& other) const {
0128 return !(*this == other);
0129 }
0130
0131
0132 bool operator<(const GeneratorEventParameters& other) const {
0133 return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0134 }
0135
0136 podio::ObjectID id() const {
0137 return getObjectID();
0138 }
0139
0140 const podio::ObjectID getObjectID() const;
0141
0142 friend void swap(GeneratorEventParameters& a, GeneratorEventParameters& b) {
0143 using std::swap;
0144 swap(a.m_obj, b.m_obj);
0145 }
0146
0147 private:
0148
0149 explicit GeneratorEventParameters(podio::utils::MaybeSharedPtr<GeneratorEventParametersObj> obj);
0150 GeneratorEventParameters(GeneratorEventParametersObj* obj);
0151
0152 podio::utils::MaybeSharedPtr<GeneratorEventParametersObj> m_obj{nullptr};
0153 };
0154
0155 std::ostream& operator<<(std::ostream& o, const GeneratorEventParameters& value);
0156
0157 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0158 void to_json(nlohmann::json& j, const GeneratorEventParameters& value);
0159 #endif
0160
0161 }
0162
0163 #endif