Geant4_10
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 // $Id: pyG4ProcessTable.cc 76884 2013-11-18 12:54:03Z gcosmo $
27 // ====================================================================
28 // pyG4ProcessTable.cc
29 //
30 // 2005 Q
31 // ====================================================================
32 #include <boost/python.hpp>
33 class G4UImessenger;
34 #include "G4ProcessTable.hh"
35 
36 using namespace boost::python;
37 
38 // ====================================================================
39 // thin wrappers
40 // ====================================================================
41 namespace pyG4ProcessTable {
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 
112 void(G4ProcessTable::*f3_SetProcessActivation)
115 
116 void(G4ProcessTable::*f4_SetProcessActivation)
117  (const G4String&, G4ProcessManager*, G4bool)
119 
120 void(G4ProcessTable::*f5_SetProcessActivation)
122 
123 void(G4ProcessTable::*f6_SetProcessActivation)
124  (G4ProcessType, const G4String&, G4bool)
126 
127 void(G4ProcessTable::*f7_SetProcessActivation)
130 
131 void(G4ProcessTable::*f8_SetProcessActivation)
134 
135 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_DumpInfo, DumpInfo, 1, 2)
136 
137 }
138 
139 using namespace pyG4ProcessTable;
140 
141 // ====================================================================
142 // module definition
143 // ====================================================================
145 {
146  class_<G4ProcessTable, G4ProcessTable*, boost::noncopyable>
147  ("G4ProcessTable", "process table")
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 }
G4VProcess *(G4ProcessTable::* f2_FindProcess)(const G4String &, const G4ParticleDefinition *) const
void DumpInfo(G4VProcess *process, G4ParticleDefinition *particle=0)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateTubeVolume, CreateTubeVolume, 4, 6) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateConeVolume
void export_G4ProcessTable()
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData
int G4int
Definition: G4Types.hh:78
void SetProcessActivation(const G4String &processName, G4bool fActive)
list f4_FindProcesses(G4ProcessTable *procTable, G4ProcessType ptype)
G4VProcess *(G4ProcessManager::* f1_SetProcessActivation)(G4VProcess *, G4bool)
void SetVerboseLevel(G4int value)
bool G4bool
Definition: G4Types.hh:79
list f1_FindProcesses(G4ProcessTable *procTable)
string pname
Definition: eplot.py:33
G4int Length() const
list f3_FindProcesses(G4ProcessTable *procTable, const G4String &pname)
G4ProcNameVector * GetNameList()
G4VProcess *(G4ProcessTable::* f1_FindProcess)(const G4String &, const G4String &) const
G4int GetVerboseLevel() const
list f2_FindProcesses(G4ProcessTable *procTable, const G4ProcessManager *procManager)
G4VProcess *(G4ProcessManager::* f2_SetProcessActivation)(G4int, G4bool)
static G4ProcessTable * GetProcessTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
G4VProcess *(G4ProcessTable::* f3_FindProcess)(const G4String &, const G4ProcessManager *) const
G4ProcessType