|
ATLAS Offline Software
|
Go to the documentation of this file.
6 from .
import Herwig7Utils
as hw7Utils
9 from MCJobOptionUtils.JOsupport
import check_reset_proc_number
12 from AthenaCommon
import Logging
13 athMsgLog = Logging.logging.getLogger(
'Herwig7Config')
19 def __init__(self, genSeq, runArgs, run_name="Herwig"):
40 self.
commands = hw7Utils.ConfigurationCommands()
46 ## =========================================
47 ## Global Pre-Commands from Herwig7Config.py
48 ## =========================================
50 ## ensure JetFinder uses AntiKt with R=0.4
51 set /Herwig/Cuts/JetFinder:Variant AntiKt
52 set /Herwig/Cuts/JetFinder:ConeRadius 0.4
66 ## Random number generator seed
67 set /Herwig/Random:Seed {}
75 ## Commands for lepton-lepton collisions
76 read snippets/EECollider.in
77 set /Herwig/Shower/PartnerFinder:QEDPartner IIandFF
78 set /Herwig/Shower/ShowerHandler:MPIHandler NULL
79 set /Herwig/DipoleShower/DipoleShowerHandler:MPIHandler NULL
80 set /Herwig/Shower/PowhegShowerHandler:MPIHandler NULL
82 elif self.
beams ==
"EP":
84 ## Commands for proton-lepton collisions
85 read snippets/EPCollider.in
86 do /Herwig/Shower/SplittingGenerator:DeleteFinalSplitting e-->e-,gamma; /Herwig/Shower/LtoLGammaSudakov
87 do /Herwig/Shower/SplittingGenerator:DeleteFinalSplitting mu-->mu-,gamma; /Herwig/Shower/LtoLGammaSudakov
88 do /Herwig/Shower/SplittingGenerator:DeleteFinalSplitting tau-->tau-,gamma; /Herwig/Shower/LtoLGammaSudakov
89 set /Herwig/Shower/KinematicsReconstructor:ReconstructionOption Colour
93 ## Commands for proton-proton collisions
94 read snippets/PPCollider.in
111 ## Center-of-mass energy
112 set /Herwig/Generators/EventGenerator:EventHandler:LuminosityFunction:Energy {}
123 ## Verbosity and printout settings
124 set /Herwig/Generators/EventGenerator:DebugLevel 1
125 set /Herwig/Generators/EventGenerator:PrintEvent 2
126 set /Herwig/Generators/EventGenerator:UseStdout Yes
127 set /Herwig/Generators/EventGenerator:NumberOfEvents 1000000000
128 set /Herwig/Generators/EventGenerator:MaxErrors 500
130 ## Make sampler print out cross sections for each subprocess
131 set /Herwig/Samplers/Sampler:Verbose Yes
144 paramlist.append(
"## Masses and widths: PDG 2019 values")
147 from EvgenProdTools.offline_dict
import parameters
148 for k,v
in parameters.items():
150 for key,value
in v.items():
152 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
"+:NominalMass "+value[
'mass'])
153 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
"+:Width "+value[
'width'])
154 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
"-:NominalMass "+value[
'mass'])
155 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
"-:Width "+value[
'width'])
157 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
"0:NominalMass "+value[
'mass'])
158 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
"0:Width "+value[
'width'])
160 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
"bar:NominalMass "+value[
'mass'])
161 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
"bar:Width "+value[
'width'])
162 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
":NominalMass "+value[
'mass'])
163 paramlist.append(
"set /Herwig/Particles/"+value[
'name']+
":Width "+value[
'width'])
166 if k ==
'EW_parameters':
167 for key,value
in v.items():
168 if key[2] ==
"Sin2ThetaW":
169 paramlist.append(
"set /Herwig/Model:EW/"+
str(key[2])+
" "+
str(value))
170 paramstring =
'\n'.
join(paramlist)
177 ## Masses and widths: PDG 2010 values (except TOP mass; kept at PDG2007)
178 set /Herwig/Particles/t:NominalMass 172.5*GeV
179 set /Herwig/Particles/tbar:NominalMass 172.5*GeV
180 set /Herwig/Particles/W+:NominalMass 80.399*GeV
181 set /Herwig/Particles/W-:NominalMass 80.399*GeV
182 set /Herwig/Particles/Z0:NominalMass 91.1876*GeV
183 set /Herwig/Particles/W+:Width 2.085*GeV
184 set /Herwig/Particles/W-:Width 2.085*GeV
185 set /Herwig/Particles/Z0:Width 2.4952*GeV
188 set /Herwig/Model:EW/Sin2ThetaW 0.23113
196 ## Disable default attempts to use Pomeron PDF data files, until we're worked how to do that on the Grid!
197 set /Herwig/Particles/pomeron:PDF /Herwig/Partons/NoPDF
199 ## Set long-lived particles stable
200 set /Herwig/Decays/DecayHandler:MaxLifeTime 10*mm
216 if order
not in [
"LO",
"NLO"]:
217 raise RuntimeError(hw7Utils.ansi_format_error(
"Parameter 'order' must either be 'LO' or 'NLO'!"))
220 ## Configure {0} AlphaS for the hard process
221 ## (LO: 1-loop-running / NLO: 2-loop running)
222 set /Herwig/Couplings/{0}AlphaS:input_scale {1}
223 set /Herwig/Couplings/{0}AlphaS:input_alpha_s {2}
224 set /Herwig/Model:QCD/RunningAlphaS /Herwig/Couplings/{0}AlphaS
225 """.
format(order, scale, value)
236 if order
not in [
"LO",
"NLO"]:
237 raise RuntimeError(hw7Utils.ansi_format_error(
"Parameter 'order' must either be 'LO' or 'NLO'!"))
242 ## Configure {0} PDF set for the hard process
243 set /Herwig/Partons/Hard{0}PDF:PDFName {1}
244 set /Herwig/Partons/Hard{0}PDF:Member {2}
245 set /Herwig/Partons/Hard{0}PDF:MaxFlav {3}
246 set /Herwig/Partons/Hard{0}PDF:RemnantHandler /Herwig/Partons/HadronRemnants
247 set /Herwig/Particles/p+:PDF /Herwig/Partons/Hard{0}PDF
248 set /Herwig/Particles/pbar-:PDF /Herwig/Partons/Hard{0}PDF
249 set /Herwig/Partons/PPExtractor:FirstPDF /Herwig/Partons/Hard{0}PDF
250 set /Herwig/Partons/PPExtractor:SecondPDF /Herwig/Partons/Hard{0}PDF
251 """.
format(order, name, member, max_flav)
262 if order
not in [
"LO",
"NLO"]:
263 raise RuntimeError(hw7Utils.ansi_format_error(
"Parameter 'order' must either be 'LO' or 'NLO'!"))
269 ## Configure {0} PDF set for the parton shower
270 set /Herwig/Partons/Shower{0}PDF:PDFName {1}
271 set /Herwig/Partons/Shower{0}PDF:Member {2}
272 set /Herwig/Partons/Shower{0}PDF:MaxFlav {3}
273 set /Herwig/Shower/ShowerHandler:PDFA /Herwig/Partons/Shower{0}PDF
274 set /Herwig/Shower/ShowerHandler:PDFB /Herwig/Partons/Shower{0}PDF
275 set /Herwig/Shower/PowhegShowerHandler:PDFA /Herwig/Partons/Shower{0}PDF
276 set /Herwig/Shower/PowhegShowerHandler:PDFB /Herwig/Partons/Shower{0}PDF
277 set /Herwig/DipoleShower/DipoleShowerHandler:PDFA /Herwig/Partons/Shower{0}PDF
278 set /Herwig/DipoleShower/DipoleShowerHandler:PDFB /Herwig/Partons/Shower{0}PDF
279 """.
format(order, name, member, max_flav)
293 set /Herwig/Partons/MPIPDF:PDFName {}
294 set /Herwig/Partons/MPIPDF:Member {}
295 set /Herwig/Partons/MPIPDF:MaxFlav {}
296 """.
format(name, member, max_flav)
307 ## Configure Remnant PDF
308 set /Herwig/Partons/RemnantPDF:PDFName {}
309 set /Herwig/Partons/RemnantPDF:Member {}
310 set /Herwig/Partons/RemnantPDF:MaxFlav {}
311 """.
format(name, member, max_flav)
320 def tune_commands(self, ps_tune_name = "H7-PS-MMHT2014LO", ue_tune_name = "H7.2-Default"):
339 ## Parton shower / hadronization tune settings
342 if tune_name ==
"H7-PS-MMHT2014LO":
344 # > The parton shower / hadronization tune "H7-MMHT2014LO" is already
345 # > configured in Herwig7 via the default settings.
350 raise Exception(
"Parton shower tune name '{}' unknown".
format(tune_name))
369 ## Underlying event tune settings
372 if tune_name ==
"H7.2-Default":
374 # > The underlying event tune "H7.2-Default" is already
375 # > configured in Herwig7 via the default settings.
380 raise Exception(
"Underlying event tune name '{}' unknown".
format(tune_name))
394 cmt_path = os.environ.get(
"CMAKE_PREFIX_PATH")
395 cmt_dir = os.environ.get(
"BINARY_TAG")
397 cmtPaths = cmt_path.split(
':')
399 for path
in cmtPaths:
400 pathNow = path +
"/InstallArea/" + cmt_dir +
"/share/"
402 fileList = os.listdir(pathNow)
405 if "HerwigDefaults.rpo" in fileList:
406 simSharePath = pathNow
408 dpdf_path = os.path.dirname(os.path.normpath(os.path.join(simSharePath, os.readlink(simSharePath +
'HerwigDefaults.rpo')))) +
"/PDF/diffraction/"
419 cmds +=
"set /Herwig/Partons/PomeronPDF:RootName %s\n" % dpdf_path
420 cmds +=
"set /Herwig/Partons/PomeronFlux:PDFFit %s\n" % flux
421 cmds +=
"set /Herwig/Partons/PomeronPDF:PDFFit %s\n" % pdf
424 set /Herwig/Particles/pomeron:PDF /Herwig/Partons/PomeronPDF
426 # Technical parameters for this run
427 set /Herwig/Generators/EventGenerator:EventHandler:Sampler:Ntry 100000
428 set /Herwig/Generators/EventGenerator:MaxErrors 500
431 # TODO: Is this a problem?
432 set /Herwig/Generators/EventGenerator:EventHandler:CascadeHandler:MPIHandler NULL
434 # Choice of phase-space generation for PDFs
435 set /Herwig/Partons/PPExtractor:FlatSHatY 0
447 # Technical parameters for this run
448 set /Herwig/Generators/EventGenerator:EventHandler:Sampler:Ntry 100000
450 # Choice of phase-space generation for PDFs
451 set /Herwig/Partons/PPExtractor:FlatSHatY 0
453 # Change the proton PDFs to those for photon radiation
454 set /Herwig/Particles/p+:PDF /Herwig/Partons/BudnevPDF
455 set /Herwig/Particles/pbar-:PDF /Herwig/Partons/BudnevPDF
458 # TODO: Is this a problem?
459 set /Herwig/Generators/EventGenerator:EventHandler:CascadeHandler:MPIHandler NULL
465 tune_schemes = [
"DotProduct-Veto",
"DotProduct",
"pT",
"Q2"]
466 if tune_scheme
not in tune_schemes:
467 athMsgLog.warn(
"Please choose one of the supported tune-schemes! (DotProduct-Veto,DotProduct,pT,Q2)")
469 athMsgLog.info(
"{tune_scheme:s} was used for the tune scheme.".
format(tune_scheme=tune_scheme))
476 # Tune-{tune_scheme:s}
477 read snippets/EvolutionScheme-{tune_scheme:s}.in
478 read snippets/Tune-{tune_scheme:s}.in
479 """.
format(tune_scheme=tune_scheme)
485 \n## -----------------------
486 ## Shower scale variation
487 ## -----------------------
489 do ShowerHandler:AddVariation MUR2_MUF2_SHOWER_HARD 2 2 Hard
490 do ShowerHandler:AddVariation MUR2_MUF1_SHOWER_HARD 2 1 Hard
491 do ShowerHandler:AddVariation MUR1_MUF2_SHOWER_HARD 1 2 Hard
492 do ShowerHandler:AddVariation MUR1_MUF0.5_SHOWER_HARD 1 0.5 Hard
493 do ShowerHandler:AddVariation MUR0.5_MUF1_SHOWER_HARD 0.5 1 Hard
494 do ShowerHandler:AddVariation MUR0.5_MUF0.5_SHOWER_HARD 0.5 0.5 Hard
495 do ShowerHandler:AddVariation MUR2_MUF2_SHOWER_SEC 2 2 Secondary
496 do ShowerHandler:AddVariation MUR2_MUF1_SHOWER_SEC 2 1 Secondary
497 do ShowerHandler:AddVariation MUR1_MUF2_SHOWER_SEC 1 2 Secondary
498 do ShowerHandler:AddVariation MUR1_MUF0.5_SHOWER_SEC 1 0.5 Secondary
499 do ShowerHandler:AddVariation MUR0.5_MUF1_SHOWER_SEC 0.5 1 Secondary
500 do ShowerHandler:AddVariation MUR0.5_MUF0.5_SHOWER_SEC 0.5 0.5 Secondary
501 set SplittingGenerator:Detuning 2.0
def technical_parameter_commands(self)
def check_reset_proc_number(opts)
def load_PS_tune(self, tune_name)
def me_pdf_commands(self, order="NLO", name="MMHT2014nlo68cl", member=0, max_flav=5)
Commands for setting the PDF in the hard process.
set_physics_parameter_commands
def load_ue_tune(self, tune_name)
def __init__(self, genSeq, runArgs, run_name="Herwig")
Constructor.
Configuration base class for Herwig7.
def pdf_gammagamma_cmds(self)
Initialize Budnev Photon flux for two-photon exclusive exchange.
def tune_commands(self, ps_tune_name="H7-PS-MMHT2014LO", ue_tune_name="H7.2-Default")
Commands for setting PS/hadronization and UE/MPI tune simultaneously.
def ue_tune_commands(self, tune_name="H7.2-Default")
Commands for only setting the UE/MPI tune.
def global_pre_commands(self)
Commands applied to all configuration classes before commands from the JobOptions.
def shower_pdf_commands(self, order="LO", name="MMHT2014lo68cl", member=0, max_flav=5)
Commands for setting the PDF in the parton showers.
def mpi_pdf_commands(self, name="MMHT2014lo68cl", member=0, max_flav=5)
Commands for setting the PDF in the underlying event (UE)
def remnant_pdf_commands(self, name="MMHT2014lo68cl", member=0, max_flav=5)
Commands for setting the remnant PDF.
def pdf_pomeron_cmds(self, flux, pdf)
Set pomeron structure function.
physics_parameter_commands
Load the dictionary and extract the values of the variables that were defined here before (top quark,...
def me_alphas_commands(self, order="NLO", scale=91.1876, value=0.118)
Commands for setting the strong coupling in the hard process.
def beam_commands(self)
Commands specific to certain beam / collision types.
def energy_commands(self)
Sets center-of-mass energy sqrts(s) in GeV.
std::string join(const std::vector< std::string > &v, const char c=',')
def ps_tune_commands(self, tune_name="H7-PS-MMHT2014LO")
Commands for only setting the PS/hadronization tune.
def printout_commands(self)
Sets printout verbosity and error tolerance.
def set_tune_scheme(self, tune_scheme="DotProduct")
set_technical_parameter_commands
def random_seed_commands(self)
Sets the seed for the random number generator.
def enable_angularShowerScaleVariations(self, do_variations=False)
def add_commands(self, commands)
Add direct Herwig7 repository commands as they wo.