37 #include <boost/python.hpp>
42 using namespace boost::python;
47 namespace pyMedicalBeam {
53 MedicalBeam* medicalbeam=
new MedicalBeam();
54 runMgr-> SetUserAction(medicalbeam);
67 beam-> SetParticleDefinition(pd);
69 G4cout <<
"*** \"" << pname <<
"\" is not registered "
70 <<
"in available particle list" <<
G4endl;
80 if(pd==0)
return std::string(
"None");
81 else return (pd-> GetParticleName()).c_str();
88 G4double fx= extract<double>(listXY[0]);
89 G4double fy= extract<double>(listXY[1]);
90 beam-> SetFieldXY(fx, fy);
100 listFieldXY.append(beam-> GetFieldX());
101 listFieldXY.append(beam-> GetFieldY());
108 using namespace pyMedicalBeam;
115 class_<MedicalBeam, MedicalBeam*,
116 bases<G4VUserPrimaryGeneratorAction> >
117 (
"MedicalBeam",
"primary generator action with medical beam")
154 enum_<MedicalBeam::FieldShape>(
"FieldShape")
161 return_value_policy<reference_existing_object>());
G4double GetFieldR() const
void SetParticleByName(MedicalBeam *beam, const std::string &pname)
std::string GetParticleByName(MedicalBeam *beam)
void SetSSD(G4double ssd)
G4double GetKineticE() const
list f_GetFieldXY(MedicalBeam *beam)
FieldShape GetFieldShape() const
G4double GetFieldY() const
void SetFieldR(G4double r)
void SetSourcePosition(const G4ThreeVector &pos)
G4GLOB_DLL std::ostream G4cout
G4ThreeVector GetSourcePosition() const
static G4RunManager * GetRunManager()
BOOST_PYTHON_MODULE(TestEm0)
void SetFieldShape(FieldShape shape)
static G4ParticleTable * GetParticleTable()
void SetKineticE(G4double e)
const XML_Char int const XML_Char * value
void f_SetFieldXY(MedicalBeam *beam, const list &listXY)
G4double GetFieldX() const