Repository navigation
Expand file tree
/
Copy pathDiscretePhotonDistribution.python.cpp
More file actions
105 lines (84 loc) · 2.52 KB
/
Copy pathDiscretePhotonDistribution.python.cpp
File metadata and controls
105 lines (84 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/DiscretePhotonDistribution.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapDiscretePhotonDistribution( python::module& module, python::module& ) {
// type aliases
using Block = njoy::ACEtk::continuous::DiscretePhotonDistribution;
// wrap views created by this block
// create the block
python::class_< Block > block(
module,
"DiscretePhotonDistribution",
"The DiscretePhotonDistribution class contains the photon energy if the\n"
"photon is a primary photon or the binding energy when the photon is not a\n"
"primary photon. It is used in the DLW block as ACE LAW 2."
);
// wrap the block
block
.def(
python::init< double, double, unsigned int, double >(),
python::arg( "emin" ), python::arg( "emax" ),
python::arg( "lp" ), python::arg( "energy" ),
"Initialise the block\n\n"
"Arguments:\n"
" self the block\n"
" emin the minimum energy for the distribution\n"
" emax the maximum energy for the distribution\n"
" lp the primary photon flag (0, 1 or 2)\n"
" energy the photon or binding energy"
)
.def_property_readonly(
"LAW",
[] ( const Block& self ) { return self.LAW(); },
"The distribution type"
)
.def_property_readonly(
"type",
[] ( const Block& self ) { return self.type(); },
"The distribution type"
)
.def_property_readonly(
"minimum_incident_energy",
&Block::minimumIncidentEnergy,
"The minimum incident energy for the distribution"
)
.def_property_readonly(
"maximum_incident_energy",
&Block::maximumIncidentEnergy,
"The maximum incident energy for the distribution"
)
.def_property_readonly(
"LP",
&Block::LP,
"The primary flag value (0, 1 or 2)"
)
.def_property_readonly(
"primary_photon_flag",
&Block::primaryPhotonFlag,
"The primary flag value (0, 1 or 2)"
)
.def_property_readonly(
"is_primary_photon",
&Block::isPrimaryPhoton,
"Indicates whether or not the photon is a primary photon"
)
.def_property_readonly(
"EG",
&Block::EG,
"The photon or binding energy"
)
.def_property_readonly(
"photon_or_binding_energy",
&Block::photonOrBindingEnergy,
"The photon or binding energy"
);
// add standard block definitions
addStandardBlockDefinitions< Block >( block );
}
} // continuous namespace