|
| 1 | +// system includes |
| 2 | +#include <pybind11/pybind11.h> |
| 3 | +#include <pybind11/stl.h> |
| 4 | + |
| 5 | +// local includes |
| 6 | +#include "definitions.hpp" |
| 7 | +#include "dryad/resonances/ParticlePair.hpp" |
| 8 | + |
| 9 | +// namespace aliases |
| 10 | +namespace python = pybind11; |
| 11 | + |
| 12 | +namespace resonances { |
| 13 | + |
| 14 | +void wrapParticlePair( python::module& module ) { |
| 15 | + |
| 16 | + // type aliases |
| 17 | + using Component = njoy::dryad::resonances::ParticlePair; |
| 18 | + using Particle = njoy::dryad::resonances::Particle; |
| 19 | + |
| 20 | + // wrap views created by this component |
| 21 | + |
| 22 | + // create the component |
| 23 | + python::class_< Component > component( |
| 24 | + |
| 25 | + module, |
| 26 | + "ParticlePair", |
| 27 | + "Particle information for resonance reconstruction\n\n" |
| 28 | + "A ParticlePair represents the two particles involved in a entrance or exit\n" |
| 29 | + "reaction channel (we assume that the reaction is a two-body reaction). The\n" |
| 30 | + "pair consists of a \"small\" incident or outgoing particle (e.g. a neutron,\n" |
| 31 | + "photon, alpha, etc.) and a \"larger\" target or residual nucleus (e.g. H1,\n" |
| 32 | + "He4, U235, etc.).\n\n" |
| 33 | + "The ParticlePair class gives us access to information related to the\n" |
| 34 | + "pair of particles such as the mass ratio and the reduced mass." |
| 35 | + ); |
| 36 | + |
| 37 | + // wrap the component |
| 38 | + component |
| 39 | + .def( |
| 40 | + |
| 41 | + python::init< Particle, Particle >(), |
| 42 | + python::arg( "particle" ), python::arg( "residual" ), |
| 43 | + "Initialise the particle pair information\n\n" |
| 44 | + "Arguments:\n" |
| 45 | + " self the particle pair information\n" |
| 46 | + " particle the light particle\n" |
| 47 | + " residual the heavy residual" |
| 48 | + ) |
| 49 | + .def( |
| 50 | + |
| 51 | + python::init< const Component& >(), |
| 52 | + python::arg( "instance" ), |
| 53 | + "Initialise a copy\n\n" |
| 54 | + "Arguments:\n" |
| 55 | + " instance the instance to be copied\n" |
| 56 | + ) |
| 57 | + .def_property_readonly( |
| 58 | + |
| 59 | + "particle", |
| 60 | + &Component::particle, |
| 61 | + "The light particle in the particle pair" |
| 62 | + ) |
| 63 | + .def_property_readonly( |
| 64 | + |
| 65 | + "residual", |
| 66 | + &Component::residual, |
| 67 | + "The heavy residual in the particle pair" |
| 68 | + ) |
| 69 | + .def_property_readonly( |
| 70 | + |
| 71 | + "reduced_mass", |
| 72 | + &Component::reducedMass, |
| 73 | + "The reduced mass of the particle pair (in atomic mass units)\n\n" |
| 74 | + "The reduced mass mu of the two particles is defined as follows:\n" |
| 75 | + " mu = ma * mb / ( ma + mb )\n" |
| 76 | + "in which ma and mb are the atomic mass values of the particles in the\n" |
| 77 | + "particle pair." |
| 78 | + ) |
| 79 | + .def_property_readonly( |
| 80 | + |
| 81 | + "mass_ratio", |
| 82 | + &Component::massRatio, |
| 83 | + "The mass ratio of the particle pair (dimensionless)\n\n" |
| 84 | + "The mass ratio of the two particles is defined as follows:\n" |
| 85 | + " ratio = mb / ( ma + mb )\n" |
| 86 | + "in which ma and mb are the atomic mass values of the particles\n" |
| 87 | + "in the particle pair." |
| 88 | + ); |
| 89 | + |
| 90 | + // add standard comparison definitions |
| 91 | + addStandardEqualityComparisonDefinitions< Component >( component ); |
| 92 | +} |
| 93 | + |
| 94 | +} // resonances namespace |
0 commit comments