Commit 3d77c1d8 authored by Ewelina Maria Lobodzinska's avatar Ewelina Maria Lobodzinska
Browse files

Merge branch 'jk_check_gentf_mem' into '21.6'

improve LHE event counting

See merge request !46579
parents 92d47085 d625724b
......@@ -595,7 +595,6 @@ if hasattr(runArgs, "postExec"):
##==============================================================
acas.dumpMasterSequence()
##==============================================================
## Input file arg handling
##==============================================================
......@@ -797,15 +796,15 @@ if hasattr(runArgs, "outputTXTFile"):
# counting the number of events in LHE output
count_ev = 0
with open(eventsFile) as f:
lines = f.read()
count_ev = lines.count('/event')
for line in f:
count_ev += line.count('/event')
print "MetaData: %s = %s" % ("Number of produced LHE events ", count_ev)
elif hasattr(runArgs, "inputGeneratorFile"):
# counting the number of events in LHE output
# counting the number of events in LHE input
count_ev = 0
with open(eventsFile) as f:
lines = f.read()
count_ev = lines.count('/event')
for line in f:
count_ev += line.count('/event')
print "MetaData: %s = %s" % ("Number of input LHE events ", count_ev)
if _checkattr("description", required=True):
......
......@@ -734,9 +734,10 @@ def _checkattr(attr, required=False):
return False
return True
# counting the number of events in LHE output
count_ev = 0
with open(eventsFile) as f:
contents = f.read()
count_ev = contents.count("/event")
for line in f:
count_ev += line.count('/event')
evgenLog.info('Requested output events = '+str(count_ev))
print "MetaData: %s = %s" % ("Number of produced LHE events ", count_ev)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment