LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pymodG4materials.cc File Reference
#include <boost/python.hpp>

Go to the source code of this file.

Functions

void export_G4Material ()
 
void export_G4MaterialTable ()
 
void export_G4Element ()
 
void export_G4ElementTable ()
 
void export_G4Isotope ()
 
void export_G4NistManager ()
 
void export_G4AtomicShells ()
 
 BOOST_PYTHON_MODULE (G4materials)
 

Function Documentation

BOOST_PYTHON_MODULE ( G4materials  )

Definition at line 47 of file pymodG4materials.cc.

References export_G4AtomicShells(), export_G4Element(), export_G4ElementTable(), export_G4Isotope(), export_G4Material(), export_G4MaterialTable(), and export_G4NistManager().

48 {
53  //export_G4ElementVector();
57 }
void export_G4NistManager()
void export_G4AtomicShells()
void export_G4MaterialTable()
void export_G4Isotope()
Definition: pyG4Isotope.cc:58
void export_G4Element()
Definition: pyG4Element.cc:67
void export_G4Material()
void export_G4ElementTable()
void export_G4AtomicShells ( )

Definition at line 39 of file pyG4AtomicShells.cc.

Referenced by BOOST_PYTHON_MODULE().

40 {
41  class_<G4AtomicShells, boost::noncopyable>
42  ("G4AtomicShells", "Atomic subshell binding energy table", no_init)
43 
44  .def("GetNumberOfShells", &G4AtomicShells::GetNumberOfShells)
45  .staticmethod("GetNumberOfShells")
46 
47  .def("GetNumberOfElectrons", &G4AtomicShells::GetNumberOfElectrons)
48  .staticmethod("GetNumberOfElectrons")
49 
50  .def("GetBindingEnergy", &G4AtomicShells::GetBindingEnergy)
51  .staticmethod("GetBindingEnergy")
52 
53  .def("GetTotalBindingEnergy", &G4AtomicShells::GetTotalBindingEnergy)
54  ;
55 }
void export_G4Element ( )

Definition at line 67 of file pyG4Element.cc.

References pyG4Element::f_GetRelativeAbundanceVector(), and pyG4Element::Print().

Referenced by BOOST_PYTHON_MODULE().

68 {
69  class_<G4Element, G4Element*, boost::noncopyable>
70  ("G4Element", "element class", no_init)
71  // constructors
72  .def(init<const G4String&, const G4String&, G4double, G4double>())
73  .def(init<const G4String&, const G4String&, G4int>())
74  // ---
75  .def("AddIsotope", &G4Element::AddIsotope)
76  .def("GetName", &G4Element::GetName,
77  return_value_policy<reference_existing_object>())
78  .def("GetSymbol", &G4Element::GetSymbol,
79  return_value_policy<reference_existing_object>())
80  .def("SetName", &G4Element::SetName)
81  .def("GetZ", &G4Element::GetZ)
82  .def("GetN", &G4Element::GetN)
83  .def("GetA", &G4Element::GetA)
84  .def("GetNbOfAtomicShells", &G4Element::GetNbOfAtomicShells)
85  .def("GetAtomicShell", &G4Element::GetAtomicShell)
86  .def("GetNumberOfIsotopes", &G4Element::GetNumberOfIsotopes)
87  .def("GetIsotopeVector", &G4Element::GetIsotopeVector,
88  return_internal_reference<>())
89  .def("GetRelativeAbundanceVector", f_GetRelativeAbundanceVector)
90  .def("GetIsotope", &G4Element::GetIsotope,
91  return_value_policy<reference_existing_object>())
92  .def("GetElementTable", &G4Element::GetElementTable,
93  return_value_policy<reference_existing_object>())
94  .staticmethod("GetElementTable")
95  .def("GetNumberOfElements", &G4Element::GetNumberOfElements)
96  .staticmethod("GetNumberOfElements")
97  .def("GetIndex", &G4Element::GetIndex)
98  .def("GetElement", &G4Element::GetElement,
99  return_value_policy<reference_existing_object>())
100  .staticmethod("GetElement")
101  .def("GetfCoulomb", &G4Element::GetfCoulomb)
102  .def("GetfRadTsai", &G4Element::GetfRadTsai)
103  .def("GetIonisation", &G4Element::GetIonisation,
104  return_internal_reference<>())
105  // ---
106  .def("Print", Print)
107  ;
108 }
void Print(G4Element &ele)
Definition: pyG4Element.cc:55
list f_GetRelativeAbundanceVector(const G4Element *element)
Definition: pyG4Element.cc:43
void export_G4ElementTable ( )

