Import Geant4 10.6.2 source tree
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
# - build library
|
||||
|
||||
# library
|
||||
set(_TARGET pyG4geometry)
|
||||
add_library (
|
||||
${_TARGET} SHARED
|
||||
geant4_add_pymodule(pyG4geometry
|
||||
pyG4BooleanSolid.cc
|
||||
pyG4Box.cc
|
||||
pyG4ChordFinder.cc
|
||||
@@ -47,17 +45,5 @@ add_library (
|
||||
pymodG4geometry.cc
|
||||
)
|
||||
|
||||
set_target_properties(${_TARGET} PROPERTIES PREFIX "")
|
||||
set_target_properties(${_TARGET} PROPERTIES OUTPUT_NAME "G4geometry")
|
||||
set_target_properties(${_TARGET} PROPERTIES SUFFIX ".so")
|
||||
set_target_properties(${_TARGET}
|
||||
PROPERTIES INSTALL_RPATH
|
||||
${GEANT4_LIBRARY_DIR}
|
||||
BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
|
||||
target_link_libraries (${_TARGET}
|
||||
${GEANT4_LIBRARIES_WITH_VIS} ${BOOST_PYTHON_LIB}
|
||||
${PYTHON_LIBRARIES})
|
||||
|
||||
# install
|
||||
install(TARGETS ${_TARGET} LIBRARY DESTINATION ${G4MODULES_INSTALL_DIR})
|
||||
target_link_libraries(pyG4geometry PRIVATE G4geometry G4track G4processes)
|
||||
install(TARGETS pyG4geometry DESTINATION "${CMAKE_INSTALL_PYTHONDIR}/Geant4")
|
||||
|
||||
@@ -50,7 +50,7 @@ const G4ChordFinder*(G4FieldManager::*f2_GetChordFinder)() const
|
||||
= &G4FieldManager::GetChordFinder;
|
||||
|
||||
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetDetectorField,
|
||||
SetDetectorField, 1, 2);
|
||||
SetDetectorField, 1, 2)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ namespace pyG4MagneticField {
|
||||
struct CB_PyG4MagneticField :
|
||||
PyG4MagneticField, wrapper<PyG4MagneticField> {
|
||||
|
||||
using PyG4MagneticField::GetFieldValue;
|
||||
|
||||
G4ThreeVector GetFieldValue(const G4ThreeVector& pos,
|
||||
const G4double time) const {
|
||||
return get_override("GetFieldValue")(pos, time);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
#include <memory>
|
||||
#include "G4Polycone.hh"
|
||||
|
||||
using namespace boost::python;
|
||||
@@ -46,9 +47,9 @@ G4Polycone* f1_CreatePolycone(const G4String& name, G4double phiStart,
|
||||
const std::vector<G4double>& rInner,
|
||||
const std::vector<G4double>& rOuter)
|
||||
{
|
||||
G4double zlist[numZPlanes];
|
||||
G4double r0list[numZPlanes];
|
||||
G4double r1list[numZPlanes];
|
||||
std::unique_ptr<G4double[]> zlist(new G4double[numZPlanes]);
|
||||
std::unique_ptr<G4double[]> r0list(new G4double[numZPlanes]);
|
||||
std::unique_ptr<G4double[]> r1list(new G4double[numZPlanes]);
|
||||
|
||||
for (G4int i=0; i< numZPlanes; i++) {
|
||||
zlist[i]= zPlane[i];
|
||||
@@ -57,7 +58,7 @@ G4Polycone* f1_CreatePolycone(const G4String& name, G4double phiStart,
|
||||
}
|
||||
|
||||
return new G4Polycone(name, phiStart, phiTotal, numZPlanes,
|
||||
zlist, r0list, r1list);
|
||||
zlist.get(), r0list.get(), r1list.get());
|
||||
}
|
||||
|
||||
|
||||
@@ -66,8 +67,8 @@ G4Polycone* f2_CreatePolycone(const G4String& name, G4double phiStart,
|
||||
const std::vector<G4double>& r,
|
||||
const std::vector<G4double>& z)
|
||||
{
|
||||
G4double zlist[numRZ];
|
||||
G4double rlist[numRZ];
|
||||
std::unique_ptr<G4double[]> zlist(new G4double[numRZ]);
|
||||
std::unique_ptr<G4double[]> rlist(new G4double[numRZ]);
|
||||
|
||||
for (G4int i=0; i< numRZ; i++) {
|
||||
rlist[i]= r[i];
|
||||
@@ -75,7 +76,7 @@ G4Polycone* f2_CreatePolycone(const G4String& name, G4double phiStart,
|
||||
}
|
||||
|
||||
return new G4Polycone(name, phiStart, phiTotal, numRZ,
|
||||
rlist, zlist);
|
||||
rlist.get(), zlist.get());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#include <boost/python.hpp>
|
||||
#include <memory>
|
||||
#include "G4Polyhedra.hh"
|
||||
|
||||
using namespace boost::python;
|
||||
@@ -40,16 +41,16 @@ namespace pyG4Polyhedra {
|
||||
|
||||
// create solid methods
|
||||
|
||||
G4Polyhedra* f1_CreatePolyhedra(const G4String& name,
|
||||
G4double phiStart, G4double phiTotal,
|
||||
G4Polyhedra* f1_CreatePolyhedra(const G4String& name,
|
||||
G4double phiStart, G4double phiTotal,
|
||||
G4int numSide, G4int numZPlanes,
|
||||
const std::vector<G4double>& zPlane,
|
||||
const std::vector<G4double>& rInner,
|
||||
const std::vector<G4double>& rOuter)
|
||||
{
|
||||
G4double zlist[numZPlanes];
|
||||
G4double r0list[numZPlanes];
|
||||
G4double r1list[numZPlanes];
|
||||
std::unique_ptr<G4double[]> zlist(new G4double[numZPlanes]);
|
||||
std::unique_ptr<G4double[]> r0list(new G4double[numZPlanes]);
|
||||
std::unique_ptr<G4double[]> r1list(new G4double[numZPlanes]);
|
||||
|
||||
for (G4int i=0; i< numZPlanes; i++) {
|
||||
zlist[i]= zPlane[i];
|
||||
@@ -58,26 +59,26 @@ G4Polyhedra* f1_CreatePolyhedra(const G4String& name,
|
||||
}
|
||||
|
||||
return new G4Polyhedra(name, phiStart, phiTotal, numSide, numZPlanes,
|
||||
zlist, r0list, r1list);
|
||||
zlist.get(), r0list.get(), r1list.get());
|
||||
}
|
||||
|
||||
|
||||
G4Polyhedra* f2_CreatePolyhedra(const G4String& name,
|
||||
G4double phiStart, G4double phiTotal,
|
||||
G4int numSide, G4int numRZ,
|
||||
const std::vector<G4double>& r,
|
||||
const std::vector<G4double>& r,
|
||||
const std::vector<G4double>& z)
|
||||
{
|
||||
G4double zlist[numRZ];
|
||||
G4double rlist[numRZ];
|
||||
std::unique_ptr<G4double[]> zlist(new G4double[numRZ]);
|
||||
std::unique_ptr<G4double[]> rlist(new G4double[numRZ]);
|
||||
|
||||
for (G4int i=0; i< numRZ; i++) {
|
||||
zlist[i]= z[i];
|
||||
rlist[i]= r[i];
|
||||
}
|
||||
|
||||
return new G4Polyhedra(name, phiStart, phiTotal, numSide, numRZ,
|
||||
rlist, zlist);
|
||||
return new G4Polyhedra(name, phiStart, phiTotal, numSide, numRZ,
|
||||
rlist.get(), zlist.get());
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user