From 2a237ecd66a3f03618703fa3dd16fa22a3f8279e Mon Sep 17 00:00:00 2001
From: Robin Newhouse <robin.newhouse@cern.ch>
Date: Tue, 18 Aug 2020 06:40:36 -0700
Subject: [PATCH] Changed print statements to allow master to run when
 producing IDTRKVALID samples

This was making the master branch fail when configuring Reco_tf to include the
--outputDAOD_IDTRKVALIDFile flag
---
 .../share/InDetDxAOD.py                       | 62 ++++++++++---------
 .../InDetPrepRawDataToxAOD/share/PixelxAOD.py | 26 ++++----
 .../InDetPrepRawDataToxAOD/share/SCTxAOD.py   |  2 +
 3 files changed, 47 insertions(+), 43 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
index 22d39a9c73fd..f07297877db2 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
@@ -1,3 +1,5 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
 #################
 ### Steering options
 #################
@@ -105,8 +107,8 @@ if dumpPixInfo:
     PixelChargeToTConversionSetter = PixelChargeToTConversion(name = "PixelChargeToTConversionSetter") 
     IDDerivationSequence += PixelChargeToTConversionSetter 
     if (printIdTrkDxAODConf):
-        print PixelChargeToTConversionSetter
-        print PixelChargeToTConversionSetter.properties()
+        print(PixelChargeToTConversionSetter)
+        print(PixelChargeToTConversionSetter.properties())
 
 #Setup SCT extension efficiency algorithm if running pixel tracklets
 #if InDetFlags.doTrackSegmentsPixel():
@@ -130,8 +132,8 @@ if makeSplitTracks:
     OutputTrackCollection = "Tracks_splitID")
     IDDerivationSequence +=splittercomb
     if (printIdTrkDxAODConf):
-        print splittercomb
-        print splittercomb.properties()
+        print(splittercomb)
+        print(splittercomb.properties())
 
     # Create xAOD::TrackParticles out of them
     from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
@@ -246,7 +248,7 @@ if TrtZSel or TrtJSel:
                                                                      expression = expression)
         
         ToolSvc += Z_SkimmingTool
-        print Z_SkimmingTool
+        print(Z_SkimmingTool)
         
     if TrtJSel:
         triggersE = [
@@ -316,7 +318,7 @@ if TrtZSel or TrtJSel:
                                                                         expression = expression)
 
         ToolSvc += JPSI_SkimmingTool
-        print JPSI_SkimmingTool
+        print(JPSI_SkimmingTool)
 
 
 if skimmingExpression: 
@@ -345,7 +347,7 @@ if DRAWZSel:
   DRAW_ZMUMU_SkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "DRAW_ZMUMU_SkimmingTool",
                                                                         expression = draw_zmumu)
   ToolSvc += DRAW_ZMUMU_SkimmingTool
-  print DRAW_ZMUMU_SkimmingTool
+  print(DRAW_ZMUMU_SkimmingTool)
 
 
 #################
@@ -369,8 +371,8 @@ if dumpTrtInfo:
 
     IDDerivationSequence += xAOD_TRT_PrepDataToxAOD
     if (printIdTrkDxAODConf):
-        print xAOD_TRT_PrepDataToxAOD
-        print xAOD_TRT_PrepDataToxAOD.properties()
+        print(xAOD_TRT_PrepDataToxAOD)
+        print(xAOD_TRT_PrepDataToxAOD.properties())
 
     # to store dEdx info
     from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import TRT_ToT_dEdx
@@ -383,7 +385,7 @@ if dumpTrtInfo:
 
     from InDetRecExample.ConfiguredNewTrackingCuts import ConfiguredNewTrackingCuts
     InDetNewTrackingCutsPixel = ConfiguredNewTrackingCuts("Pixel")
-    print InDetNewTrackingCutsPixel
+    print(InDetNewTrackingCutsPixel)
 
     if not hasattr(topSequence,'InDetTrackCollectionMerger') :
         from InDetRecExample import TrackingCommon
@@ -395,7 +397,7 @@ if dumpTrtInfo:
                                                                 OutputLevel=INFO
         )
         topSequence += InDetPRD_Association
-        print InDetPRD_Association
+        print(InDetPRD_Association)
 
 if dumpSctInfo:
     from InDetPrepRawDataToxAOD.InDetPrepRawDataToxAODConf import SCT_PrepDataToxAOD
