33 #include <boost/python.hpp>
42 using namespace boost::python;
47 namespace pyG4EmCalculator {
94 GetCrossSectionPerVolume, 4, 5);
97 #if G4VERSION_NUMBER <= 801
101 = &G4EmCalculator::GetCrossSectionPerAtom;
106 = &G4EmCalculator::GetCrossSectionPerAtom;
109 GetCrossSectionPerAtom, 4, 5);
124 GetMeanFreePath, 4, 5);
139 #if G4VERSION_NUMBER >=710
149 #if G4VERSION_NUMBER >= 810
160 ComputeElectronicDEDX, 3, 4);
187 ComputeCrossSectionPerVolume, 4, 5);
200 ComputeCrossSectionPerAtom, 5, 6);
203 ComputeCrossSectionPerAtom, 4, 5);
205 #if G4VERSION_NUMBER >= 830
228 ComputeMeanFreePath, 4, 5);
235 using namespace pyG4EmCalculator;
242 class_<G4EmCalculator, boost::noncopyable>
243 (
"G4EmCalculator",
"Provide access to dE/dx and cross section")
251 .def(
"GetCrossSectionPerVolume",
253 .def(
"GetCrossSectionPerVolume",
256 .def(
"GetCrossSectionPerAtom",
258 .def(
"GetCrossSectionPerAtom",
270 #if G4VERSION_NUMBER >=710
271 .def(
"ComputeNuclearDEDX", f1_ComputeNuclearDEDX)
272 .def(
"ComputeNuclearDEDX", f2_ComputeNuclearDEDX)
274 #if G4VERSION_NUMBER >= 810
275 .def(
"ComputeElectronicDEDX", f1_ComputeElectronicDEDX,
276 f_ComputeElectronicDEDX())
277 .def(
"ComputeDEDX", f2_ComputeElectronicDEDX,
278 f_ComputeElectronicDEDX())
279 .def(
"ComputeTotalDEDX", f1_ComputeTotalDEDX, f_ComputeTotalDEDX())
280 .def(
"ComputeTotalDEDX", f2_ComputeTotalDEDX, f_ComputeTotalDEDX())
283 .def(
"ComputeCrossSectionPerVolume",
285 .def(
"ComputeCrossSectionPerVolume",
287 .def(
"ComputeCrossSectionPerAtom",
289 .def(
"ComputeCrossSectionPerAtom",
291 #if G4VERSION_NUMBER >= 830
292 .def(
"ComputeEnergyCutFromRangeCut", f1_ComputeEnergyCutFromRangeCut)
293 .def(
"ComputeEnergyCutFromRangeCut", f2_ComputeEnergyCutFromRangeCut)
296 .def(
"ComputeMeanFreePath",
298 .def(
"ComputeMeanFreePath",
302 return_value_policy<reference_existing_object>())
304 return_value_policy<reference_existing_object>())
306 return_value_policy<reference_existing_object>())
308 f_FindCouple()[return_value_policy<reference_existing_object>()])