Message: Re: using FTFP_BERT_EMX from python Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: using FTFP_BERT_EMX from python 

Forum: Physics List
Re: None using FTFP_BERT_EMX from python (Thomas Ruf)
Date: 05 Oct, 2013
From: Thomas Ruf <Thomas Ruf>

I answer my own question. Right a converter: // ==================================================================== // pyG4PhysListFactory.cc // // 2005 Q // ====================================================================
#include <boost/python.hpp>
#include "G4PhysListFactory.hh"

using namespace boost::python;

// ====================================================================
// module definition
// ====================================================================
void export_G4PhysListFactory()
{
  class_<G4PhysListFactory, G4PhysListFactory*>
    ("G4PhysListFactory", "phys list factory")
    // ---
    .def("GetReferencePhysList", &G4PhysListFactory::GetReferencePhysList,
         return_internal_reference<>())	 
    ;
}
and add it to the pymodG4physicslists module:
// ====================================================================
// module definition
// ====================================================================
void export_PhysicsLists();
void export_G4PhysListFactory();

BOOST_PYTHON_MODULE(G4physicslists)
{
  export_PhysicsLists();
  export_G4PhysListFactory();
}

in python: factory = G4physicslists.G4PhysListFactory() xx = factory.GetReferencePhysList("FTFP_BERT_EMX") gRunManager.SetUserInitialization(xx)

 Add Message Add Message
to: "Re: using FTFP_BERT_EMX from python"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]