Repository navigation
Expand file tree
/
Copy pathPhotonProductionBlock.python.cpp
More file actions
69 lines (54 loc) · 1.71 KB
/
Copy pathPhotonProductionBlock.python.cpp
File metadata and controls
69 lines (54 loc) · 1.71 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
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/PhotonProductionBlock.hpp"
#include "tools/views/views-python.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapPhotonProductionBlock( python::module& module, python::module& ) {
// type aliases
using Block = njoy::ACEtk::continuous::PhotonProductionBlock;
// wrap views created by this block
// create the block
python::class_< Block > block(
module,
"PhotonProductionBlock",
"The continuous energy GPD block with the total photon production cross section\n\n"
"The PhotonProductionBlock class contains the total photon production cross\n"
"section, given on the same energy grid as defined in the principal cross\n"
"section block. For older data files, this also contains the equiprobable\n"
"energy bins."
);
// wrap the block
block
.def(
python::init< std::vector< double > >(),
python::arg( "production" ),
"Initialise the block\n\n"
"Arguments:\n"
" self the block\n"
" production the total photon production cross section values"
)
.def_property_readonly(
"NES",
&Block::NES,
"The number of energy points"
)
.def_property_readonly(
"number_energy_points",
&Block::numberEnergyPoints,
"The number of energy points"
)
.def_property_readonly(
"total_production",
[] ( const Block& self ) -> DoubleRange
{ return self.totalProduction(); },
"The total photon production cross section values"
);
// add standard block definitions
addStandardBlockDefinitions< Block >( block );
}
} // continuous namespace