Geant4-11
pyG4ProcessTable.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// ====================================================================
27// pyG4ProcessTable.cc
28//
29// 2005 Q
30// ====================================================================
31#include <boost/python.hpp>
32class G4UImessenger;
33#include "G4ProcessTable.hh"
34
35using namespace boost::python;
36
37
38// ====================================================================
39// thin wrappers
40// ====================================================================
42
43// FindProcess
45 (const G4String&, const G4String&) const = &G4ProcessTable::FindProcess;
46
48 (const G4String&, const G4ParticleDefinition*) const
50
52 (const G4String&, const G4ProcessManager*) const
54
55// FindProcesses
56// raw vector pointer -> Python list conversion
58{
59 list procList;
60 G4ProcessVector* procVec= procTable-> FindProcesses();
61 G4int nproc= procVec-> size();
62 for(G4int i=0; i< nproc; i++) {
63 procList.append(&(*procVec)[i]);
64 }
65 return procList;
66}
67
69 const G4ProcessManager* procManager)
70{
71 list procList;
72 G4ProcessVector* procVec= procTable-> FindProcesses(procManager);
73 G4int nproc= procVec-> size();
74 for(G4int i=0; i< nproc; i++) {
75 procList.append(&(*procVec)[i]);
76 }
77 return procList;
78}
79
81 const G4String& pname)
82{
83 list procList;
84 G4ProcessVector* procVec= procTable-> FindProcesses(pname);
85 G4int nproc= procVec-> size();
86 for(G4int i=0; i< nproc; i++) {
87 procList.append(&(*procVec)[i]);
88 }
89 return procList;
90}
91
93 G4ProcessType ptype)
94{
95 list procList;
96 G4ProcessVector* procVec= procTable-> FindProcesses(ptype);
97 G4int nproc= procVec-> size();
98 for(G4int i=0; i< nproc; i++) {
99 procList.append(&(*procVec)[i]);
100 }
101 return procList;
102}
103
104// SetProcessActivation
107
109 (const G4String&, const G4String&, G4bool)
111
113 (const G4String&, const G4ParticleDefinition*, G4bool)
115
119
122
124 (G4ProcessType, const G4String&, G4bool)
126
130
134
135BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_DumpInfo, DumpInfo, 1, 2)
136
137}
138
139using namespace pyG4ProcessTable;
140
141// ====================================================================
142// module definition
143// ====================================================================
145{
146 class_<G4ProcessTable, boost::noncopyable>
147 ("G4ProcessTable", "process table", no_init)
148 // ---
149 .def("GetProcessTable", &G4ProcessTable::GetProcessTable,
150 return_value_policy<reference_existing_object>())
151 .staticmethod("GetProcessTable")
152 .def("Length", &G4ProcessTable::Length)
153 //.def("Insert", &G4ProcessTable::Insert) // protected
154 //.def("Remove", &G4ProcessTable::Remove) // protected
155 // ---
156 .def("FindProcess", f1_FindProcess,
157 return_value_policy<reference_existing_object>())
158 .def("FindProcess", f2_FindProcess,
159 return_value_policy<reference_existing_object>())
160 .def("FindProcess", f3_FindProcess,
161 return_value_policy<reference_existing_object>())
162 .def("FindProcess", f3_FindProcess,
163 return_value_policy<reference_existing_object>())
164 // ---
165 .def("FindProcesses", f1_FindProcesses)
166 .def("FindProcesses", f2_FindProcesses)
167 .def("FindProcesses", f3_FindProcesses)
168 .def("FindProcesses", f4_FindProcesses)
169 // ---
170 .def("SetProcessActivation", f1_SetProcessActivation)
171 .def("SetProcessActivation", f2_SetProcessActivation)
172 .def("SetProcessActivation", f3_SetProcessActivation)
173 .def("SetProcessActivation", f4_SetProcessActivation)
174 .def("SetProcessActivation", f5_SetProcessActivation)
175 .def("SetProcessActivation", f6_SetProcessActivation)
176 .def("SetProcessActivation", f7_SetProcessActivation)
177 .def("SetProcessActivation", f8_SetProcessActivation)
178 // ---
179 .def("GetNameList", &G4ProcessTable::GetNameList,
180 return_internal_reference<>())
181 .def("DumpInfo", &G4ProcessTable::DumpInfo, f_DumpInfo())
182 .def("SetVerboseLevel", &G4ProcessTable::SetVerboseLevel)
183 .def("GetVerboseLevel", &G4ProcessTable::GetVerboseLevel)
184 ;
185}
G4ProcessType
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
void DumpInfo(G4VProcess *process, const G4ParticleDefinition *particle=nullptr)
static G4ProcessTable * GetProcessTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
G4int Length() const
G4ProcNameVector * GetNameList()
G4int GetVerboseLevel() const
void SetProcessActivation(const G4String &processName, G4bool fActive)
void SetVerboseLevel(G4int value)
string pname
Definition: eplot.py:33
list f3_FindProcesses(G4ProcessTable *procTable, const G4String &pname)
G4VProcess *(G4ProcessTable::* f1_FindProcess)(const G4String &, const G4String &) const
void(G4ProcessTable::* f7_SetProcessActivation)(G4ProcessType, const G4ParticleDefinition *, G4bool)
list f1_FindProcesses(G4ProcessTable *procTable)
void(G4ProcessTable::* f2_SetProcessActivation)(const G4String &, const G4String &, G4bool)
list f2_FindProcesses(G4ProcessTable *procTable, const G4ProcessManager *procManager)
void(G4ProcessTable::* f1_SetProcessActivation)(const G4String &, G4bool)
void(G4ProcessTable::* f8_SetProcessActivation)(G4ProcessType, G4ProcessManager *, G4bool)
void(G4ProcessTable::* f5_SetProcessActivation)(G4ProcessType, G4bool)
G4VProcess *(G4ProcessTable::* f3_FindProcess)(const G4String &, const G4ProcessManager *) const
G4VProcess *(G4ProcessTable::* f2_FindProcess)(const G4String &, const G4ParticleDefinition *) const
void(G4ProcessTable::* f3_SetProcessActivation)(const G4String &, const G4ParticleDefinition *, G4bool)
void(G4ProcessTable::* f4_SetProcessActivation)(const G4String &, G4ProcessManager *, G4bool)
list f4_FindProcesses(G4ProcessTable *procTable, G4ProcessType ptype)
void(G4ProcessTable::* f6_SetProcessActivation)(G4ProcessType, const G4String &, G4bool)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ClearWaitingStack, ClearWaitingStack, 0, 1) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetNWaitingTrack
void export_G4ProcessTable()