Geant4-11
pyG4EmCalculator.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// ====================================================================
27// pyG4EmCalculator.cc
28//
29// 2006 Q
30// ====================================================================
31#include <boost/python.hpp>
32#include "G4Version.hh"
33#include "G4EmCalculator.hh"
34#include "G4Region.hh"
35#include "G4Material.hh"
36#include "G4Element.hh"
39
40using namespace boost::python;
41
42// ====================================================================
43// thin wrappers
44// ====================================================================
46
47// GetDEDX
49 (G4double, const G4ParticleDefinition*, const G4Material*, const G4Region*)
51
53 (G4double, const G4String&, const G4String&, const G4String&)
55
56BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetDEDX, GetDEDX, 3, 4)
57
58// GetRange
60 (G4double, const G4ParticleDefinition*, const G4Material*, const G4Region*)
61 = &G4EmCalculator::GetRange;
62
64 (G4double, const G4String&, const G4String&, const G4String&)
65 = &G4EmCalculator::GetRange;
66
67BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetRange, GetRange, 3, 4)
68
69// GetKinEnergy
71 (G4double, const G4ParticleDefinition*, const G4Material*, const G4Region*)
72 = &G4EmCalculator::GetKinEnergy;
73
75 (G4double, const G4String&, const G4String&, const G4String&)
76 = &G4EmCalculator::GetKinEnergy;
77
78BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetKinEnergy, GetKinEnergy, 3, 4)
79
80// GetCrossSectionPerVolume
83 const G4String&, const G4Material*, const G4Region*)
84 = &G4EmCalculator::GetCrossSectionPerVolume;
85
87 (G4double, const G4String&, const G4String&,
88 const G4String&, const G4String&)
89 = &G4EmCalculator::GetCrossSectionPerVolume;
90
91BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetCrossSectionPerVolume,
92 GetCrossSectionPerVolume, 4, 5)
93
94// GetMeanFreePath
95G4double (G4EmCalculator::*f1_GetMeanFreePath)
97 const G4String&, const G4Material*, const G4Region*)
98 = &G4EmCalculator::GetMeanFreePath;
99
101 (G4double, const G4String&, const G4String&,
102 const G4String&, const G4String&)
103 = &G4EmCalculator::GetMeanFreePath;
104
106 GetMeanFreePath, 4, 5)
107
108// ComputeDEDX
109G4double (G4EmCalculator::*f1_ComputeDEDX)
111 const G4String&, const G4Material*, G4double)
112 = &G4EmCalculator::ComputeDEDX;
113
115 (G4double, const G4String&, const G4String&, const G4String&, G4double)
116 = &G4EmCalculator::ComputeDEDX;
117
118BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeDEDX, ComputeDEDX, 4, 5)
119
120// ComputeNuclearDEDX
123 = &G4EmCalculator::ComputeNuclearDEDX;
124
126 (G4double, const G4String&, const G4String&)
127 = &G4EmCalculator::ComputeNuclearDEDX;
128
129// ComputeElectronicDEDX
132 = &G4EmCalculator::ComputeElectronicDEDX;
133
135 (G4double, const G4String&, const G4String&, G4double)
136 = &G4EmCalculator::ComputeElectronicDEDX;
137
138BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeElectronicDEDX,
139 ComputeElectronicDEDX, 3, 4)
140
141// ComputeTotalDEDX
142G4double (G4EmCalculator::*f1_ComputeTotalDEDX)
144 = &G4EmCalculator::ComputeTotalDEDX;
145
147 (G4double, const G4String&, const G4String&, G4double)
148 = &G4EmCalculator::ComputeTotalDEDX;
149
150BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeTotalDEDX, ComputeTotalDEDX,
151 3, 4)
152// ComputeCrossSectionPerVolume
153G4double (G4EmCalculator::*f1_ComputeCrossSectionPerVolume)
155 const G4String&, const G4Material*, G4double)
156 = &G4EmCalculator::ComputeCrossSectionPerVolume;
157
159 (G4double, const G4String&, const G4String&, const G4String&, G4double)
160 = &G4EmCalculator::ComputeCrossSectionPerVolume;
161
162BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeCrossSectionPerVolume,
163 ComputeCrossSectionPerVolume, 4, 5)
164
165// ComputeCrossSectionPerAtom
166G4double (G4EmCalculator::*f1_ComputeCrossSectionPerAtom)
167 (G4double, const G4ParticleDefinition*, const G4String&,
170
172 (G4double, const G4String&, const G4String&, const G4Element*, G4double)
174
175BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeCrossSectionPerAtom,
177
178BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(g_ComputeCrossSectionPerAtom,
180
181// ComputeEnergyCutFromRangeCut
184 = &G4EmCalculator::ComputeEnergyCutFromRangeCut;
185
187 (G4double range, const G4String&, const G4String&)
188 = &G4EmCalculator::ComputeEnergyCutFromRangeCut;
189
190// ComputeMeanFreePath
193 const G4String&, const G4Material*, G4double)
194 = &G4EmCalculator::ComputeMeanFreePath;
195
197 (G4double, const G4String&, const G4String&, const G4String&, G4double)
198 = &G4EmCalculator::ComputeMeanFreePath;
199
200BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeMeanFreePath,
201 ComputeMeanFreePath, 4, 5)
202
203// FindCouple
204BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_FindCouple, FindCouple, 1, 2)
205
206}
207
208using namespace pyG4EmCalculator;
209
210// ====================================================================
211// module definition
212// ====================================================================
214{
215 class_<G4EmCalculator, boost::noncopyable>
216 ("G4EmCalculator", "Provide access to dE/dx and cross section")
217 // ---
218 .def("GetDEDX", f1_GetDEDX, f_GetDEDX())
219 .def("GetDEDX", f2_GetDEDX, f_GetDEDX())
220 .def("GetRange", f1_GetRange, f_GetRange())
221 .def("GetRange", f2_GetDEDX, f_GetRange())
222 .def("GetKinEnergy", f1_GetKinEnergy, f_GetKinEnergy())
223 .def("GetKinEnergy", f2_GetKinEnergy, f_GetKinEnergy())
224 .def("GetCrossSectionPerVolume",
225 f1_GetCrossSectionPerVolume, f_GetCrossSectionPerVolume())
226 .def("GetCrossSectionPerVolume",
227 f2_GetCrossSectionPerVolume, f_GetCrossSectionPerVolume())
228 .def("GetMeanFreePath", f1_GetMeanFreePath, f_GetMeanFreePath())
229 .def("GetMeanFreePath", f2_GetMeanFreePath, f_GetMeanFreePath())
230 // ---
231 .def("PrintDEDXTable", &G4EmCalculator::PrintDEDXTable)
232 .def("PrintRangeTable", &G4EmCalculator::PrintRangeTable)
233 .def("PrintInverseRangeTable", &G4EmCalculator::PrintInverseRangeTable)
234 // ---
235 .def("ComputeDEDX", f1_ComputeDEDX, f_ComputeDEDX())
236 .def("ComputeDEDX", f2_ComputeDEDX, f_ComputeDEDX())
237 .def("ComputeNuclearDEDX", f1_ComputeNuclearDEDX)
238 .def("ComputeNuclearDEDX", f2_ComputeNuclearDEDX)
239 .def("ComputeElectronicDEDX", f1_ComputeElectronicDEDX,
240 f_ComputeElectronicDEDX())
241 .def("ComputeDEDX", f2_ComputeElectronicDEDX,
242 f_ComputeElectronicDEDX())
243 .def("ComputeTotalDEDX", f1_ComputeTotalDEDX, f_ComputeTotalDEDX())
244 .def("ComputeTotalDEDX", f2_ComputeTotalDEDX, f_ComputeTotalDEDX())
245 // ---
246 .def("ComputeCrossSectionPerVolume",
247 f1_ComputeCrossSectionPerVolume, f_ComputeCrossSectionPerVolume())
248 .def("ComputeCrossSectionPerVolume",
249 f2_ComputeCrossSectionPerVolume, f_ComputeCrossSectionPerVolume())
250 .def("ComputeCrossSectionPerAtom",
251 f1_ComputeCrossSectionPerAtom, f_ComputeCrossSectionPerAtom())
252 .def("ComputeCrossSectionPerAtom",
253 f2_ComputeCrossSectionPerAtom, g_ComputeCrossSectionPerAtom())
254 .def("ComputeEnergyCutFromRangeCut", f1_ComputeEnergyCutFromRangeCut)
255 .def("ComputeEnergyCutFromRangeCut", f2_ComputeEnergyCutFromRangeCut)
256 // ---
257 .def("ComputeMeanFreePath",
258 f1_ComputeMeanFreePath, f_ComputeMeanFreePath())
259 .def("ComputeMeanFreePath",
260 f2_ComputeMeanFreePath, f_ComputeMeanFreePath())
261 // ---
262 .def("FindParticle", &G4EmCalculator::FindParticle,
263 return_value_policy<reference_existing_object>())
264 .def("FindMaterial", &G4EmCalculator::FindMaterial,
265 return_value_policy<reference_existing_object>())
266 .def("FindRegion", &G4EmCalculator::FindRegion,
267 return_value_policy<reference_existing_object>())
268 .def("FindCouple", &G4EmCalculator::FindCouple,
269 f_FindCouple()[return_value_policy<reference_existing_object>()])
270 // ---
271 .def("SetVerbose", &G4EmCalculator::SetVerbose)
272 ;
273}
double G4double
Definition: G4Types.hh:83
const G4ParticleDefinition * FindParticle(const G4String &)
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
void SetVerbose(G4int val)
void PrintDEDXTable(const G4ParticleDefinition *)
const G4Region * FindRegion(const G4String &)
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=nullptr)
void PrintRangeTable(const G4ParticleDefinition *)
void PrintInverseRangeTable(const G4ParticleDefinition *)
const G4Material * FindMaterial(const G4String &)
G4double(G4EmCalculator::* f2_ComputeMeanFreePath)(G4double, const G4String &, const G4String &, const G4String &, G4double)
G4double(G4EmCalculator::* f2_ComputeEnergyCutFromRangeCut)(G4double range, const G4String &, const G4String &)
G4double(G4EmCalculator::* f1_GetDEDX)(G4double, const G4ParticleDefinition *, const G4Material *, const G4Region *)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeCrossSectionPerAtom, ComputeCrossSectionPerAtom, 5, 6) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(g_ComputeCrossSectionPerAtom
G4double(G4EmCalculator::* f1_ComputeNuclearDEDX)(G4double, const G4ParticleDefinition *, const G4Material *)
G4double(G4EmCalculator::* f2_GetCrossSectionPerVolume)(G4double, const G4String &, const G4String &, const G4String &, const G4String &)
G4double(G4EmCalculator::* f2_GetDEDX)(G4double, const G4String &, const G4String &, const G4String &)
G4double(G4EmCalculator::* f1_GetRange)(G4double, const G4ParticleDefinition *, const G4Material *, const G4Region *)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetCrossSectionPerVolume, GetCrossSectionPerVolume, 4, 5) G4double(G4EmCalculator G4double(G4EmCalculator::* f2_GetMeanFreePath)(G4double, const G4String &, const G4String &, const G4String &, const G4String &)
G4double(G4EmCalculator::* f2_GetKinEnergy)(G4double, const G4String &, const G4String &, const G4String &)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeTotalDEDX, ComputeTotalDEDX, 3, 4) G4double(G4EmCalculator G4double(G4EmCalculator::* f2_ComputeCrossSectionPerVolume)(G4double, const G4String &, const G4String &, const G4String &, G4double)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetMeanFreePath, GetMeanFreePath, 4, 5) G4double(G4EmCalculator G4double(G4EmCalculator::* f2_ComputeDEDX)(G4double, const G4String &, const G4String &, const G4String &, G4double)
G4double(G4EmCalculator::* f1_ComputeElectronicDEDX)(G4double, const G4ParticleDefinition *, const G4Material *, G4double)
G4double(G4EmCalculator::* f1_GetCrossSectionPerVolume)(G4double, const G4ParticleDefinition *, const G4String &, const G4Material *, const G4Region *)
G4double(G4EmCalculator::* f2_ComputeNuclearDEDX)(G4double, const G4String &, const G4String &)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeCrossSectionPerVolume, ComputeCrossSectionPerVolume, 4, 5) G4double(G4EmCalculator G4double(G4EmCalculator::* f2_ComputeCrossSectionPerAtom)(G4double, const G4String &, const G4String &, const G4Element *, G4double)
G4double(G4EmCalculator::* f1_ComputeMeanFreePath)(G4double, const G4ParticleDefinition *, const G4String &, const G4Material *, G4double)
G4double(G4EmCalculator::* f1_ComputeEnergyCutFromRangeCut)(G4double, const G4ParticleDefinition *, const G4Material *)
G4double(G4EmCalculator::* f2_GetRange)(G4double, const G4String &, const G4String &, const G4String &)
G4double(G4EmCalculator::* f2_ComputeElectronicDEDX)(G4double, const G4String &, const G4String &, G4double)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeElectronicDEDX, ComputeElectronicDEDX, 3, 4) G4double(G4EmCalculator G4double(G4EmCalculator::* f2_ComputeTotalDEDX)(G4double, const G4String &, const G4String &, G4double)
G4double(G4EmCalculator::* f1_GetKinEnergy)(G4double, const G4ParticleDefinition *, const G4Material *, const G4Region *)
void export_G4EmCalculator()