OPAL (Object Oriented Parallel Accelerator Library)
2024.2
OPAL
PyOutputPlane.cpp
Go to the documentation of this file.
1
// Copyright (c) 2023, Chris Rogers
2
// All rights reserved
3
//
4
// This file is part of OPAL.
5
//
6
// OPAL is free software: you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation, either version 3 of the License, or
9
// (at your option) any later version.
10
//
11
// You should have received a copy of the GNU General Public License
12
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
13
//
14
15
#include "
PyOpal/PyCore/ExceptionTranslation.h
"
16
#include "
PyOpal/PyCore/Globals.h
"
17
#include "
PyOpal/PyCore/PyOpalObject.h
"
18
19
#include "
Elements/OpalOutputPlane.h
"
20
21
namespace
PyOpal
{
22
template
<>
23
std::vector<PyOpalObjectNS::AttributeDef>
24
PyOpalObjectNS::PyOpalObject<OpalOutputPlane>::attributes
= {
25
{
"CENTRE"
,
"centre"
,
""
,
PyOpalObjectNS::FLOAT_LIST
},
26
{
"NORMAL"
,
"normal"
,
""
,
PyOpalObjectNS::FLOAT_LIST
},
27
{
"XSTART"
,
"x_start"
,
""
,
PyOpalObjectNS::DOUBLE
},
28
{
"XEND"
,
"x_end"
,
""
,
PyOpalObjectNS::DOUBLE
},
29
{
"YSTART"
,
"y_start"
,
""
,
PyOpalObjectNS::DOUBLE
},
30
{
"YEND"
,
"y_end"
,
""
,
PyOpalObjectNS::DOUBLE
},
31
{
"PLACEMENT_STYLE"
,
"placement_style"
,
""
,
PyOpalObjectNS::PREDEFINED_STRING
},
32
{
"ALGORITHM"
,
"algorithm"
,
""
,
PyOpalObjectNS::PREDEFINED_STRING
},
33
{
"TOLERANCE"
,
"tolerance"
,
""
,
PyOpalObjectNS::DOUBLE
},
34
{
"REFERENCE_ALIGNMENT_PARTICLE"
,
"reference_alignment_particle"
,
""
,
35
PyOpalObjectNS::INT
},
36
{
"OUTFN"
,
"output_filename"
,
""
,
37
PyOpalObjectNS::STRING
},
// OUTFN comes from OpalElement (yes, all elements can have a
38
// filename!)
39
{
"VERBOSE"
,
"verbose_level"
,
""
,
PyOpalObjectNS::INT
},
40
{
"WIDTH"
,
"width"
,
""
,
PyOpalObjectNS::DOUBLE
},
41
{
"HEIGHT"
,
"height"
,
""
,
PyOpalObjectNS::DOUBLE
},
42
{
"RADIUS"
,
"radius"
,
""
,
PyOpalObjectNS::DOUBLE
}};
43
44
template
<>
45
std::string
PyOpalObjectNS::PyOpalObject<OpalOutputPlane>::classDocstring
=
46
"OutputPlane is used to generate output data based on particle tracks crossing a plane."
;
47
48
namespace
PyOutputPlane
{
49
50
const
char
*
module_docstring
=
"output_plane contains the OutputPlane class"
;
51
52
BOOST_PYTHON_MODULE
(output_plane) {
53
PyOpal::Globals::Initialise
();
54
ExceptionTranslation::registerExceptions
();
55
PyOpalObjectNS::PyOpalObject<OpalOutputPlane>
element;
56
auto
elementClass = element.
make_element_class
(
"OutputPlane"
);
57
}
58
59
}
// namespace PyOutputPlane
60
}
// namespace PyOpal
ExceptionTranslation.h
PyOpalObject.h
Globals.h
OpalOutputPlane.h
PyOpal
Definition
ExceptionTranslation.cpp:21
PyOpal::ExceptionTranslation::registerExceptions
void registerExceptions()
Definition
ExceptionTranslation.cpp:23
PyOpal::Globals::Initialise
void Initialise()
Definition
Globals.cpp:50
PyOpal::PyOpalObjectNS::FLOAT_LIST
@ FLOAT_LIST
Definition
PyOpalObject.h:81
PyOpal::PyOpalObjectNS::INT
@ INT
Definition
PyOpalObject.h:81
PyOpal::PyOpalObjectNS::PREDEFINED_STRING
@ PREDEFINED_STRING
Definition
PyOpalObject.h:80
PyOpal::PyOpalObjectNS::DOUBLE
@ DOUBLE
Definition
PyOpalObject.h:81
PyOpal::PyOpalObjectNS::STRING
@ STRING
Definition
PyOpalObject.h:80
PyOpal::PyOutputPlane
Definition
PyOutputPlane.cpp:48
PyOpal::PyOutputPlane::module_docstring
const char * module_docstring
Definition
PyOutputPlane.cpp:50
PyOpal::PyOutputPlane::BOOST_PYTHON_MODULE
BOOST_PYTHON_MODULE(output_plane)
Definition
PyOutputPlane.cpp:52
PyOpal::PyOpalObjectNS::PyOpalObject
Definition
PyOpalObject.h:138
PyOpal::PyOpalObjectNS::PyOpalObject::attributes
static std::vector< AttributeDef > attributes
Definition
PyOpalObject.h:293
PyOpal::PyOpalObjectNS::PyOpalObject::make_element_class
boost::python::class_< PyC > make_element_class(const char *className)
Definition
PyOpalObject.h:752
PyOpal::PyOpalObjectNS::PyOpalObject::classDocstring
static std::string classDocstring
Definition
PyOpalObject.h:295