LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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>
32 class G4UImessenger;
33 #include "G4ProcessTable.hh"
34 
35 using namespace boost::python;
36 
37 // ====================================================================
38 // thin wrappers
39 // ====================================================================
40 namespace pyG4ProcessTable {
41 
42 // FindProcess
43 G4VProcess*(G4ProcessTable::*f1_FindProcess)
44  (const G4String&, const G4String&) const = &G4ProcessTable::FindProcess;
45 
46 G4VProcess*(G4ProcessTable::*f2_FindProcess)
47  (const G4String&, const G4ParticleDefinition*) const
48  = &G4ProcessTable::FindProcess;
49 
50 G4VProcess*(G4ProcessTable::*f3_FindProcess)
51  (const G4String&, const G4ProcessManager*) const
52  = &G4ProcessTable::FindProcess;
53 
54 // FindProcesses
55 // raw vector pointer -> Python list conversion
56 list f1_FindProcesses(G4ProcessTable* procTable)
57 {
58  list procList;
59  G4ProcessVector* procVec= procTable-> FindProcesses();
60  G4int nproc= procVec-> size();
61  for(G4int i=0; i< nproc; i++) {
62  procList.append(&(*procVec)[i]);
63  }
64  return procList;
65 }
66 
67 list f2_FindProcesses(G4ProcessTable* procTable,
68  const G4ProcessManager* procManager)
69 {
70  list procList;
71  G4ProcessVector* procVec= procTable-> FindProcesses(procManager);
72  G4int nproc= procVec-> size();
73  for(G4int i=0; i< nproc; i++) {
74  procList.append(&(*procVec)[i]);
75  }
76  return procList;
77 }
78 
79 list f3_FindProcesses(G4ProcessTable* procTable,
80  const G4String& pname)
81 {
82  list procList;
83  G4ProcessVector* procVec= procTable-> FindProcesses(pname);
84  G4int nproc= procVec-> size();
85  for(G4int i=0; i< nproc; i++) {
86  procList.append(&(*procVec)[i]);
87  }
88  return procList;
89 }
90 
91 list f4_FindProcesses(G4ProcessTable* procTable,
92  G4ProcessType ptype)
93 {
94  list procList;
95  G4ProcessVector* procVec= procTable-> FindProcesses(ptype);
96  G4int nproc= procVec-> size();
97  for(G4int i=0; i< nproc; i++) {
98  procList.append(&(*procVec)[i]);
99  }
100  return procList;
101 }
102 
103 // SetProcessActivation
104 void(G4ProcessTable::*f1_SetProcessActivation)
105  (const G4String&, G4bool)= &G4ProcessTable::SetProcessActivation;
106 
107 void(G4ProcessTable::*f2_SetProcessActivation)
108  (const G4String&, const G4String&, G4bool)
109  = &G4ProcessTable::SetProcessActivation;
110 
111 void(G4ProcessTable::*f3_SetProcessActivation)
112  (const G4String&, G4ParticleDefinition*, G4bool)
113  = &G4ProcessTable::SetProcessActivation;
114 
115 void(G4ProcessTable::*f4_SetProcessActivation)
116  (const G4String&, G4ProcessManager*, G4bool)
117  = &G4ProcessTable::SetProcessActivation;
118 
119 void(G4ProcessTable::*f5_SetProcessActivation)
120  (G4ProcessType, G4bool)= &G4ProcessTable::SetProcessActivation;
121 
122 void(G4ProcessTable::*f6_SetProcessActivation)
123  (G4ProcessType, const G4String&, G4bool)
124  = &G4ProcessTable::SetProcessActivation;
125 
126 void(G4ProcessTable::*f7_SetProcessActivation)
127  (G4ProcessType, G4ParticleDefinition*, G4bool)
128  = &G4ProcessTable::SetProcessActivation;
129 
130 void(G4ProcessTable::*f8_SetProcessActivation)
131  (G4ProcessType, G4ProcessManager*, G4bool)
132  = &G4ProcessTable::SetProcessActivation;
133 
134 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_DumpInfo, DumpInfo, 1, 2)
135 
136 }
137 
138 using namespace pyG4ProcessTable;
139 
140 // ====================================================================
141 // module definition
142 // ====================================================================
144 {
145  class_<G4ProcessTable, G4ProcessTable*, boost::noncopyable>
146  ("G4ProcessTable", "process table")
147  // ---
148  .def("GetProcessTable", &G4ProcessTable::GetProcessTable,
149  return_value_policy<reference_existing_object>())
150  .staticmethod("GetProcessTable")
151  .def("Length", &G4ProcessTable::Length)
152  //.def("Insert", &G4ProcessTable::Insert) // protected
153  //.def("Remove", &G4ProcessTable::Remove) // protected
154  // ---
155  .def("FindProcess", f1_FindProcess,
156  return_value_policy<reference_existing_object>())
157  .def("FindProcess", f2_FindProcess,
158  return_value_policy<reference_existing_object>())
159  .def("FindProcess", f3_FindProcess,
160  return_value_policy<reference_existing_object>())
161  .def("FindProcess", f3_FindProcess,
162  return_value_policy<reference_existing_object>())
163  // ---
164  .def("FindProcesses", f1_FindProcesses)
165  .def("FindProcesses", f2_FindProcesses)
166  .def("FindProcesses", f3_FindProcesses)
167  .def("FindProcesses", f4_FindProcesses)
168  // ---
169  .def("SetProcessActivation", f1_SetProcessActivation)
170  .def("SetProcessActivation", f2_SetProcessActivation)
171  .def("SetProcessActivation", f3_SetProcessActivation)
172  .def("SetProcessActivation", f4_SetProcessActivation)
173  .def("SetProcessActivation", f5_SetProcessActivation)
174  .def("SetProcessActivation", f6_SetProcessActivation)
175  .def("SetProcessActivation", f7_SetProcessActivation)
176  .def("SetProcessActivation", f8_SetProcessActivation)
177  // ---
178  .def("GetNameList", &G4ProcessTable::GetNameList,
179  return_internal_reference<>())
180  .def("DumpInfo", &G4ProcessTable::DumpInfo, f_DumpInfo())
181  .def("SetVerboseLevel", &G4ProcessTable::SetVerboseLevel)
182  .def("GetVerboseLevel", &G4ProcessTable::GetVerboseLevel)
183  ;
184 }
list f2_FindProcesses(G4ProcessTable *procTable, const G4ProcessManager *procManager)
G4VProcess *(G4ProcessTable::* f2_FindProcess)(const G4String &, const G4ParticleDefinition *) const
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateTubeVolume, CreateTubeVolume, 4, 6) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateConeVolume
float Length(const PFPStruct &pfp)
Definition: PFPUtils.cxx:3269
void(G4ProcessTable::* f7_SetProcessActivation)(G4ProcessType, G4ParticleDefinition *, G4bool)
void(G4ProcessTable::* f3_SetProcessActivation)(const G4String &, G4ParticleDefinition *, G4bool)
void(G4ProcessTable::* f4_SetProcessActivation)(const G4String &, G4ProcessManager *, G4bool)
void(G4ProcessTable::* f6_SetProcessActivation)(G4ProcessType, const G4String &, G4bool)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
G4VProcess *(G4ProcessTable::* f3_FindProcess)(const G4String &, const G4ProcessManager *) const
list f4_FindProcesses(G4ProcessTable *procTable, G4ProcessType ptype)
void(G4ProcessTable::* f2_SetProcessActivation)(const G4String &, const G4String &, G4bool)
G4VProcess *(G4ProcessTable::* f1_FindProcess)(const G4String &, const G4String &) const
void(G4ProcessTable::* f5_SetProcessActivation)(G4ProcessType, G4bool)
list f3_FindProcesses(G4ProcessTable *procTable, const G4String &pname)
void export_G4ProcessTable()
void(G4ProcessTable::* f1_SetProcessActivation)(const G4String &, G4bool)
list f1_FindProcesses(G4ProcessTable *procTable)
void(G4ProcessTable::* f8_SetProcessActivation)(G4ProcessType, G4ProcessManager *, G4bool)