ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyG4ProcessTable.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyG4ProcessTable.cc
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 // ====================================================================
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 
115 
119 
122 
126 
130 
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, 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 }