LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 48 of file pymodG4materials.cc.

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

49 {
54  //export_G4ElementVector();
58 }
void export_G4NistManager()
void export_G4AtomicShells()
void export_G4MaterialTable()
void export_G4Isotope()
Definition: pyG4Isotope.cc:59
void export_G4Element()
Definition: pyG4Element.cc:68
void export_G4Material()
void export_G4ElementTable()
void export_G4AtomicShells ( )

Definition at line 40 of file pyG4AtomicShells.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 68 of file pyG4Element.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 42 of file pyG4ElementTable.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 59 of file pyG4Isotope.cc.

References pyG4Isotope::Print().

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 109 of file pyG4Material.cc.

References pyG4Material::f1_AddElement, pyG4Material::f2_AddElement, pyG4Material::f_GetAtomicNumDensityVector(), pyG4Material::f_GetAtomsVector(), pyG4Material::f_GetFractionVector(), pyG4Material::f_GetVecNbOfAtomsPerVolume(), pyG4Material::Print(), and fhicl::detail::atom::value().

Referenced by BOOST_PYTHON_MODULE().

110 {
111  class_<G4Material, G4Material*, boost::noncopyable>
112  ("G4Material", "material class", no_init)
113  .def(init<const G4String&, G4double, G4double, G4double>())
114  .def(init<const G4String&, G4double, G4int>())
115  // ---
116  .def("AddElement", f1_AddElement)
117  .def("AddElement", f2_AddElement)
118  .def("AddMaterial", &G4Material::AddMaterial)
119  .def("GetName", &G4Material::GetName,
120  return_value_policy<reference_existing_object>())
121  .def("GetChemicalFormula", &G4Material::GetChemicalFormula,
122  return_value_policy<reference_existing_object>())
123  .def("SetName", &G4Material::SetName)
124  .def("SetChemicalFormula", &G4Material::SetChemicalFormula)
125  .def("GetDensity", &G4Material::GetDensity)
126  .def("GetState", &G4Material::GetState)
127  .def("GetTemperature", &G4Material::GetTemperature)
128  .def("GetPressure", &G4Material::GetPressure)
129  // ---
130  .def("GetElementVector", &G4Material::GetElementVector,
131  return_internal_reference<>())
132  .def("GetElement", &G4Material::GetElement,
133  return_value_policy<reference_existing_object>())
134  .def("GetTotNbOfAtomsPerVolume", &G4Material::GetTotNbOfAtomsPerVolume)
135  .def("GetTotNbOfElectPerVolume", &G4Material::GetTotNbOfElectPerVolume)
136  .def("GetFractionVector", f_GetFractionVector)
137  .def("GetAtomsVector", f_GetAtomsVector)
138  .def("GetVecNbOfAtomsPerVolume", f_GetVecNbOfAtomsPerVolume)
139  .def("GetAtomicNumDensityVector", f_GetAtomicNumDensityVector)
140  // ----
141  .def("GetElectronDensity", &G4Material::GetElectronDensity)
142  .def("GetRadlen", &G4Material::GetRadlen)
143  .def("GetNuclearInterLength", &G4Material::GetNuclearInterLength)
144  .def("GetIonisation", &G4Material::GetIonisation,
145  return_internal_reference<>())
146  .def("GetSandiaTable", &G4Material::GetSandiaTable,
147  return_internal_reference<>())
148  // ---
149  .def("GetZ", &G4Material::GetZ)
150  .def("GetA", &G4Material::GetA)
151  .def("SetMaterialPropertiesTable", &G4Material::SetMaterialPropertiesTable)
152  .def("GetMaterialPropertiesTable", &G4Material::GetMaterialPropertiesTable,
153  return_internal_reference<>())
154  .def("GetMaterialTable", &G4Material::GetMaterialTable,
155  return_value_policy<reference_existing_object>())
156  .staticmethod("GetMaterialTable")
157  .def("GetNumberOfMaterials", &G4Material::GetNumberOfMaterials)
158  .staticmethod("GetNumberOfMaterials")
159  .def("GetIndex", &G4Material::GetIndex)
160  .def("GetMaterial", &G4Material::GetMaterial,
161  f_GetMaterial()
162  [return_value_policy<reference_existing_object>()])
163  .staticmethod("GetMaterial")
164  // ---
165  //.def(self_ns::str(self))
166  .def("Print", Print)
167  ;
168 
169  // ---
170  enum_<G4State>("G4State")
171  .value("kStateUndefined", kStateUndefined)
172  .value("kStateSolid", kStateSolid)
173  .value("kStateLiquid", kStateLiquid)
174  .value("kStateGas", kStateGas)
175  ;
176 }
void(G4Material::* f2_AddElement)(G4Element *, G4double)
Definition: pyG4Material.cc:46
list f_GetVecNbOfAtomsPerVolume(const G4Material *material)
Definition: pyG4Material.cc:74
void Print(G4Material &mat)
Definition: pyG4Material.cc:97
std::string value(boost::any const &)
void(G4Material::* f1_AddElement)(G4Element *, G4int)
Definition: pyG4Material.cc:44
list f_GetAtomsVector(const G4Material *material)
Definition: pyG4Material.cc:63
list f_GetAtomicNumDensityVector(const G4Material *material)
Definition: pyG4Material.cc:85
list f_GetFractionVector(const G4Material *material)
Definition: pyG4Material.cc:52
void export_G4MaterialTable ( )

Definition at line 42 of file pyG4MaterialTable.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 92 of file pyG4NistManager.cc.

Referenced by BOOST_PYTHON_MODULE().

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