6from .
import Herwig7Utils
as hw7Utils
9from MCJobOptionUtils.JOsupport
import check_reset_proc_number
12from AthenaCommon
import Logging
13athMsgLog = Logging.logging.getLogger(
'Herwig7Config')
19 def __init__(self, genSeq, runArgs, run_name="Herwig"):
22 check_reset_proc_number(runArgs)
39 self.
commands = hw7Utils.ConfigurationCommands()
45## =========================================
46## Global Pre-Commands from Herwig7Config.py
47## =========================================
49## ensure JetFinder uses AntiKt with R=0.4
50set /Herwig/Cuts/JetFinder:Variant AntiKt
51set /Herwig/Cuts/JetFinder:ConeRadius 0.4
65## Random number generator seed
66set /Herwig/Random:Seed {}
67""".format(self.
runArgs.randomSeed))
74## Commands for lepton-lepton collisions
75read snippets/EECollider.in
76set /Herwig/Shower/PartnerFinder:QEDPartner IIandFF
77set /Herwig/Shower/ShowerHandler:MPIHandler NULL
78set /Herwig/DipoleShower/DipoleShowerHandler:MPIHandler NULL
79set /Herwig/Shower/PowhegShowerHandler:MPIHandler NULL
81 elif self.
beams ==
"EP":
83## Commands for proton-lepton collisions
84read snippets/EPCollider.in
85do /Herwig/Shower/SplittingGenerator:DeleteFinalSplitting e-->e-,gamma; /Herwig/Shower/LtoLGammaSudakov
86do /Herwig/Shower/SplittingGenerator:DeleteFinalSplitting mu-->mu-,gamma; /Herwig/Shower/LtoLGammaSudakov
87do /Herwig/Shower/SplittingGenerator:DeleteFinalSplitting tau-->tau-,gamma; /Herwig/Shower/LtoLGammaSudakov
88set /Herwig/Shower/KinematicsReconstructor:ReconstructionOption Colour
92## Commands for proton-proton collisions
93read snippets/PPCollider.in
110## Center-of-mass energy
111set /Herwig/Generators/EventGenerator:EventHandler:LuminosityFunction:Energy {}
112""".format(self.
runArgs.ecmEnergy))
122## Verbosity and printout settings
123set /Herwig/Generators/EventGenerator:DebugLevel 1
124set /Herwig/Generators/EventGenerator:PrintEvent 2
125set /Herwig/Generators/EventGenerator:UseStdout Yes
126set /Herwig/Generators/EventGenerator:NumberOfEvents 1000000000
127set /Herwig/Generators/EventGenerator:MaxErrors 500
129## Make sampler print out cross sections for each subprocess
130set /Herwig/Samplers/Sampler:Verbose Yes
142## Masses and widths: PDG 2010 values (except TOP mass; kept at PDG2007)
145set /Herwig/Particles/t:NominalMass 172.5*GeV
146set /Herwig/Particles/tbar:NominalMass 172.5*GeV
148set /Herwig/Particles/W+:NominalMass 80.399*GeV
149set /Herwig/Particles/W-:NominalMass 80.399*GeV
150set /Herwig/Particles/W+:Width 2.085*GeV
151set /Herwig/Particles/W-:Width 2.085*GeV
153set /Herwig/Particles/Z0:NominalMass 91.1876*GeV
154set /Herwig/Particles/Z0:Width 2.4952*GeV
156set /Herwig/Particles/b:NominalMass 4.95*GeV
157set /Herwig/Particles/bbar:NominalMass 4.95*GeV
160set /Herwig/Model:EW/Sin2ThetaW 0.23113
168## Disable default attempts to use Pomeron PDF data files, until we're worked how to do that on the Grid!
169set /Herwig/Particles/pomeron:PDF /Herwig/Partons/NoPDF
171## Set long-lived particles stable
172set /Herwig/Decays/DecayHandler:MaxLifeTime 10*mm
188 if order
not in [
"LO",
"NLO"]:
189 raise RuntimeError(hw7Utils.ansi_format_error(
"Parameter 'order' must either be 'LO' or 'NLO'!"))
192## Configure {0} AlphaS for the hard process
193## (LO: 1-loop-running / NLO: 2-loop running)
194set /Herwig/Couplings/{0}AlphaS:input_scale {1}
195set /Herwig/Couplings/{0}AlphaS:input_alpha_s {2}
196set /Herwig/Model:QCD/RunningAlphaS /Herwig/Couplings/{0}AlphaS
197""".format(order, scale, value)
208 if order
not in [
"LO",
"NLO"]:
209 raise RuntimeError(hw7Utils.ansi_format_error(
"Parameter 'order' must either be 'LO' or 'NLO'!"))
214## Configure {0} PDF set for the hard process
215set /Herwig/Partons/Hard{0}PDF:PDFName {1}
216set /Herwig/Partons/Hard{0}PDF:Member {2}
217set /Herwig/Partons/Hard{0}PDF:MaxFlav {3}
218set /Herwig/Partons/Hard{0}PDF:RemnantHandler /Herwig/Partons/HadronRemnants
219set /Herwig/Particles/p+:PDF /Herwig/Partons/Hard{0}PDF
220set /Herwig/Particles/pbar-:PDF /Herwig/Partons/Hard{0}PDF
221set /Herwig/Partons/PPExtractor:FirstPDF /Herwig/Partons/Hard{0}PDF
222set /Herwig/Partons/PPExtractor:SecondPDF /Herwig/Partons/Hard{0}PDF
223""".format(order, name, member, max_flav)
234 if order
not in [
"LO",
"NLO"]:
235 raise RuntimeError(hw7Utils.ansi_format_error(
"Parameter 'order' must either be 'LO' or 'NLO'!"))
241## Configure {0} PDF set for the parton shower
242set /Herwig/Partons/Shower{0}PDF:PDFName {1}
243set /Herwig/Partons/Shower{0}PDF:Member {2}
244set /Herwig/Partons/Shower{0}PDF:MaxFlav {3}
245set /Herwig/Shower/ShowerHandler:PDFA /Herwig/Partons/Shower{0}PDF
246set /Herwig/Shower/ShowerHandler:PDFB /Herwig/Partons/Shower{0}PDF
247set /Herwig/Shower/PowhegShowerHandler:PDFA /Herwig/Partons/Shower{0}PDF
248set /Herwig/Shower/PowhegShowerHandler:PDFB /Herwig/Partons/Shower{0}PDF
249set /Herwig/DipoleShower/DipoleShowerHandler:PDFA /Herwig/Partons/Shower{0}PDF
250set /Herwig/DipoleShower/DipoleShowerHandler:PDFB /Herwig/Partons/Shower{0}PDF
251""".format(order, name, member, max_flav)
265set /Herwig/Partons/MPIPDF:PDFName {}
266set /Herwig/Partons/MPIPDF:Member {}
267set /Herwig/Partons/MPIPDF:MaxFlav {}
268""".format(name, member, max_flav)
279## Configure Remnant PDF
280set /Herwig/Partons/RemnantPDF:PDFName {}
281set /Herwig/Partons/RemnantPDF:Member {}
282set /Herwig/Partons/RemnantPDF:MaxFlav {}
283""".format(name, member, max_flav)
306## Parton shower / hadronization tune settings
325## Underlying event tune settings
340 cmt_path = os.environ.get(
"CMAKE_PREFIX_PATH")
341 cmt_dir = os.environ.get(
"BINARY_TAG")
343 cmtPaths = cmt_path.split(
':')
345 for path
in cmtPaths:
346 pathNow = path +
"/InstallArea/" + cmt_dir +
"/share/"
348 fileList = os.listdir(pathNow)
351 if "HerwigDefaults.rpo" in fileList:
352 simSharePath = pathNow
354 dpdf_path = os.path.dirname(os.path.normpath(os.path.join(simSharePath, os.readlink(simSharePath +
'HerwigDefaults.rpo')))) +
"/PDF/diffraction/"
365 cmds +=
"set /Herwig/Partons/PomeronPDF:RootName %s\n" % dpdf_path
366 cmds +=
"set /Herwig/Partons/PomeronFlux:PDFFit %s\n" % flux
367 cmds +=
"set /Herwig/Partons/PomeronPDF:PDFFit %s\n" % pdf
370set /Herwig/Particles/pomeron:PDF /Herwig/Partons/PomeronPDF
372# Technical parameters for this run
373set /Herwig/Generators/EventGenerator:EventHandler:Sampler:Ntry 100000
374set /Herwig/Generators/EventGenerator:MaxErrors 500
377# TODO: Is this a problem?
378set /Herwig/Generators/EventGenerator:EventHandler:CascadeHandler:MPIHandler NULL
380# Choice of phase-space generation for PDFs
381set /Herwig/Partons/PPExtractor:FlatSHatY 0
393# Technical parameters for this run
394set /Herwig/Generators/EventGenerator:EventHandler:Sampler:Ntry 100000
396# Choice of phase-space generation for PDFs
397set /Herwig/Partons/PPExtractor:FlatSHatY 0
399# Change the proton PDFs to those for photon radiation
400set /Herwig/Particles/p+:PDF /Herwig/Partons/BudnevPDF
401set /Herwig/Particles/pbar-:PDF /Herwig/Partons/BudnevPDF
404# TODO: Is this a problem?
405set /Herwig/Generators/EventGenerator:EventHandler:CascadeHandler:MPIHandler NULL
411 tune_schemes = [
"DotProduct-Veto",
"DotProduct",
"pT",
"Q2"]
412 if tune_scheme
not in tune_schemes:
413 athMsgLog.warn(
"Please choose one of the supported tune-schemes! (DotProduct-Veto,DotProduct,pT,Q2)")
415 athMsgLog.info(
"{tune_scheme:s} was used for the tune scheme.".format(tune_scheme=tune_scheme))
422# Tune-{tune_scheme:s}
423read snippets/EvolutionScheme-{tune_scheme:s}.in
424read snippets/Tune-{tune_scheme:s}.in
425""".format(tune_scheme=tune_scheme)
431\n## -----------------------
432## Shower scale variation
433## -----------------------
435do ShowerHandler:AddVariation MUR2_MUF2_SHOWER_HARD 2 2 Hard
436do ShowerHandler:AddVariation MUR2_MUF1_SHOWER_HARD 2 1 Hard
437do ShowerHandler:AddVariation MUR1_MUF2_SHOWER_HARD 1 2 Hard
438do ShowerHandler:AddVariation MUR1_MUF0.5_SHOWER_HARD 1 0.5 Hard
439do ShowerHandler:AddVariation MUR0.5_MUF1_SHOWER_HARD 0.5 1 Hard
440do ShowerHandler:AddVariation MUR0.5_MUF0.5_SHOWER_HARD 0.5 0.5 Hard
441do ShowerHandler:AddVariation MUR2_MUF2_SHOWER_SEC 2 2 Secondary
442do ShowerHandler:AddVariation MUR2_MUF1_SHOWER_SEC 2 1 Secondary
443do ShowerHandler:AddVariation MUR1_MUF2_SHOWER_SEC 1 2 Secondary
444do ShowerHandler:AddVariation MUR1_MUF0.5_SHOWER_SEC 1 0.5 Secondary
445do ShowerHandler:AddVariation MUR0.5_MUF1_SHOWER_SEC 0.5 1 Secondary
446do ShowerHandler:AddVariation MUR0.5_MUF0.5_SHOWER_SEC 0.5 0.5 Secondary
447set SplittingGenerator:Detuning 2.0
Configuration base class for Herwig7.
technical_parameter_commands(self)
remnant_pdf_commands(self, name="MMHT2014lo68cl", member=0, max_flav=5)
Commands for setting the remnant PDF.
pdf_pomeron_cmds(self, flux, pdf)
Set pomeron structure function.
bool physics_parameter_commands
global_pre_commands(self)
Commands applied to all configuration classes before commands from the JobOptions.
add_commands(self, commands)
Add direct Herwig7 repository commands as they wo.
bool set_technical_parameter_commands
set_tune_scheme(self, tune_scheme="DotProduct")
printout_commands(self)
Sets printout verbosity and error tolerance.
shower_pdf_commands(self, order="LO", name="MMHT2014lo68cl", member=0, max_flav=5)
Commands for setting the PDF in the parton showers.
bool set_printout_commands
__init__(self, genSeq, runArgs, run_name="Herwig")
Constructor.
ue_tune_commands(self)
Commands for only setting the UE/MPI tune.
mpi_pdf_commands(self, name="MMHT2014lo68cl", member=0, max_flav=5)
Commands for setting the PDF in the underlying event (UE).
me_alphas_commands(self, order="NLO", scale=91.1876, value=0.118)
Commands for setting the strong coupling in the hard process.
enable_angularShowerScaleVariations(self, do_variations=False)
tune_commands(self)
Commands for setting PS/hadronization and UE/MPI tune simultaneously.
me_pdf_commands(self, order="NLO", name="MMHT2014nlo68cl", member=0, max_flav=5)
Commands for setting the PDF in the hard process.
bool set_physics_parameter_commands
beam_commands(self)
Commands specific to certain beam / collision types.
random_seed_commands(self)
Sets the seed for the random number generator.
energy_commands(self)
Sets center-of-mass energy sqrts(s) in GeV.
pdf_gammagamma_cmds(self)
Initialize Budnev Photon flux for two-photon exclusive exchange.
ps_tune_commands(self)
Commands for only setting the PS/hadronization tune.