LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 40 of file pyG4ClassificationOfNewTrack.cc.

References fhicl::detail::atom::value().

Referenced by BOOST_PYTHON_MODULE().

41 {
42  enum_<G4ClassificationOfNewTrack>("G4ClassificationOfNewTrack")
43  .value("fUrgent", fUrgent)
44  .value("fWaiting", fWaiting)
45  .value("fPostpone", fPostpone)
46  .value("fKill", fKill)
47  .value("fWaiting_1", fWaiting_1)
48  .value("fWaiting_2", fWaiting_2)
49  .value("fWaiting_3", fWaiting_3)
50  .value("fWaiting_4", fWaiting_4)
51  .value("fWaiting_5", fWaiting_5)
52  .value("fWaiting_6", fWaiting_6)
53  .value("fWaiting_7", fWaiting_7)
54  .value("fWaiting_8", fWaiting_8)
55  .value("fWaiting_9", fWaiting_9)
56  .value("fWaiting_19", fWaiting_10)
57  ;
58 }
std::string value(boost::any const &)
void export_G4Event ( )

Definition at line 51 of file pyG4Event.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 41 of file pyG4EventManager.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 127 of file pyG4ParticleGun.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 55 of file pyG4StackManager.cc.

References clear(), and pyG4StackManager::GetNWaitingTrack.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 65 of file pyG4UserEventAction.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 79 of file pyG4UserStackingAction.cc.

Referenced by BOOST_PYTHON_MODULE().

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