Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/edm4hep/MutableGeneratorEventParameters.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_MutableGeneratorEventParameters_H
0004 #define EDM4HEP_MutableGeneratorEventParameters_H
0005 
0006 #include "edm4hep/GeneratorEventParametersObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/GeneratorEventParameters.h"
0009 
0010 #include "edm4hep/MCParticle.h"
0011 #include "podio/RelationRange.h"
0012 #include <array>
0013 #include <vector>
0014 
0015 #include "podio/utilities/MaybeSharedPtr.h"
0016 
0017 #include <cstdint>
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 edm4hep {
0029 
0030 /** @class MutableGeneratorEventParameters
0031  *  Generator Event Parameters and information
0032  *  @author: EDM4hep authors
0033  */
0034 class MutableGeneratorEventParameters {
0035 
0036   friend class GeneratorEventParametersCollection;
0037   friend class GeneratorEventParametersMutableCollectionIterator;
0038   friend class GeneratorEventParameters;
0039 
0040 public:
0041   using object_type = GeneratorEventParameters;
0042   using collection_type = GeneratorEventParametersCollection;
0043 
0044   /// default constructor
0045   MutableGeneratorEventParameters() = default;
0046 
0047   /// Constructor initializing all members
0048   MutableGeneratorEventParameters(const double sqrts, const std::array<double, 2>& beamsPz,
0049                                   const std::array<int, 2>& partonIds, const std::array<float, 2>& beamPolarizations);
0050 
0051   /// copy constructor
0052   MutableGeneratorEventParameters(const MutableGeneratorEventParameters& other) = default;
0053 
0054   /// copy-assignment operator
0055   MutableGeneratorEventParameters&
0056   operator=(MutableGeneratorEventParameters other) &; // Rebind this to other's internal object
0057   MutableGeneratorEventParameters& operator=(MutableGeneratorEventParameters other) && =
0058       delete; // Prevent rebinding temporary as the changes wouldn't persist
0059 
0060   /// create a mutable deep-copy of the object with identical relations
0061   /// if cloneRelations=false, the relations are not cloned and will be empty
0062   MutableGeneratorEventParameters clone(bool cloneRelations = true) const;
0063 
0064   /// destructor
0065   ~MutableGeneratorEventParameters() = default;
0066 
0067 public:
0068   /// Access the sqrt(s) - The nominal beam center of mass energy [GeV]
0069   double getSqrts() const;
0070 
0071   /// Access the nominal z-momentum of the two incoming particle (beams) [GeV]
0072   const std::array<double, 2>& getBeamsPz() const;
0073   /// Access item i of the nominal z-momentum of the two incoming particle (beams) [GeV]
0074   double getBeamsPz(size_t i) const;
0075   /// Access the PDG id of the partons undergoing the hard scatter
0076   const std::array<int, 2>& getPartonIds() const;
0077   /// Access item i of the PDG id of the partons undergoing the hard scatter
0078   int getPartonIds(size_t i) const;
0079   /// Access the Polarization of the incoming beam particles
0080   const std::array<float, 2>& getBeamPolarizations() const;
0081   /// Access item i of the Polarization of the incoming beam particles
0082   float getBeamPolarizations(size_t i) const;
0083 
0084   /// Set the sqrt(s) - The nominal beam center of mass energy [GeV]
0085   void setSqrts(const double sqrts);
0086   /// Get mutable reference to sqrt(s) - The nominal beam center of mass energy [GeV]
0087   double& getSqrts();
0088   /// Get reference to sqrt(s) - The nominal beam center of mass energy [GeV]
0089   [[deprecated("use getSqrts instead")]] double& sqrts();
0090 
0091   /// Set the nominal z-momentum of the two incoming particle (beams) [GeV]
0092   void setBeamsPz(const std::array<double, 2>& beamsPz);
0093   void setBeamsPz(size_t i, double value);
0094   /// Get mutable reference to nominal z-momentum of the two incoming particle (beams) [GeV]
0095   std::array<double, 2>& getBeamsPz();
0096   /// Get reference to nominal z-momentum of the two incoming particle (beams) [GeV]
0097   [[deprecated("use getBeamsPz instead")]] std::array<double, 2>& beamsPz();
0098 
0099   /// Set the PDG id of the partons undergoing the hard scatter
0100   void setPartonIds(const std::array<int, 2>& partonIds);
0101   void setPartonIds(size_t i, int value);
0102   /// Get mutable reference to PDG id of the partons undergoing the hard scatter
0103   std::array<int, 2>& getPartonIds();
0104   /// Get reference to PDG id of the partons undergoing the hard scatter
0105   [[deprecated("use getPartonIds instead")]] std::array<int, 2>& partonIds();
0106 
0107   /// Set the Polarization of the incoming beam particles
0108   void setBeamPolarizations(const std::array<float, 2>& beamPolarizations);
0109   void setBeamPolarizations(size_t i, float value);
0110   /// Get mutable reference to Polarization of the incoming beam particles
0111   std::array<float, 2>& getBeamPolarizations();
0112   /// Get reference to Polarization of the incoming beam particles
0113   [[deprecated("use getBeamPolarizations instead")]] std::array<float, 2>& beamPolarizations();
0114 
0115   void addToSignalVertexParticles(const edm4hep::MCParticle&);
0116   std::size_t signalVertexParticles_size() const;
0117   edm4hep::MCParticle getSignalVertexParticles(std::size_t) const;
0118   std::vector<edm4hep::MCParticle>::const_iterator signalVertexParticles_begin() const;
0119   std::vector<edm4hep::MCParticle>::const_iterator signalVertexParticles_end() const;
0120   podio::RelationRange<edm4hep::MCParticle> getSignalVertexParticles() const;
0121   void addToCrossSections(const double&);
0122   std::size_t crossSections_size() const;
0123   double getCrossSections(std::size_t) const;
0124   std::vector<double>::const_iterator crossSections_begin() const;
0125   std::vector<double>::const_iterator crossSections_end() const;
0126   podio::RelationRange<double> getCrossSections() const;
0127   void addToCrossSectionErrors(const double&);
0128   std::size_t crossSectionErrors_size() const;
0129   double getCrossSectionErrors(std::size_t) const;
0130   std::vector<double>::const_iterator crossSectionErrors_begin() const;
0131   std::vector<double>::const_iterator crossSectionErrors_end() const;
0132   podio::RelationRange<double> getCrossSectionErrors() const;
0133   void addToWeights(const double&);
0134   std::size_t weights_size() const;
0135   double getWeights(std::size_t) const;
0136   std::vector<double>::const_iterator weights_begin() const;
0137   std::vector<double>::const_iterator weights_end() const;
0138   podio::RelationRange<double> getWeights() const;
0139 
0140   /// check whether the object is actually available
0141   bool isAvailable() const;
0142   /// disconnect from GeneratorEventParametersObj instance
0143   void unlink() { m_obj = podio::utils::MaybeSharedPtr<GeneratorEventParametersObj>{nullptr}; }
0144 
0145   bool operator==(const MutableGeneratorEventParameters& other) const { return m_obj == other.m_obj; }
0146   bool operator==(const GeneratorEventParameters& other) const;
0147 
0148   bool operator!=(const MutableGeneratorEventParameters& other) const { return !(*this == other); }
0149   bool operator!=(const GeneratorEventParameters& other) const { return !(*this == other); }
0150 
0151   // less comparison operator, so that objects can be e.g. stored in sets.
0152   bool operator<(const MutableGeneratorEventParameters& other) const {
0153     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0154   }
0155 
0156   podio::ObjectID id() const { return getObjectID(); }
0157 
0158   const podio::ObjectID getObjectID() const;
0159 
0160   friend std::hash<MutableGeneratorEventParameters>;
0161 
0162   friend void swap(MutableGeneratorEventParameters& a, MutableGeneratorEventParameters& b) {
0163     using std::swap;
0164     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0165   }
0166 
0167 private:
0168   /// constructor from existing GeneratorEventParametersObj
0169   explicit MutableGeneratorEventParameters(podio::utils::MaybeSharedPtr<GeneratorEventParametersObj> obj);
0170 
0171   podio::utils::MaybeSharedPtr<GeneratorEventParametersObj> m_obj{new GeneratorEventParametersObj{},
0172                                                                   podio::utils::MarkOwned};
0173 };
0174 
0175 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0176 void to_json(nlohmann::json& j, const MutableGeneratorEventParameters& value);
0177 #endif
0178 
0179 } // namespace edm4hep
0180 
0181 template <>
0182 struct std::hash<edm4hep::MutableGeneratorEventParameters> {
0183   std::size_t operator()(const edm4hep::MutableGeneratorEventParameters& obj) const {
0184     return std::hash<edm4hep::GeneratorEventParametersObj*>{}(obj.m_obj.get());
0185   }
0186 };
0187 
0188 #endif