File indexing completed on 2025-06-03 08:33:24
0001
0002
0003 #ifndef EDM4HEP_MutableGeneratorEventParameters_H
0004 #define EDM4HEP_MutableGeneratorEventParameters_H
0005
0006 #include "edm4hep/GeneratorEventParametersObj.h"
0007
0008 #include "edm4hep/GeneratorEventParameters.h"
0009
0010 #include "edm4hep/MCParticle.h"
0011 #include "podio/RelationRange.h"
0012 #include <vector>
0013
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015
0016 #include <cstdint>
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 edm4hep {
0028
0029
0030
0031
0032
0033 class MutableGeneratorEventParameters {
0034
0035 friend class GeneratorEventParametersCollection;
0036 friend class GeneratorEventParametersMutableCollectionIterator;
0037 friend class GeneratorEventParameters;
0038
0039 public:
0040 using object_type = GeneratorEventParameters;
0041 using collection_type = GeneratorEventParametersCollection;
0042
0043
0044 MutableGeneratorEventParameters();
0045
0046
0047 MutableGeneratorEventParameters(double eventScale, double alphaQED, double alphaQCD, int signalProcessId,
0048 double sqrts);
0049
0050
0051 MutableGeneratorEventParameters(const MutableGeneratorEventParameters& other) = default;
0052
0053
0054 MutableGeneratorEventParameters& operator=(MutableGeneratorEventParameters other);
0055
0056
0057
0058 MutableGeneratorEventParameters clone(bool cloneRelations = true) const;
0059
0060
0061 ~MutableGeneratorEventParameters() = default;
0062
0063 public:
0064
0065 double getEventScale() const;
0066
0067
0068 double getAlphaQED() const;
0069
0070
0071 double getAlphaQCD() const;
0072
0073
0074 int getSignalProcessId() const;
0075
0076
0077 double getSqrts() const;
0078
0079
0080 void setEventScale(double value);
0081
0082 double& getEventScale();
0083
0084 [[deprecated("use getEventScale instead")]] double& eventScale();
0085
0086
0087 void setAlphaQED(double value);
0088
0089 double& getAlphaQED();
0090
0091 [[deprecated("use getAlphaQED instead")]] double& alphaQED();
0092
0093
0094 void setAlphaQCD(double value);
0095
0096 double& getAlphaQCD();
0097
0098 [[deprecated("use getAlphaQCD instead")]] double& alphaQCD();
0099
0100
0101 void setSignalProcessId(int value);
0102
0103 int& getSignalProcessId();
0104
0105 [[deprecated("use getSignalProcessId instead")]] int& signalProcessId();
0106
0107
0108 void setSqrts(double value);
0109
0110 double& getSqrts();
0111
0112 [[deprecated("use getSqrts instead")]] double& sqrts();
0113
0114 void addToSignalVertex(const edm4hep::MCParticle&);
0115 std::size_t signalVertex_size() const;
0116 edm4hep::MCParticle getSignalVertex(std::size_t) const;
0117 std::vector<edm4hep::MCParticle>::const_iterator signalVertex_begin() const;
0118 std::vector<edm4hep::MCParticle>::const_iterator signalVertex_end() const;
0119 podio::RelationRange<edm4hep::MCParticle> getSignalVertex() const;
0120 void addToCrossSections(const double&);
0121 std::size_t crossSections_size() const;
0122 double getCrossSections(std::size_t) const;
0123 std::vector<double>::const_iterator crossSections_begin() const;
0124 std::vector<double>::const_iterator crossSections_end() const;
0125 podio::RelationRange<double> getCrossSections() const;
0126 void addToCrossSectionErrors(const double&);
0127 std::size_t crossSectionErrors_size() const;
0128 double getCrossSectionErrors(std::size_t) const;
0129 std::vector<double>::const_iterator crossSectionErrors_begin() const;
0130 std::vector<double>::const_iterator crossSectionErrors_end() const;
0131 podio::RelationRange<double> getCrossSectionErrors() const;
0132
0133
0134 bool isAvailable() const;
0135
0136 void unlink() {
0137 m_obj = podio::utils::MaybeSharedPtr<GeneratorEventParametersObj>{nullptr};
0138 }
0139
0140 bool operator==(const MutableGeneratorEventParameters& other) const {
0141 return m_obj == other.m_obj;
0142 }
0143 bool operator==(const GeneratorEventParameters& other) const;
0144
0145 bool operator!=(const MutableGeneratorEventParameters& other) const {
0146 return !(*this == other);
0147 }
0148 bool operator!=(const GeneratorEventParameters& other) const {
0149 return !(*this == other);
0150 }
0151
0152
0153 bool operator<(const MutableGeneratorEventParameters& other) const {
0154 return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0155 }
0156
0157 podio::ObjectID id() const {
0158 return getObjectID();
0159 }
0160
0161 const podio::ObjectID getObjectID() const;
0162
0163 friend void swap(MutableGeneratorEventParameters& a, MutableGeneratorEventParameters& b) {
0164 using std::swap;
0165 swap(a.m_obj, b.m_obj);
0166 }
0167
0168 private:
0169
0170 explicit MutableGeneratorEventParameters(podio::utils::MaybeSharedPtr<GeneratorEventParametersObj> obj);
0171
0172 podio::utils::MaybeSharedPtr<GeneratorEventParametersObj> m_obj{nullptr};
0173 };
0174
0175 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0176 void to_json(nlohmann::json& j, const MutableGeneratorEventParameters& value);
0177 #endif
0178
0179 }
0180
0181 #endif