Commit 5e3b55f6 authored by Andy Buckley's avatar Andy Buckley Committed by Graeme Stewart
Browse files

'Fix use of set() in new executor setup.' (EvgenJobTransforms-01-01-11)

parent ea3bd03b
package EvgenJobTransforms
use AtlasPolicy AtlasPolicy-*
use PyJobTransforms PyJobTransforms-* Tools
private
use TestPolicy TestPolicy-*
end_private
apply_pattern declare_job_transforms tfs='*.py' jo='*.py'
apply_pattern declare_python_modules files="*.py"
apply_pattern declare_runtime_extras extras="../test/EvgenJobTransforms_TestConfiguration.xml"
apply_pattern declare_joboptions files="../test/test_*.py"
private
apply_pattern validate_xml
end_private
macro EvgenJobTransforms_TestConfiguration "../test/EvgenJobTransforms_TestConfiguration.xml"
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
## Generators providing input events via the LHEF format (MC@NLO produces LHEF
## when used in connection with Herwig++, which is fine since this variable is
## just used to determine the input file dummy-naming strategy for C++ generators)
lhefGenerators = ["Lhef", # generic name: prefer to use the names below
"aMcAtNlo", "McAtNlo", "Powheg", "PowHel", "MadGraph", "CompHep", "CalcHep",
"Whizard", "MCFM", "JHU", "MEtop", "Charybdis", "Charybdis2",
"BlackMax", "QBH", "gg2ww", "gg2zz", "gg2vv", "HvyN", "VBFNLO", "FPMC"]
## A more general list of generators which provide partonic input, including non-LHEF ones
inputGenerators = lhefGenerators + ["Alpgen", "Protos"]
## "Main" generators which typically model QCD showers, hadronisation, decays, etc.
## Herwig family, including Herwig++
mainGenerators = ["Herwig", "Herwigpp", "Jimmy", "Matchig", "Pomwig", "Herwigpp"]
## Pythia family, including Pythia8
mainGenerators += ["Pythia", "PythiaB"]
mainGenerators += ["PythiaRhad", "PythiaChL", "PythiaGS", "PythiaResMod", "PythiaTopMdiff"]
mainGenerators += ["Pythia8", "Pythia8B"]
## Sherpa family
mainGenerators += ["Sherpa"]
## Soft QCD generators
mainGenerators += ["Exhume", "Phojet", "Epos"]
## ATLAS-specific generators
mainGenerators += ["ParticleGenerator", "ParticleGun"]
mainGenerators += ["CosmicGenerator", "BeamHaloGenerator"]
## Heavy ion generators
mainGenerators += ["Starlight", "Hijing", "Hydjet", "Reldis", "Pyquen"]
## Misc generators
mainGenerators += ["AcerMC", "TopRex", "LPair"]
## Reading in fully-formed events
mainGenerators += ["HepMCAscii"]
## Special QED and decay afterburners
afterburnerGenerators = ["Photos", "Photospp", "Tauola", "Tauolapp", "EvtGen", "ParticleDecayer"]
## Set up list of allowed generators. The evgenConfig.generators list will be used
## to set random seeds, determine input config and event files, and report used generators to AMI.
knownGenerators = inputGenerators + mainGenerators + afterburnerGenerators
## Note which generators should NOT be sanity tested by the TestHepMC alg
notesthepmcGenerators = ["ParticleDecayer", "ParticleGun", "CosmicGenerator", "BeamHaloGenerator", "FPMC",
"Hijing", "Hydjet", "Starlight", "PythiaRhad"]
## Generators with no flexibility/concept of a tune or PDF choice
notuneGenerators = ["ParticleGenerator", "ParticleGun", "CosmicGenerator", "BeamHaloGenerator", "HepMCAscii"]
def gen_known(genname):
"Return whether a generator name is known"
return genname in knownGenerators
def gens_known(gennames):
"Return whether all generator names are known"
return all(gen_known(g) for g in gennames)
def gen_lhef(genname):
"Return whether a generator uses LHEF input files"
return genname in lhefGenerators
def gens_lhef(gennames):
"Return whether any of the generators uses LHEF input files"
return any(gen_lhef(g) for g in gennames)
def gen_testhepmc(genname):
"Return whether a generator should be sanity tested with TestHepMC"
return genname not in notesthepmcGenerators
def gens_testhepmc(gennames):
"Return whether all of the generators should be sanity tested with TestHepMC"
return all(gen_testhepmc(g) for g in gennames)
def gen_notune(genname):
"Return whether a generator is allowed to not provide PDF and tune information"
return genname not in notuneGenerators
def gens_notune(gennames):
"Return whether all of the generators are allowed to not provide PDF and tune information"
return all(gen_notune(g) for g in gennames)
def gen_sortkey(genname):
"Return a key suitable for sorting a generator name by stage, then alphabetically"
## Sort mainly in order of generator stage
genstage = None
for istage, gens in enumerate([inputGenerators, mainGenerators, afterburnerGenerators]):
if genname in gens:
genstage = istage
break
## Make sure JIMMY sorts after HERWIG
isjimmy = (genname == "Jimmy")
## Any special treatment for Photos, Tauola, EvtGen?
## Return a tuple
return (genstage, isjimmy, genname)
from PyJobTransformsCore.TransformConfig import *
class EvgenConfig(TransformConfig):
__slots__ = ()
generators = ListOfStrings("List of used generators", allowedValues=knownGenerators)
description = String("Human readable description of the dataset content")
process = String("Specific information about the physics process being generated")
notes = String("Extra information about this process e.g. known current problems")
contact = ListOfStrings("Contact person for this dataset. Leave empty for 'MC group'")
keywords = ListOfStrings("Search keywords for this dataset, e.g. 'QCD', 'EW', 'minbias', ...")
inputfilecheck = String("A regex to check that the input file needed for some generators has a valid name")
inputconfcheck = String("A regex to check that the config file needed for some generators has a valid name")
specialConfig = String("Special configuration for subsequent prod steps")
tune = String("Generator shower/hadronisation/MPI tune name")
saveJets = Boolean("Save truth jet collections in the output file if they are available", False)
def __init__(self, name="evgenConfig"):
TransformConfig.__init__(self, name)
self.contact = ["MC group"]
self.auxfiles = ["PDGTABLE.MeV", "pdt.table", "DECAY.DEC", "Bdecays0.dat", "Bs2Jpsiphi.DEC","G4particle_whitelist.txt"]
self.minevents = 5000
self.maxeventsstrategy = "ABORT"
self.specialConfig = "NONE"
## Explicitly block MC11/12 settings of efficiency, input*base, or weighting attrs
def __setattr__(self, name, value):
if name in ["efficiency", "inputfilebase", "inputconfbase", "weighting"]:
msg = "evgenConfig.%s is not used in MC14 production. " % name + \
"Please update your JO file, having read the docs at " + \
"https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/AtlasMcProductionMC14"
raise TransformConfigError(msg)
object.__setattr__(self, name, value)
evgenConfig = EvgenConfig()
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
def downloadUsingProxy(url, filename=None):
'''Download URL using proxy setup from environment (ATLAS_PROXIES, fallback to FRONTIER_SERVER)'''
import os
if filename is None:
filename = os.path.basename(url)
proxyList = []
if 'http_proxy' in os.environ:
proxyList.append( os.environ['http_proxy'] )
elif 'ATLAS_PROXIES' in os.environ:
proxyList.extend( os.environ['ATLAS_PROXIES'].split(',') )
elif 'FRONTIER_SERVER' in os.environ:
frontierConfig = [ conf.lstrip('(') for conf in os.environ['FRONTIER_SERVER'].split(')') ]
for conf in frontierConfig:
if conf.startswith('proxyurl=http://'):
proxyList.append(conf.split('proxyurl=http://')[1])
proxyList.append(None) # a last try with no proxy is flagged by None
msg = "Found proxy list %s\n" % proxyList
for proxy in proxyList:
if proxy is not None:
os.environ['http_proxy'] = proxy
elif 'http_proxy' in os.environ:
del os.environ['http_proxy']
cmd = "wget --waitretry=5 --tries=3 --connect-timeout=20 --read-timeout=120 -O %s %s" % (filename, url)
msg += "Trying to retrieve '%s' using proxy '%s' via: %s\n" % (url, proxy, cmd)
import commands
status, output = commands.getstatusoutput(cmd)
if status == 0:
msg += "Downloaded %s using proxy '%s'\n" % (url, proxy)
break
else:
msg += "Failed to get '%s' via proxy '%s'. exit status=%d, output='%s'\n" % (url, proxy, status, output)
if proxy is None:
msg += "All download attempts failed"
return 1, msg
return 0, msg
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
import PyJobTransforms.trfArgClasses as trfArgClasses
def addStdEvgenArgs(parser):
parser.defineArgGroup("Evgen", "Event generator options")
# TODO: Try to automatically determine the run number from the JO name, if not specified
parser.add_argument('--runNumber', '--RunNumber', group='Evgen',
type=trfArgClasses.argFactory(trfArgClasses.argInt, runarg=True),
help='Manual run number setting')
parser.add_argument("--ecmEnergy", "--EcmEnergy", group="Evgen",
default=trfArgClasses.argFloat(8000, runarg=True),
help="centre-of-mass energy parameter in GeV",
type=trfArgClasses.argFactory(trfArgClasses.argFloat, runarg=True))
parser.add_argument("--firstEvent", "--FirstEvent", group="Evgen",
default=trfArgClasses.argInt(1, runarg=True),
help="the number of the first event in the output data file",
type=trfArgClasses.argFactory(trfArgClasses.argInt, runarg=True))
parser.add_argument("--randomSeed", "--RandomSeed", "--seed", group="Evgen",
default=trfArgClasses.argInt(12345, runarg=True),
help="a seed for the MC generator random number engines",
type=trfArgClasses.argFactory(trfArgClasses.argInt, runarg=True))
parser.add_argument("--printEvts", group="Evgen",
default=trfArgClasses.argInt(5, runarg=True),
help="number of full event dumps to print out for debugging",
type=trfArgClasses.argFactory(trfArgClasses.argInt, runarg=True))
parser.add_argument("--jobConfig", "--JobConfig", "--jo", group="Evgen",
help="a comma-separated list of job configuration script files",
type=trfArgClasses.argFactory(trfArgClasses.argList, runarg=True))
# TODO: Add "--eventFile"?
parser.add_argument("--inputGeneratorFile", "--inputGenEventFile", "--inputGenFile", "--InputGeneratorFile", group="Evgen",
help="optional parton-level events file to be processed",
type=trfArgClasses.argFactory(trfArgClasses.argString, runarg=True))
# TODO: Add "--confFile"?
parser.add_argument("--inputGenConfFile", "--InputGenConfFile", group="Evgen",
help="optional generator configuration file",
type=trfArgClasses.argFactory(trfArgClasses.argString, runarg=True))
parser.add_argument("--evgenJobOpts", "--EvgenJobOpts", group="Evgen",
help="download and install the EvgenJobOpts tarball with the given name",
type=trfArgClasses.argFactory(trfArgClasses.argString, runarg=True))
# TODO: make optional: by default auto-determine from the JO name. If NONE, don't write?
parser.add_argument("--outputEVNTFile", "--OutputEVNTFile", group="Evgen",
help="POOL file into which generated events will be written",
type=trfArgClasses.argFactory(trfArgClasses.argPOOLFile, runarg=True))
parser.add_argument('--outputNTUP_TRUTHFile',
type=trfArgClasses.argFactory(trfArgClasses.argNTUPFile, treeNames=['truth']),
help='Output NTUP_TRUTH file', group='Evgen')
parser.add_argument("--rivetAnas", group="Evgen",
help="a comma-separated list of Rivet analyses to run on the resulting events",
type=trfArgClasses.argFactory(trfArgClasses.argList, runarg=True))
#! /usr/bin/env python
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
"""
Run event simulation and produce an EVNT file.
"""
import os, sys, time, shutil
from PyJobTransforms.trfLogger import msg
from PyJobTransforms.transform import transform
from PyJobTransforms.trfExe import athenaExecutor
from PyJobTransforms.trfArgs import addAthenaArguments
from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
from EvgenJobTransforms.evgenTrfArgs import addStdEvgenArgs
import PyJobTransforms.trfArgClasses as trfArgClasses
## Prodsys1 hack...
# TODO: Remove!
ListOfDefaultPositionalKeys=['--AMI', '--AMITag', '--DBRelease', '--asetup', '--athena', '--athenaopts', '--autoConfiguration', '--beamType', '--checkEventCount', '--command', '--conditionsTag', '--ecmEnergy', '--eventAcceptanceEfficiency', '--evgenJobOpts', '--execOnly', '--firstEvent', '--geometryVersion', '--ignoreErrors', '--ignoreFilters', '--ignorePatterns', '--inputGenConfFile', '--inputGeneratorFile', '--jobConfig', '--maxEvents', '--omitFileValidation', '--outputEVNTFile', '--postExec', '--postInclude', '--preExec', '--preInclude', '--randomSeed', '--reportName', '--runNumber', '--showGraph', '--showPath', '--showSteps', '--skipEvents', '--uploadtoami', '--validation']
class EvgenExecutor(athenaExecutor):
"Specialised trf executor class for event generation jobs"
def __init__(self, skeleton):
athenaExecutor.__init__(self, name="generate", skeletonFile=skeleton, substep="gen2evnt", tryDropAndReload=False, inData=["inNULL"], outData=["EVNT"])
def preExecute(self, input=set(), output=set()):
"Get input tarball, unpack and set up env if an evgenJobOpts arg was provided."
## First call the base class preExecute
super(EvgenExecutor, self).preExecute(input, output)
def expand_if_archive(filename):
"Function to expand a file if it is a zip archive or tarball"
if ".tar" in filename:
import tarfile
tf = tarfile.open(filename)
tf.extractall()
tf.close()
elif filename.endswith(".zip"):
import zipfile
zf = zipfile.ZipFile(filename)
zf.extractall()
zf.close()
def mk_jo_proxy(targetbasepath, pkgname, proxypath="_joproxy", addtosearch=True):
"Make a JO proxy dir such that the MCxxJobOptions/dddd dirs' contents are found via include(MCxxJobOptions/yyyy)"
if os.path.exists(proxypath):
shutil.rmtree(proxypath)
os.mkdir(proxypath)
for d in ("common", "share", "gencontrol", "susycontrol"):
# TODO: we could _maybe_ add the appropriate share/DSIDxxxx/ dir to the path based on the jobConfig arg... too much magic?
dpath = os.path.join(proxypath, d)
os.mkdir(dpath)
os.symlink(os.path.join(targetbasepath, d), os.path.join(dpath, pkgname))
if addtosearch:
os.environ["JOBOPTSEARCHPATH"] = dpath + ":" + os.environ["JOBOPTSEARCHPATH"]
## Handle locating of evgen job options / fragments, either from a tarball or CVMFS
if "evgenJobOpts" in self._trf.argdict: ## Use a specified JO tarball
tarball = self._trf.argdict["evgenJobOpts"].value
## Prepend the standard tarball URL prefix if the arg is not a full URL
# TODO: also allow a copy from a local filesystem location if it starts with a / (or can be found with os.path)?
if tarball.startswith("http"):
url = tarball
tarball = os.basename(tarball)
else:
url = "http://cern.ch/atlas-computing/links/kitsDirectory/EvgenJobOpts/" + tarball
## Download the tarball in a Grid-safe way (if it doesn't already exist)
if not os.path.exists(tarball):
from EvgenJobTransforms.download import downloadUsingProxy
status, output = downloadUsingProxy(url)
if status != 0:
raise EnvironmentError('Error downloading tarball %s. Downloader reports: %s' % (tarball, output))
msg.info('Evgen tarball download success: %s' % output)
## Expand tarball
expand_if_archive(tarball)
## Source setup script (requires some shenanigans to update the Python env robustly)
# TODO: trf framework now bans use of exec()...
#import subprocess
#pipe = subprocess.Popen(". ./setupevprod.sh; python -c 'import os; print \"newenv = %r\" % os.environ'", stdout=subprocess.PIPE, shell=True)
#exec(pipe.communicate()[0])
#os.environ.update(newenv)
else: ## Use the CVMFS copy of the latest MC14 JOs tag
if os.path.exists("/cvmfs/atlas.cern.ch"):
# TODO: Make the package name configurable
mk_jo_proxy("/cvmfs/atlas.cern.ch/repo/sw/Generators/MC14JobOptions/latest/", "MC14JobOptions")
msg.info("No evgenJobOpts tarball specified, using JOBOPTSEARCHPATH = '%s'" % os.environ["JOBOPTSEARCHPATH"])
elif os.path.exists("/afs/cern.ch/atlas/groups/Generators"):
mk_jo_proxy("/afs/cern.ch/atlas/groups/Generators/MC14JobOptions/latest/", "MC14JobOptions")
msg.info("No evgenJobOpts tarball specified, no cvmfs, using JOBOPTSEARCHPATH = '%s'" % os.environ["JOBOPTSEARCHPATH"])
## Expand tarball input event and generator conf files, if provided
if "inputGeneratorFile" in self._trf.argdict:
expand_if_archive(self._trf.argdict["inputGeneratorFile"].value)
if "inputGenConfFile" in self._trf.argdict:
expand_if_archive(self._trf.argdict["inputGenConfFile"].value)
def getTransform():
exeSet = set()
exeSet.add(EvgenExecutor("EvgenJobTransforms/skeleton.GENtoEVGEN.py"))
exeSet.add(athenaExecutor(name = "AODtoDPD", skeletonFile = "PATJobTransforms/skeleton.AODtoDPD_tf.py",
substep = "a2d", inData = ["EVNT"], outData = ["NTUP_TRUTH"], perfMonFile = "ntuple_AODtoDPD.pmon.gz"))
trf = transform(executor=exeSet)
addAthenaArguments(trf.parser)
addStdEvgenArgs(trf.parser)
return trf
@stdTrfExceptionHandler
@sigUsrStackTrace
def main():
msg.info("This is %s" % sys.argv[0])
trf = getTransform()
trf.parseCmdLineArgs(sys.argv[1:])
trf.execute()
trf.generateReport()
msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode))
sys.exit(trf.exitCode)
# TODO: Open resulting EVNT file to extract cross-section, generator names+versions, etc. from the HepMC::GenRun or whatever... in an executor postExecute?
if __name__ == "__main__":
main()
## Propagate energy argument to the generators
# TODO: Standardise energy setting in the GenModule interface
eCM = runArgs.ecmEnergy
eBeam = runArgs.ecmEnergy*0.5
if 'Pythia' in evgenConfig.generators:
genSeq.Pythia.PythiaCommand.append("pyinit win %s" % eCM)
elif 'PythiaB' in evgenConfig.generators:
genSeq.PythiaB.PythiaCommand.append("pyinit win %s" % eCM)
elif 'PythiaRhad' in evgenConfig.generators:
genSeq.PythiaRhad.PythiaCommand.append("pyinit win %s" % eCM)
elif 'PythiaChL' in evgenConfig.generators:
genSeq.PythiaChL.PythiaCommand.append("pyinit win %s" % eCM)
elif 'PythiaGS' in evgenConfig.generators:
genSeq.PythiaGS.PythiaCommand.append("pyinit win %s" % eCM)
elif 'PythiaResMod' in evgenConfig.generators:
genSeq.PythiaResMod.PythiaCommand.append("pyinit win %s" % eCM)
elif 'PythiaTopMdiff' in evgenConfig.generators:
genSeq.PythiaTopMdiff.PythiaCommand.append("pyinit win %s" % eCM)
elif 'Pythia8' in evgenConfig.generators:
genSeq.Pythia8.CollisionEnergy = eCM
elif 'Pythia8B' in evgenConfig.generators:
genSeq.Pythia8B.CollisionEnergy = eCM
elif 'Herwig' in evgenConfig.generators:
genSeq.Herwig.HerwigCommand.append("beam1energy %s" % eBeam)
genSeq.Herwig.HerwigCommand.append("beam2energy %s" % eBeam)
elif 'Herwigpp' in evgenConfig.generators:
genSeq.Herwigpp.Commands.append("set /Herwig/Generators/LHCGenerator:EventHandler:LuminosityFunction:Energy %s" % eCM)
elif 'Sherpa' in evgenConfig.generators:
genSeq.Sherpa_i.Parameters.append("BEAM_ENERGY_1=%s" % eBeam)
genSeq.Sherpa_i.Parameters.append("BEAM_ENERGY_2=%s" % eBeam)
elif 'Epos' in evgenConfig.generators:
genSeq.Epos.BeamMomentum = -eBeam
genSeq.Epos.TargetMomentum = eBeam
del eCM, eBeam
## Set random seeds depending on used generators
genseeds = {
'Pythia' : ["PYTHIA OFFSET {rnd} 47898993 {rnd}", "PYTHIA_INIT 820021 2347532"],
'PythiaB' : ["PYTHIA OFFSET {rnd} 47898993 {rnd}", "PYTHIA_INIT 820021 2347532"],
'PythiaRhad' : ["PYTHIA OFFSET {rnd} 47898993 {rnd}", "PYTHIA_INIT 820021 2347532"],
'PythiaChL' : ["PYTHIA OFFSET {rnd} 47898993 {rnd}", "PYTHIA_INIT 820021 2347532"],
'PythiaGS' : ["PYTHIA OFFSET {rnd} 47898993 {rnd}", "PYTHIA_INIT 820021 2347532"],
'PythiaResMod' : ["PYTHIA OFFSET {rnd} 47898993 {rnd}", "PYTHIA_INIT 820021 2347532"],
'PythiaTopMdiff' : ["PYTHIA OFFSET {rnd} 47898993 {rnd}", "PYTHIA_INIT 820021 2347532"],
'Pythia8' : ["PYTHIA8 OFFSET {rnd} 4789899 {rnd}", "PYTHIA8_INIT 820021 2347532"],
'Pythia8B' : ["PYTHIA8 OFFSET {rnd} 4789899 {rnd}", "PYTHIA8_INIT 820021 2347532"],
'Herwig' : ["HERWIG OFFSET {rnd} 30450275 {rnd}", "HERWIG_INIT 620021 5347532"],
'Herwigpp' : ["Herwigpp OFFSET {rnd} {rnd} 31122001"],
'Jimmy' : ["JIMMY OFFSET {rnd} 39002061 {rnd}", "JIMMY_INIT 720021 4347532"],
'Cascade' : ["CASCADE OFFSET {rnd} 4789899 {rnd}", "CASCADE_INIT 889223465 78782321"],
'Tauola' : ["TAUOLA OFFSET {rnd} 10480275 {rnd}", "TAUOLA_INIT 920021 3347532"],
'Photos' : ["PHOTOS OFFSET {rnd} 20450275 {rnd}", "PHOTOS_INIT 930021 3447532"],
'Photospp' : ["PHOTOSPP OFFSET {rnd} 20450275 {rnd}", "PHOTOSPP_INIT 930021 3447532"],
'EvtGen' : ["EVTGEN OFFSET {rnd} 30450275 {rnd}"],
'Hijing' : ["HIJING OFFSET {rnd} 327213897 {rnd}", "HIJING_INIT 31452781 78713307"],
'Hydjet' : ["HYDJET OFFSET {rnd} 252413389 {rnd}", "HYDJET_INIT 52413389 24133894"],
'Pyquen' : ["PYTHIA OFFSET {rnd} 47898993 {rnd}", "PYTHIA_INIT 820021 2347532"],
'Isajet' : ["ISAJET OFFSET {rnd} 1857585203 {rnd}", "ISAJET_INIT 820021 2347532"],
'Phojet' : ["PHOJET OFFSET {rnd} 174947321 {rnd}", "PHOJET_INIT 820021 2347532"],
'Epos' : ["EPOS OFFSET {rnd} {rnd} 31122001", "EPOS_INIT OFFSET {rnd} 820021 2347532"],
'ParticleGun' : ["ParticleGun {rnd} {rnd}"],
'ParticleGenerator' : ["SINGLE LUXURY 2 OFFSET 12345 {rnd} {rnd}"],
'ParticleDecayer' : ["ParticleDecayer LUXURY 2 OFFSET 54321 {rnd} {rnd}"],
'CosmicGenerator' : ["SINGLE OFFSET {rnd} 20401607 {rnd}"],
'Sherpa' : ["SHERPA OFFSET {rnd} 174947321 {rnd}", "SHERPA_INIT 820021 2347532"],
'Exhume' : ["ExhumeRand OFFSET {rnd} 4475757 {rnd}"],
'Pomwig' : ["POMWIG OFFSET {rnd} 37489241 {rnd}", "POMWIG_INIT 21219421 1984121"],
'Starlight' : ["STARLIGHT OFFSET {rnd} {rnd} 31122001"],
'BeamHaloGenerator' : ["BeamHalo OFFSET {rnd} 3524752 {rnd}"]
}
## Decide whether to use the RanLux or standard random number service
# TODO: Is this necessary or can we just provide the seeds to both services and the alg chooses which to use?
ranluxlist = ["ParticleGenerator"]
assert evgenConfig.generators
if any(gen in ranluxlist for gen in evgenConfig.generators):
evgenLog.info("Using RanLux random numbers!")
atRndmGenSvc = svcMgr.AtRanluxGenSvc
else:
atRndmGenSvc = svcMgr.AtRndmGenSvc
## Pass the random seed from the transform command line into each used generator's seed config string
seedstrs = []
for gen in evgenConfig.generators:
if genseeds.has_key(gen):
for seedtemplate in genseeds[gen]:
seedstr = seedtemplate.format(rnd=runArgs.randomSeed)
evgenLog.info("Adding %s random seed config: %s" % (gen, seedstr))
seedstrs.append(seedstr)
svcMgr.AtRanluxGenSvc.Seeds = seedstrs
svcMgr.AtRndmGenSvc.Seeds = seedstrs
This diff is collapsed.
<?xml version="1.0"?>
<!DOCTYPE unifiedTestConfiguration SYSTEM "http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/unifiedTestConfiguration.dtd">
<unifiedTestConfiguration>
<atn>
<TEST name="Py8Minbias" type="script" suite="EvgenJobTransforms-Core">
<doc>Test inclusive, unfiltered minimum bias generation</doc>
<classification>
<displayClass>OfflineValidation</displayClass>
<displayProcess>EvGen</displayProcess>
<displayComponent>Athena-Core</displayComponent>
</classification>
<options_atn>${ATN_PACKAGE}/test/test_pythia8_minbias</options_atn>
<timelimit>15</timelimit>
<prescript>source ${ATN_PACKAGE}/test/setup_testenv</prescript>
</TEST>
<TEST name="Py8Pileup" type="script" suite="EvgenJobTransforms-Core">
<doc>Test high-pT minimum bias generation for pile-up sampling</doc>
<classification>
<displayClass>OfflineValidation</displayClass>
<displayProcess>EvGen</displayProcess>
<displayComponent>Athena-Core</displayComponent>
</classification>
<options_atn>${ATN_PACKAGE}/test/test_pythia8_minbias_high</options_atn>
<timelimit>15</timelimit>
<prescript>source ${ATN_PACKAGE}/test/setup_testenv</prescript>
</TEST>
<TEST name="Py8Jets" type="script" suite="EvgenJobTransforms-Core">
<doc>Test a Pythia8 jet slice, with a very low filter efficiency</doc>
<classification>
<displayClass>OfflineValidation</displayClass>
<displayProcess>EvGen</displayProcess>
<displayComponent>Athena-Core</displayComponent>
</classification>
<options_atn>${ATN_PACKAGE}/test/test_pythia8_jets</options_atn>
<timelimit>15</timelimit>
<prescript>source ${ATN_PACKAGE}/test/setup_testenv</prescript>
</TEST>
<TEST name="Py8Ztautau" type="script" suite="EvgenJobTransforms-Core">
<doc>Tests a Pythia8 Z->tautau job, with Photos++</doc>
<classification>
<displayClass>OfflineValidation</displayClass>
<displayProcess>EvGen</displayProcess>
<displayComponent>Athena-Core</displayComponent>
</classification>
<options_atn>${ATN_PACKAGE}/test/test_pythia8_ztautau</options_atn>
<timelimit>15</timelimit>
<prescript>source ${ATN_PACKAGE}/test/setup_testenv</prescript>
</TEST>
<TEST name="Py8EvtGen" type="script" suite="EvgenJobTransforms-Core">
<doc>Test Pythia8+EvtGen</doc>
<classification>
<displayClass>OfflineValidation</displayClass>
<displayProcess>EvGen</displayProcess>
<displayComponent>Athena-Core</displayComponent>
</classification>
<options_atn>${ATN_PACKAGE}/test/test_pythia8_evtgen</options_atn>
<timelimit>15</timelimit>
<prescript>source ${ATN_PACKAGE}/test/setup_testenv</prescript>
</TEST>
<TEST name="Py8Powheg" type="script" suite="EvgenJobTransforms-Core">
<doc>Test POWHEG+Pythia8</doc>
<classification>
<displayClass>OfflineValidation</displayClass>
<displayProcess>EvGen</displayProcess>
<displayComponent>Athena-Core</displayComponent>
</classification>
<options_atn>${ATN_PACKAGE}/test/test_pythia8_powheg</options_atn>
<timelimit>15</timelimit>
<prescript>source ${ATN_PACKAGE}/test/setup_testenv</prescript>
</TEST>
<TEST name="McAtNloJimmy" type="script" suite="EvgenJobTransforms-Core">
<doc>Test MC@NLO+HERWIG+JIMMY</doc>
<classification>
<displayClass>OfflineValidation</displayClass>
<displayProcess>EvGen</displayProcess>
<displayComponent>Athena-Core</displayComponent>
</classification>
<options_atn>${ATN_PACKAGE}/test/test_mcatnlo_jimmy</options_atn>
<timelimit>15</timelimit>
<prescript>source ${ATN_PACKAGE}/test/setup_testenv</prescript>
</TEST>