LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
pymodG4run.cc File Reference
#include <boost/python.hpp>

Go to the source code of this file.

Functions

void export_G4RunManager ()
 
void export_G4RunManagerKernel ()
 
void export_G4Run ()
 
void export_G4UserRunAction ()
 
void export_G4VUserPrimaryGeneratorAction ()
 
void export_G4VUserDetectorConstruction ()
 
void export_G4VUserPhysicsList ()
 
void export_G4VModularPhysicsList ()
 
void export_G4VPhysicsConstructor ()
 
 BOOST_PYTHON_MODULE (G4run)
 

Function Documentation

BOOST_PYTHON_MODULE ( G4run  )

Definition at line 50 of file pymodG4run.cc.

References export_G4Run(), export_G4RunManager(), export_G4RunManagerKernel(), export_G4UserRunAction(), export_G4VModularPhysicsList(), export_G4VPhysicsConstructor(), export_G4VUserDetectorConstruction(), export_G4VUserPhysicsList(), and export_G4VUserPrimaryGeneratorAction().

51 {
54  export_G4Run();
61 }
void export_G4UserRunAction()
void export_G4RunManager()
void export_G4VModularPhysicsList()
void export_G4VUserPrimaryGeneratorAction()
void export_G4VPhysicsConstructor()
void export_G4Run()
Definition: pyG4Run.cc:42
void export_G4VUserPhysicsList()
void export_G4VUserDetectorConstruction()
void export_G4RunManagerKernel()
void export_G4Run ( )

Definition at line 42 of file pyG4Run.cc.

Referenced by BOOST_PYTHON_MODULE().

43 {
44  class_<G4Run, G4Run*, boost::noncopyable>("G4Run", "run class")
45  // ---
46  .def("GetRunID", &G4Run::GetRunID)
47  .def("SetRunID", &G4Run::SetRunID)
48  .def("GetNumberOfEvent", &G4Run::GetNumberOfEvent)
49  .def("GetNumberOfEventToBeProcessed",
50  &G4Run::GetNumberOfEventToBeProcessed)
51  .def("SetNumberOfEventToBeProcessed",
52  &G4Run::SetNumberOfEventToBeProcessed)
53  ;
54 
55  // reduced functionality...
56  //.def("RecordEvent", &G4Run::RecordEvent) // virtual
57  //.def("GetHCtable", &G4Run::GetHCtable,
58  //return_internal_reference<>())
59  //.def("SetHCtable", &G4Run::SetHCtable)
60  //.def("GetDCtable", &G4Run::GetDCtable,
61  //return_internal_reference<>())
62  //.def("SetDCtable", &G4Run::SetDCtable)
63 
64 }
void export_G4RunManager ( )

Definition at line 103 of file pyG4RunManager.cc.

References pyG4RunManager::f1_DumpRegion, pyG4RunManager::f1_SetUserAction, pyG4RunManager::f1_SetUserInitialization, pyG4RunManager::f2_DumpRegion, pyG4RunManager::f2_SetUserAction, pyG4RunManager::f2_SetUserInitialization, pyG4RunManager::f3_SetUserAction, pyG4RunManager::f4_SetUserAction, pyG4RunManager::f5_SetUserAction, pyG4RunManager::f6_SetUserAction, pyG4RunManager::GeometryHasBeenModified, and Initialize().

Referenced by BOOST_PYTHON_MODULE().