Definition at line 41 of file pyG4ElementTable.cc.

Referenced by BOOST_PYTHON_MODULE().

42 {
43  class_<G4ElementTable> ("G4ElementTable", "element table")
45  .def(self_ns::str(self))
46  ;
47 }
void export_G4Isotope ( )

Definition at line 58 of file pyG4Isotope.cc.

References pyG4Isotope::Print().

Referenced by BOOST_PYTHON_MODULE().

59 {
60  class_<G4Isotope, G4Isotope*, boost::noncopyable>
61  ("G4Isotope", "isotope class", no_init)
62  // constructors
63  .def(init<const G4String&, G4int, G4int>())
64  .def(init<const G4String&, G4int, G4int, G4double>())
65  // ---
66  .def("GetName", &G4Isotope::GetName,
67  return_value_policy<reference_existing_object>())
68  .def("SetName", &G4Isotope::SetName)
69  .def("GetZ", &G4Isotope::GetZ)
70  .def("GetN", &G4Isotope::GetN)
71  .def("GetA", &G4Isotope::GetA)
72  .def("GetIsotope", &G4Isotope::GetIsotope,
73  f_GetIsotope()
74  [return_value_policy<reference_existing_object>()])
75  .staticmethod("GetIsotope")
76  .def("GetIsotopeTable", &G4Isotope::GetIsotopeTable,
77  return_value_policy<reference_existing_object>())
78  .staticmethod("GetIsotopeTable")
79  .def("GetNumberOfIsotopes", &G4Isotope::GetNumberOfIsotopes)
80  .staticmethod("GetNumberOfIsotopes")
81 
82  .def("GetIndex", &G4Isotope::GetIndex)
83  // ---
84  .def("Print", Print)
85  .def(self == self)
86  .def(self != self)
87  ;
88 
89  // G4IsotopeTable
90  class_<G4IsotopeTable> ("G4IsotopeTable", "isotope table")
92  .def(self_ns::str(self))
93  ;
94 }
void Print(G4Isotope &iso)
Definition: pyG4Isotope.cc:46
void export_G4Material ( )

Definition at line 115 of file pyG4Material.cc.

References pyG4Material::f1_AddElement, pyG4Material::f1_GetMaterial, pyG4Material::f2_AddElement, pyG4Material::f2_GetMaterial, pyG4Material::f3_GetMaterial, pyG4Material::f_GetAtomicNumDensityVector(), pyG4Material::f_GetAtomsVector(), pyG4Material::f_GetFractionVector(), pyG4Material::f_GetVecNbOfAtomsPerVolume(), pyG4Material::Print(), and value.

Referenced by BOOST_PYTHON_MODULE().

116 {
117  class_<G4Material, G4Material*, boost::noncopyable>
118  ("G4Material", "material class", no_init)
119  .def(init<const G4String&, G4double, G4double, G4double>())
120  .def(init<const G4String&, G4double, G4int>())
121  // ---
122  .def("AddElement", f1_AddElement)
123  .def("AddElement", f2_AddElement)
124  .def("AddMaterial", &G4Material::AddMaterial)
125  .def("GetName", &G4Material::GetName,
126  return_value_policy<reference_existing_object>())
127  .def("GetChemicalFormula", &G4Material::GetChemicalFormula,
128  return_value_policy<reference_existing_object>())
129  .def("SetName", &G4Material::SetName)
130  .def("SetChemicalFormula", &G4Material::SetChemicalFormula)
131  .def("GetDensity", &G4Material::GetDensity)
132  .def("GetState", &G4Material::GetState)
133  .def("GetTemperature", &G4Material::GetTemperature)
134  .def("GetPressure", &G4Material::GetPressure)
135  // ---
136  .def("GetElementVector", &G4Material::GetElementVector,
137  return_internal_reference<>())
138  .def("GetElement", &G4Material::GetElement,
139  return_value_policy<reference_existing_object>())
140  .def("GetTotNbOfAtomsPerVolume", &G4Material::GetTotNbOfAtomsPerVolume)
141  .def("GetTotNbOfElectPerVolume", &G4Material::GetTotNbOfElectPerVolume)
142  .def("GetFractionVector", f_GetFractionVector)
143  .def("GetAtomsVector", f_GetAtomsVector)
144  .def("GetVecNbOfAtomsPerVolume", f_GetVecNbOfAtomsPerVolume)
145  .def("GetAtomicNumDensityVector", f_GetAtomicNumDensityVector)
146  // ----
147  .def("GetElectronDensity", &G4Material::GetElectronDensity)
148  .def("GetRadlen", &G4Material::GetRadlen)
149  .def("GetNuclearInterLength", &G4Material::GetNuclearInterLength)
150  .def("GetIonisation", &G4Material::GetIonisation,
151  return_internal_reference<>())
152  .def("GetSandiaTable", &G4Material::GetSandiaTable,
153  return_internal_reference<>())
154  // ---
155  .def("GetZ", &G4Material::GetZ)
156  .def("GetA", &G4Material::GetA)
157  .def("SetMaterialPropertiesTable", &G4Material::SetMaterialPropertiesTable)
158  .def("GetMaterialPropertiesTable", &G4Material::GetMaterialPropertiesTable,
159  return_internal_reference<>())
160  .def("GetMaterialTable", &G4Material::GetMaterialTable,
161  return_value_policy<reference_existing_object>())
162  .staticmethod("GetMaterialTable")
163  .def("GetNumberOfMaterials", &G4Material::GetNumberOfMaterials)
164  .staticmethod("GetNumberOfMaterials")
165  .def("GetIndex", &G4Material::GetIndex)
166  .def("GetMaterial", f1_GetMaterial, f_GetMaterial()
167  [return_value_policy<reference_existing_object>()])
168  .def("GetMaterial", f2_GetMaterial,
169  return_value_policy<reference_existing_object>())
170  .def("GetMaterial", f3_GetMaterial,
171  return_value_policy<reference_existing_object>())
172  .staticmethod("GetMaterial")
173  // ---
174  //.def(self_ns::str(self))
175  .def("Print", Print)
176  ;
177 
178  // ---
179  enum_<G4State>("G4State")
180  .value("kStateUndefined", kStateUndefined)
181  .value("kStateSolid", kStateSolid)
182  .value("kStateLiquid", kStateLiquid)
183  .value("kStateGas", kStateGas)
184  ;
185 }
void(G4Material::* f2_AddElement)(G4Element *, G4double)
Definition: pyG4Material.cc:44
G4Material *(* f2_GetMaterial)(G4double, G4double, G4double)
Definition: pyG4Material.cc:50
list f_GetVecNbOfAtomsPerVolume(const G4Material *material)
Definition: pyG4Material.cc:80
void Print(G4Material &mat)
double value
Definition: spectrum.C:18
G4Material *(* f3_GetMaterial)(size_t, G4double)
Definition: pyG4Material.cc:52
void(G4Material::* f1_AddElement)(G4Element *, G4int)
Definition: pyG4Material.cc:42
list f_GetAtomsVector(const G4Material *material)
Definition: pyG4Material.cc:69
list f_GetAtomicNumDensityVector(const G4Material *material)
Definition: pyG4Material.cc:91
list f_GetFractionVector(const G4Material *material)
Definition: pyG4Material.cc:58
G4Material *(* f1_GetMaterial)(const G4String &, G4bool)
Definition: pyG4Material.cc:48
void export_G4MaterialTable ( )

