From 10ca45079e83a1f9c58ae39fa92c492749021e70 Mon Sep 17 00:00:00 2001
From: Johannes Josef Junggeburth <johannes.josef.junggeburth@CERN.CH>
Date: Thu, 27 Sep 2018 15:59:31 +0200
Subject: [PATCH] Fixing the PATJobTransforms to allow the MCP code to be
 processed on tier0

Former-commit-id: 0d58b66693b460f85e2041df77b7b16a4d610bd2
---
 .../PATJobTransforms/share/skeleton.AODtoDPD_tf.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/PhysicsAnalysis/PATJobTransforms/share/skeleton.AODtoDPD_tf.py b/PhysicsAnalysis/PATJobTransforms/share/skeleton.AODtoDPD_tf.py
index 4a1efa299a6..7c7a75059e7 100644
--- a/PhysicsAnalysis/PATJobTransforms/share/skeleton.AODtoDPD_tf.py
+++ b/PhysicsAnalysis/PATJobTransforms/share/skeleton.AODtoDPD_tf.py
@@ -135,8 +135,7 @@ if hasattr(runArgs,"outputNTUP_MCPScaleFile"):
     from MuonPtCalibNtupleMaker import MuonPtCalibNtupleMaker_Config
     MuonPtCalibNtupleMaker_Config.MuonScaleConfig(runArgs.outputNTUP_MCPScaleFile)
 
-#Import D3PD flags before preExec, for convenience
-from D3PDMakerConfig.D3PDProdFlags  import oldProdFlags
+
 
 ## Pre-exec
 if hasattr(runArgs,"preExec"):
@@ -169,9 +168,14 @@ else:
 if hasattr(runArgs,"topOptions"): include(runArgs.topOptions)
 else: include( "RecExCommon/RecExCommon_topOptions.py" )
 
-## Make "old style" D3PDs.
-for c in SetupOutputDPDs(runArgs, [oldProdFlags]): c()
-
+try:
+    #Import D3PD flags before preExec, for convenience
+    from D3PDMakerConfig.D3PDProdFlags  import oldProdFlags
+    ## Make "old style" D3PDs.
+    for c in SetupOutputDPDs(runArgs, [oldProdFlags]): c()
+except ImportError:
+    print "WARNING: Old prod flags could not be included this. Only OK if you're using job transforms without the AtlasAnalysis project."
+    
 ## Offline prescales (has to be *after* the topOptions)
 if hasattr(runArgs,"prescales"):
     recoLog.info( '**** DPD offline prescale arguments:' )
-- 
GitLab