From c2eb9ad7d21bbedc741f65cbc3abdb40301f480c Mon Sep 17 00:00:00 2001 From: Zach Marshall Date: Fri, 16 Oct 2020 09:41:42 +0200 Subject: [PATCH] Bit more data overlay setup and import cleanup One more flag set based on not-quite-complete information, which needs to be fixed to cope with data overlay. Helps with ATLASG-1532 Cleaning a couple of imports up in the meantime. --- .../python/DerivationFrameworkMaster.py | 5 ++++- .../DerivationFrameworkCore/python/LHE3WeightMetadata.py | 4 ++-- .../DerivationFrameworkCore/python/WeightMetadata.py | 7 +++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/DerivationFrameworkMaster.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/DerivationFrameworkMaster.py index d17253f93cb..640d8688161 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/DerivationFrameworkMaster.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/DerivationFrameworkMaster.py @@ -54,7 +54,10 @@ athOutSeq += CfgMgr.xAODMaker__ElementLinkResetAlg( "ELReset" ) from RecExConfig.InputFilePeeker import inputFileSummary if inputFileSummary is not None: - if (inputFileSummary['evt_type'][0] == 'IS_SIMULATION') and (inputFileSummary['stream_names'][0] != 'StreamEVGEN'): + # If we have Simulation metadata in the file or if this is simulation, add it to the IOVDbSvc + # Might have Simulation metadata but not IS_SIMULATION if we're running data overlay + if ('metadata' in inputFileSummary and '/Simulation/Parameters' in inputFileSummary['metadata']) or \ + (inputFileSummary['evt_type'][0] == 'IS_SIMULATION' and inputFileSummary['stream_names'][0] != 'StreamEVGEN'): svcMgr.IOVDbSvc.Folders += ['/Simulation/Parameters'] # Set up the metadata tool: diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/LHE3WeightMetadata.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/LHE3WeightMetadata.py index 39f06090daa..c10ff585925 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/LHE3WeightMetadata.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/LHE3WeightMetadata.py @@ -5,7 +5,7 @@ import json def addLHE3Weights(seq, pref = '', var_dict = {}): from AthenaCommon.AppMgr import ToolSvc - from ReweightUtils.ReweightUtilsConf import * + from ReweightUtils.ReweightUtilsConf import SumOfWeightsAlg,McEventWeight sumOfWeightsAlg = SumOfWeightsAlg(name = pref+"LHE3SumWeightsAlg") @@ -22,7 +22,7 @@ def addLHE3Weights(seq, pref = '', var_dict = {}): seq += sumOfWeightsAlg -from DerivationFrameworkCore.DerivationFrameworkMaster import * +from DerivationFrameworkCore.DerivationFrameworkMaster import DerivationFrameworkHasTruth,DerivationFrameworkJob # skip this in datfrom AthenaCommon.GlobalFlags import globalflags if DerivationFrameworkHasTruth: diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/WeightMetadata.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/WeightMetadata.py index 4df14dafea4..97799b9f2b2 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/WeightMetadata.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/WeightMetadata.py @@ -4,7 +4,7 @@ def addWeights(seq, pdfMap = {'CT14nlo':20}, pref = ""): from AthenaCommon.AppMgr import ToolSvc - from ReweightUtils.ReweightUtilsConf import * + from ReweightUtils.ReweightUtilsConf import McEventWeight,SumOfWeightsAlg,PDFWeight,WeightsAgregator #Load standard generator event weight mcEventWeightNom = McEventWeight(name = pref+"mcWNom") @@ -46,7 +46,7 @@ def addWeightsHist(stream, seq, svcMgr, CfgMgr, ToolSvc, derivName, fileName, pd svcMgr.THistSvc.PrintAll = True stream.OtherAlgs += svcMgr.THistSvc - from ReweightUtils.ReweightUtilsConf import * + from ReweightUtils.ReweightUtilsConf import McEventWeight,PDFWeight,WeightsAgregator #Load standard generator event weight mcEventWeightNom = McEventWeight(name = derivName+"_mcEventWeightNom") @@ -90,7 +90,6 @@ def addWeightsHist(stream, seq, svcMgr, CfgMgr, ToolSvc, derivName, fileName, pd seq += CfgMgr.CP__PileupReweightingProvider(derivName+"_pdfProvWeight"+pdfName+"_"+str(i),Tool=provTools[i],ConfigOutputStream="METADATA/pdfWeight"+pdfName+"_"+str(i)) -from DerivationFrameworkCore.DerivationFrameworkMaster import * #addWeights(DerivationFrameworkJob, {'CT10nlo':52, 'MSTW2008nlo68cl': 40, 'NNPDF23_lo_as_0130_qed': 100, 'NNPDF30_nlo_as_0118': 100}, "") listPDF = {} #listPDF["CT14nlo"] = 56 @@ -119,7 +118,7 @@ listPDF["CT10"] = 52 #listPDF["abm12lhc_4_nnlo"] = 28 # skip this in data -from DerivationFrameworkCore.DerivationFrameworkMaster import DerivationFrameworkHasTruth +from DerivationFrameworkCore.DerivationFrameworkMaster import DerivationFrameworkHasTruth,DerivationFrameworkJob if DerivationFrameworkHasTruth: addWeights(DerivationFrameworkJob, listPDF, "") -- GitLab