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
+14
View File
@@ -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 := G4run#
include $(G4PY_INSTALL)/config/g4py.gmk
include $(G4PY_INSTALL)/config/module.gmk
include $(G4PY_INSTALL)/config/install.gmk
+65
View File
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * 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: pyG4Run.cc,v 1.4 2006/06/29 15:35:09 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4Run.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4Run.hh"
#include "G4HCtable.hh"
#include "G4DCtable.hh"
using namespace boost::python;
// ====================================================================
// module definition
// ====================================================================
void export_G4Run()
{
class_<G4Run, G4Run*>("G4Run", "run class")
// ---
.def("GetRunID", &G4Run::GetRunID)
.def("SetRunID", &G4Run::SetRunID)
.def("GetNumberOfEvent", &G4Run::GetNumberOfEvent)
.def("GetNumberOfEventToBeProcessed",
&G4Run::GetNumberOfEventToBeProcessed)
.def("SetNumberOfEventToBeProcessed",
&G4Run::SetNumberOfEventToBeProcessed)
;
// reduced functionality...
//.def("RecordEvent", &G4Run::RecordEvent) // virtual
//.def("GetHCtable", &G4Run::GetHCtable,
//return_internal_reference<>())
//.def("SetHCtable", &G4Run::SetHCtable)
//.def("GetDCtable", &G4Run::GetDCtable,
//return_internal_reference<>())
//.def("SetDCtable", &G4Run::SetDCtable)
}
@@ -0,0 +1,183 @@
//
// ********************************************************************
// * 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: pyG4RunManager.cc,v 1.4 2006/06/29 15:35:12 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4RunManager.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4RunManager.hh"
#include "G4VUserDetectorConstruction.hh"
#include "G4VUserPhysicsList.hh"
#include "G4UserRunAction.hh"
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4UserEventAction.hh"
#include "G4UserStackingAction.hh"
#include "G4UserTrackingAction.hh"
#include "G4UserSteppingAction.hh"
#include "G4Region.hh"
#include "G4Run.hh"
#include "G4Event.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4RunManager {
// SetUserInitialization()
void (G4RunManager::*f1_SetUserInitialization)(G4VUserDetectorConstruction*)
= &G4RunManager::SetUserInitialization;
void (G4RunManager::*f2_SetUserInitialization)(G4VUserPhysicsList*)
= &G4RunManager::SetUserInitialization;
// SetUserAction()
void (G4RunManager::*f1_SetUserAction)(G4UserRunAction*)
= &G4RunManager::SetUserAction;
void (G4RunManager::*f2_SetUserAction)(G4VUserPrimaryGeneratorAction*)
= &G4RunManager::SetUserAction;
void (G4RunManager::*f3_SetUserAction)(G4UserEventAction*)
= &G4RunManager::SetUserAction;
void (G4RunManager::*f4_SetUserAction)(G4UserStackingAction*)
= &G4RunManager::SetUserAction;
void (G4RunManager::*f5_SetUserAction)(G4UserTrackingAction*)
= &G4RunManager::SetUserAction;
void (G4RunManager::*f6_SetUserAction)(G4UserSteppingAction*)
= &G4RunManager::SetUserAction;
// DumpRegion
void (G4RunManager::*f1_DumpRegion)(G4String) const
= &G4RunManager::DumpRegion;
void (G4RunManager::*f2_DumpRegion)(G4Region*) const
= &G4RunManager::DumpRegion;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_DumpRegion,
DumpRegion, 0, 1);
// BeamOn()
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_BeamOn, BeamOn, 1, 3);
// AbortRun()
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_AbortRun, AbortRun, 0, 1);
// DefineWorldVolume()
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_DefineWorldVolume,
DefineWorldVolume, 1, 2);
};
using namespace pyG4RunManager;
// ====================================================================
// module definition
// ====================================================================
void export_G4RunManager()
{
class_<G4RunManager>("G4RunManager", "run manager class")
// ---
.def("GetRunManager", &G4RunManager::GetRunManager,
"Get an instance of G4RunManager",
return_value_policy<reference_existing_object>())
.staticmethod("GetRunManager")
// ---
.def("SetVerboseLevel", &G4RunManager::SetVerboseLevel)
.def("GetVerboseLevel", &G4RunManager::GetVerboseLevel)
// ---
.def("Initialize", &G4RunManager::Initialize)
.def("BeamOn", &G4RunManager::BeamOn,
f_BeamOn((arg("n_event"), arg("macroFile")=0,
arg("n_select")=-1),
"Starts event loop."))
// ---
.def("SetUserInitialization", f1_SetUserInitialization)
.def("SetUserInitialization", f2_SetUserInitialization)
.def("SetUserAction", f1_SetUserAction)
.def("SetUserAction", f2_SetUserAction)
.def("SetUserAction", f3_SetUserAction)
.def("SetUserAction", f4_SetUserAction)
.def("SetUserAction", f5_SetUserAction)
.def("SetUserAction", f6_SetUserAction)
// ---
.def("GetUserDetectorConstruction",
&G4RunManager::GetUserDetectorConstruction,
return_internal_reference<>())
.def("GetUserPhysicsList",
&G4RunManager::GetUserPhysicsList,
return_internal_reference<>())
.def("GetUserPrimaryGeneratorAction",
&G4RunManager::GetUserPrimaryGeneratorAction,
return_internal_reference<>())
.def("GetUserRunAction", &G4RunManager::GetUserRunAction,
return_internal_reference<>())
.def("GetUserEventAction", &G4RunManager::GetUserEventAction,
return_internal_reference<>())
.def("GetUserStackingAction", &G4RunManager::GetUserStackingAction,
return_internal_reference<>())
.def("GetUserTrackingAction", &G4RunManager::GetUserTrackingAction,
return_internal_reference<>())
.def("GetUserSteppingAction", &G4RunManager::GetUserSteppingAction,
return_internal_reference<>())
// ---
.def("AbortRun", &G4RunManager::AbortRun,
f_AbortRun((arg("soft_abort")=false),
"Abort run (event loop)."))
.def("AbortEvent", &G4RunManager::AbortEvent)
.def("GetVersionString", &G4RunManager::GetVersionString)
.def("DefineWorldVolume", &G4RunManager::DefineWorldVolume,
f_DefineWorldVolume())
.def("DumpRegion", f1_DumpRegion)
.def("DumpRegion", f2_DumpRegion, f_DumpRegion())
.def("rndmSaveThisRun", &G4RunManager::rndmSaveThisRun)
.def("rndmSaveThisEvent", &G4RunManager::rndmSaveThisEvent)
.def("RestoreRandomNumberStatus",
&G4RunManager::RestoreRandomNumberStatus)
.def("SetRandomNumberStore", &G4RunManager::SetRandomNumberStore)
.def("GetRandomNumberStore", &G4RunManager::GetRandomNumberStore)
.def("SetRandomNumberStoreDir", &G4RunManager::SetRandomNumberStoreDir)
.def("GetRandomNumberStoreDir", &G4RunManager::GetRandomNumberStoreDir)
.def("GeometryHasBeenModified", &G4RunManager::GeometryHasBeenModified)
.def("PhysicsHasBeenModified", &G4RunManager::PhysicsHasBeenModified)
.def("GetGeometryToBeOptimized",&G4RunManager::GetGeometryToBeOptimized)
.def("GetCurrentRun", &G4RunManager::GetCurrentRun,
return_value_policy<reference_existing_object>())
.def("GetCurrentEvent", &G4RunManager::GetCurrentEvent,
return_value_policy<reference_existing_object>())
.def("SetRunIDCounter", &G4RunManager::SetRunIDCounter)
;
// reduced functionality...
// void SetPrimaryTransformer(G4PrimaryTransformer* pt)
// void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
// void CutOffHasBeenModified()
// void SetGeometryToBeOptimized(G4bool vl)
// const G4Event* GetPreviousEvent(G4int i) const
// void SetNumberOfEventsToBeStored(G4int val)
// void SetDCtable(G4DCtable* DCtbl)
}
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * 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: pyG4RunManagerKernel.cc,v 1.3 2006/06/29 15:35:15 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4RunManagerKernel.cc
//
// 2006 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4RunManagerKernel.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4RunManagerKernel {
};
using namespace pyG4RunManagerKernel;
// ====================================================================
// module definition
// ====================================================================
void export_G4RunManagerKernel()
{
class_<G4RunManagerKernel>("G4RunManagerKernel", "run manager kernel")
.def("GetRunManagerKernel", &G4RunManagerKernel::GetRunManagerKernel,
"Get an instance of G4RunManagerKernel",
return_value_policy<reference_existing_object>())
.staticmethod("GetRunManagerKernel")
// ---
//.def("DefineWorldVolume", &G4RunManagerKernel::DefineWorldVolume)
//.def("SetPhysics", &G4RunManagerKernel::SetPhysics)
//.def("InitializePhysics", &G4RunManagerKernel::InitializePhysics)
.def("RunInitialization", &G4RunManagerKernel::RunInitialization)
//.def("RunTermination", &G4RunManagerKernel::RunTermination)
//.def("UpdateRegion", &G4RunManagerKernel::UpdateRegion)
//.def("DumpRegion", &G4RunManagerKernel::DumpRegion)
//.def("DumpRegion", &G4RunManagerKernel::DumpRegion)
//.def("GeometryHasBeenModified",
//&G4RunManagerKernel::GeometryHasBeenModified)
//.def("PhysicsHasBeenModified",
//&G4RunManagerKernel::PhysicsHasBeenModified)
//.def("GetEventManager", &G4RunManagerKernel::GetEventManager,
//...)
//.def("GetStackManager", &G4RunManagerKernel::GetStackManager,
//...)
//.def("GetTrackingManager", &G4RunManagerKernel::GetTrackingManager,
//...)
//.def("SetPrimaryTransformer", &G4RunManagerKernel::SetPrimaryTransformer)
//.def("GetPrimaryTransformer", &G4RunManagerKernel::GetPrimaryTransformer,
//...)
//.def("GetVersionString", &G4RunManagerKernel::GetVersionString)
//.def("SetVerboseLevel", &G4RunManagerKernel::SetVerboseLevel)
//.def("SetGeometryToBeOptimized",
//&G4RunManagerKernel::SetGeometryToBeOptimized)
;
}
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * 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: pyG4UserRunAction.cc,v 1.6 2006/06/29 15:35:18 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4UserRunAction.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4UserRunAction.hh"
#include "G4Run.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
struct CB_G4UserRunAction : G4UserRunAction, wrapper<G4UserRunAction> {
// BeginOfRunAction
void BeginOfRunAction(const G4Run* aRun) {
if(const override& f= get_override("BeginOfRunAction")) {
f(boost::ref(aRun));
} else
G4UserRunAction::BeginOfRunAction(aRun);
}
// EndOfRunAction
void EndOfRunAction(const G4Run* aRun) {
if(const override& f= get_override("EndOfRunAction")) {
f(boost::ref(aRun));
} else {
G4UserRunAction::EndOfRunAction(aRun);
}
}
};
// ====================================================================
// module definition
// ====================================================================
void export_G4UserRunAction()
{
class_<CB_G4UserRunAction, CB_G4UserRunAction*, boost::noncopyable>
( "G4UserRunAction", "run action class")
// ---
.def("BeginOfRunAction", &G4UserRunAction::BeginOfRunAction,
&CB_G4UserRunAction::BeginOfRunAction)
.def("EndOfRunAction", &G4UserRunAction::EndOfRunAction,
&CB_G4UserRunAction::EndOfRunAction)
// reduced functionality...
//.def("GenerateRun", &G4UserRunAction::GenerateRun) // virtual
;
}
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * 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: pyG4VModularPhysicsList.cc,v 1.3 2006/06/29 15:35:21 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4VModularPhysicsList.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4VModularPhysicsList.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4VModularPhysicsList {
struct CB_G4VModularPhysicsList :
G4VModularPhysicsList, wrapper<G4VModularPhysicsList> {
void SetCuts() {
get_override("SetCuts")();
}
};
// GetPhysics()
const G4VPhysicsConstructor*
(G4VModularPhysicsList::*f1_GetPhysics)(G4int) const
= &G4VModularPhysicsList::GetPhysics;
const G4VPhysicsConstructor*
(G4VModularPhysicsList::*f2_GetPhysics)(const G4String&) const
= &G4VModularPhysicsList::GetPhysics;
}
using namespace pyG4VModularPhysicsList;
// ====================================================================
// module definition
// ====================================================================
void export_G4VModularPhysicsList()
{
class_<CB_G4VModularPhysicsList, bases<G4VUserPhysicsList>,
boost::noncopyable>
("G4VModularPhysicsList", "base class of modular physics list")
// ---
.def("SetCuts", pure_virtual(&G4VModularPhysicsList::SetCuts))
.def("ConstructParticle", &G4VModularPhysicsList::ConstructParticle)
.def("ConstructProcess", &G4VModularPhysicsList::ConstructProcess)
// ---
.def("RegisterPhysis", &G4VModularPhysicsList::RegisterPhysics)
.def("GetPhysics", f1_GetPhysics,
return_value_policy<reference_existing_object>())
.def("GetPhysics", f2_GetPhysics,
return_value_policy<reference_existing_object>())
;
}
@@ -0,0 +1,94 @@
//
// ********************************************************************
// * 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: pyG4VPhysicsConstructor.cc,v 1.3 2006/06/29 15:35:24 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4VPhysicsConstructor.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4VPhysicsConstructor.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4VPhysicsConstructor {
class CB_G4VPhysicsConstructor :
public G4VPhysicsConstructor,
public wrapper<G4VPhysicsConstructor> {
public:
CB_G4VPhysicsConstructor(): G4VPhysicsConstructor() { }
CB_G4VPhysicsConstructor(const G4String& name)
: G4VPhysicsConstructor(name) { }
void ConstructParticle() {
get_override("ConstructParticle")();
}
void ConstructProcess() {
get_override("ConstructProcess")();
}
};
// SetPhysicsName()
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetPhysicsName,
SetPhysicsName, 0, 1);
};
using namespace pyG4VPhysicsConstructor;
// ====================================================================
// module definition
// ====================================================================
void export_G4VPhysicsConstructor()
{
class_<CB_G4VPhysicsConstructor, boost::noncopyable>
("G4VPhysicsConstructor",
"base class of user physics constructor")
// ----
.def(init<const G4String&>())
// ---
.def("ConstructParticle",
pure_virtual(&G4VPhysicsConstructor::ConstructParticle))
.def("ConstructProcess",
pure_virtual(&G4VPhysicsConstructor::ConstructProcess))
// ---
.def("SetPhysicsName", &G4VPhysicsConstructor::SetPhysicsName,
f_SetPhysicsName())
.def("GetPhysicsName", &G4VPhysicsConstructor::GetPhysicsName,
return_value_policy<return_by_value>())
.def("SetVerboseLevel", &G4VPhysicsConstructor::SetVerboseLevel)
.def("GetVerboseLevel", &G4VPhysicsConstructor::GetVerboseLevel)
;
}
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * 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: pyG4VUserDetectorConstruction.cc,v 1.5 2006/06/29 15:35:27 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4VUserDetectorConstruction.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4VUserDetectorConstruction.hh"
#include "G4VPhysicalVolume.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4VUserDetectorConstruction {
struct CB_G4VUserDetectorConstruction :
G4VUserDetectorConstruction, wrapper<G4VUserDetectorConstruction> {
G4VPhysicalVolume* Construct() {
get_override("Construct")();
}
};
};
using namespace pyG4VUserDetectorConstruction;
// ====================================================================
// module definition
// ====================================================================
void export_G4VUserDetectorConstruction()
{
class_<CB_G4VUserDetectorConstruction, CB_G4VUserDetectorConstruction*,
boost::noncopyable>
("G4VUserDetectorConstruction",
"base class of user detector construction")
.def("Construct",
pure_virtual(&G4VUserDetectorConstruction::Construct),
return_value_policy<reference_existing_object>())
;
}
@@ -0,0 +1,133 @@
//
// ********************************************************************
// * 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: pyG4VUserPhysicsList.cc,v 1.5 2006/06/29 15:35:30 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4VUserPhysicsList.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4VUserPhysicsList.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4VUserPhysicsList {
struct CB_G4VUserPhysicsList :
G4VUserPhysicsList, wrapper<G4VUserPhysicsList> {
void ConstructParticle() {
get_override("ConstructParticle")();
}
void ConstructProcess() {
get_override("ConstructProcess")();
}
void SetCuts() {
get_override("SetCuts")();
}
};
// SetCutValue
void (G4VUserPhysicsList::*f1_SetCutValue)(G4double, const G4String&)
= &G4VUserPhysicsList::SetCutValue;
void (G4VUserPhysicsList::*f2_SetCutValue)(G4double, const G4String&,
const G4String&)
= &G4VUserPhysicsList::SetCutValue;
// StorePhysicsTable
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_StorePhysicsTable,
StorePhysicsTable, 0, 1);
// SetParticleCuts
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetParticleCuts,
SetParticleCuts, 2, 3);
}
using namespace pyG4VUserPhysicsList;
// ====================================================================
// module definition
// ====================================================================
void export_G4VUserPhysicsList()
{
class_<CB_G4VUserPhysicsList, CB_G4VUserPhysicsList*, boost::noncopyable>
("G4VUserPhysicsList", "base class of user physics list")
// ---
.def("ConstructParticle",
pure_virtual(&G4VUserPhysicsList::ConstructParticle))
.def("ConstructProcess",
pure_virtual(&G4VUserPhysicsList::ConstructProcess))
.def("SetCuts",
pure_virtual(&G4VUserPhysicsList::SetCuts))
// ---
.def("SetDefaultCutValue", &G4VUserPhysicsList::SetDefaultCutValue)
.def("GetDefaultCutValue", &G4VUserPhysicsList::GetDefaultCutValue)
// ---
.def("StorePhysicsTable", &G4VUserPhysicsList::StorePhysicsTable,
f_StorePhysicsTable())
.def("IsPhysicsTableRetrieved",
&G4VUserPhysicsList::IsPhysicsTableRetrieved)
.def("IsStoredInAscii", &G4VUserPhysicsList::IsStoredInAscii)
.def("GetPhysicsTableDirectory",
&G4VUserPhysicsList::GetPhysicsTableDirectory,
return_value_policy<return_by_value>())
.def("SetStoredInAscii", &G4VUserPhysicsList::SetStoredInAscii)
.def("ResetStoredInAscii", &G4VUserPhysicsList::ResetStoredInAscii)
// ---
.def("DumpList", &G4VUserPhysicsList::DumpList)
.def("DumpCutValuesTable", &G4VUserPhysicsList::DumpCutValuesTable)
.def("DumpCutValuesTableIfRequested",
&G4VUserPhysicsList::DumpCutValuesTableIfRequested)
.def("SetCutValue", f1_SetCutValue)
.def("SetCutValue", f2_SetCutValue)
.def("SetParticleCuts", &G4VUserPhysicsList::SetParticleCuts,
f_SetParticleCuts())
// ---
.def("SetVerboseLevel", &G4VUserPhysicsList::SetVerboseLevel)
.def("GetVerboseLevel", &G4VUserPhysicsList::GetVerboseLevel)
.def("SetCutsWithDefault", &G4VUserPhysicsList::SetCutsWithDefault)
.def("SetCutsForRegion", &G4VUserPhysicsList::SetCutsForRegion)
.def("GetApplyCuts", &G4VUserPhysicsList::GetApplyCuts)
;
// Note that exposed items are limited,
// because this class object is mainly for internal uses or obsolete.
// Construct
// BuildPhysicsTable
// PreparePhysicsTable
// SetPhysicsTableRetrieved
// ReSetPhysicsTableRetrieved
// SetApplyCuts
// DumpCutValues (obsolete)
// ResetCuts;
}
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * 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: pyG4VUserPrimaryGeneratorAction.cc,v 1.7 2006/06/29 15:35:33 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pyG4VUserPrimaryGeneratorAction.cc
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4Event.hh"
using namespace boost::python;
// ====================================================================
// thin wrappers
// ====================================================================
namespace pyG4VUserPrimaryGeneratorAction {
struct CB_G4VUserPrimaryGeneratorAction :
G4VUserPrimaryGeneratorAction, wrapper<G4VUserPrimaryGeneratorAction> {
void GeneratePrimaries(G4Event* anEvent) {
get_override("GeneratePrimaries")(boost::ref(anEvent));
}
};
};
using namespace pyG4VUserPrimaryGeneratorAction;
// ====================================================================
// module definition
// ====================================================================
void export_G4VUserPrimaryGeneratorAction()
{
class_<CB_G4VUserPrimaryGeneratorAction, CB_G4VUserPrimaryGeneratorAction*,
boost::noncopyable>
("G4VUserPrimaryGeneratorAction",
"base class of user primary generator action")
.def("GeneratePrimaries",
pure_virtual(&G4VUserPrimaryGeneratorAction::GeneratePrimaries))
;
}
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * 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: pymodG4run.cc,v 1.4 2006/06/29 15:35:35 gunter Exp $
// $Name: geant4-08-01 $
// ====================================================================
// pymodG4run.cc [Geant4Py module]
//
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
using namespace boost::python;
// ====================================================================
// module definition
// ====================================================================
void export_G4RunManager();
void export_G4RunManagerKernel();
void export_G4Run();
void export_G4UserRunAction();
void export_G4VUserPrimaryGeneratorAction();
void export_G4VUserDetectorConstruction();
void export_G4VUserPhysicsList();
void export_G4VModularPhysicsList();
void export_G4VPhysicsConstructor();
BOOST_PYTHON_MODULE(G4run)
{
export_G4RunManager();
export_G4RunManagerKernel();
export_G4Run();
export_G4UserRunAction();
export_G4VUserPrimaryGeneratorAction();
export_G4VUserDetectorConstruction();
export_G4VUserPhysicsList();
export_G4VModularPhysicsList();
export_G4VPhysicsConstructor();
}