104 {
105  class_<G4RunManager, boost::noncopyable>
106  ("G4RunManager", "run manager class")
107  // ---
108  .def("GetRunManager", &G4RunManager::GetRunManager,
109  "Get an instance of G4RunManager",
110  return_value_policy<reference_existing_object>())
111  .staticmethod("GetRunManager")
112  // ---
113  .def("SetVerboseLevel", &G4RunManager::SetVerboseLevel)
114  .def("GetVerboseLevel", &G4RunManager::GetVerboseLevel)
115  // ---
116  .def("Initialize", &G4RunManager::Initialize)
117  .def("BeamOn", &G4RunManager::BeamOn,
118  f_BeamOn((arg("n_event"), arg("macroFile")=0,
119  arg("n_select")=-1),
120  "Starts event loop."))
121  // ---
122  .def("SetUserInitialization", f1_SetUserInitialization)
123  .def("SetUserInitialization", f2_SetUserInitialization)
124  .def("SetUserAction", f1_SetUserAction)
125  .def("SetUserAction", f2_SetUserAction)
126  .def("SetUserAction", f3_SetUserAction)
127  .def("SetUserAction", f4_SetUserAction)
128  .def("SetUserAction", f5_SetUserAction)
129  .def("SetUserAction", f6_SetUserAction)
130  // ---
131  .def("GetUserDetectorConstruction",
132  &G4RunManager::GetUserDetectorConstruction,
133  return_internal_reference<>())
134  .def("GetUserPhysicsList",
135  &G4RunManager::GetUserPhysicsList,
136  return_internal_reference<>())
137  .def("GetUserPrimaryGeneratorAction",
138  &G4RunManager::GetUserPrimaryGeneratorAction,
139  return_internal_reference<>())
140  .def("GetUserRunAction", &G4RunManager::GetUserRunAction,
141  return_internal_reference<>())
142  .def("GetUserEventAction", &G4RunManager::GetUserEventAction,
143  return_internal_reference<>())
144  .def("GetUserStackingAction", &G4RunManager::GetUserStackingAction,
145  return_internal_reference<>())
146  .def("GetUserTrackingAction", &G4RunManager::GetUserTrackingAction,
147  return_internal_reference<>())
148  .def("GetUserSteppingAction", &G4RunManager::GetUserSteppingAction,
149  return_internal_reference<>())
150  // ---
151  .def("AbortRun", &G4RunManager::AbortRun,
152  f_AbortRun((arg("soft_abort")=false),
153  "Abort run (event loop)."))
154  .def("AbortEvent", &G4RunManager::AbortEvent)
155  .def("DefineWorldVolume", &G4RunManager::DefineWorldVolume,
156  f_DefineWorldVolume())
157  .def("DumpRegion", f1_DumpRegion)
158  .def("DumpRegion", f2_DumpRegion, f_DumpRegion())
159  .def("rndmSaveThisRun", &G4RunManager::rndmSaveThisRun)
160  .def("rndmSaveThisEvent", &G4RunManager::rndmSaveThisEvent)
161  .def("RestoreRandomNumberStatus",
162  &G4RunManager::RestoreRandomNumberStatus)
163  .def("SetRandomNumberStore", &G4RunManager::SetRandomNumberStore)
164  .def("GetRandomNumberStore", &G4RunManager::GetRandomNumberStore)
165  .def("SetRandomNumberStoreDir", &G4RunManager::SetRandomNumberStoreDir)
166  .def("GeometryHasBeenModified", &G4RunManager::GeometryHasBeenModified,
167  f_GeometryHasBeenModified())
168  .def("PhysicsHasBeenModified", &G4RunManager::PhysicsHasBeenModified)
169  .def("GetGeometryToBeOptimized",&G4RunManager::GetGeometryToBeOptimized)
170  .def("GetCurrentRun", &G4RunManager::GetCurrentRun,
171  return_value_policy<reference_existing_object>())
172  .def("GetCurrentEvent", &G4RunManager::GetCurrentEvent,
173  return_value_policy<reference_existing_object>())
174  .def("SetRunIDCounter", &G4RunManager::SetRunIDCounter)
175  .def("GetVersionString", &G4RunManager::GetVersionString,
176  return_value_policy<reference_existing_object>())
177  .def("GetRandomNumberStoreDir", &G4RunManager::GetRandomNumberStoreDir,
178  return_internal_reference<>())
179  ;
180 
181  // reduced functionality...
182  // void SetPrimaryTransformer(G4PrimaryTransformer* pt)
183  // void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
184  // void CutOffHasBeenModified()
185  // void SetGeometryToBeOptimized(G4bool vl)
186  // const G4Event* GetPreviousEvent(G4int i) const
187  // void SetNumberOfEventsToBeStored(G4int val)
188  // void SetDCtable(G4DCtable* DCtbl)
189 
190 }
void(G4RunManager::* f5_SetUserAction)(G4UserTrackingAction *)
void(G4RunManager::* f4_SetUserAction)(G4UserStackingAction *)
void Initialize()
Definition: errprop.cc:101
void(G4RunManager::* f1_SetUserAction)(G4UserRunAction *)
void(G4RunManager::* f6_SetUserAction)(G4UserSteppingAction *)
void(G4RunManager::* f2_DumpRegion)(G4Region *) const
void(G4RunManager::* f2_SetUserInitialization)(G4VUserPhysicsList *)
void(G4RunManager::* f1_DumpRegion)(const G4String &) const
void(G4RunManager::* f2_SetUserAction)(G4VUserPrimaryGeneratorAction *)
void(G4RunManager::* f1_SetUserInitialization)(G4VUserDetectorConstruction *)
void(G4RunManager::* f3_SetUserAction)(G4UserEventAction *)
void export_G4RunManagerKernel ( )

