From 064c0c5516647df6471e640cde5137a0f6990897 Mon Sep 17 00:00:00 2001
From: Spyros Argyropoulos <spyridon.argyropoulos@cern.ch>
Date: Tue, 26 Jan 2021 18:06:14 +0100
Subject: [PATCH] Fix logic for special generator handling

---
 scripts/logParser.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/logParser.py b/scripts/logParser.py
index 6ded737c03..8ef9daf255 100644
--- a/scripts/logParser.py
+++ b/scripts/logParser.py
@@ -489,7 +489,7 @@ def main():
             else:
                 val=val[0]
             loginfo(f"- {key} = ",f"{val}")
-
+            
     # Check if input files are used that inputFilesPerJob matches the number of input files
     if generateTfDict['inputGeneratorFile'] and len(generateTfDict['inputGeneratorFile'][0].split(',')) != int(generateTfDict['inputFilesPerJob'][0]):
         logerr("", f"ERROR: {len(generateTfDict['inputGeneratorFile'][0].split(','))} input files used while inputFilesPerJob={generateTfDict['inputFilesPerJob'][0]}")
@@ -538,7 +538,7 @@ def main():
         print("MISSING Metadata:")
         for i in metaDataErrors:
             if i=="weights" or i=="genFilterNames" or i=="generator" or i=="PDF" or i=="sumOfNegWeights" or i=="sumOfPosWeights" \
-               or ((i=="cross-section (nb)" or i=="generatorTune") and (generatorName in specialGenerators))\
+               or ((i=="cross-section (nb)" or i=="generatorTune") and (any(gen in generatorName for gen in specialGenerators)))\
                or (i=="generatorTune" and LHEonly):
                 loginfo("INFO:","%s is missing"%i)
             else:
@@ -612,7 +612,7 @@ def main():
                 logwarn("","WARNING: %s is missing!"%i)
             else:
                 # TestHepMC is not needed for special generators or when running LHE only
-                if ("TestHepMC" in i) and ((generatorName in specialGenerators) or LHEonly):
+                if ("TestHepMC" in i) and ((any(gen in generatorName for gen in specialGenerators)) or LHEonly):
                     logwarn("",f"WARNING: {i} is missing")
                 else:
                     logerr("","ERROR: %s is missing!"%i)
-- 
GitLab