@@ -409,8 +411,8 @@ if dumpSctInfo:
 
     IDDerivationSequence += xAOD_SCT_PrepDataToxAOD
     if (printIdTrkDxAODConf):
-        print xAOD_SCT_PrepDataToxAOD
-        print xAOD_SCT_PrepDataToxAOD.properties()
+        print(xAOD_SCT_PrepDataToxAOD)
+        print(xAOD_SCT_PrepDataToxAOD.properties())
 
 if dumpPixInfo:
     from IOVDbSvc.CondDB import conddb
@@ -453,8 +455,8 @@ if dumpPixInfo:
 
     IDDerivationSequence += xAOD_PixelPrepDataToxAOD
     if (printIdTrkDxAODConf):
-        print xAOD_PixelPrepDataToxAOD
-        print xAOD_PixelPrepDataToxAOD.properties()
+        print(xAOD_PixelPrepDataToxAOD)
+        print(xAOD_PixelPrepDataToxAOD.properties())
 
 
 #################
@@ -500,8 +502,8 @@ if dumpTrtInfo:
 ToolSvc += DFTSOS
 augmentationTools+=[DFTSOS]
 if (printIdTrkDxAODConf):
-    print DFTSOS
-    print DFTSOS.properties()
+    print(DFTSOS)
+    print(DFTSOS.properties())
 
 # If requested, decorate also split tracks (for cosmics)
 if makeSplitTracks:
@@ -531,8 +533,8 @@ if dumpBytestreamErrors:
     ToolSvc += DFEI
     augmentationTools+=[DFEI]
     if (printIdTrkDxAODConf):
-        print DFEI
-        print DFEI.properties()
+        print(DFEI)
+        print(DFEI.properties())
 
 # Add Unassociated hits augmentation tool
 if dumpUnassociatedHits:
@@ -549,8 +551,8 @@ if dumpUnassociatedHits:
                                                                                   TRTDriftCircleContainer = "TRT_DriftCircles")
     ToolSvc += unassociatedHitsGetterTool
     if (printIdTrkDxAODConf):