Definition at line 53 of file pyG4RunManagerKernel.cc.

Referenced by BOOST_PYTHON_MODULE().

54 {
55  class_<G4RunManagerKernel>("G4RunManagerKernel", "run manager kernel")
56  .def("GetRunManagerKernel", &G4RunManagerKernel::GetRunManagerKernel,
57  "Get an instance of G4RunManagerKernel",
58  return_value_policy<reference_existing_object>())
59  .staticmethod("GetRunManagerKernel")
60  // ---
61  //.def("DefineWorldVolume", &G4RunManagerKernel::DefineWorldVolume)
62  //.def("SetPhysics", &G4RunManagerKernel::SetPhysics)
63  //.def("InitializePhysics", &G4RunManagerKernel::InitializePhysics)
64  .def("RunInitialization", &G4RunManagerKernel::RunInitialization,
65  f_RunInitialization())
66  //.def("RunTermination", &G4RunManagerKernel::RunTermination)
67  //.def("UpdateRegion", &G4RunManagerKernel::UpdateRegion)
68  //.def("DumpRegion", &G4RunManagerKernel::DumpRegion)
69  //.def("DumpRegion", &G4RunManagerKernel::DumpRegion)
70  //.def("GeometryHasBeenModified",
71  //&G4RunManagerKernel::GeometryHasBeenModified)
72  //.def("PhysicsHasBeenModified",
73  //&G4RunManagerKernel::PhysicsHasBeenModified)
74  //.def("GetEventManager", &G4RunManagerKernel::GetEventManager,
75  //...)
76  //.def("GetStackManager", &G4RunManagerKernel::GetStackManager,
77  //...)
78  //.def("GetTrackingManager", &G4RunManagerKernel::GetTrackingManager,
79  //...)
80  //.def("SetPrimaryTransformer", &G4RunManagerKernel::SetPrimaryTransformer)
81  //.def("GetPrimaryTransformer", &G4RunManagerKernel::GetPrimaryTransformer,
82  //...)
83  //.def("GetVersionString", &G4RunManagerKernel::GetVersionString)
84  //.def("SetVerboseLevel", &G4RunManagerKernel::SetVerboseLevel)
85  //.def("SetGeometryToBeOptimized",
86  //&G4RunManagerKernel::SetGeometryToBeOptimized)
87  ;
88 }
void export_G4UserRunAction ( )

Definition at line 64 of file pyG4UserRunAction.cc.

References CB_G4UserRunAction::BeginOfRunAction(), and CB_G4UserRunAction::EndOfRunAction().

Referenced by BOOST_PYTHON_MODULE().

