LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pymodG4event.cc File Reference
#include <boost/python.hpp>

Go to the source code of this file.

Functions

void export_G4EventManager ()
 
void export_G4StackManager ()
 
void export_G4Event ()
 
void export_G4UserEventAction ()
 
void export_G4UserStackingAction ()
 
void export_G4ClassificationOfNewTrack ()
 
void export_G4ParticleGun ()
 
 BOOST_PYTHON_MODULE (G4event)
 

Function Documentation

BOOST_PYTHON_MODULE ( G4event  )
void export_G4ClassificationOfNewTrack ( )

Definition at line 39 of file pyG4ClassificationOfNewTrack.cc.

References value.

Referenced by BOOST_PYTHON_MODULE().

40 {
41  enum_<G4ClassificationOfNewTrack>("G4ClassificationOfNewTrack")
42  .value("fUrgent", fUrgent)
43  .value("fWaiting", fWaiting)
44  .value("fPostpone", fPostpone)
45  .value("fKill", fKill)
46  .value("fWaiting_1", fWaiting_1)
47  .value("fWaiting_2", fWaiting_2)
48  .value("fWaiting_3", fWaiting_3)
49  .value("fWaiting_4", fWaiting_4)
50  .value("fWaiting_5", fWaiting_5)
51  .value("fWaiting_6", fWaiting_6)
52  .value("fWaiting_7", fWaiting_7)
53  .value("fWaiting_8", fWaiting_8)
54  .value("fWaiting_9", fWaiting_9)
55  .value("fWaiting_19", fWaiting_10)
56  ;
57 }
double value
Definition: spectrum.C:18
void export_G4Event ( )

Definition at line 50 of file pyG4Event.cc.

References Draw(), and pyG4Element::Print().

Referenced by BOOST_PYTHON_MODULE().

51 {
52  class_<G4Event, G4Event*, boost::noncopyable>("G4Event", "event class")
53  .def(init<G4int>())
54  // ---
55  .def("Print", &G4Event::Print)
56  .def("Draw", &G4Event::Draw)
57  .def("SetEventID", &G4Event::SetEventID)
58  .def("GetEventID", &G4Event::GetEventID)
59  .def("SetEventAborted", &G4Event::SetEventAborted)
60  .def("IsAborted", &G4Event::IsAborted)
61  // ---
62  .def("AddPrimaryVertex", &G4Event::AddPrimaryVertex)
63  .def("GetNumberOfPrimaryVertex", &G4Event::GetNumberOfPrimaryVertex)
64  .def("GetPrimaryVertex", &G4Event::GetPrimaryVertex,
65  f_GetPrimaryVertex()[return_internal_reference<>()])
66  // ---
67  .def("GetTrajectoryContainer", &G4Event::GetTrajectoryContainer,
68  return_internal_reference<>())
69  .def("SetUserInformation", &G4Event::SetUserInformation)
70  .def("GetUserInformation", &G4Event::GetUserInformation,
71  return_internal_reference<>())
72  ;
73 
74  // reduced functionality...
75  //.def("SetHCofThisEvent", &G4Event::SetHCofThisEvent)
76  //.def("GetHCofThisEvent", &G4Event::SetHCofThisEvent,
77  // return_internal_reference<>())
78  //.def("SetDCofThisEvent", &G4Event::SetHCofThisEvent)
79  //.def("GetDCofThisEvent", &G4Event::SetHCofThisEvent,
80  // return_internal_reference<>())
81 
82 }
hist1 Draw("HIST")
void Print(G4Element &ele)
Definition: pyG4Element.cc:55
void export_G4EventManager ( )

Definition at line 40 of file pyG4EventManager.cc.

Referenced by BOOST_PYTHON_MODULE().

41 {
42  class_<G4EventManager, boost::noncopyable>
43  ("G4EventManager", "event manager class")
44  .def("GetEventManager", &G4EventManager::GetEventManager,
45  return_value_policy<reference_existing_object>())
46  .staticmethod("GetEventManager")
47  // ---
48  .def("GetConstCurrentEvent", &G4EventManager::GetConstCurrentEvent,
49  return_internal_reference<>())
50  .def("GetNonconstCurrentEvent",
51  &G4EventManager::GetNonconstCurrentEvent,
52  return_internal_reference<>())
53  .def("AbortCurrentEvent", &G4EventManager::AbortCurrentEvent)
54  .def("SetNumberOfAdditionalWaitingStacks",
55  &G4EventManager::SetNumberOfAdditionalWaitingStacks)
56  .def("GetStackManager", &G4EventManager::GetStackManager,
57  return_value_policy<reference_existing_object>())
58  .def("GetTrackingManager", &G4EventManager::GetTrackingManager,
59  return_value_policy<reference_existing_object>())
60  .def("GetVerboseLevel", &G4EventManager::GetVerboseLevel)
61  .def("SetVerboseLevel", &G4EventManager::SetVerboseLevel)
62  .def("SetUserInformation", &G4EventManager::SetUserInformation)
63  .def("GetUserInformation", &G4EventManager::GetUserInformation,
64  return_value_policy<reference_existing_object>())
65  ;
66 
67  // Note that exposed items are limited,
68  // because this class object is mainly for internal uses.
69  // ProcessOneEvent
70  // SetUserAction
71  // GetUserXXXAction
72  // GetPrimaryTransformer
73  // SetPrimaryTransformer
74 
75 }
void export_G4ParticleGun ( )

Definition at line 126 of file pyG4ParticleGun.cc.

References pyG4ParticleGun::GetParticleByName(), and pyG4ParticleGun::SetParticleByName().

Referenced by BOOST_PYTHON_MODULE().

127 {
128 #if G4VERSION_NUMBER < 910
129  class_<G4ParticleGun>
130 #else
131  class_<G4ParticleGun, boost::noncopyable>
132 #endif
133  ("G4ParticleGun", "particle gun")
134  // constructor
135  .def(init<G4int>())
136  .def(init<G4ParticleDefinition*>())
137  .def(init<G4ParticleDefinition*, G4int>())
138  // ---
139  .def("GeneratePrimaryVertex", &G4ParticleGun::GeneratePrimaryVertex)
140  .def("SetParticleDefinition", &G4ParticleGun::SetParticleDefinition)
141  .def("GetParticleDefinition", &G4ParticleGun::GetParticleDefinition,
142  return_value_policy<reference_existing_object>())
143 #if G4VERSION_NUMBER >= 910
144  .def("SetParticleMomentum", f1_SetParticleMomentum)
145  .def("SetParticleMomentum", f2_SetParticleMomentum)
146 #else
147  .def("SetParticleMomentum", &G4ParticleGun::SetParticleMomentum)
148 #endif
149  .def("SetParticleMomentumDirection",
150  &G4ParticleGun::SetParticleMomentumDirection)
151  .def("GetParticleMomentumDirection",
152  &G4ParticleGun::GetParticleMomentumDirection)
153  .def("SetParticleEnergy", &G4ParticleGun::SetParticleEnergy)
154  .def("GetParticleEnergy", &G4ParticleGun::GetParticleEnergy)
155  .def("SetParticleCharge", &G4ParticleGun::SetParticleCharge)
156  .def("GetParticleCharge", &G4ParticleGun::GetParticleCharge)
157  .def("SetParticlePolarization", &G4ParticleGun::SetParticlePolarization)
158  .def("GetParticlePolarization", &G4ParticleGun::GetParticlePolarization)
159  .def("SetNumberOfParticles", &G4ParticleGun::SetNumberOfParticles)
160  .def("GetNumberOfParticles", &G4ParticleGun::GetNumberOfParticles)
161  .def("SetParticlePosition", &G4ParticleGun::SetParticlePosition)
162  .def("GetParticlePosition", &G4ParticleGun::GetParticlePosition)
163  .def("SetParticleTime", &G4ParticleGun::SetParticleTime)
164  .def("GetParticleTime", &G4ParticleGun::GetParticleTime)
165  .def("SetParticleByName", SetParticleByName)
166  .def("GetParticleByName", GetParticleByName)
167  ;
168 }
void SetParticleByName(G4ParticleGun *gun, const std::string &pname)
std::string GetParticleByName(G4ParticleGun *gun)
void export_G4StackManager ( )

Definition at line 54 of file pyG4StackManager.cc.

References clear(), and pyG4StackManager::GetNWaitingTrack.

Referenced by BOOST_PYTHON_MODULE().

55 {
56  class_<G4StackManager, boost::noncopyable>
57  ("G4StackManager", "stack management class")
58  // ---
59  // Note that exposed items are limited, because this class object
60  // is mainly for internal uses.
61  .def("ReClassify", &G4StackManager::ReClassify)
62  .def("clear", &G4StackManager::clear)
63  .def("ClearUrgentStack", &G4StackManager::ClearUrgentStack)
64  .def("ClearWaitingStack", &G4StackManager::ClearWaitingStack,
65  f_ClearWaitingStack())
66  .def("ClearPostponeStack", &G4StackManager::ClearPostponeStack)
67  .def("GetNTotalTrack", &G4StackManager::GetNTotalTrack)
68  .def("GetNUrgentTrack", &G4StackManager::GetNUrgentTrack)
69  .def("GetNWaitingTrack", &G4StackManager::GetNWaitingTrack,
70  f_GetNWaitingTrack())
71  .def("SetVerboseLevel", &G4StackManager::SetVerboseLevel)
72  ;
73 }
vec_iX clear()
void export_G4UserEventAction ( )

Definition at line 64 of file pyG4UserEventAction.cc.

References CB_G4UserEventAction::BeginOfEventAction(), and CB_G4UserEventAction::EndOfEventAction().

Referenced by BOOST_PYTHON_MODULE().

65 {
66  class_<CB_G4UserEventAction, CB_G4UserEventAction*, boost::noncopyable>
67  ( "G4UserEventAction", "event action class")
68 
69  .def("BeginOfEventAction", &G4UserEventAction::BeginOfEventAction,
71  .def("EndOfEventAction", &G4UserEventAction::EndOfEventAction,
73  ;
74 }
void EndOfEventAction(const G4Event *anEvent)
void BeginOfEventAction(const G4Event *anEvent)
void export_G4UserStackingAction ( )

Definition at line 78 of file pyG4UserStackingAction.cc.

Referenced by BOOST_PYTHON_MODULE().

79 {
80  class_<CB_G4UserStackingAction, CB_G4UserStackingAction*, boost::noncopyable>
81  ("G4UserStackingAction", "stacking action class")
82  // ---
83  .def("ClassifyNewTrack", &G4UserStackingAction::ClassifyNewTrack,
84  &CB_G4UserStackingAction::ClassifyNewTrack)
85  .def("NewStage", &G4UserStackingAction::NewStage,
86  &CB_G4UserStackingAction::NewStage)
87  .def("PrepareNewEvent", &G4UserStackingAction::PrepareNewEvent,
88  &CB_G4UserStackingAction::PrepareNewEvent)
89  ;
90 }