Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
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 fKill, fPostpone, fUrgent, fWaiting, fWaiting_1, fWaiting_10, fWaiting_2, fWaiting_3, fWaiting_4, fWaiting_5, fWaiting_6, fWaiting_7, fWaiting_8, and fWaiting_9.

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 }
const XML_Char int const XML_Char * value
void export_G4Event ( )

Definition at line 51 of file pyG4Event.cc.

References G4Event::AddPrimaryVertex(), G4Event::Draw(), G4Event::GetEventID(), G4Event::GetNumberOfPrimaryVertex(), G4Event::GetPrimaryVertex(), G4Event::GetTrajectoryContainer(), G4Event::GetUserInformation(), G4Event::IsAborted(), G4Event::Print(), G4Event::SetEventAborted(), G4Event::SetEventID(), and G4Event::SetUserInformation().

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 }
G4VUserEventInformation * GetUserInformation() const
Definition: G4Event.hh:188
G4int GetNumberOfPrimaryVertex() const
Definition: G4Event.hh:153
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
Definition: G4Event.hh:143
void Print() const
Definition: G4Event.cc:87
G4TrajectoryContainer * GetTrajectoryContainer() const
Definition: G4Event.hh:178
G4int GetEventID() const
Definition: G4Event.hh:140
void SetUserInformation(G4VUserEventInformation *anInfo)
Definition: G4Event.hh:187
G4PrimaryVertex * GetPrimaryVertex(G4int i=0) const
Definition: G4Event.hh:156
void SetEventAborted()
Definition: G4Event.hh:122
void Draw() const
Definition: G4Event.cc:92
void SetEventID(G4int i)
Definition: G4Event.hh:114
G4bool IsAborted() const
Definition: G4Event.hh:184
void export_G4EventManager ( )

Definition at line 41 of file pyG4EventManager.cc.

References G4EventManager::AbortCurrentEvent(), G4EventManager::GetConstCurrentEvent(), G4EventManager::GetEventManager(), G4EventManager::GetNonconstCurrentEvent(), G4EventManager::GetStackManager(), G4EventManager::GetTrackingManager(), G4EventManager::GetUserInformation(), G4EventManager::GetVerboseLevel(), G4EventManager::SetNumberOfAdditionalWaitingStacks(), G4EventManager::SetUserInformation(), and G4EventManager::SetVerboseLevel().

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",
53  return_internal_reference<>())
54  .def("AbortCurrentEvent", &G4EventManager::AbortCurrentEvent)
55  .def("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 }
G4StackManager * GetStackManager() const
G4Event * GetNonconstCurrentEvent()
void SetVerboseLevel(G4int value)
G4TrackingManager * GetTrackingManager() const
void SetUserInformation(G4VUserEventInformation *anInfo)
G4int GetVerboseLevel()
static G4EventManager * GetEventManager()
void AbortCurrentEvent()
const G4Event * GetConstCurrentEvent()
void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
G4VUserEventInformation * GetUserInformation()
void export_G4ParticleGun ( )

Definition at line 127 of file pyG4ParticleGun.cc.

References G4ParticleGun::GeneratePrimaryVertex(), G4ParticleGun::GetNumberOfParticles(), pyG4ParticleGun::GetParticleByName(), G4ParticleGun::GetParticleCharge(), G4ParticleGun::GetParticleDefinition(), G4ParticleGun::GetParticleEnergy(), G4ParticleGun::GetParticleMomentumDirection(), G4ParticleGun::GetParticlePolarization(), G4VPrimaryGenerator::GetParticlePosition(), G4VPrimaryGenerator::GetParticleTime(), G4ParticleGun::SetNumberOfParticles(), pyG4ParticleGun::SetParticleByName(), G4ParticleGun::SetParticleCharge(), G4ParticleGun::SetParticleDefinition(), G4ParticleGun::SetParticleEnergy(), G4ParticleGun::SetParticleMomentum(), G4ParticleGun::SetParticleMomentumDirection(), G4ParticleGun::SetParticlePolarization(), G4VPrimaryGenerator::SetParticlePosition(), and G4VPrimaryGenerator::SetParticleTime().

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",
152  .def("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 SetParticleMomentum(G4double aMomentum)
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
G4ThreeVector GetParticlePosition()
virtual void GeneratePrimaryVertex(G4Event *evt)
G4ParticleMomentum GetParticleMomentumDirection() const
void SetParticlePolarization(G4ThreeVector aVal)
G4ThreeVector GetParticlePolarization() const
void SetParticlePosition(G4ThreeVector aPosition)
void SetParticleCharge(G4double aCharge)
G4double GetParticleCharge() const
void SetNumberOfParticles(G4int i)
void SetParticleByName(G4ParticleGun *gun, const std::string &pname)
G4int GetNumberOfParticles() const
void SetParticleEnergy(G4double aKineticEnergy)
std::string GetParticleByName(G4ParticleGun *gun)
G4ParticleDefinition * GetParticleDefinition() const
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
G4double GetParticleEnergy() const
void SetParticleTime(G4double aTime)
void export_G4StackManager ( )

Definition at line 55 of file pyG4StackManager.cc.

References G4StackManager::clear(), G4StackManager::ClearPostponeStack(), G4StackManager::ClearUrgentStack(), G4StackManager::ClearWaitingStack(), G4StackManager::GetNTotalTrack(), G4StackManager::GetNUrgentTrack(), G4StackManager::GetNWaitingTrack(), G4StackManager::ReClassify(), and G4StackManager::SetVerboseLevel().

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 }
G4int GetNTotalTrack() const
G4int GetNUrgentTrack() const
void SetVerboseLevel(G4int const value)
G4int GetNWaitingTrack(int i=0) const
void ClearPostponeStack()
void ClearWaitingStack(int i=0)
void export_G4UserEventAction ( )

Definition at line 65 of file pyG4UserEventAction.cc.

References CB_G4UserEventAction::BeginOfEventAction(), G4UserEventAction::BeginOfEventAction(), CB_G4UserEventAction::EndOfEventAction(), and 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 BeginOfEventAction(const G4Event *anEvent)
virtual void EndOfEventAction(const G4Event *anEvent)
virtual void BeginOfEventAction(const G4Event *anEvent)
void EndOfEventAction(const G4Event *anEvent)
void export_G4UserStackingAction ( )

Definition at line 79 of file pyG4UserStackingAction.cc.

References G4UserStackingAction::ClassifyNewTrack(), G4UserStackingAction::NewStage(), and G4UserStackingAction::PrepareNewEvent().

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 }
virtual void PrepareNewEvent()
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)