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
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
0024 namespace edm4hep {
0025 class GeneratorEventParametersCollection;
0026 }
0027
0028 namespace podio::detail {
0029
0030 OrderKey getOrderKey(const edm4hep::GeneratorEventParameters& obj);
0031 };
0032
0033 namespace edm4hep {
0034
0035 class MutableGeneratorEventParameters;
0036 class GeneratorEventParametersCollection;
0037 class GeneratorEventParametersCollectionData;
0038
0039
0040
0041
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
0056 GeneratorEventParameters() = default;
0057
0058
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
0063 GeneratorEventParameters(const GeneratorEventParameters& other) = default;
0064
0065
0066 GeneratorEventParameters& operator=(GeneratorEventParameters other) &;
0067 GeneratorEventParameters&
0068 operator=(GeneratorEventParameters other) && = delete;
0069
0070
0071
0072 MutableGeneratorEventParameters clone(bool cloneRelations = true) const;
0073
0074
0075 ~GeneratorEventParameters() = default;
0076
0077
0078 GeneratorEventParameters(const MutableGeneratorEventParameters& other);
0079
0080 static GeneratorEventParameters makeEmpty();
0081
0082 public:
0083 static constexpr std::string_view typeName = "edm4hep::GeneratorEventParameters";
0084
0085
0086 double getSqrts() const;
0087
0088
0089 const std::array<double, 2>& getBeamsPz() const;
0090
0091 double getBeamsPz(size_t i) const;
0092
0093 const std::array<int, 2>& getPartonIds() const;
0094
0095 int getPartonIds(size_t i) const;
0096
0097 const std::array<float, 2>& getBeamPolarizations() const;
0098
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
0123 bool isAvailable() const;
0124
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
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);
0147 }
0148
0149 private:
0150
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 }
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
0174
0175
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