Import Geant4 8.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:44:26 +02:00
parent 8a51e0bc40
commit 216a75eeb1
8717 changed files with 360418 additions and 141343 deletions
@@ -0,0 +1,14 @@
# $Id: GNUmakefile,v 1.2 2006/04/25 08:09:45 kmura Exp $
# $Name: geant4-08-01 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
include ../../config/config.gmk
# python module name
MODULE := G4processes#
include $(G4PY_INSTALL)/config/g4py.gmk
include $(G4PY_INSTALL)/config/module.gmk
include $(G4PY_INSTALL)/config/install.gmk
@@ -0,0 +1,295 @@
//
// ********************************************************************
// * 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: pyG4EmCalculator.cc,v 1.4 2006/06/29 15:34:49 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4EmCalculator.cc
//
// 2006 Q
// ====================================================================
#include <boost/python.hpp>
#include "pyG4Version.hh"
#include "G4EmCalculator.hh"
#include "G4Region.hh"
#include "G4Material.hh"
#include "G4Element.hh"
#include "G4ParticleDefinition.hh"
#include "G4MaterialCutsCouple.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4EmCalculator {
// GetDEDX
G4double (G4EmCalculator::*f1_GetDEDX)
(G4double, const G4ParticleDefinition*, const G4Material*, const G4Region*)
= &G4EmCalculator::GetDEDX;
G4double (G4EmCalculator::*f2_GetDEDX)
(G4double, const G4String&, const G4String&, const G4String&)
= &G4EmCalculator::GetDEDX;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetDEDX, GetDEDX, 3, 4);
// GetRange
G4double (G4EmCalculator::*f1_GetRange)
(G4double, const G4ParticleDefinition*, const G4Material*, const G4Region*)
= &G4EmCalculator::GetRange;
G4double (G4EmCalculator::*f2_GetRange)
(G4double, const G4String&, const G4String&, const G4String&)
= &G4EmCalculator::GetRange;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetRange, GetRange, 3, 4);
// GetKinEnergy
G4double (G4EmCalculator::*f1_GetKinEnergy)
(G4double, const G4ParticleDefinition*, const G4Material*, const G4Region*)
= &G4EmCalculator::GetKinEnergy;
G4double (G4EmCalculator::*f2_GetKinEnergy)
(G4double, const G4String&, const G4String&, const G4String&)
= &G4EmCalculator::GetKinEnergy;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetKinEnergy, GetKinEnergy, 3, 4);
// GetCrossSectionPerVolume
G4double (G4EmCalculator::*f1_GetCrossSectionPerVolume)
(G4double, const G4ParticleDefinition*,
const G4String&, const G4Material*, const G4Region*)
= &G4EmCalculator::GetCrossSectionPerVolume;
G4double (G4EmCalculator::*f2_GetCrossSectionPerVolume)
(G4double, const G4String&, const G4String&,
const G4String&, const G4String&)
= &G4EmCalculator::GetCrossSectionPerVolume;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetCrossSectionPerVolume,
GetCrossSectionPerVolume, 4, 5);
// GetCrossSectionPerAtom
#if G4VERSION_NUMBER <= 801
G4double (G4EmCalculator::*f1_GetCrossSectionPerAtom)
(G4double, const G4ParticleDefinition*,
const G4String&, const G4Material*, const G4Region*)
= &G4EmCalculator::GetCrossSectionPerAtom;
G4double (G4EmCalculator::*f2_GetCrossSectionPerAtom)
(G4double, const G4String&, const G4String&,
const G4String&, const G4String&)
= &G4EmCalculator::GetCrossSectionPerAtom;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetCrossSectionPerAtom,
GetCrossSectionPerAtom, 4, 5);
#endif
// GetMeanFreePath
G4double (G4EmCalculator::*f1_GetMeanFreePath)
(G4double, const G4ParticleDefinition*,
const G4String&, const G4Material*, const G4Region*)
= &G4EmCalculator::GetMeanFreePath;
G4double (G4EmCalculator::*f2_GetMeanFreePath)
(G4double, const G4String&, const G4String&,
const G4String&, const G4String&)
= &G4EmCalculator::GetMeanFreePath;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetMeanFreePath,
GetMeanFreePath, 4, 5);
// ComputeDEDX
G4double (G4EmCalculator::*f1_ComputeDEDX)
(G4double, const G4ParticleDefinition*,
const G4String&, const G4Material*, G4double)
= &G4EmCalculator::ComputeDEDX;
G4double (G4EmCalculator::*f2_ComputeDEDX)
(G4double, const G4String&, const G4String&, const G4String&, G4double)
= &G4EmCalculator::ComputeDEDX;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeDEDX, ComputeDEDX, 4, 5);
// ComputeNuclearDEDX
G4double (G4EmCalculator::*f1_ComputeNuclearDEDX)
(G4double, const G4ParticleDefinition*, const G4Material*)
= &G4EmCalculator::ComputeNuclearDEDX;
G4double (G4EmCalculator::*f2_ComputeNuclearDEDX)
(G4double, const G4String&, const G4String&)
= &G4EmCalculator::ComputeNuclearDEDX;
#if G4VERSION_NUMBER >= 810
// ComputeElectronicDEDX
G4double (G4EmCalculator::*f1_ComputeElectronicDEDX)
(G4double, const G4ParticleDefinition*, const G4Material*, G4double)
= &G4EmCalculator::ComputeElectronicDEDX;
G4double (G4EmCalculator::*f2_ComputeElectronicDEDX)
(G4double, const G4String&, const G4String&, G4double)
= &G4EmCalculator::ComputeElectronicDEDX;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeElectronicDEDX,
ComputeElectronicDEDX, 3, 4);
// ComputeTotalDEDX
G4double (G4EmCalculator::*f1_ComputeTotalDEDX)
(G4double, const G4ParticleDefinition*, const G4Material*, G4double)
= &G4EmCalculator::ComputeTotalDEDX;
G4double (G4EmCalculator::*f2_ComputeTotalDEDX)
(G4double, const G4String&, const G4String&, G4double)
= &G4EmCalculator::ComputeTotalDEDX;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeTotalDEDX, ComputeTotalDEDX,
3, 4);
#endif
// ComputeCrossSectionPerVolume
G4double (G4EmCalculator::*f1_ComputeCrossSectionPerVolume)
(G4double, const G4ParticleDefinition*,
const G4String&, const G4Material*, G4double)
= &G4EmCalculator::ComputeCrossSectionPerVolume;
G4double (G4EmCalculator::*f2_ComputeCrossSectionPerVolume)
(G4double, const G4String&, const G4String&, const G4String&, G4double)
= &G4EmCalculator::ComputeCrossSectionPerVolume;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeCrossSectionPerVolume,
ComputeCrossSectionPerVolume, 4, 5);
// ComputeCrossSectionPerAtom
G4double (G4EmCalculator::*f1_ComputeCrossSectionPerAtom)
(G4double, const G4ParticleDefinition*, const G4String&,
G4double, G4double, G4double)
= &G4EmCalculator::ComputeCrossSectionPerAtom;
G4double (G4EmCalculator::*f2_ComputeCrossSectionPerAtom)
(G4double, const G4String&, const G4String&, const G4Element*, G4double)
= &G4EmCalculator::ComputeCrossSectionPerAtom;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeCrossSectionPerAtom,
ComputeCrossSectionPerAtom, 5, 6);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(g_ComputeCrossSectionPerAtom,
ComputeCrossSectionPerAtom, 4, 5);
// ComputeMeanFreePath
G4double (G4EmCalculator::*f1_ComputeMeanFreePath)
(G4double, const G4ParticleDefinition*,
const G4String&, const G4Material*, G4double)
= &G4EmCalculator::ComputeMeanFreePath;
G4double (G4EmCalculator::*f2_ComputeMeanFreePath)
(G4double, const G4String&, const G4String&, const G4String&, G4double)
= &G4EmCalculator::ComputeMeanFreePath;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ComputeMeanFreePath,
ComputeMeanFreePath, 4, 5);
// FindCouple
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_FindCouple, FindCouple, 1, 2);
};
using namespace pyG4EmCalculator;
// ====================================================================
// module definition
// ====================================================================
void export_G4EmCalculator()
{
class_<G4EmCalculator, boost::noncopyable>
("G4EmCalculator", "Provide access to dE/dx and cross section")
// ---
.def("GetDEDX", f1_GetDEDX, f_GetDEDX())
.def("GetDEDX", f2_GetDEDX, f_GetDEDX())
.def("GetRange", f1_GetRange, f_GetRange())
.def("GetRange", f2_GetDEDX, f_GetRange())
.def("GetKinEnergy", f1_GetKinEnergy, f_GetKinEnergy())
.def("GetKinEnergy", f2_GetKinEnergy, f_GetKinEnergy())
.def("GetCrossSectionPerVolume",
f1_GetCrossSectionPerVolume, f_GetCrossSectionPerVolume())
.def("GetCrossSectionPerVolume",
f2_GetCrossSectionPerVolume, f_GetCrossSectionPerVolume())
#if G4VERSION_NUMBER <= 801
.def("GetCrossSectionPerAtom",
f1_GetCrossSectionPerAtom, f_GetCrossSectionPerAtom())
.def("GetCrossSectionPerAtom",
f2_GetCrossSectionPerAtom, f_GetCrossSectionPerAtom())
#endif
.def("GetMeanFreePath", f1_GetMeanFreePath, f_GetMeanFreePath())
.def("GetMeanFreePath", f2_GetMeanFreePath, f_GetMeanFreePath())
// ---
.def("PrintDEDXTable", &G4EmCalculator::PrintDEDXTable)
.def("PrintRangeTable", &G4EmCalculator::PrintRangeTable)
.def("PrintInverseRangeTable", &G4EmCalculator::PrintInverseRangeTable)
// ---
.def("ComputeDEDX", f1_ComputeDEDX, f_ComputeDEDX())
.def("ComputeDEDX", f2_ComputeDEDX, f_ComputeDEDX())
.def("ComputeNuclearDEDX", f1_ComputeNuclearDEDX)
.def("ComputeNuclearDEDX", f2_ComputeNuclearDEDX)
#if G4VERSION_NUMBER >= 810
.def("ComputeElectronicDEDX", f1_ComputeElectronicDEDX,
f_ComputeElectronicDEDX())
.def("ComputeDEDX", f2_ComputeElectronicDEDX,
f_ComputeElectronicDEDX())
.def("ComputeTotalDEDX", f1_ComputeTotalDEDX, f_ComputeTotalDEDX())
.def("ComputeTotalDEDX", f2_ComputeTotalDEDX, f_ComputeTotalDEDX())
#endif
// ---
.def("ComputeCrossSectionPerVolume",
f1_ComputeCrossSectionPerVolume, f_ComputeCrossSectionPerVolume())
.def("ComputeCrossSectionPerVolume",
f2_ComputeCrossSectionPerVolume, f_ComputeCrossSectionPerVolume())
.def("ComputeCrossSectionPerAtom",
f1_ComputeCrossSectionPerAtom, f_ComputeCrossSectionPerAtom())
.def("ComputeCrossSectionPerAtom",
f2_ComputeCrossSectionPerAtom, g_ComputeCrossSectionPerAtom())
.def("ComputeMeanFreePath",
f1_ComputeMeanFreePath, f_ComputeMeanFreePath())
.def("ComputeMeanFreePath",
f2_ComputeMeanFreePath, f_ComputeMeanFreePath())
// ---
.def("FindParticle", &G4EmCalculator::FindParticle,
return_value_policy<reference_existing_object>())
.def("FindMaterial", &G4EmCalculator::FindMaterial,
return_value_policy<reference_existing_object>())
.def("FindRegion", &G4EmCalculator::FindRegion,
return_value_policy<reference_existing_object>())
.def("FindCouple", &G4EmCalculator::FindCouple,
f_FindCouple()[return_value_policy<reference_existing_object>()])
// ---
.def("SetVerbose", &G4EmCalculator::SetVerbose)
;
}
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * 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: pyG4ProcVector.cc,v 1.4 2006/06/29 15:34:52 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4ProcVector.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "pyG4indexing.hh"
#include "G4VProcess.hh"
using namespace boost::python;
namespace pyG4ProcVector {
typedef std::vector<G4VProcess*> G4ProcVector;
};
using namespace pyG4ProcVector;
// ====================================================================
// module definition
// ====================================================================
void export_G4ProcVector()
{
class_<G4ProcVector> ("G4ProcVector", "process vector")
.def(vector_indexing_suite<G4ProcVector>())
;
}
@@ -0,0 +1,254 @@
//
// ********************************************************************
// * 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: pyG4ProcessManager.cc,v 1.4 2006/06/29 15:34:55 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4ProcessManager.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4ProcessManager.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4ProcessManager {
// GetProcessList()
// raw vector pointer -> Python list conversion
list f_GetProcessList(const G4ProcessManager* procMgr)
{
list procList;
G4ProcessVector* procVec= procMgr-> GetProcessList();
G4int nproc= procVec-> size();
for(G4int i=0; i< nproc; i++) {
procList.append(&(*procVec)[i]);
}
return procList;
}
// GetProcessVector()
list f_GetProcessVector(const G4ProcessManager* procMgr,
G4ProcessVectorDoItIndex idx,
G4ProcessVectorTypeIndex typ= typeGPIL )
{
list procList;
G4ProcessVector* procVec= procMgr-> GetProcessVector(idx, typ);
G4int nproc= procVec-> size();
for(G4int i=0; i< nproc; i++) {
procList.append(&(*procVec)[i]);
}
return procList;
}
BOOST_PYTHON_FUNCTION_OVERLOADS(g_GetProcessVector,
f_GetProcessVector, 2, 3);
// GetAtRestProcessVector()
list f_GetAtRestProcessVector(const G4ProcessManager* procMgr,
G4ProcessVectorTypeIndex typ= typeGPIL )
{
list procList;
G4ProcessVector* procVec= procMgr-> GetAtRestProcessVector(typ);
G4int nproc= procVec-> size();
for(G4int i=0; i< nproc; i++) {
procList.append(&(*procVec)[i]);
}
return procList;
}
BOOST_PYTHON_FUNCTION_OVERLOADS(g_GetAtRestProcessVector,
f_GetAtRestProcessVector, 1, 2);
// GetAlongStepProcessVector()
list f_GetAlongStepProcessVector(const G4ProcessManager* procMgr,
G4ProcessVectorTypeIndex typ= typeGPIL )
{
list procList;
G4ProcessVector* procVec= procMgr-> GetAlongStepProcessVector(typ);
G4int nproc= procVec-> size();
for(G4int i=0; i< nproc; i++) {
procList.append(&(*procVec)[i]);
}
return procList;
}
BOOST_PYTHON_FUNCTION_OVERLOADS(g_GetAlongStepProcessVector,
f_GetAlongStepProcessVector, 1, 2);
// GetPostStepProcessVector()
list f_GetPostStepProcessVector(const G4ProcessManager* procMgr,
G4ProcessVectorTypeIndex typ= typeGPIL )
{
list procList;
G4ProcessVector* procVec= procMgr-> GetPostStepProcessVector(typ);
G4int nproc= procVec-> size();
for(G4int i=0; i< nproc; i++) {
procList.append(&(*procVec)[i]);
}
return procList;
}
BOOST_PYTHON_FUNCTION_OVERLOADS(g_GetPostStepProcessVector,
f_GetPostStepProcessVector, 1, 2);
// GetProcessVectorIndex...
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetProcessVectorIndex,
GetProcessVectorIndex, 2, 3);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetAtRestIndex,
GetAtRestIndex, 1, 2);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetAlongStepIndex,
GetAlongStepIndex, 1, 2);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetPostStepIndex,
GetPostStepIndex, 1, 2);
// AddProcess...
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_AddProcess, AddProcess, 1, 4);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_AddRestProcess,
AddRestProcess, 1, 2);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_AddDiscreteProcess,
AddDiscreteProcess, 1, 2);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_AddContinuousProcess,
AddContinuousProcess, 1, 2);
// SetProcessOrdering
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetProcessOrdering,
SetProcessOrdering, 2, 3);
// RemoveProcess...
G4VProcess*(G4ProcessManager::*f1_RemoveProcess)(G4VProcess*)
= &G4ProcessManager::RemoveProcess;
G4VProcess*(G4ProcessManager::*f2_RemoveProcess)(G4int)
= &G4ProcessManager::RemoveProcess;
// Set/GetProcessActivation...
G4VProcess*(G4ProcessManager::*f1_SetProcessActivation)(G4VProcess*, G4bool)
= &G4ProcessManager::SetProcessActivation;
G4VProcess*(G4ProcessManager::*f2_SetProcessActivation)(G4int, G4bool)
= &G4ProcessManager::SetProcessActivation;
G4bool(G4ProcessManager::*f1_GetProcessActivation)(G4VProcess*) const
= &G4ProcessManager::GetProcessActivation;
G4bool(G4ProcessManager::*f2_GetProcessActivation)(G4int) const
= &G4ProcessManager::GetProcessActivation;
};
using namespace pyG4ProcessManager;
// ====================================================================
// module definition
// ====================================================================
void export_G4ProcessManager()
{
class_<G4ProcessManager, G4ProcessManager*, boost::noncopyable>
("G4ProcessManager", "process manager class", no_init)
// ---
.def("GetProcessList", f_GetProcessList)
.def("GetProcessListLength", &G4ProcessManager::GetProcessListLength)
.def("GetProcessIndex", &G4ProcessManager::GetProcessIndex)
.def("GetProcessVector", f_GetProcessVector,
g_GetProcessVector())
.def("GetAtRestProcessVector", f_GetAtRestProcessVector,
g_GetAtRestProcessVector())
.def("GetAlongStepProcessVector", f_GetAlongStepProcessVector,
g_GetAlongStepProcessVector())
.def("GetPostStepProcessVector", f_GetPostStepProcessVector,
g_GetPostStepProcessVector())
.def("GetProcessVectorIndex",
&G4ProcessManager::GetProcessVectorIndex,
f_GetProcessVectorIndex())
.def("GetAtRestIndex", &G4ProcessManager::GetAtRestIndex,
f_GetAtRestIndex())
.def("GetAlongStepIndex", &G4ProcessManager::GetAlongStepIndex,
f_GetAlongStepIndex())
.def("GetPostStepIndex", &G4ProcessManager::GetPostStepIndex,
f_GetPostStepIndex())
// ----
.def("AddProcess", &G4ProcessManager::AddProcess,
f_AddProcess())
.def("AddRestProcess", &G4ProcessManager::AddRestProcess,
f_AddRestProcess())
.def("AddDiscreteProcess", &G4ProcessManager::AddDiscreteProcess,
f_AddDiscreteProcess())
.def("AddContinuousProcess", &G4ProcessManager::AddContinuousProcess,
f_AddContinuousProcess())
// ---
.def("GetProcessOrdering", &G4ProcessManager::GetProcessOrdering)
.def("SetProcessOrdering", &G4ProcessManager::SetProcessOrdering,
f_SetProcessOrdering())
.def("SetProcessOrderingToFirst",
&G4ProcessManager::SetProcessOrderingToFirst)
.def("SetProcessOrderingToLast",
&G4ProcessManager::SetProcessOrderingToLast)
// ---
.def("RemoveProcess", f1_RemoveProcess,
return_value_policy<reference_existing_object>())
.def("RemoveProcess", f2_RemoveProcess,
return_value_policy<reference_existing_object>())
// ---
.def("SetProcessActivation", f1_SetProcessActivation,
return_value_policy<reference_existing_object>())
.def("SetProcessActivation", f2_SetProcessActivation,
return_value_policy<reference_existing_object>())
.def("GetProcessActivation", f1_GetProcessActivation)
.def("GetProcessActivation", f2_GetProcessActivation)
// ---
.def("GetParticleType", &G4ProcessManager::GetParticleType,
return_internal_reference<>())
.def("SetParticleType", &G4ProcessManager::SetParticleType)
.def("DumpInfo", &G4ProcessManager::DumpInfo)
.def("SetVerboseLevel", &G4ProcessManager::SetVerboseLevel)
.def("GetVerboseLevel", &G4ProcessManager::GetVerboseLevel)
;
// enums...
enum_<G4ProcessVectorTypeIndex>("G4ProcessVectorTypeIndex")
.value("typeGPIL", typeGPIL)
.value("typeGPIL", typeDoIt)
;
enum_<G4ProcessVectorDoItIndex>("G4ProcessVectorDoItIndex")
.value("idxAll", idxAll)
.value("idxAtRest", idxAtRest)
.value("idxAlongStep", idxAlongStep)
.value("idxPostStep", idxPostStep)
;
enum_<G4ProcessVectorOrdering>("G4ProcessVectorOrdering")
.value("ordInActive", ordInActive)
.value("ordDefault", ordDefault)
.value("ordLast", ordLast)
;
}
@@ -0,0 +1,186 @@
//
// ********************************************************************
// * 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: pyG4ProcessTable.cc,v 1.4 2006/06/29 15:34:58 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4ProcessTable.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
class G4UImessenger;
#include "G4ProcessTable.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4ProcessTable {
// FindProcess
G4VProcess*(G4ProcessTable::*f1_FindProcess)
(const G4String&, const G4String&) const = &G4ProcessTable::FindProcess;
G4VProcess*(G4ProcessTable::*f2_FindProcess)
(const G4String&, const G4ParticleDefinition*) const
= &G4ProcessTable::FindProcess;
G4VProcess*(G4ProcessTable::*f3_FindProcess)
(const G4String&, const G4ProcessManager*) const
= &G4ProcessTable::FindProcess;
// FindProcesses
// raw vector pointer -> Python list conversion
list f1_FindProcesses(G4ProcessTable* procTable)
{
list procList;
G4ProcessVector* procVec= procTable-> FindProcesses();
G4int nproc= procVec-> size();
for(G4int i=0; i< nproc; i++) {
procList.append(&(*procVec)[i]);
}
return procList;
}
list f2_FindProcesses(G4ProcessTable* procTable,
const G4ProcessManager* procManager)
{
list procList;
G4ProcessVector* procVec= procTable-> FindProcesses(procManager);
G4int nproc= procVec-> size();
for(G4int i=0; i< nproc; i++) {
procList.append(&(*procVec)[i]);
}
return procList;
}
list f3_FindProcesses(G4ProcessTable* procTable,
const G4String& pname)
{
list procList;
G4ProcessVector* procVec= procTable-> FindProcesses(pname);
G4int nproc= procVec-> size();
for(G4int i=0; i< nproc; i++) {
procList.append(&(*procVec)[i]);
}
return procList;
}
list f4_FindProcesses(G4ProcessTable* procTable,
G4ProcessType ptype)
{
list procList;
G4ProcessVector* procVec= procTable-> FindProcesses(ptype);
G4int nproc= procVec-> size();
for(G4int i=0; i< nproc; i++) {
procList.append(&(*procVec)[i]);
}
return procList;
}
// SetProcessActivation
void(G4ProcessTable::*f1_SetProcessActivation)
(const G4String&, G4bool)= &G4ProcessTable::SetProcessActivation;
void(G4ProcessTable::*f2_SetProcessActivation)
(const G4String&, const G4String&, G4bool)
= &G4ProcessTable::SetProcessActivation;
void(G4ProcessTable::*f3_SetProcessActivation)
(const G4String&, G4ParticleDefinition*, G4bool)
= &G4ProcessTable::SetProcessActivation;
void(G4ProcessTable::*f4_SetProcessActivation)
(const G4String&, G4ProcessManager*, G4bool)
= &G4ProcessTable::SetProcessActivation;
void(G4ProcessTable::*f5_SetProcessActivation)
(G4ProcessType, G4bool)= &G4ProcessTable::SetProcessActivation;
void(G4ProcessTable::*f6_SetProcessActivation)
(G4ProcessType, const G4String&, G4bool)
= &G4ProcessTable::SetProcessActivation;
void(G4ProcessTable::*f7_SetProcessActivation)
(G4ProcessType, G4ParticleDefinition*, G4bool)
= &G4ProcessTable::SetProcessActivation;
void(G4ProcessTable::*f8_SetProcessActivation)
(G4ProcessType, G4ProcessManager*, G4bool)
= &G4ProcessTable::SetProcessActivation;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_DumpInfo, DumpInfo, 1, 2);
};
using namespace pyG4ProcessTable;
// ====================================================================
// module definition
// ====================================================================
void export_G4ProcessTable()
{
class_<G4ProcessTable, G4ProcessTable*, boost::noncopyable>
("G4ProcessTable", "process table")
// ---
.def("GetProcessTable", &G4ProcessTable::GetProcessTable,
return_value_policy<reference_existing_object>())
.staticmethod("GetProcessTable")
.def("Length", &G4ProcessTable::Length)
//.def("Insert", &G4ProcessTable::Insert) // protected
//.def("Remove", &G4ProcessTable::Remove) // protected
// ---
.def("FindProcess", f1_FindProcess,
return_value_policy<reference_existing_object>())
.def("FindProcess", f2_FindProcess,
return_value_policy<reference_existing_object>())
.def("FindProcess", f3_FindProcess,
return_value_policy<reference_existing_object>())
.def("FindProcess", f3_FindProcess,
return_value_policy<reference_existing_object>())
// ---
.def("FindProcesses", f1_FindProcesses)
.def("FindProcesses", f2_FindProcesses)
.def("FindProcesses", f3_FindProcesses)
.def("FindProcesses", f4_FindProcesses)
// ---
.def("SetProcessActivation", f1_SetProcessActivation)
.def("SetProcessActivation", f2_SetProcessActivation)
.def("SetProcessActivation", f3_SetProcessActivation)
.def("SetProcessActivation", f4_SetProcessActivation)
.def("SetProcessActivation", f5_SetProcessActivation)
.def("SetProcessActivation", f6_SetProcessActivation)
.def("SetProcessActivation", f7_SetProcessActivation)
.def("SetProcessActivation", f8_SetProcessActivation)
// ---
.def("GetNameList", &G4ProcessTable::GetNameList,
return_internal_reference<>())
.def("DumpInfo", &G4ProcessTable::DumpInfo, f_DumpInfo())
.def("SetVerboseLevel", &G4ProcessTable::SetVerboseLevel)
.def("GetVerboseLevel", &G4ProcessTable::GetVerboseLevel)
;
}
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * 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: pyG4ProcessType.cc,v 1.4 2006/06/29 15:35:00 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4ProcessTyoe.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4ProcessType.hh"
using namespace boost::python;
// ====================================================================
// module definition
// ====================================================================
void export_G4ProcessType()
{
enum_<G4ProcessType>("G4ProcessType")
.value("fNotDefined", fNotDefined)
.value("fTransportation", fTransportation)
.value("fElectromagnetic", fElectromagnetic)
.value("fOptical", fOptical)
.value("fHadronic", fHadronic)
.value("fPhotolepton_hadron", fPhotolepton_hadron)
.value("fDecay", fDecay)
.value("fGeneral", fGeneral)
.value("fParameterisation", fParameterisation)
.value("fUserDefined", fUserDefined)
;
}
@@ -0,0 +1,81 @@
//
// ********************************************************************
// * 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: pyG4VProcess.cc,v 1.4 2006/06/29 15:35:03 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4VProcess.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4VProcess.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4VProcess {
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_StorePhysicsTable,
StorePhysicsTable, 2, 3);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_RetrievePhysicsTable,
RetrievePhysicsTable, 2, 3);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetPhysicsTableFileName,
GetPhysicsTableFileName, 3, 4);
};
using namespace pyG4VProcess;
// ====================================================================
// module definition
// ====================================================================
void export_G4VProcess()
{
class_<G4VProcess, G4VProcess*, boost::noncopyable>
("G4VProcess", "base class for process", no_init)
// ---
// Note that only limited methods are exposed.
.def("SetPILfactor", &G4VProcess::SetPILfactor)
.def("GetPILfactor", &G4VProcess::GetPILfactor)
.def("IsApplicable", &G4VProcess::IsApplicable)
.def("BuildPhysicsTable", &G4VProcess::BuildPhysicsTable)
.def("PreparePhysicsTable", &G4VProcess::PreparePhysicsTable)
.def("StorePhysicsTable", &G4VProcess::StorePhysicsTable,
f_StorePhysicsTable())
.def("RetrievePhysicsTable", &G4VProcess::RetrievePhysicsTable,
f_RetrievePhysicsTable())
.def("GetPhysicsTableFileName", &G4VProcess::GetPhysicsTableFileName,
f_GetPhysicsTableFileName()
[return_value_policy<return_by_value>()])
.def("GetProcessName", &G4VProcess::GetProcessName,
return_value_policy<return_by_value>())
.def("GetProcessType", &G4VProcess::GetProcessType)
.def("DumpInfo", &G4VProcess::DumpInfo)
.def("SetVerboseLevel", &G4VProcess::SetVerboseLevel)
.def("GetVerboseLevel", &G4VProcess::GetVerboseLevel)
;
}
@@ -0,0 +1,55 @@
//
// ********************************************************************
// * 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: pymodG4processes.cc,v 1.4 2006/06/29 15:35:06 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pymodG4processes.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
using namespace boost::python;
// ====================================================================
// module definition
// ====================================================================
void export_G4ProcessManager();
void export_G4ProcessTable();
void export_G4VProcess();
void export_G4ProcVector();
void export_G4ProcessType();
void export_G4EmCalculator();
BOOST_PYTHON_MODULE(G4processes)
{
export_G4ProcessManager();
export_G4ProcessTable();
export_G4VProcess();
export_G4ProcVector();
export_G4ProcessType();
export_G4EmCalculator();
}