LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 // $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
44 G4VProcess*(G4ProcessTable::*f1_FindProcess)
45  (const G4String&, const G4String&) const = &G4ProcessTable::FindProcess;
46 
47 G4VProcess*(G4ProcessTable::*f2_FindProcess)
48  (const G4String&, const G4ParticleDefinition*) const
49  = &G4ProcessTable::FindProcess;
50 
51 G4VProcess*(G4ProcessTable::*f3_FindProcess)
52  (const G4String&, const G4ProcessManager*) const
53  = &G4ProcessTable::FindProcess;
54 
55 // FindProcesses
56 // raw vector pointer -> Python list conversion
57 list f1_FindProcesses(G4ProcessTable* procTable)
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 
68 list f2_FindProcesses(G4ProcessTable* procTable,
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 
80 list f3_FindProcesses(G4ProcessTable* procTable,
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 
92 list f4_FindProcesses(G4ProcessTable* procTable,
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
105 void(G4ProcessTable::*f1_SetProcessActivation)
106  (const G4String&, G4bool)= &G4ProcessTable::SetProcessActivation;
107 
108 void(G4ProcessTable::*f2_SetProcessActivation)
109  (const G4String&, const G4String&, G4bool)
110  = &G4ProcessTable::SetProcessActivation;
111 
112 void(G4ProcessTable::*f3_SetProcessActivation)
113  (const G4String&, G4ParticleDefinition*, G4bool)
114  = &G4ProcessTable::SetProcessActivation;
115 
116 void(G4ProcessTable::*f4_SetProcessActivation)
117  (const G4String&, G4ProcessManager*, G4bool)
118  = &G4ProcessTable::SetProcessActivation;
119 
120 void(G4ProcessTable::*f5_SetProcessActivation)
121  (G4ProcessType, G4bool)= &G4ProcessTable::SetProcessActivation;
122 
123 void(G4ProcessTable::*f6_SetProcessActivation)
124  (G4ProcessType, const G4String&, G4bool)
125  = &G4ProcessTable::SetProcessActivation;
126 
127 void(G4ProcessTable::*f7_SetProcessActivation)
128  (G4ProcessType, G4ParticleDefinition*, G4bool)
129  = &G4ProcessTable::SetProcessActivation;
130 
131 void(G4ProcessTable::*f8_SetProcessActivation)
132  (G4ProcessType, G4ProcessManager*, G4bool)
133  = &G4ProcessTable::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 }
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
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)
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)