diff --git a/gen/herwig/SoftModel.in b/gen/herwig/DefaultTune.in similarity index 100% rename from gen/herwig/SoftModel.in rename to gen/herwig/DefaultTune.in diff --git a/gen/herwig/MB.in b/gen/herwig/MB.in deleted file mode 100644 index b4fcfa5..0000000 --- a/gen/herwig/MB.in +++ /dev/null @@ -1,43 +0,0 @@ -################################################## -# MEMinBias Matrix Element -################################################## - -# MPI model settings - -## Report the correct cross section -# (as advised e.g. in https://herwig.hepforge.org/trac/browser/Tests/Rivet/SppS-900-UE.in) -cd /Herwig/Generators -create Herwig::MPIXSecReweighter MPIXSecReweighter -insert EventGenerator:EventHandler:PostSubProcessHandlers 0 MPIXSecReweighter -set EventGenerator:EventHandler:CascadeHandler NULL - -clear EventGenerator:EventHandler:SubProcessHandlers[0] - -################################################## -# Create separate SubProcessHandler for MinBias -################################################## -cd /Herwig/MatrixElements/ -cp SubProcess QCDMinBias - -set QCDMinBias:CascadeHandler /Herwig/Shower/ShowerHandler -set QCDMinBias:CascadeHandler:MPIHandler /Herwig/UnderlyingEvent/MPIHandler -set QCDMinBias:DecayHandler /Herwig/Decays/DecayHandler - -# Due to numerics the pomeron could be seen as timelike. -set /Herwig/Shower/ShowerHandler:SplitHardProcess No -set /Herwig/DipoleShower/DipoleShowerHandler:SplitHardProcess No - -insert QCDMinBias:MatrixElements[0] MEMinBias - -cd /Herwig/Generators -# MinBias parameters used for the new kinematics of soft MPI -set /Herwig/Cuts/MinBiasCuts:X1Min 0.01 -set /Herwig/Cuts/MinBiasCuts:X2Min 0.01 - -# Needed to get the correct fraction of diffractive events -set /Herwig/MatrixElements/MEMinBias:csNorm 4.5584 - -set EventGenerator:EventHandler:Cuts /Herwig/Cuts/MinBiasCuts - -cd /Herwig/MatrixElements/ -insert /Herwig/Generators/EventGenerator:EventHandler:SubProcessHandlers[0] QCDMinBias diff --git a/gen/herwig/PPCollider.in b/gen/herwig/PPCollider.in deleted file mode 100644 index baa7412..0000000 --- a/gen/herwig/PPCollider.in +++ /dev/null @@ -1,35 +0,0 @@ -# -*- ThePEG-repository -*- -cd /Herwig/EventHandlers -create ThePEG::FixedCMSLuminosity Luminosity FixedCMSLuminosity.so -set Luminosity:Energy 7000.0 -set EventHandler:LuminosityFunction Luminosity -set EventHandler:BeamA /Herwig/Particles/p+ -set EventHandler:BeamB /Herwig/Particles/p+ - -cd /Herwig/Cuts -# create the cuts object for hadron collisions -set Cuts:ScaleMin 2.0*GeV2 -set Cuts:X1Min 1.0e-5 -set Cuts:X2Min 1.0e-5 - -# Matchbox settings -cd /Herwig/MatrixElements/Matchbox -set Factory:FirstPerturbativePDF Yes -set Factory:SecondPerturbativePDF Yes -set Factory:PartonExtractor /Herwig/Partons/PPExtractor - -cd /Herwig/Merging -set MergingFactory:FirstPerturbativePDF Yes -set MergingFactory:SecondPerturbativePDF Yes -set MergingFactory:PartonExtractor /Herwig/Partons/PPExtractor - -cd /Herwig/Generators/ -set /Herwig/MatrixElements/SubProcess:PartonExtractor /Herwig/Partons/PPExtractor - - -# Read in parameters to use the soft model -read SoftModel.in - -# Make particles with c*tau > 10 mm stable: -set /Herwig/Decays/DecayHandler:MaxLifeTime 10*mm -set /Herwig/Decays/DecayHandler:LifeTimeOption Average diff --git a/gen/herwig/gen.sh b/gen/herwig/gen.sh index 5fb24a9..fed7973 100644 --- a/gen/herwig/gen.sh +++ b/gen/herwig/gen.sh @@ -11,10 +11,11 @@ gen_herwig(){ if [ "x${KTMIN}" != "x" ]; then cmd=$(printf "%s --ktmin %s" "$cmd" ${KTMIN}); fi if [ "x${KTMAX}" != "x" ]; then cmd=$(printf "%s --ktmax %s" "$cmd" ${KTMAX}); fi eval $cmd - cp_input PPCollider.in . - cp_input SoftModel.in . - cp_input SoftTune.in . - if [ "x${TUNE}" == "xmb" ]; then cp_input MB.in .; fi + if [ "x${TUNE}" != "xmb" ]; then + cp_input DefaultTune.in . + cp_input SoftTune.in . + fi + run_in_env 'Herwig --repo=${HERWIG_ROOT}/share/Herwig/HerwigDefaults.rpo read herwig.in' > setup.log run_in_env 'Herwig --repo=${HERWIG_ROOT}/share/Herwig/HerwigDefaults.rpo run herwig.run -N ${NEV} --seed ${SEED}' > hwgen.log diff --git a/gen/herwig/generate_hwgin.py b/gen/herwig/generate_hwgin.py index 7a74855..599da82 100644 --- a/gen/herwig/generate_hwgin.py +++ b/gen/herwig/generate_hwgin.py @@ -7,53 +7,53 @@ def GenerateHerwigInput(outputfile, tune, cmsenegy, events, hepmcfile, ktmin, kt # See (jet): http://mcplots.cern.ch/dat/pp/jets/pt/cms2011-y0.5/7000/herwig++/2.7.1/default.params # See also for minimum-bias: Chapter B.2 https://arxiv.org/abs/0803.0883 with open(outputfile, "w") as myfile: - myfile.write("read PPCollider.in\n") + myfile.write("read snippets/PPCollider.in\n") # Markus: Take PPCollider.in fron Herwig repositiory instead of custom version myfile.write("set /Herwig/Generators/EventGenerator:EventHandler:LuminosityFunction:Energy {}.0\n".format(cmsenegy)) - if tune == "beauty": - myfile.write("set /Herwig/MatrixElements/MEHeavyQuark:QuarkType 5\n") - myfile.write("insert /Herwig/MatrixElements/SubProcess:MatrixElements[0] /Herwig/MatrixElements/MEHeavyQuark\n") - myfile.write("set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV\n") - myfile.write("set /Herwig/Cuts/JetKtCut:MaxKT {}.0*GeV\n".format(cmsenegy)) - myfile.write("set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE -1\n") - elif tune == "charm": - myfile.write("set /Herwig/MatrixElements/MEHeavyQuark:QuarkType 4\n") - myfile.write("insert /Herwig/MatrixElements/SubProcess:MatrixElements[0] /Herwig/MatrixElements/MEHeavyQuark\n") - myfile.write("set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV\n") - myfile.write("set /Herwig/Cuts/JetKtCut:MaxKT {}.0*GeV\n".format(cmsenegy)) - myfile.write("set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE -1\n") - elif tune == "dijet": - myfile.write("insert /Herwig/MatrixElements/SubProcess:MatrixElements[0] /Herwig/MatrixElements/MEQCD2to2\n") - myfile.write("set /Herwig/Cuts/JetKtCut:MinKT 5.0*GeV\n") - myfile.write("set /Herwig/Cuts/JetKtCut:MaxKT {}.0*GeV\n".format(cmsenegy)) - myfile.write("set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE -1\n") - elif tune == "mb": - myfile.write("read MB.in\n") - myfile.write("set /Herwig/Cuts/JetKtCut:MinKT 0.0*GeV\n") - myfile.write("set /Herwig/Cuts/JetKtCut:MaxKT {}.0*GeV\n".format(cmsenegy)) - myfile.write("set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE 0\n") - elif tune == "kthard": - myfile.write("insert /Herwig/MatrixElements/SubProcess:MatrixElements[0] /Herwig/MatrixElements/MEQCD2to2\n") - localktmin = ktmin - localktmax = ktmax - if localktmin < 0: - localktmin > 0 - if localktmax < 0 or localktmax > cmsenegy: - localktmax = cmsenegy - myfile.write("set /Herwig/Cuts/JetKtCut:MinKT %f*GeV\n" %(localktmin)) - myfile.write("set /Herwig/Cuts/JetKtCut:MaxKT %f*GeV\n" %(localktmax)) - myfile.write("set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE -1\n") + if tune == "mb": + # MB tune from Herwig repo + myfile.write("set /Herwig/Shower/ShowerHandler:IntrinsicPtGaussian 2.2*GeV\n") + myfile.write("read snippets/MB.in\n") + myfile.write("read snippets/Diffraction.in\n") else: - print("Process '{}' not implemented for HERWIG!".format(tune)) - exit(1) - myfile.write("set /Herwig/Cuts/Cuts:MHatMax {}.0*GeV\n".format(cmsenegy)) - myfile.write("set /Herwig/Cuts/Cuts:MHatMin 0.0*GeV\n") - myfile.write("read SoftTune.in\n") + # Use SoftTune as UE tune for Herwig7 (>= 7.1) based on https://herwig.hepforge.org/tutorials/mpi/tunes.html + myfile.write("read SoftTune.in\n") + # Set PDF (LO) + myfile.write("set /Herwig/Partons/HardLOPDF:PDFName CT14lo\n") + myfile.write("set /Herwig/Partons/ShowerLOPDF:PDFName CT14lo\n") + myfile.write("set /Herwig/Partons/MPIPDF:PDFName CT14lo\n") + myfile.write("set /Herwig/Partons/RemnantPDF:PDFName CT14lo\n") + kthardmin = 0. + kthardmax = 0. + if tune == "beauty" or tune == "charm": + quarktye = 4 if tune == "charm" else 5 + myfile.write("set /Herwig/MatrixElements/MEHeavyQuark:QuarkType {}\n".format(quarktye)) + myfile.write("insert /Herwig/MatrixElements/SubProcess:MatrixElements[0] /Herwig/MatrixElements/MEHeavyQuark\n") + kthardmin = 0. + kthardmax = float(cmsenegy) + elif tune == "dijet_lo": + myfile.write("insert /Herwig/MatrixElements/SubProcess:MatrixElements[0] /Herwig/MatrixElements/MEQCD2to2\n") + kthardmin = 5. + kthardmax = float(cmsenegy) + elif tune == "kthard": + myfile.write("insert /Herwig/MatrixElements/SubProcess:MatrixElements[0] /Herwig/MatrixElements/MEQCD2to2\n") + kthardmin = ktmin + kthardmax = ktmax + if kthardmin < 0: + kthardmin = 0 + if kthardmax < 0 or kthardmax > cmsenegy: + kthardmax = cmsenegy + else: + print("Process '{}' not implemented for HERWIG!".format(tune)) + exit(1) + myfile.write("set /Herwig/Cuts/JetKtCut:MinKT %f*GeV\n" %(kthardmin)) + myfile.write("set /Herwig/Cuts/JetKtCut:MaxKT %f*GeV\n" %(kthardmax)) + myfile.write("set /Herwig/Cuts/Cuts:MHatMax {}.0*GeV\n".format(cmsenegy)) + myfile.write("set /Herwig/Cuts/Cuts:MHatMin 0.0*GeV\n") + myfile.write("set /Herwig/UnderlyingEvent/MPIHandler:IdenticalToUE -1\n") - # PDF selection - myfile.write("create ThePEG::LHAPDF /Herwig/Partons/PDFSet ThePEGLHAPDF.so\n") - myfile.write("set /Herwig/Partons/PDFSet:PDFName CT10nlo\n") - myfile.write("set /Herwig/Partons/PDFSet:RemnantHandler /Herwig/Partons/HadronRemnants\n") - myfile.write("set /Herwig/Particles/p+:PDF /Herwig/Partons/PDFSet\n") + # Stable particles with a lifetime > 10 mm (decay externally) + myfile.write("set /Herwig/Decays/DecayHandler:MaxLifeTime 10*mm\n") + myfile.write("set /Herwig/Decays/DecayHandler:LifeTimeOption Average\n") #HEP MC writer myfile.write("read snippets/HepMC.in\n")