Skip to content

Commit

Permalink
Merge pull request #12462 from thuer/Sherpa_22_fixes
Browse files Browse the repository at this point in the history
Changed the Hadronizer and scripts to work with Sherpa 2.2.0
  • Loading branch information
cmsbuild committed Nov 25, 2015
2 parents 7892dbd + 97a575d commit 629a116
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
filterEfficiency = cms.untracked.double(1.0),
crossSection = cms.untracked.double(-1),
SherpaProcess = cms.string('ZtoEE_0j_BlackHat_13TeV'),
SherpackLocation = cms.string('slc6_amd64_gcc491/sherpa/2.1.1/13TeV'),
SherpackChecksum = cms.string('52628d97d3299f46515fe8c4a3006f34'),
SherpackLocation = cms.string('/cvmfs/cms.cern.ch/phys_generator/gridpacks/slc6_amd64_gcc493/13TeV/sherpa/2.2.0'),
SherpackChecksum = cms.string('214d968be9b50e862ecd8224dd53b7bd'),
FetchSherpack = cms.bool(True),
SherpaPath = cms.string('./'),
SherpaPathPiece = cms.string('./'),
Expand All @@ -20,8 +20,8 @@
"Run"),
MPI_Cross_Sections = cms.vstring(
" MPIs in Sherpa, Model = Amisic:",
" semihard xsec = 74.0613 mb,",
" non-diffractive xsec = 18.1593 mb with nd factor = 0.335."
" semihard xsec = 43.6681 mb,",
" non-diffractive xsec = 17.0318 mb with nd factor = 0.3142."
),
Run = cms.vstring(
"(run){",
Expand All @@ -39,7 +39,7 @@
"}(run)",
"(processes){",
" Process 93 93 -> 11 -11 93{NJET};",
" Order_EW 2; CKKW sqr(QCUT/E_CMS);",
" Order(*,2); CKKW sqr(QCUT/E_CMS);",
" NLO_QCD_Mode MC@NLO {LJET};",
" ME_Generator Amegic {LJET};",
" RS_ME_Generator Comix {LJET};",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
filterEfficiency = cms.untracked.double(1.0),
crossSection = cms.untracked.double(-1),
SherpaProcess = cms.string('ZtoEE_0j_OpenLoops_13TeV'),
SherpackLocation = cms.string('slc6_amd64_gcc491/sherpa/2.1.1/13TeV'),
SherpackChecksum = cms.string('100ee88a091480befb360aef2e7f637d'),
SherpackLocation = cms.string('/cvmfs/cms.cern.ch/phys_generator/gridpacks/slc6_amd64_gcc493/13TeV/sherpa/2.2.0'),
SherpackChecksum = cms.string('777066bf69695c51557027c85bf80025'),
FetchSherpack = cms.bool(True),
SherpaPath = cms.string('./'),
SherpaPathPiece = cms.string('./'),
Expand All @@ -20,8 +20,8 @@
"Run"),
MPI_Cross_Sections = cms.vstring(
" MPIs in Sherpa, Model = Amisic:",
" semihard xsec = 74.0613 mb,",
" non-diffractive xsec = 18.1593 mb with nd factor = 0.335."
" semihard xsec = 43.6681 mb,",
" non-diffractive xsec = 17.0318 mb with nd factor = 0.3142."
),
Run = cms.vstring(
"(run){",
Expand All @@ -40,7 +40,7 @@
"}(run)",
"(processes){",
" Process 93 93 -> 11 -11 93{NJET};",
" Order_EW 2; CKKW sqr(QCUT/E_CMS);",
" Order(*,2); CKKW sqr(QCUT/E_CMS);",
" NLO_QCD_Mode MC@NLO {LJET};",
" ME_Generator Amegic {LJET};",
" RS_ME_Generator Comix {LJET};",
Expand All @@ -58,9 +58,13 @@
"(selector){",
" Mass 11 -11 66 E_CMS",
" Mass 13 -13 66 E_CMS",
"}(selector)"
"}(selector)",
"(mi){",
" MI_HANDLER = Amisic # None or Amisic",
"}(mi)"
),
)
)

ProductionFilterSequence = cms.Sequence(generator)

1 change: 0 additions & 1 deletion GeneratorInterface/SherpaInterface/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<use name="GeneratorInterface/Pythia6Interface"/>
<use name="clhep"/>
<use name="sherpa"/>
<use name="frontier_client"/>
<use name="FWCore/Services"/>
<use name="zlib"/>
<flags EDM_PLUGIN="1"/>
30 changes: 16 additions & 14 deletions GeneratorInterface/SherpaInterface/data/MakeSherpaLibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# library production and cross section calculation
# uses: the required SHERPA data cards (+ libraries) [see below]
#
# author: Markus Merschmeyer, Sebastian Thueer, RWTH Aachen
# date: 5th July 2013
# version: 4.3
# author: Markus Merschmeyer, Philipp Millet, Sebastian Thueer, RWTH Aachen
# date: 5th Nov 2015
# version: 4.4
#

