LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 49 of file pymodG4run.cc.

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

50 {
53  export_G4Run();
60 }
void export_G4UserRunAction()
void export_G4RunManager()
void export_G4VModularPhysicsList()
void export_G4VUserPrimaryGeneratorAction()
void export_G4VPhysicsConstructor()
void export_G4Run()
Definition: pyG4Run.cc:41
void export_G4VUserPhysicsList()
void export_G4VUserDetectorConstruction()
void export_G4RunManagerKernel()
void export_G4Run ( )

Definition at line 41 of file pyG4Run.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 102 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().

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 63 of file pyG4UserRunAction.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 65 of file pyG4VModularPhysicsList.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 71 of file pyG4VPhysicsConstructor.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 58 of file pyG4VUserDetectorConstruction.cc.

References pyExN03geom::Construct().

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 88 of file pyG4VUserPhysicsList.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Referenced by BOOST_PYTHON_MODULE().

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