From c6dcbe6bb112d190515629c51a16e175d00b8501 Mon Sep 17 00:00:00 2001
From: Zach Marshall <ZLMarshall@lbl.gov>
Date: Fri, 6 Nov 2020 14:00:35 +0100
Subject: [PATCH] Fixing warnings in derivation jobs

This fixes a handful of warnings:

-) From EventInfoCnvTool, when certain truth collections are not
available. This is expected in any job running on EVNT

-) In PrimmaryDPDFlags, some lines were duplicated (completely
identical), leading to a warning when the flags are imported

-) In RecExCommon_flags, athena common flags values were checked
independent of whether they had statusOn. Now the code checks for
statusOn before checking the value of the flag

-) In Reco_tf.py, both digitization and overlay were loading the basic
digitization flags into the transform. Now only the overlay portion does
the loading of these flags.
---
 .../xAODEventInfoCnv/src/EventInfoCnvTool.cxx  |  7 ++++---
 .../PrimaryDPDMaker/python/PrimaryDPDFlags.py  | 13 -------------
 .../RecExCond/share/RecExCommon_flags.py       | 18 ++++++++++--------
 .../RecJobTransforms/scripts/Reco_tf.py        |  4 ++--
 4 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvTool.cxx b/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvTool.cxx
index bac247aea3a1..11763c8887b8 100644
--- a/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvTool.cxx
+++ b/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvTool.cxx
@@ -77,9 +77,10 @@ namespace xAODMaker {
       if( detStore()->contains< AthenaAttributeList >( INDET_BEAMPOS ) ) {
          m_beamCondSvcAvailable = true;
       } else {
-         ATH_MSG_WARNING( "Beam conditions service not available" );
-         ATH_MSG_WARNING( "Will not fill beam spot information into "
-                          "xAOD::EventInfo" );
+         // This is normal in some cases, but tell the user anyway
+         ATH_MSG_INFO( "Beam conditions service not available" );
+         ATH_MSG_INFO( "Will not fill beam spot information into "
+                       "xAOD::EventInfo" );
          m_beamCondSvcAvailable = false;
       }
       if(m_disableBeamSpot){
diff --git a/PhysicsAnalysis/PrimaryDPDMaker/python/PrimaryDPDFlags.py b/PhysicsAnalysis/PrimaryDPDMaker/python/PrimaryDPDFlags.py
index bde8beb00ab8..c086a7c36e3a 100644
--- a/PhysicsAnalysis/PrimaryDPDMaker/python/PrimaryDPDFlags.py
+++ b/PhysicsAnalysis/PrimaryDPDMaker/python/PrimaryDPDFlags.py
@@ -515,19 +515,6 @@ class WriteDAOD_SCTVALIDStream(JobProperty):
 jobproperties.PrimaryDPDFlags.add_JobProperty(WriteDAOD_SCTVALIDStream)
 listRAWtoDPD.append(WriteDAOD_SCTVALIDStream.StreamName)
 
-class WriteDAOD_PIXELVALIDStream(JobProperty):
-    """ Produce the DPD for DAOD_PIXELVALID - AOD with PrepRawData """
-    statusOn     = True
-    allowedTypes = ['bool']
-    StoredValue  = False
-    StreamName   = "StreamDAOD_PIXELVALID"
-    FileName     = ""
-    isVirtual      = False
-    DPDMakerScript = "InDetPrepRawDataToxAOD/PixelxAOD.py"
-    pass
-jobproperties.PrimaryDPDFlags.add_JobProperty(WriteDAOD_PIXELVALIDStream)
-listRAWtoDPD.append(WriteDAOD_PIXELVALIDStream.StreamName)
-
 class WriteDAOD_IDTIDEStream(JobProperty):
     """ Produce the DPD for DAOD_IDTIDE - AOD with PrepRawData """
     statusOn     = True
diff --git a/Reconstruction/RecExample/RecExCond/share/RecExCommon_flags.py b/Reconstruction/RecExample/RecExCond/share/RecExCommon_flags.py
index 02a7462d2b73..c4c508aece8f 100755
--- a/Reconstruction/RecExample/RecExCond/share/RecExCommon_flags.py
+++ b/Reconstruction/RecExample/RecExCond/share/RecExCommon_flags.py
@@ -465,14 +465,16 @@ else:
           jobproperties.set_JobProperties(data)
        else:   
           i_value=RecExCommonFlags.get(i)
-          jpvalue = getattr(jobproperties.AthenaCommonFlags, i)()
-          if i!="PoolRDOInput":
-            if i_value!=jpvalue:
-               logRecExCommon_flags.info('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
-          else:   
-            if i_value!=jpvalue:
-               logRecExCommon_flags.info ('Modified value for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
-
+          if getattr(jobproperties.AthenaCommonFlags, i).statusOn:
+              jpvalue = getattr(jobproperties.AthenaCommonFlags, i)()
+              if i!="PoolRDOInput":
+                if i_value!=jpvalue:
+                   logRecExCommon_flags.info('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
+              else:
+                if i_value!=jpvalue:
+                   logRecExCommon_flags.info ('Modified value for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
+          else:
+              logRecExCommon_flags.info('Modified value for flag %s new flag: unset, old flag %s',i,i_value)
 
 # some special migration (temporary)
 if rec.doFloatingPointException() and not athenaCommonFlags.isOnline():
diff --git a/Reconstruction/RecJobTransforms/scripts/Reco_tf.py b/Reconstruction/RecJobTransforms/scripts/Reco_tf.py
index 958cb866868f..759fb5f43721 100755
--- a/Reconstruction/RecJobTransforms/scripts/Reco_tf.py
+++ b/Reconstruction/RecJobTransforms/scripts/Reco_tf.py
@@ -65,9 +65,9 @@ def getTransform(RAWtoALL=False):
     # For digi step - make sure we can add the digitisation/simulation arguments
     # before we add this substep; allows Reco_tf to work without AtlasSimulation
     try:
-        from SimuJobTransforms.simTrfArgs import addForwardDetTrfArgs, addBasicDigiArgs, addPileUpTrfArgs, addCommonSimDigTrfArgs
+        from SimuJobTransforms.simTrfArgs import addForwardDetTrfArgs, addPileUpTrfArgs, addCommonSimDigTrfArgs
         from SimuJobTransforms.SimTransformUtils import addDigitizationSubstep
-        addBasicDigiArgs(trf.parser)
+        # NB "Basic Digi Args" are added by the overlay setup below, so no need for addBasicDigiArgs here
         addForwardDetTrfArgs(trf.parser)
         addPileUpTrfArgs(trf.parser)
         addCommonSimDigTrfArgs(trf.parser)
-- 
GitLab