Import Geant4 9.2.0 source tree
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# $Id: GNUmakefile,v 1.2 2006/04/25 08:09:45 kmura Exp $
|
||||
# $Name: geant4-09-01 $
|
||||
# $Name: geant4-09-02 $
|
||||
# ===========================================================
|
||||
# Makefile for building Geant4Py modules
|
||||
# ===========================================================
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4AtomicShells.cc,v 1.1 2008/06/03 06:27:20 kmura Exp $
|
||||
// $Name: geant4-09-02 $
|
||||
// ====================================================================
|
||||
// pyG4AtomicShells.cc
|
||||
//
|
||||
// 2008 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
#include "G4AtomicShells.hh"
|
||||
|
||||
using namespace boost::python;
|
||||
|
||||
// ====================================================================
|
||||
// module definition
|
||||
// ====================================================================
|
||||
void export_G4AtomicShells()
|
||||
{
|
||||
class_<G4AtomicShells, boost::noncopyable>
|
||||
("G4AtomicShells", "Atomic subshell binding energy table")
|
||||
|
||||
.def("GetNumberOfShells", &G4AtomicShells::GetNumberOfShells)
|
||||
.staticmethod("GetNumberOfShells")
|
||||
|
||||
.def("GetNumberOfElectrons", &G4AtomicShells::GetNumberOfElectrons)
|
||||
.staticmethod("GetNumberOfElectrons")
|
||||
|
||||
.def("GetBindingEnergy", &G4AtomicShells::GetBindingEnergy)
|
||||
.staticmethod("GetBindingEnergy")
|
||||
|
||||
.def("GetTotalBindingEnergy", &G4AtomicShells::GetTotalBindingEnergy)
|
||||
;
|
||||
}
|
||||
@@ -23,15 +23,15 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4Element.cc,v 1.5 2006/08/25 05:46:17 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
// $Id: pyG4Element.cc,v 1.7 2008/12/04 08:55:25 kmura Exp $
|
||||
// $Name: geant4-09-02 $
|
||||
// ====================================================================
|
||||
// pyG4Element.cc
|
||||
//
|
||||
// 2005 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
#include "pyG4Version.hh"
|
||||
#include "G4Version.hh"
|
||||
#include "G4Element.hh"
|
||||
|
||||
using namespace boost::python;
|
||||
@@ -75,8 +75,17 @@ void export_G4Element()
|
||||
.def(init<const G4String&, const G4String&, G4int>())
|
||||
// ---
|
||||
.def("AddIsotope", &G4Element::AddIsotope)
|
||||
#if G4VERSION_NUMBER >= 920
|
||||
.def("GetName", &G4Element::GetName,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("GetSymbol", &G4Element::GetSymbol,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("SetName", &G4Element::SetName)
|
||||
#else
|
||||
.def("GetName", &G4Element::GetName)
|
||||
.def("GetSymbol", &G4Element::GetSymbol)
|
||||
#endif
|
||||
|
||||
.def("GetZ", &G4Element::GetZ)
|
||||
.def("GetN", &G4Element::GetN)
|
||||
.def("GetA", &G4Element::GetA)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4ElementTable.cc,v 1.4 2006/06/29 15:34:12 gunter Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
// $Name: geant4-09-02 $
|
||||
// ====================================================================
|
||||
// pyG4ElementTable.cc
|
||||
//
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4ElementVector.cc,v 1.1 2008/12/04 10:31:03 kmura Exp $
|
||||
// $Name: geant4-09-02 $
|
||||
// ====================================================================
|
||||
// pyG4ElementVector.cc
|
||||
//
|
||||
// 2005 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
#include "pyG4indexing.hh"
|
||||
#include "G4Element.hh"
|
||||
#include "G4ElementVector.hh"
|
||||
|
||||
using namespace boost::python;
|
||||
|
||||
// ====================================================================
|
||||
// module definition
|
||||
// ====================================================================
|
||||
void export_G4ElementVector()
|
||||
{
|
||||
class_<G4ElementVector> ("G4ElementVector", "element vector")
|
||||
.def(vector_indexing_suite<G4ElementVector>())
|
||||
.def(self_ns::str(self))
|
||||
;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4Isotope.cc,v 1.1 2008/12/04 08:55:25 kmura Exp $
|
||||
// $Name: geant4-09-02 $
|
||||
// ====================================================================
|
||||
// pyG4Isotope.cc
|
||||
//
|
||||
// 2005 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
#include "G4Version.hh"
|
||||
#include "pyG4indexing.hh"
|
||||
#include "G4Isotope.hh"
|
||||
|
||||
using namespace boost::python;
|
||||
|
||||
// ====================================================================
|
||||
// thin wrappers
|
||||
// ====================================================================
|
||||
namespace pyG4Isotope {
|
||||
|
||||
BOOST_PYTHON_FUNCTION_OVERLOADS(f_GetIsotope, G4Isotope::GetIsotope, 1, 2);
|
||||
|
||||
// copy constructor is private, so ...
|
||||
void Print(G4Isotope& iso)
|
||||
{
|
||||
G4cout << iso;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
using namespace pyG4Isotope;
|
||||
|
||||
// ====================================================================
|
||||
// module definition
|
||||
// ====================================================================
|
||||
void export_G4Isotope()
|
||||
{
|
||||
class_<G4Isotope, G4Isotope*, boost::noncopyable>
|
||||
("G4Isotope", "isotope class", no_init)
|
||||
// constructors
|
||||
.def(init<const G4String&, G4int, G4int>())
|
||||
.def(init<const G4String&, G4int, G4int, G4double>())
|
||||
// ---
|
||||
#if G4VERSION_NUMBER >= 920
|
||||
.def("GetName", &G4Isotope::GetName,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("SetName", &G4Isotope::SetName)
|
||||
#else
|
||||
.def("GetName", &G4Isotope::GetName)
|
||||
#endif
|
||||
.def("GetZ", &G4Isotope::GetZ)
|
||||
.def("GetN", &G4Isotope::GetN)
|
||||
.def("GetA", &G4Isotope::GetA)
|
||||
.def("GetCountUse", &G4Isotope::GetCountUse)
|
||||
.def("GetIsotope", &G4Isotope::GetIsotope,
|
||||
f_GetIsotope()
|
||||
[return_value_policy<reference_existing_object>()])
|
||||
.staticmethod("GetIsotope")
|
||||
.def("GetIsotopeTable", &G4Isotope::GetIsotopeTable,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.staticmethod("GetIsotopeTable")
|
||||
.def("GetNumberOfIsotopes", &G4Isotope::GetNumberOfIsotopes)
|
||||
.staticmethod("GetNumberOfIsotopes")
|
||||
|
||||
.def("GetIndex", &G4Isotope::GetIndex)
|
||||
// ---
|
||||
.def("Print", Print)
|
||||
.def(self == self)
|
||||
.def(self != self)
|
||||
;
|
||||
|
||||
// G4IsotopeTable
|
||||
class_<G4IsotopeTable> ("G4IsotopeTable", "isotope table")
|
||||
.def(vector_indexing_suite<G4IsotopeTable>())
|
||||
.def(self_ns::str(self))
|
||||
;
|
||||
}
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4Material.cc,v 1.5 2006/12/01 02:10:08 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
// $Id: pyG4Material.cc,v 1.7 2008/12/04 08:55:25 kmura Exp $
|
||||
// $Name: geant4-09-02 $
|
||||
// ====================================================================
|
||||
// pyG4Material.cc
|
||||
//
|
||||
// 2005 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
#include "pyG4Version.hh"
|
||||
#include "G4Version.hh"
|
||||
#include "G4Material.hh"
|
||||
|
||||
using namespace boost::python;
|
||||
@@ -119,9 +119,17 @@ void export_G4Material()
|
||||
.def("AddElement", f1_AddElement)
|
||||
.def("AddElement", f2_AddElement)
|
||||
.def("AddMaterial", &G4Material::AddMaterial)
|
||||
#if G4VERSION_NUMBER >= 920
|
||||
.def("GetName", &G4Material::GetName,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("GetChemicalFormula", &G4Material::GetChemicalFormula,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("SetName", &G4Material::SetName)
|
||||
#else
|
||||
.def("GetName", &G4Material::GetName)
|
||||
.def("SetChemicalFormula", &G4Material::SetChemicalFormula)
|
||||
.def("GetChemicalFormula", &G4Material::GetChemicalFormula)
|
||||
#endif
|
||||
.def("SetChemicalFormula", &G4Material::SetChemicalFormula)
|
||||
.def("GetDensity", &G4Material::GetDensity)
|
||||
.def("GetState", &G4Material::GetState)
|
||||
.def("GetTemperature", &G4Material::GetTemperature)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4MaterialTable.cc,v 1.4 2006/06/29 15:34:18 gunter Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
// $Name: geant4-09-02 $
|
||||
// ====================================================================
|
||||
// pyG4MaterialTable.cc
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4NistManager.cc,v 1.6 2007/11/07 08:49:31 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
// $Name: geant4-09-02 $
|
||||
// ====================================================================
|
||||
// pyG4NistManager.cc
|
||||
//
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pymodG4materials.cc,v 1.5 2007/05/28 03:11:20 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
// $Id: pymodG4materials.cc,v 1.7 2008/12/04 08:55:25 kmura Exp $
|
||||
// $Name: geant4-09-02 $
|
||||
// ====================================================================
|
||||
// pymodG4materials.cc [Geant4Py module]
|
||||
//
|
||||
@@ -41,7 +41,10 @@ void export_G4Material();
|
||||
void export_G4MaterialTable();
|
||||
void export_G4Element();
|
||||
void export_G4ElementTable();
|
||||
void export_G4ElementVector();
|
||||
void export_G4Isotope();
|
||||
void export_G4NistManager();
|
||||
void export_G4AtomicShells();
|
||||
|
||||
BOOST_PYTHON_MODULE(G4materials)
|
||||
{
|
||||
@@ -49,6 +52,9 @@ BOOST_PYTHON_MODULE(G4materials)
|
||||
export_G4MaterialTable();
|
||||
export_G4Element();
|
||||
export_G4ElementTable();
|
||||
export_G4ElementVector();
|
||||
export_G4Isotope();
|
||||
export_G4NistManager();
|
||||
export_G4AtomicShells();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user