65 {
66  class_<CB_G4UserRunAction, CB_G4UserRunAction*, boost::noncopyable>
67  ( "G4UserRunAction", "run action class")
68  // ---
69  .def("BeginOfRunAction", &G4UserRunAction::BeginOfRunAction,
71  .def("EndOfRunAction", &G4UserRunAction::EndOfRunAction,
73 
74  // reduced functionality...
75  //.def("GenerateRun", &G4UserRunAction::GenerateRun) // virtual
76  ;
77 }
void EndOfRunAction(const G4Run *aRun)
void BeginOfRunAction(const G4Run *aRun)
void export_G4VModularPhysicsList ( )

Definition at line 66 of file pyG4VModularPhysicsList.cc.

References pyG4VModularPhysicsList::f1_GetPhysics, and pyG4VModularPhysicsList::f2_GetPhysics.

Referenced by BOOST_PYTHON_MODULE().

67 {
68  class_<CB_G4VModularPhysicsList, bases<G4VUserPhysicsList>,
69  boost::noncopyable>
70  ("G4VModularPhysicsList", "base class of modular physics list")
71  // ---
72  .def("SetCuts", pure_virtual(&G4VModularPhysicsList::SetCuts))
73  .def("ConstructParticle", &G4VModularPhysicsList::ConstructParticle)
74  .def("ConstructProcess", &G4VModularPhysicsList::ConstructProcess)
75  // ---
76  .def("RegisterPhysics", &G4VModularPhysicsList::RegisterPhysics)
77  .def("GetPhysics", f1_GetPhysics,
78  return_value_policy<reference_existing_object>())
79  .def("GetPhysics", f2_GetPhysics,
80  return_value_policy<reference_existing_object>())
81  ;
82 }
const G4VPhysicsConstructor *(G4VModularPhysicsList::* f1_GetPhysics)(G4int) const
const G4VPhysicsConstructor *(G4VModularPhysicsList::* f2_GetPhysics)(const G4String &) const
void export_G4VPhysicsConstructor ( )

Definition at line 72 of file pyG4VPhysicsConstructor.cc.

Referenced by BOOST_PYTHON_MODULE().

73 {
74  class_<CB_G4VPhysicsConstructor, boost::noncopyable>
75  ("G4VPhysicsConstructor",
76  "base class of user physics constructor")
77  // ----
78  .def(init<const G4String&>())
79  // ---
80  .def("ConstructParticle",
81  pure_virtual(&G4VPhysicsConstructor::ConstructParticle))
82  .def("ConstructProcess",
83  pure_virtual(&G4VPhysicsConstructor::ConstructProcess))
84  // ---
85  .def("SetPhysicsName", &G4VPhysicsConstructor::SetPhysicsName,
86  f_SetPhysicsName())
87  .def("GetPhysicsName", &G4VPhysicsConstructor::GetPhysicsName,
88  return_value_policy<return_by_value>())
89  .def("SetVerboseLevel", &G4VPhysicsConstructor::SetVerboseLevel)
90  .def("GetVerboseLevel", &G4VPhysicsConstructor::GetVerboseLevel)
91  ;
92 }
void export_G4VUserDetectorConstruction ( )

Definition at line 59 of file pyG4VUserDetectorConstruction.cc.

References pyExN03geom::Construct().

Referenced by BOOST_PYTHON_MODULE().

60 {
61  class_<CB_G4VUserDetectorConstruction, CB_G4VUserDetectorConstruction*,
62  boost::noncopyable>
63  ("G4VUserDetectorConstruction",
64  "base class of user detector construction")
65 
66  .def("Construct",
68  return_value_policy<reference_existing_object>())
69  ;
70 }
void Construct()
Definition: pyExN01geom.cc:48
void export_G4VUserPhysicsList ( )

Definition at line 89 of file pyG4VUserPhysicsList.cc.

References pyG4VUserPhysicsList::f1_SetCutValue, pyG4VUserPhysicsList::f1_SetParticleCuts, pyG4VUserPhysicsList::f2_SetCutValue, and pyG4VUserPhysicsList::f2_SetParticleCuts.

Referenced by BOOST_PYTHON_MODULE().

90 {
91  class_<CB_G4VUserPhysicsList, CB_G4VUserPhysicsList*, boost::noncopyable>
92  ("G4VUserPhysicsList", "base class of user physics list")
93  // ---
94  .def("ConstructParticle",
95  pure_virtual(&G4VUserPhysicsList::ConstructParticle))
96  .def("ConstructProcess",
97  pure_virtual(&G4VUserPhysicsList::ConstructProcess))
98  .def("SetCuts",
99  pure_virtual(&G4VUserPhysicsList::SetCuts))
100  // ---
101  .def("SetDefaultCutValue", &G4VUserPhysicsList::SetDefaultCutValue)
102  .def("GetDefaultCutValue", &G4VUserPhysicsList::GetDefaultCutValue)
103  // ---
104  .def("StorePhysicsTable", &G4VUserPhysicsList::StorePhysicsTable,
105  f_StorePhysicsTable())
106  .def("IsPhysicsTableRetrieved",
107  &G4VUserPhysicsList::IsPhysicsTableRetrieved)
108  .def("IsStoredInAscii", &G4VUserPhysicsList::IsStoredInAscii)
109  .def("GetPhysicsTableDirectory",
110  &G4VUserPhysicsList::GetPhysicsTableDirectory,
111  return_value_policy<return_by_value>())
112  .def("SetStoredInAscii", &G4VUserPhysicsList::SetStoredInAscii)
113  .def("ResetStoredInAscii", &G4VUserPhysicsList::ResetStoredInAscii)
114  // ---
115  .def("DumpList", &G4VUserPhysicsList::DumpList)
116 
117  .def("DumpCutValuesTable", &G4VUserPhysicsList::DumpCutValuesTable)
118  .def("DumpCutValuesTableIfRequested",
119  &G4VUserPhysicsList::DumpCutValuesTableIfRequested)
120  .def("SetCutValue", f1_SetCutValue)
121  .def("SetCutValue", f2_SetCutValue)
122  .def("SetParticleCuts", f1_SetParticleCuts, f_SetParticleCuts())
123  .def("SetParticleCuts", f2_SetParticleCuts, f_SetParticleCuts())
124  // ---
125  .def("SetVerboseLevel", &G4VUserPhysicsList::SetVerboseLevel)
126  .def("GetVerboseLevel", &G4VUserPhysicsList::GetVerboseLevel)
127  .def("SetCutsWithDefault", &G4VUserPhysicsList::SetCutsWithDefault)
128  .def("SetCutsForRegion", &G4VUserPhysicsList::SetCutsForRegion)
129  .def("GetApplyCuts", &G4VUserPhysicsList::GetApplyCuts)
130  ;
131 
132  // Note that exposed items are limited,
133  // because this class object is mainly for internal uses or obsolete.
134  // Construct
135  // BuildPhysicsTable
136  // PreparePhysicsTable
137  // SetPhysicsTableRetrieved
138  // ReSetPhysicsTableRetrieved
139  // SetApplyCuts
140  // DumpCutValues (obsolete)
141  // ResetCuts;
142 }
void(G4VUserPhysicsList::* f2_SetCutValue)(G4double, const G4String &, const G4String &)
void(G4VUserPhysicsList::* f1_SetCutValue)(G4double, const G4String &)
void(G4VUserPhysicsList::* f1_SetParticleCuts)(G4double, G4ParticleDefinition *, G4Region *)
void(G4VUserPhysicsList::* f2_SetParticleCuts)(G4double, G4ParticleDefinition *, G4Region *)
void export_G4VUserPrimaryGeneratorAction ( )

Definition at line 58 of file pyG4VUserPrimaryGeneratorAction.cc.

Referenced by BOOST_PYTHON_MODULE().

59 {
60  class_<CB_G4VUserPrimaryGeneratorAction, CB_G4VUserPrimaryGeneratorAction*,
61  boost::noncopyable>
62  ("G4VUserPrimaryGeneratorAction",
63  "base class of user primary generator action")
64 
65  .def("GeneratePrimaries",
66  pure_virtual(&G4VUserPrimaryGeneratorAction::GeneratePrimaries))
67  ;
68 }