LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
pyMedicalBeam Namespace Reference

Functions

MedicalBeamConstruct ()
 
void SetParticleByName (MedicalBeam *beam, const std::string &pname)
 
std::string GetParticleByName (MedicalBeam *beam)
 
void f_SetFieldXY (MedicalBeam *beam, const list &listXY)
 
list f_GetFieldXY (MedicalBeam *beam)
 

Function Documentation

MedicalBeam* pyMedicalBeam::Construct ( )

Definition at line 49 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

50 {
51  G4RunManager* runMgr= G4RunManager::GetRunManager();
52 
53  MedicalBeam* medicalbeam= new MedicalBeam();
54  runMgr-> SetUserAction(medicalbeam);
55 
56  return medicalbeam;
57 }
list pyMedicalBeam::f_GetFieldXY ( MedicalBeam beam)

Definition at line 95 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

97 {
98  list listFieldXY;
99 
100  listFieldXY.append(beam-> GetFieldX());
101  listFieldXY.append(beam-> GetFieldY());
102 
103  return listFieldXY;
104 }
void pyMedicalBeam::f_SetFieldXY ( MedicalBeam beam,
const list &  listXY 
)

Definition at line 85 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

87 {
88  G4double fx= extract<double>(listXY[0]);
89  G4double fy= extract<double>(listXY[1]);
90  beam-> SetFieldXY(fx, fy);
91 }
std::string pyMedicalBeam::GetParticleByName ( MedicalBeam beam)

Definition at line 75 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

77 {
78  const G4ParticleDefinition* pd= beam-> GetParticleDefinition();
79 
80  if(pd==0) return std::string("None");
81  else return (pd-> GetParticleName()).c_str();
82 }
void pyMedicalBeam::SetParticleByName ( MedicalBeam beam,
const std::string &  pname 
)

Definition at line 61 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

63 {
64  G4ParticleTable* particleTable= G4ParticleTable::GetParticleTable();
65  G4ParticleDefinition* pd= particleTable-> FindParticle(pname);
66  if (pd != 0) {
67  beam-> SetParticleDefinition(pd);
68  } else {
69  G4cout << "*** \"" << pname << "\" is not registered "
70  << "in available particle list" << G4endl;
71  }
72 }