36 #include <boost/python.hpp>
41 using namespace boost::python;
46 namespace pyMedicalBeam {
52 MedicalBeam* medicalbeam=
new MedicalBeam();
53 runMgr-> SetUserAction(medicalbeam);
66 beam-> SetParticleDefinition(pd);
68 G4cout <<
"*** \"" << pname <<
"\" is not registered "
69 <<
"in available particle list" <<
G4endl;
79 if(pd==0)
return std::string(
"None");
80 else return (pd-> GetParticleName()).c_str();
87 G4double fx= extract<double>(listXY[0]);
88 G4double fy= extract<double>(listXY[1]);
89 beam-> SetFieldXY(fx, fy);
99 listFieldXY.append(beam-> GetFieldX());
100 listFieldXY.append(beam-> GetFieldY());
107 using namespace pyMedicalBeam;
114 class_<MedicalBeam, MedicalBeam*,
115 bases<G4VUserPrimaryGeneratorAction> >
116 (
"MedicalBeam",
"primary generator action with medical beam")
153 enum_<MedicalBeam::FieldShape>(
"FieldShape")
160 return_value_policy<reference_existing_object>());