LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pyMedicalBeam.cc File Reference
#include <boost/python.hpp>
#include "MedicalBeam.hh"
#include "G4ParticleTable.hh"
#include "G4RunManager.hh"

Go to the source code of this file.

Namespaces

 pyMedicalBeam
 

Functions

MedicalBeampyMedicalBeam::Construct ()
 
void pyMedicalBeam::SetParticleByName (MedicalBeam *beam, const std::string &pname)
 
std::string pyMedicalBeam::GetParticleByName (MedicalBeam *beam)
 
void pyMedicalBeam::f_SetFieldXY (MedicalBeam *beam, const list &listXY)
 
list pyMedicalBeam::f_GetFieldXY (MedicalBeam *beam)
 
 BOOST_PYTHON_MODULE (MedicalBeam)
 

Function Documentation

BOOST_PYTHON_MODULE ( MedicalBeam  )

Definition at line 113 of file pyMedicalBeam.cc.

References MedicalBeam::CIRCLE, pyMedicalBeam::Construct(), pyMedicalBeam::f_GetFieldXY(), pyMedicalBeam::f_SetFieldXY(), MedicalBeam::GetFieldR(), MedicalBeam::GetFieldShape(), MedicalBeam::GetFieldX(), MedicalBeam::GetFieldY(), MedicalBeam::GetKineticE(), pyMedicalBeam::GetParticleByName(), MedicalBeam::GetSourcePosition(), MedicalBeam::GetSSD(), MedicalBeam::SetFieldR(), MedicalBeam::SetFieldShape(), MedicalBeam::SetKineticE(), pyMedicalBeam::SetParticleByName(), MedicalBeam::SetSourcePosition(), MedicalBeam::SetSSD(), MedicalBeam::SQUARE, and value.

113  {
114  class_<MedicalBeam, MedicalBeam*,
115  bases<G4VUserPrimaryGeneratorAction> >
116  ("MedicalBeam", "primary generator action with medical beam")
117  // ---
118  .add_property("particle", GetParticleByName, SetParticleByName)
119  .def("SetParticleByName", SetParticleByName)
120  .def("GetParticleByName", GetParticleByName)
121  // ---
122  .add_property("kineticE", &MedicalBeam::GetKineticE,
124  .def("SetKineticE", &MedicalBeam::SetKineticE)
125  .def("GetKineticE", &MedicalBeam::GetKineticE)
126  // ---
127  .add_property("sourcePosition", &MedicalBeam::GetSourcePosition,
129  .def("SetSourcePosition", &MedicalBeam::SetSourcePosition)
130  .def("GetSourcePosition", &MedicalBeam::GetSourcePosition)
131  // ---
132  .add_property("fieldShape", &MedicalBeam::GetFieldShape,
134  .def("SetFieldShape", &MedicalBeam::SetFieldShape)
135  .def("GetFieldShape", &MedicalBeam::GetFieldShape)
136  // ---
137  .add_property("SSD", &MedicalBeam::GetSSD, &MedicalBeam::SetSSD)
138  .def("SetSSD", &MedicalBeam::SetSSD)
139  .def("GetSSD", &MedicalBeam::GetSSD)
140  // ----
141  .add_property("fieldXY", f_GetFieldXY, f_SetFieldXY)
142  .def("SetFieldXY", f_SetFieldXY)
143  .def("GetFieldXY", f_GetFieldXY)
144  .def("GetFieldX", &MedicalBeam::GetFieldX)
145  .def("GetFieldY", &MedicalBeam::GetFieldY)
146  // ---
147  .add_property("fieldR", &MedicalBeam::GetFieldR, &MedicalBeam::SetFieldR)
148  .def("SetFieldR", &MedicalBeam::SetFieldR)
149  .def("GetFieldR", &MedicalBeam::GetFieldR)
150  ;
151 
152  // enums...
153  enum_<MedicalBeam::FieldShape>("FieldShape")
154  .value("SQUARE", MedicalBeam::SQUARE)
155  .value("CIRCLE", MedicalBeam::CIRCLE)
156  ;
157 
158  // ---
159  def("Construct", Construct,
160  return_value_policy<reference_existing_object>());
161 }
G4double GetFieldR() const
Definition: MedicalBeam.hh:139
G4double GetKineticE() const
Definition: MedicalBeam.hh:106
MedicalBeam * Construct()
void SetFieldShape(FieldShape shape)
Definition: MedicalBeam.hh:115
std::string GetParticleByName(MedicalBeam *beam)
void SetFieldR(G4double r)
Definition: MedicalBeam.hh:136
void SetSourcePosition(const G4ThreeVector &pos)
Definition: MedicalBeam.hh:109
void SetSSD(G4double ssd)
Definition: MedicalBeam.hh:121
list f_GetFieldXY(MedicalBeam *beam)
G4double GetFieldX() const
Definition: MedicalBeam.hh:130
double value
Definition: spectrum.C:18
G4double GetSSD() const
Definition: MedicalBeam.hh:124
FieldShape GetFieldShape() const
Definition: MedicalBeam.hh:118
void SetParticleByName(MedicalBeam *beam, const std::string &pname)
void SetKineticE(G4double e)
Definition: MedicalBeam.hh:103
G4ThreeVector GetSourcePosition() const
Definition: MedicalBeam.hh:112
G4double GetFieldY() const
Definition: MedicalBeam.hh:133
void f_SetFieldXY(MedicalBeam *beam, const list &listXY)