Definition at line 41 of file pyG4MaterialTable.cc.

Referenced by BOOST_PYTHON_MODULE().

42 {
43  class_<G4MaterialTable> ("G4MaterialTable", "material table")
45  .def(self_ns::str(self))
46  ;
47 }
void export_G4NistManager ( )

Definition at line 91 of file pyG4NistManager.cc.

Referenced by BOOST_PYTHON_MODULE().

92 {
93 #if G4VERSION_NUMBER >= 710
94 
95  class_<G4NistManager, boost::noncopyable>
96  ("G4NistManager", "manager class for NIST materials", no_init)
97  // ---
98  .def("Instance", &G4NistManager::Instance,
99  return_value_policy<reference_existing_object>())
100  .staticmethod("Instance")
101  // ---
102  .def("SetVerbose", &G4NistManager::SetVerbose)
103  .def("GetVerbose", &G4NistManager::GetVerbose)
104  // ---
105 #if G4VERSION_NUMBER < 910
106  .def("RegisterElement", &G4NistManager::RegisterElement)
107  .def("DeRegisterElement", &G4NistManager::DeRegisterElement)
108 #endif
109  .def("GetElement", &G4NistManager::GetElement,
110  return_internal_reference<>())
111  .def("FindOrBuildElement", f1_FindOrBuildElement,
112  f_FindOrBuildElement()
113  [return_value_policy<reference_existing_object>()])
114  .def("FindOrBuildElement", f2_FindOrBuildElement,
115  f_FindOrBuildElement()
116  [return_value_policy<reference_existing_object>()])
117  .def("GetNumberOfElements", &G4NistManager::GetNumberOfElements)
118  .def("GetZ", &G4NistManager::GetZ)
119  .def("GetIsotopeMass", &G4NistManager::GetIsotopeMass)
120  .def("PrintElement", f1_PrintElement)
121  .def("PrintElement", f2_PrintElement)
122  .def("PrintG4Element", &G4NistManager::PrintG4Element)
123  // ---
124 #if G4VERSION_NUMBER < 910
125  .def("RegisterMaterial", &G4NistManager::RegisterMaterial)
126  .def("DeRegisterMaterial", &G4NistManager::DeRegisterMaterial)
127 #endif
128  .def("GetMaterial", &G4NistManager::GetMaterial,
129  return_value_policy<reference_existing_object>())
130  .def("FindOrBuildMaterial", &G4NistManager::FindOrBuildMaterial,
131  f_FindOrBuildMaterial()
132  [return_value_policy<reference_existing_object>()])
133  .def("ConstructNewMaterial", f1_ConstructNewMaterial,
134  f_ConstructNewMaterial()
135  [return_value_policy<reference_existing_object>()])
136  .def("ConstructNewMaterial", f2_ConstructNewMaterial,
137  f_ConstructNewMaterial()
138  [return_value_policy<reference_existing_object>()])
139 #if G4VERSION_NUMBER >= 910
140  .def("ConstructNewGasMaterial", &G4NistManager::ConstructNewGasMaterial,
141  f_ConstructNewGasMaterial()
142  [return_value_policy<reference_existing_object>()])
143 #endif
144  .def("GetNumberOfMaterials", &G4NistManager::GetNumberOfMaterials)
145  .def("ListMaterials", &G4NistManager::ListMaterials)
146  .def("PrintG4Material", &G4NistManager::PrintG4Material)
147  ;
148 #endif
149 }