-        print unassociatedHitsGetterTool
-        print unassociatedHitsGetterTool.properties()
+        print(unassociatedHitsGetterTool)
+        print(unassociatedHitsGetterTool.properties())
 
     from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__UnassociatedHitsDecorator
     unassociatedHitsDecorator = DerivationFramework__UnassociatedHitsDecorator (name ='unassociatedHitsDecorator',
@@ -561,8 +563,8 @@ if dumpUnassociatedHits:
     ToolSvc += unassociatedHitsDecorator
     augmentationTools+=[unassociatedHitsDecorator]
     if (printIdTrkDxAODConf):
-        print unassociatedHitsDecorator
-        print unassociatedHitsDecorator.properties()
+        print(unassociatedHitsDecorator)
+        print(unassociatedHitsDecorator.properties())
 
 # Add LArCollisionTime augmentation tool
 if dumpLArCollisionTime:
@@ -580,8 +582,8 @@ if dumpLArCollisionTime:
         ToolSvc += lArCollisionTimeDecorator
         augmentationTools+=[lArCollisionTimeDecorator]
         if (printIdTrkDxAODConf):
-            print lArCollisionTimeDecorator
-            print lArCollisionTimeDecorator.properties()
+            print(lArCollisionTimeDecorator)
+            print(lArCollisionTimeDecorator.properties())
 
 
 #====================================================================
@@ -606,7 +608,7 @@ if skimmingExpression:
 #  TrigSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "TrigSkimmingTool", expression = minimumbiasTrig)
 #  ToolSvc += TrigSkimmingTool
 #  skimmingTools.append(TrigSkimmingTool)
-#  print "InDetDxAOD.py TrigSkimmingTool: ", TrigSkimmingTool
+#  print("InDetDxAOD.py TrigSkimmingTool: ", TrigSkimmingTool)
 
 #====================================================================
 # Thinning Tools
@@ -670,8 +672,8 @@ IDDerivationSequence += CfgMgr.DerivationFramework__DerivationKernel("DFTSOS_KER
 
 topSequence += IDDerivationSequence 
 if (printIdTrkDxAODConf):
-    print IDDerivationSequence 
-    print IDDerivationSequence.properties()
+    print(IDDerivationSequence )
+    print(IDDerivationSequence.properties())
 
 
 #################
@@ -809,8 +811,8 @@ if dumpTriggerInfo:
         from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
         SlimmingHelper = SlimmingHelper("SlimmingHelper")
         SlimmingHelper.AllVariables += ["HLT_xAOD__ElectronContainer_egamma_Electrons","HLT_xAOD__MuonContainer_MuonEFInfo"]
-        print SlimmingHelper
+        print(SlimmingHelper)
         SlimmingHelper.AppendContentToStream(IDTRKVALIDStream)
 
 if (printIdTrkDxAODConf):
-    print IDTRKVALIDStream
+    print(IDTRKVALIDStream)
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/PixelxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/PixelxAOD.py
index 5b02c262d915..9bce9fe033d9 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/PixelxAOD.py
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/PixelxAOD.py
@@ -52,8 +52,8 @@ from PixelCalibAlgs.PixelCalibAlgsConf import PixelChargeToTConversion
 PixelChargeToTConversionSetter = PixelChargeToTConversion(name = "PixelChargeToTConversionSetter") 
 IDDerivationSequence += PixelChargeToTConversionSetter 
 if (printIdTrkDxAODConf):
-    print PixelChargeToTConversionSetter
-    print PixelChargeToTConversionSetter.properties()
+    print(PixelChargeToTConversionSetter)
+    print(PixelChargeToTConversionSetter.properties())
 
 
 DRAW_ZMUMU_SkimmingTool=None
@@ -74,7 +74,7 @@ if DRAWZSel:
     DRAW_ZMUMU_SkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "DRAW_ZMUMU_SkimmingTool",
                                                                         expression = draw_zmumu)
     ToolSvc += DRAW_ZMUMU_SkimmingTool
-    print DRAW_ZMUMU_SkimmingTool
+    print(DRAW_ZMUMU_SkimmingTool)
 
 
 from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__PixelNtupleMaker
@@ -99,8 +99,8 @@ if InDetFlags.doSLHC():
 
 IDDerivationSequence += xAOD_PixelPrepDataToxAOD
 if (printIdTrkDxAODConf):
-    print xAOD_PixelPrepDataToxAOD
-    print xAOD_PixelPrepDataToxAOD.properties()
+    print(xAOD_PixelPrepDataToxAOD)
+    print(xAOD_PixelPrepDataToxAOD.properties())
 
 
 #################
@@ -136,8 +136,8 @@ DFTSOS = DerivationFramework__TrackStateOnSurfaceDecorator(name = "DFTrackStateO
 ToolSvc += DFTSOS
 augmentationTools+=[DFTSOS]
 if (printIdTrkDxAODConf):
-    print DFTSOS
-    print DFTSOS.properties()
+    print(DFTSOS)
+    print(DFTSOS.properties())
 
 # Add BS error augmentation tool
 if dumpBytestreamErrors:
@@ -149,8 +149,8 @@ if dumpBytestreamErrors:
     ToolSvc += DFEI
     augmentationTools+=[DFEI]
     if (printIdTrkDxAODConf):
-        print DFEI
-        print DFEI.properties()
+        print(DFEI)
+        print(DFEI.properties())
 
 # Add decoration with truth parameters if running on simulation
 #if isIdTrkDxAODSimulation:
@@ -160,7 +160,7 @@ if dumpBytestreamErrors:
 #                                                                        DecorationPrefix = "")
 #    ToolSvc += TruthDecor
 #    augmentationTools.append(TruthDecor)
-#    print TruthDecor
+#    print(TruthDecor)
 
 #====================================================================
 # Skimming Tools
@@ -190,8 +190,8 @@ IDDerivationSequence += CfgMgr.DerivationFramework__DerivationKernel("PixelxAOD_
 
 topSequence += IDDerivationSequence 
 if (printIdTrkDxAODConf):
-    print IDDerivationSequence 
-    print IDDerivationSequence.properties()
+    print(IDDerivationSequence)
+    print(IDDerivationSequence.properties())
 
 #################
 ### Steer output file content
@@ -279,4 +279,4 @@ if dumpTriggerInfo:
     PIXELVALIDStream.AddItem("xAOD::TrigNavigationAuxInfo#TrigNavigationAux.")
 
 if (printIdTrkDxAODConf):
-    print PIXELVALIDStream
+    print(PIXELVALIDStream)
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/SCTxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/SCTxAOD.py
index e4cca7fe4875..a3117719e20c 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/SCTxAOD.py
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/SCTxAOD.py
@@ -1,3 +1,5 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
 #################
 ### Steering options
 #################
-- 
GitLab