Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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,v 1.4 2006-06-29 15:34:58 gunter Exp $
27 // $Name: not supported by cvs2svn $
28 // ====================================================================
29 // pyG4ProcessTable.cc
30 //
31 // 2005 Q
32 // ====================================================================
33 #include <boost/python.hpp>
34 class G4UImessenger;
35 #include "G4ProcessTable.hh"
36 
37 using namespace boost::python;
38 
39 // ====================================================================
40 // thin wrappers
41 // ====================================================================
42 namespace pyG4ProcessTable {
43 
44 // FindProcess
46  (const G4String&, const G4String&) const = &G4ProcessTable::FindProcess;
47 
49  (const G4String&, const G4ParticleDefinition*) const
51 
53  (const G4String&, const G4ProcessManager*) const
55 
56 // FindProcesses
57 // raw vector pointer -> Python list conversion
59 {
60  list procList;
61  G4ProcessVector* procVec= procTable-> FindProcesses();
62  G4int nproc= procVec-> size();
63  for(G4int i=0; i< nproc; i++) {
64  procList.append(&(*procVec)[i]);
65  }
66  return procList;
67 }
68 
70  const G4ProcessManager* procManager)
71 {
72  list procList;
73  G4ProcessVector* procVec= procTable-> FindProcesses(procManager);
74  G4int nproc= procVec-> size();
75  for(G4int i=0; i< nproc; i++) {
76  procList.append(&(*procVec)[i]);
77  }
78  return procList;
79 }
80 
82  const G4String& pname)
83 {
84  list procList;
85  G4ProcessVector* procVec= procTable-> FindProcesses(pname);
86  G4int nproc= procVec-> size();
87  for(G4int i=0; i< nproc; i++) {
88  procList.append(&(*procVec)[i]);
89  }
90  return procList;
91 }
92 
94  G4ProcessType ptype)
95 {
96  list procList;
97  G4ProcessVector* procVec= procTable-> FindProcesses(ptype);
98  G4int nproc= procVec-> size();
99  for(G4int i=0; i< nproc; i++) {
100  procList.append(&(*procVec)[i]);
101  }
102  return procList;
103 }
104 
105 // SetProcessActivation
108 
110  (const G4String&, const G4String&, G4bool)
112 
116 
120 
123 
127 
131 
135 
136 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_DumpInfo, DumpInfo, 1, 2);
137 
138 };
139 
140 using namespace pyG4ProcessTable;
141 
142 // ====================================================================
143 // module definition
144 // ====================================================================
146 {
147  class_<G4ProcessTable, G4ProcessTable*, boost::noncopyable>
148  ("G4ProcessTable", "process table")
149  // ---
150  .def("GetProcessTable", &G4ProcessTable::GetProcessTable,
151  return_value_policy<reference_existing_object>())
152  .staticmethod("GetProcessTable")
153  .def("Length", &G4ProcessTable::Length)
154  //.def("Insert", &G4ProcessTable::Insert) // protected
155  //.def("Remove", &G4ProcessTable::Remove) // protected
156  // ---
157  .def("FindProcess", f1_FindProcess,
158  return_value_policy<reference_existing_object>())
159  .def("FindProcess", f2_FindProcess,
160  return_value_policy<reference_existing_object>())
161  .def("FindProcess", f3_FindProcess,
162  return_value_policy<reference_existing_object>())
163  .def("FindProcess", f3_FindProcess,
164  return_value_policy<reference_existing_object>())
165  // ---
166  .def("FindProcesses", f1_FindProcesses)
167  .def("FindProcesses", f2_FindProcesses)
168  .def("FindProcesses", f3_FindProcesses)
169  .def("FindProcesses", f4_FindProcesses)
170  // ---
171  .def("SetProcessActivation", f1_SetProcessActivation)
172  .def("SetProcessActivation", f2_SetProcessActivation)
173  .def("SetProcessActivation", f3_SetProcessActivation)
174  .def("SetProcessActivation", f4_SetProcessActivation)
175  .def("SetProcessActivation", f5_SetProcessActivation)
176  .def("SetProcessActivation", f6_SetProcessActivation)
177  .def("SetProcessActivation", f7_SetProcessActivation)
178  .def("SetProcessActivation", f8_SetProcessActivation)
179  // ---
180  .def("GetNameList", &G4ProcessTable::GetNameList,
181  return_internal_reference<>())
182  .def("DumpInfo", &G4ProcessTable::DumpInfo, f_DumpInfo())
183  .def("SetVerboseLevel", &G4ProcessTable::SetVerboseLevel)
184  .def("GetVerboseLevel", &G4ProcessTable::GetVerboseLevel)
185  ;
186 }