LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pyG4ParticleGun.cc File Reference
#include <boost/python.hpp>
#include "G4Version.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4Event.hh"

Go to the source code of this file.

Namespaces

 pyG4ParticleGun
 

Functions

void pyG4ParticleGun::SetParticleByName (G4ParticleGun *gun, const std::string &pname)
 
std::string pyG4ParticleGun::GetParticleByName (G4ParticleGun *gun)
 
void export_G4ParticleGun ()
 

Function Documentation

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)