Commit 45acc73f authored by Giancarlo Panizzo's avatar Giancarlo Panizzo
Browse files
parent ca30b4b9
......@@ -11,19 +11,9 @@ if( ATLAS_RELEASE_MODE )
return()
endif()
set( PYTHIA8_VERSION 244p3 )
set( PYTHIA8_LCGVERSION 244p3 )
set( PYTHIA8_ROOT
/cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/pythia8/${PYTHIA8_VERSION}/${LCG_PLATFORM} )
set( PYTHIA8_LCGROOT ${PYTHIA8_ROOT})
set( PYTHIA8_LCGVERSION ${PYTHIA8_ROOT})
# message( INFO " Setting Pythia8 env. variables from External/Pythia8." )
# set( PYTHIA8_LCGVERSION 301p3 )
# set( PYTHIA8_LCGROOT
# /cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/pythia8/${PYTHIA8_LCGVERSION}/${LCG_PLATFORM} )
# set( PYTHIA8_VERSION ${PYTHIA8_LCGVERSION})
# set( PYTHIA8_ROOT ${PYTHIA8_LCGROOT})
#set( PYTHIA8_VERSION 230 )
#set( PYTHIA8_ROOT
# /cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/pythia8/${PYTHIA8_VERSION}/${LCG_PLATFORM} )
# Find Pythia8:
find_package( Pythia8 )
......@@ -37,7 +27,7 @@ endif()
# Install the files from the xmldoc directory into the offline release.
set( xmldoc_dir "${PYTHIA8_LCGROOT}/share/Pythia8/xmldoc" )
if( NOT IS_DIRECTORY ${xmldoc_dir} )
message( WARNING "Can't access ${xmldoc_dir}" )
message( WARNING " Can't access ${xmldoc_dir}" )
return()
endif()
atlas_install_generic( ${xmldoc_dir}/*.xml ${xmldoc_dir}/*.dat
......@@ -45,3 +35,14 @@ atlas_install_generic( ${xmldoc_dir}/*.xml ${xmldoc_dir}/*.dat
${xmldoc_dir}/*.tbl ${xmldoc_dir}/*.eps
DESTINATION share/Pythia8/xmldoc
TYPENAME XmlDoc )
# Install the files from the pdfdata directory into the offline release. New in Pythia8.3
set( pdfdata_dir "${PYTHIA8_LCGROOT}/share/Pythia8/pdfdata" )
if( NOT IS_DIRECTORY ${pdfdata_dir} )
message( INFO " Can't access ${pdfdata_dir} (Needed only for Pythia8.3)" )
return()
endif()
atlas_install_generic( ${pdfdata_dir}/*.*
DESTINATION share/Pythia8/pdfdata
TYPENAME XmlDoc )
......@@ -10,9 +10,14 @@
#include <string>
#include <map>
#define PYTHIA8_PTRWRAP(A) A
#ifdef PYTHIA_VERSION_INTEGER
#if PYTHIA_VERSION_INTEGER > 8300
#if PYTHIA_VERSION_INTEGER > 8299
#define PYTHIA8_3SERIES
typedef std::shared_ptr<Pythia8::UserHooks> UserHooksPtrType;
#undef PYTHIA8_PTRWRAP
#define PYTHIA8_PTRWRAP(A) std::shared_ptr<Pythia8::UserHooks>(A)
#else
typedef Pythia8::UserHooks* UserHooksPtrType;
#endif
......@@ -30,7 +35,7 @@ namespace Pythia8_UserHooks{
public:
static UserHooksPtrType create(const string &hookName);
static UserHooks *create(const string &hookName);
private:
......
......@@ -62,7 +62,7 @@ m_sigmaTotal(0.),
m_conversion(1.),
m_failureCount(0),
m_procPtr(0),
m_userHooksPtrs(std::vector<UserHooksPtrType>()),
m_userHooksPtrs(),
m_doLHE3Weights(false),
m_athenaTool("IPythia8Custom")
{
......@@ -77,7 +77,7 @@ m_athenaTool("IPythia8Custom")
declareProperty("FxFxXS", m_doFxFxXS = false);
declareProperty("MaxFailures", m_maxFailures = 10);//the max number of consecutive failures
declareProperty("UserProcess", m_userProcess="");
declareProperty("UserHooks", m_userHooks);
declareProperty("UserHooks", m_userHooks={});
declareProperty("UserResonances", m_userResonances="");
declareProperty("UseLHAPDF", m_useLHAPDF=true);
declareProperty("ParticleData", m_particleDataFile="");
......@@ -106,18 +106,12 @@ Pythia8_i::~Pythia8_i() {
delete m_atlasRndmEngine;
if(m_procPtr != 0) delete m_procPtr;
#ifdef PYTHIA_VERSION_INTEGER
#if PYTHIA_VERSION_INTEGER < 8300
#ifndef PYTHIA8_3SERIES
for(UserHooksPtrType ptr: m_userHooksPtrs){
delete ptr;
}
#endif
#else
for(UserHooksPtrType ptr: m_userHooksPtrs){
delete ptr;
}
#endif
}
////////////////////////////////////////////////////////////////////////////////
......@@ -149,7 +143,8 @@ StatusCode Pythia8_i::genInitialize() {
bool firstHook=true;
for(const auto &hook: m_userHooks){
m_userHooksPtrs.push_back(Pythia8_UserHooks::UserHooksFactory::create(hook));
ATH_MSG_INFO("Adding user hook " + hook + ".");
m_userHooksPtrs.push_back(PYTHIA8_PTRWRAP(Pythia8_UserHooks::UserHooksFactory::create(hook)) );
bool canSetHook = true;
if(firstHook){
canSetHook = m_pythia.setUserHooksPtr(m_userHooksPtrs.back());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment