Skip to content
Snippets Groups Projects
Commit 67d001bd authored by Ewelina Maria Lobodzinska's avatar Ewelina Maria Lobodzinska
Browse files

Merge branch '21.6-FixLHEOnly' into '21.6'

21.6: fix lhe-only production - AGENE-1884

See merge request atlas/athena!35337
parents 32084319 23485dca
No related branches found
No related tags found
No related merge requests found
# Common fragment for generation of 1 Pythia8 event, when producing LHE output only
# the number of events is set to 1 in two places: as Pythia param: Main:numberOfEvents = 1 and evgenconfig.nEventsPerJob=1 (the later one is stronger)
# the number of events is set to 1 in two places: as Pythia param: Main:numberOfEvents = 1 and postSeq.CountHepMC.RequestedOutput=1 (the later one is stronger)
# It is needed to make the transform run
# we don't modify nEventsPerJob anymore, which now corresponds to the number of events in the output lhe file
# No output is kept from this generation
## Base config for Pythia8
......@@ -19,7 +20,7 @@ genSeq += Pythia8_i("Pythia8")
genSeq.Pythia8.Commands += [
"Main:timesAllowErrors = 500",
"Main:numberOfEvents = 1",
"Main:numberOfEvents = 1",### first place for number of dummy events
"6:m0 = 172.5",
"23:m0 = 91.1876",
"23:mWidth = 2.4952",
......@@ -41,7 +42,15 @@ genSeq.Pythia8.Commands += [
"SoftQCD:inelastic = on",
"SpaceShower:rapidityOrder=0"]
evgenConfig.nEventsPerJob = 1
### second place for number of dummy events
if not hasattr(postSeq, "CountHepMC"):
postSeq += CountHepMC()
postSeq.CountHepMC.RequestedOutput = 1
### we don't modify nEventsPerJob, it'll correspond to the number of events in the output lhe file
#evgenConfig.nEventsPerJob = 1
### deleting TestHepMC for lhe-only production
del testSeq.TestHepMC
......
......@@ -316,23 +316,11 @@ if evgenConfig.minevents > 0 :
if evgenConfig.nEventsPerJob < 1:
raise RuntimeError("evgenConfig.nEventsPerJob must be at least 1")
elif evgenConfig.nEventsPerJob > 100000:
raise RuntimeError("evgenConfig.nEventsPerJob can be max. 100000")
#elif evgenConfig.nEventsPerJob > 100000:# limitation to 100k events per output lhe file
#raise RuntimeError("evgenConfig.nEventsPerJob can be max. 100000")
else:
allowed_nEventsPerJob_lt1000 = [1, 2, 5, 10, 20, 25, 50, 100, 200, 500, 1000]
msg = "evgenConfig.nEventsPerJob = %d: " % evgenConfig.nEventsPerJob
if evgenConfig.nEventsPerJob >= 1000 and evgenConfig.nEventsPerJob <=10000 and (evgenConfig.nEventsPerJob % 1000 != 0 or 10000 % evgenConfig.nEventsPerJob != 0) :
msg += "nEventsPerJob in range [1K, 10K] must be a multiple of 1K and a divisor of 10K"
raise RuntimeError(msg)
elif evgenConfig.nEventsPerJob > 10000 and evgenConfig.nEventsPerJob % 10000 != 0:
msg += "nEventsPerJob >10K must be a multiple of 10K"
raise RuntimeError(msg)
elif evgenConfig.nEventsPerJob < 1000 and evgenConfig.nEventsPerJob not in allowed_nEventsPerJob_lt1000:
msg += "nEventsPerJob in range <= 1000 must be one of %s" % allowed_nEventsPerJob_lt1000
raise RuntimeError(msg)
postSeq.CountHepMC.RequestedOutput = evgenConfig.nEventsPerJob if runArgs.maxEvents == -1 else runArgs.maxEvents
evgenLog.info('Requested output events '+str(postSeq.CountHepMC.RequestedOutput))
evgenLog.info("evgenConfig.nEventsPerJob = {}, but only {} (dummy) event(s) will be generated by Pythia8 for lhe-only production".format(evgenConfig.nEventsPerJob, postSeq.CountHepMC.RequestedOutput))
### NB: postSeq.CountHepMC.RequestedOutput is set to 1 in LHEonly.py
## Check that the keywords list is not empty:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment