38 #include <boost/python.hpp>
43 using namespace boost::python;
48 namespace pyMedicalBeam {
54 MedicalBeam* medicalbeam=
new MedicalBeam();
55 runMgr-> SetUserAction(medicalbeam);
68 beam-> SetParticleDefinition(pd);
70 G4cout <<
"*** \"" << pname <<
"\" is not registered "
71 <<
"in available particle list" <<
G4endl;
81 if(pd==0)
return std::string(
"None");
82 else return (pd-> GetParticleName()).c_str();
89 G4double fx= extract<double>(listXY[0]);
90 G4double fy= extract<double>(listXY[1]);
91 beam-> SetFieldXY(fx, fy);
101 listFieldXY.append(beam-> GetFieldX());
102 listFieldXY.append(beam-> GetFieldY());
109 using namespace pyMedicalBeam;
116 class_<MedicalBeam, MedicalBeam*,
117 bases<G4VUserPrimaryGeneratorAction> >
118 (
"MedicalBeam",
"primary generator action with medical beam")
155 enum_<MedicalBeam::FieldShape>(
"FieldShape")
162 return_value_policy<reference_existing_object>());