LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 48 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 94 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 84 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 74 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 60 of file pyMedicalBeam.cc.

Referenced by BOOST_PYTHON_MODULE().

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