36 #include <boost/python.hpp> 38 #include "G4ParticleTable.hh" 39 #include "G4RunManager.hh" 50 G4RunManager* runMgr= G4RunManager::GetRunManager();
53 runMgr-> SetUserAction(medicalbeam);
63 G4ParticleTable* particleTable= G4ParticleTable::GetParticleTable();
64 G4ParticleDefinition* pd= particleTable-> FindParticle(pname);
66 beam-> SetParticleDefinition(pd);
68 G4cout <<
"*** \"" << pname <<
"\" is not registered " 69 <<
"in available particle list" << G4endl;
77 const G4ParticleDefinition* pd= beam-> GetParticleDefinition();
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());
115 bases<G4VUserPrimaryGeneratorAction> >
116 (
"MedicalBeam",
"primary generator action with medical beam")
153 enum_<MedicalBeam::FieldShape>(
"FieldShape")
160 return_value_policy<reference_existing_object>());
BOOST_PYTHON_MODULE(MedicalBeam)
G4double GetFieldR() const
G4double GetKineticE() const
MedicalBeam * Construct()
void SetFieldShape(FieldShape shape)
std::string GetParticleByName(MedicalBeam *beam)
void SetFieldR(G4double r)
void SetSourcePosition(const G4ThreeVector &pos)
void SetSSD(G4double ssd)
list f_GetFieldXY(MedicalBeam *beam)
G4double GetFieldX() const
FieldShape GetFieldShape() const
void SetParticleByName(MedicalBeam *beam, const std::string &pname)
void SetKineticE(G4double e)
G4ThreeVector GetSourcePosition() const
G4double GetFieldY() const
void f_SetFieldXY(MedicalBeam *beam, const list &listXY)