37 #include <boost/python.hpp> 39 #include "G4ParticleTable.hh" 40 #include "G4RunManager.hh" 51 G4RunManager* runMgr= G4RunManager::GetRunManager();
54 runMgr-> SetUserAction(medicalbeam);
64 G4ParticleTable* particleTable= G4ParticleTable::GetParticleTable();
65 G4ParticleDefinition* pd= particleTable-> FindParticle(pname);
67 beam-> SetParticleDefinition(pd);
69 G4cout <<
"*** \"" << pname <<
"\" is not registered " 70 <<
"in available particle list" << G4endl;
78 const G4ParticleDefinition* pd= beam-> GetParticleDefinition();
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());
116 bases<G4VUserPrimaryGeneratorAction> >
117 (
"MedicalBeam",
"primary generator action with medical beam")
154 enum_<MedicalBeam::FieldShape>(
"FieldShape")
161 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
std::string value(boost::any 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)