set +o posix
Expand All @@ -19,7 +19,7 @@ set +o posix

print_help() {
echo "" && \
echo "MakeSherpaLibs version 4.3" && echo && \
echo "MakeSherpaLibs version 4.4" && echo && \
echo "options: -d path (optional) path to your SHERPA installation (otherwise the SHERPA" && \
echo " package belonging to the release under '\$CMSSW_BASE' is used)" && \
echo " -> ( "${shr}" )" && \
Expand Down Expand Up @@ -69,23 +69,25 @@ check_occurence() {

clean_libs() {
DIRS=`find Process -name P?_?`" "`find Process -name P?_??`
BASEDIR=`pwd`
for J in $DIRS ; do
echo "."
echo "======================"
echo "$J";
echo "======================"
cd $J
make clean
# make clean
rm config* Makefile*
# rm *.tex
rm aclocal.m4 ChangeLog depcomp install-sh libtool ltmain.sh missing
# rm aclocal.m4 ChangeLog depcomp install-sh libtool ltmain.sh missing
rm aclocal.m4 ChangeLog depcomp install-sh ltmain.sh missing
rm AUTHORS COPYING INSTALL NEWS README
rm -rf autom4te.cache
find ./ -type f -name 'Makefile*' -exec rm -rf {} \;
find ./ -type d -name '.deps' -exec rm -rf {} \;
find ./ -type f -name '*.C' -exec rm -rf {} \;
find ./ -type f -name '*.H' -exec rm -rf {} \;
cd ../..
cd $BASEDIR
done
}

Expand Down Expand Up @@ -489,7 +491,7 @@ if [ "${lbo}" == "LIBS" ] || [ "${lbo}" == "LBCR" ]; then

echo " <I> creating library code..."
echo " ...Logs stored in ${shrun}/${outflbs}_pass${lbo}.out and ${shrun}/${outflbs}_pass${lbo}.err."
exec_log2 -a ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${sherpaexe} ${multithread_opt} -p ${pth} -r ${dir2} ${SHERPAOPTS}
exec_log2 -a ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${sherpaexe} -p ${pth} -r ${dir2} ${SHERPAOPTS}

if [ "${FLGAMEGIC}" == "TRUE" ]; then

Expand All @@ -501,7 +503,7 @@ if [ "${lbo}" == "LIBS" ] || [ "${lbo}" == "LBCR" ]; then
# compile created library code
echo " <I> compiling libraries..."
echo " ...Logs stored in ${shrun}/${outflbs}_mklib.out and ${shrun}/${outflbs}_mklib.err."
exec_log2 -a ${shrun}/${outflbs}_mklib.out ${shrun}/${outflbs}_mklib.err ./makelibs ${POPTS}
exec_log2 -a ${shrun}/${outflbs}_mklib.out ${shrun}/${outflbs}_mklib.err ./makelibs ${POPTS} -i $SHERPA_INCLUDE_PATH
# get gross size of created libraries
nf=`du -sh | grep -o "\." | grep -c "\."`
lsize=`du -sh | cut -f 1-${nf} -d "."`
Expand All @@ -517,7 +519,7 @@ if [ "${lbo}" == "LIBS" ] || [ "${lbo}" == "LBCR" ]; then
# reinvoke Sherpa
echo " <I> re-invoking Sherpa for futher library/cross section calculation..."
echo " ...Logs stored in ${shrun}/${outflbs}_pass${lbo}.out and ${shrun}/${outflbs}_pass${lbo}.err."
exec_log2 -a ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${sherpaexe} ${multithread_opt} -p ${pth} -r ${dir2} ${SHERPAOPTS}
exec_log2 -a ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${sherpaexe} -p ${pth} -r ${dir2} ${SHERPAOPTS}

# newly created process code by AMEGIC?
cd ${dir1}
Expand Down Expand Up @@ -556,10 +558,10 @@ if [ "${lbo}" == "LBCR" ] || [ "${lbo}" == "CRSS" ]; then
SHERPAOPTS="-e 101"
echo " <I> calculating cross sections... Logs stored in ${shrun}/${outflbs}_pass${lbo}.out and ${shrun}/${outflbs}_pass${lbo}.err."
if [ "$ML_MPICMD" == "" ]; then
exec_log2 ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${sherpaexe} ${multithread_opt} -p ${pth} -r ${dir2} ${SHERPAOPTS}
exec_log2 ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${sherpaexe} -p ${pth} -r ${dir2} ${SHERPAOPTS}
else
echo " <I> ...using MPI"
exec_log2 ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${ML_MPICMD} ${ML_MPIOPT} ${sherpaexe} ${multithread_opt} -p ${pth} -r ${dir2} ${SHERPAOPTS}
exec_log2 ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${ML_MPICMD} ${ML_MPIOPT} ${sherpaexe} -p ${pth} -r ${dir2} ${SHERPAOPTS}
fi
fi

Expand All @@ -574,10 +576,10 @@ if [ "${lbo}" == "EVTS" ]; then
fi
echo " <I> generating events (${NEVTS})... Logs stored in ${shrun}/${outflbs}_pass${lbo}.out and ${shrun}/${outflbs}_pass${lbo}.err."
if [ "$ML_MPICMD" == "" ]; then
exec_log2 ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${sherpaexe} ${multithread_opt} -p ${pth} -r ${dir2} ${SHEVTOPT}
exec_log2 ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${sherpaexe} -p ${pth} -r ${dir2} ${SHEVTOPT}
else
echo " <I> ...using MPI"
exec_log2 ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${ML_MPICMD} ${ML_MPIOPT} ${sherpaexe} ${multithread_opt} -p ${pth} -r ${dir2} ${SHEVTOPT}
exec_log2 ${shrun}/${outflbs}_pass${lbo}.out ${shrun}/${outflbs}_pass${lbo}.err ${ML_MPICMD} ${ML_MPIOPT} ${sherpaexe} -p ${pth} -r ${dir2} ${SHEVTOPT}
fi
fi

Expand Down
3 changes: 2 additions & 1 deletion GeneratorInterface/SherpaInterface/data/PrepareSherpaLibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ function build_python_cff() {
mv ${file}.tmp2 ${file}.tmp1
sed '/^$/d' < ${file}.tmp1 > ${file}.tmp2 # remove empty lines
mv ${file}.tmp2 ${file}.tmp1
sed -e 's/^/ /g;s/ (/(/;s/ }/}/' < ${file}.tmp1 > ${file}.tmp2 # add single space in front of parameters
#sed -e 's/^/ /g;s/ (/(/;s/ }/}/' < ${file}.tmp1 > ${file}.tmp2 # add single space in front of parameters
sed -e 's/^/ /g;s/ }/}/' < ${file}.tmp1 > ${file}.tmp2 # add single space in front of parameters
mv ${file}.tmp2 ${file}.tmp1
###
sed -e 's/\"/\\"/g' < ${file}.tmp1 > ${file}.tmp2 # protect existing '"' by '\"'
Expand Down
10 changes: 1 addition & 9 deletions GeneratorInterface/SherpaInterface/interface/SherpackFetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@
#include <string>
#include <memory>
#include <stdint.h>
#include <fcntl.h>
#include <fstream>
#include "frontier_client/frontier-cpp.h"

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

#include "FWCore/Catalog/interface/SiteLocalConfig.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Services/src/SiteLocalConfigService.h"
#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "GeneratorInterface/SherpaInterface/interface/SherpackUtilities.h"

namespace spf {
Expand All @@ -30,7 +22,7 @@ class SherpackFetcher {
SherpackFetcher(edm::ParameterSet const&);
int Fetch();
~SherpackFetcher();
int FnFileGet(std::string);
int CopyFile(std::string pathstring);
const char *classname() const { return "SherpackFetcher"; }

private:
Expand Down
3 changes: 0 additions & 3 deletions GeneratorInterface/SherpaInterface/src/SherpaHadronizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,13 @@ SherpaHadronizer::SherpaHadronizer(const edm::ParameterSet &params) :
std::string shRes = "RESULT_DIRECTORY=" + SherpaResultDir; // from Sherpa 1.2.0 on
//Name of the external random number class
std::string shRng = "EXTERNAL_RNG=CMS_SHERPA_RNG";
//switch off multithreading
std::string shNoMT = "-j1";

//create the command line
arguments.push_back(shRun.c_str());
arguments.push_back(shPath.c_str());
arguments.push_back(shPathPiece.c_str());
arguments.push_back(shRes.c_str());
arguments.push_back(shRng.c_str());
arguments.push_back(shNoMT.c_str());
isInitialized=false;
//initialization of Sherpa moved to initializeForInternalPartons
}
Expand Down
Loading

0 comments on commit 629a116

Please sign in to comment.