diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/CMakeLists.txt
index dc849b86d410df7d235641db39225def0303e973..f7de71e2dbd46b4cc7b484931b34d220abcd51d7 100644
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/CMakeLists.txt
+++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/CMakeLists.txt
@@ -1,6 +1,4 @@
-################################################################################
-# Package: egammaD3PDAnalysis
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( egammaD3PDAnalysis )
@@ -9,8 +7,7 @@ atlas_subdir( egammaD3PDAnalysis )
 atlas_add_component( egammaD3PDAnalysis
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES CaloClusterCorrectionLib CaloEvent CaloGeoHelpers CaloRecLib AthContainers AthenaBaseComps AthenaKernel EventKernel xAODCaloEvent xAODEgamma xAODTruth GaudiKernel LArCablingLib D3PDMakerUtils MCTruthClassifierLib RecoToolInterfaces egammaEvent TrkCaloExtension VxVertex egammaInterfacesLib )
+                     LINK_LIBRARIES AthContainers AthenaBaseComps AthenaKernel CaloEvent CaloGeoHelpers D3PDMakerInterfaces EventKernel GaudiKernel LArCablingLib MCTruthClassifierLib RecoToolInterfaces StoreGateLib TrkCaloExtension egammaInterfacesLib xAODCaloEvent xAODEgamma xAODTruth )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/python/TileGapSelectionGetter.py b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/python/TileGapSelectionGetter.py
index b0820af63f4f77cdf3620230bfaaa337876816b7..89f3ad6f8c518255915d4b139e2f1b0a5383e403 100644
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/python/TileGapSelectionGetter.py
+++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/python/TileGapSelectionGetter.py
@@ -1,6 +1,5 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-# $Id$
 #
 # @file egammaD3PDAnalysis/python/TileGapSelectionGetter.py
 # @author scott snyder <snyder@bnl.gov>
@@ -53,7 +52,7 @@ class TileGapSelectionGetter ( Configured )  :
 
             self._handle = alg
 
-        except:
+        except Exception:
             mlog.error ("Error configuring TileGapSelectionAlg.")
             traceback.print_exc()
 
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/python/egammaTruthParticleConfig.py b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/python/egammaTruthParticleConfig.py
index eb659e62ebbbbf90fdf7100a58491ebb593fb23c..6fd9a3d84675bee31bd612ee360d08afd1600146 100644
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/python/egammaTruthParticleConfig.py
+++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDAnalysis/python/egammaTruthParticleConfig.py
@@ -1,6 +1,5 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-# $Id$
 #
 # @file egammaD3PDAnalysis/python/egammaTruthParticleConfig.py
 # @author scott snyder <snyder@bnl.gov>
@@ -11,12 +10,10 @@
 
 
 import egammaD3PDAnalysis
-import D3PDMakerCoreComps
 from D3PDMakerConfig.D3PDMakerFlags           import D3PDMakerFlags
-from McParticleAlgs.JobOptCfg                 import createMcAodBuilder
-from RecExConfig.RecFlags                     import rec
 from AthenaCommon.AlgSequence                 import AlgSequence
 from RecExConfig.ObjKeyStore                  import cfgKeyStore
+from RecExConfig.RecFlags                     import rec
 from AthenaCommon                             import CfgMgr
 
 
@@ -36,7 +33,6 @@ def egammaTruthParticleConfig \
 
     algname = prefix + sgkey + 'Builder'
     if not hasattr (seq, algname):
-        import AthenaCommon.CfgMgr as CfgMgr
         from egammaRec.Factories import ToolFactory
         exten = ToolFactory (CfgMgr.Trk__ParticleCaloExtensionTool,
                              name="GSFParticleCaloExtensionTool",
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/CMakeLists.txt
index eda4cfa902c5d48645cfca197515d776be62559f..8b4a3693da9ae2de615814923b2ce5988221285a 100644
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/CMakeLists.txt
+++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/CMakeLists.txt
@@ -1,6 +1,4 @@
-################################################################################
-# Package: egammaD3PDMaker
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( egammaD3PDMaker )
@@ -13,9 +11,8 @@ atlas_add_component( egammaD3PDMaker
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} 
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib CaloIdentifier AthenaKernel Navigation StoreGateLib SGtests EventKernel FourMomUtils xAODBase xAODCaloEvent xAODEgamma xAODJet xAODTracking xAODTruth GaudiKernel AnalysisTriggerEvent D3PDMakerUtils TriggerD3PDMakerLib MCTruthClassifierLib egammaEvent TrkParameters TrkExInterfaces TrkVertexFitterInterfaces TrigObjectMatchingLib TrigCaloEvent TrigInDetEvent TrigParticle CaloTrackingGeometryLib )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib CaloIdentifier AthenaKernel Navigation StoreGateLib EventKernel FourMomUtils xAODBase xAODCaloEvent xAODEgamma xAODJet xAODTracking xAODTruth GaudiKernel AnalysisTriggerEvent D3PDMakerInterfaces D3PDMakerUtils TriggerD3PDMakerLib MCTruthClassifierLib egammaEvent TrkParameters TrkExInterfaces TrkVertexFitterInterfaces CaloTrackingGeometryLib )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
-
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/CorrectionClusterD3PDObject.py b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/CorrectionClusterD3PDObject.py
index cce388f2d6b86d2e12ea40e0a04e8e51a2fc3cbf..2528bbe8c2e414d4bbe56bd8c6228cc2b510f484 100644
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/CorrectionClusterD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/CorrectionClusterD3PDObject.py
@@ -1,6 +1,5 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-# $Id$
 #
 # @file egammaD3PDMaker/python/CorrectionClusterD3PDObject.py
 # @author scott snyder <snyder@bnl.gov>
@@ -11,15 +10,10 @@
 
 
 from D3PDMakerCoreComps.D3PDObject    import make_SGDataVector_D3PDObject
-from D3PDMakerCoreComps               import SGObjGetterTool
-from D3PDMakerConfig.D3PDMakerFlags   import D3PDMakerFlags
 from egammaD3PDAnalysis.TileGapConfig import TileGapConfig
 from D3PDMakerCoreComps.D3PDObject    import DeferArg
-from D3PDMakerCoreComps.resolveSGKey  import resolveSGKey
-from AthenaCommon.AlgSequence         import AlgSequence
 import EventCommonD3PDMaker
 import D3PDMakerCoreComps
-import egammaD3PDMaker
 import CaloD3PDMaker
 
 
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/CorrectionClusterGetter.py b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/CorrectionClusterGetter.py
index 7b5f30e44bf5c4e6ab396359cd1865d8677b969e..31fd018d9f3c8e7c98fd7d90a4fbe09219057410 100644
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/CorrectionClusterGetter.py
+++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/CorrectionClusterGetter.py
@@ -99,13 +99,13 @@ def make_CorrectionClusterGetter (typ, eta_size, phi_size,
     else:
         sizekey = "%d%d" % (eta_size, phi_size)
 
-    if output_key == None:
+    if output_key is None:
         output_key = name_base + typ + sizekey + suffix
 
-    if algname == None:
+    if algname is None:
         algname = output_key
 
-    if copier_name == None:
+    if copier_name is None:
         copier_name = algname + '_copier'
 
     key = typ
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/ElectronD3PDObject.py b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/ElectronD3PDObject.py
index a7327726cea8d7cb11c1e2544c06a84a2066f954..b0df9756add61c847cd62f4553852f78da7f40d2 100644
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/ElectronD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/ElectronD3PDObject.py
@@ -7,18 +7,15 @@
 # @brief Configure electron D3PD object.
 #
 
-from egammaD3PDMaker.defineBlockAndAlg   \
-     import defineAlgLODFunc, defineBlockAndAlg
+from egammaD3PDMaker.defineBlockAndAlg      import defineBlockAndAlg
 from EventCommonD3PDMaker.DRAssociation     import DRAssociation
 from TrackD3PDMaker.xAODTrackSummaryFiller  import xAODTrackSummaryFiller
 from D3PDMakerCoreComps.D3PDObject          import make_SGDataVector_D3PDObject
 from D3PDMakerCoreComps.D3PDObject          import DeferArg
-from D3PDMakerCoreComps.SimpleAssociation   import SimpleAssociation, IdentityAssociation
-from D3PDMakerCoreComps.IndexAssociation    import IndexAssociation
+from D3PDMakerCoreComps.SimpleAssociation   import SimpleAssociation
 from D3PDMakerCoreComps.IndexMultiAssociation import IndexMultiAssociation
-from D3PDMakerCoreComps.resolveSGKey        import resolveSGKey, testSGKey
+from D3PDMakerCoreComps.resolveSGKey        import testSGKey
 from D3PDMakerConfig.D3PDMakerFlags         import D3PDMakerFlags
-# from TriggerD3PDMaker.defineTriggerBits     import defineTriggerBits
 from RecExConfig.RecFlags                   import rec
 import egammaD3PDMaker
 import EventCommonD3PDMaker
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/GSFElectronD3PDObject.py b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/GSFElectronD3PDObject.py
deleted file mode 100644
index 740cf17002f4d76520e4409b7b6d59cc8bee00ce..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/GSFElectronD3PDObject.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# $Id: GSFElectronD3PDObject.py 523036 2012-10-24 15:50:12Z ssnyder $
-#
-# @file egammaD3PDMaker/python/GSFElectronD3PDObject.py
-# @author scott snyder <snyder@bnl.gov>
-# @date 2009
-# @brief Configure GSF electron D3PD object.
-#
-
-from egammaD3PDMaker.defineBlockAndAlg      import defineBlockAndAlg
-from D3PDMakerCoreComps.D3PDObject          import DeferArg
-from D3PDMakerCoreComps.resolveSGKey        import resolveSGKey
-from D3PDMakerConfig.D3PDMakerFlags         import D3PDMakerFlags
-from AthenaCommon.AlgSequence               import AlgSequence
-from RecExConfig.RecFlags                   import rec
-import egammaD3PDMaker
-import egammaD3PDAnalysis
-import EventCommonD3PDMaker
-import D3PDMakerCoreComps
-
-
-from egammaD3PDMaker.ElectronD3PDObject import ElectronD3PDObject
-
-GSFElectronD3PDObject = ElectronD3PDObject.copy()
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/PhotonD3PDObject.py b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/PhotonD3PDObject.py
index 8362699959afc550a148bc67a4b6ab73cfc4d246..fbf504ce8a1cf20e37085bac4469c387ea1968bd 100644
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/PhotonD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/PhotonD3PDObject.py
@@ -7,26 +7,18 @@
 # @brief Configure photon D3PD object.
 #
 
-
-# from egammaD3PDMaker.isem_version            import isem_version
-from egammaD3PDMaker.defineBlockAndAlg   \
-     import defineAlgLODFunc, defineBlockAndAlg
+from egammaD3PDMaker.defineBlockAndAlg       import defineBlockAndAlg
 from EventCommonD3PDMaker.DRAssociation      import DRAssociation
 from D3PDMakerCoreComps.D3PDObject           import make_SGDataVector_D3PDObject
 from D3PDMakerCoreComps.D3PDObject           import DeferArg
 from D3PDMakerCoreComps.SimpleAssociation    import SimpleAssociation
-# from D3PDMakerCoreComps.IndexAssociation     import IndexAssociation
 from D3PDMakerConfig.D3PDMakerFlags          import D3PDMakerFlags
-from D3PDMakerCoreComps.resolveSGKey         import resolveSGKey, testSGKey
+from D3PDMakerCoreComps.resolveSGKey         import testSGKey
 from TrackD3PDMaker.xAODTrackSummaryFiller   import xAODTrackSummaryFiller
 from D3PDMakerCoreComps.ContainedVectorMultiAssociation import ContainedVectorMultiAssociation
-# from TriggerD3PDMaker.defineTriggerBits      import defineTriggerBits
-# from AthenaCommon.AlgSequence                import AlgSequence
 from RecExConfig.RecFlags                    import rec
 import egammaD3PDMaker
-# import egammaD3PDAnalysis
 import EventCommonD3PDMaker
-# import CaloD3PDMaker
 import D3PDMakerCoreComps
 import TruthD3PDMaker
 import TrackD3PDMaker
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/egammaTriggerBitsD3PDObject.py b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/egammaTriggerBitsD3PDObject.py
deleted file mode 100644
index b3b24424b85414c75e65d46c68cf2b6ff35bc143..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/egammaTriggerBitsD3PDObject.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# $Id$
-#
-# @file  egammaD3PDMaker/python/egammaTriggerBitsD3PDObject.py
-# @author  Haifeng Li <Haifeng.Li@cern.ch>, sss
-# @date    Sep, 2009
-# @brief   Define trigger bit blocks for egamma.
-#
-
-
-import D3PDMakerCoreComps
-import TriggerD3PDMaker
-from D3PDMakerCoreComps.D3PDObject  import make_Void_D3PDObject
-from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
-
-
-# Create the object type.
-egammaTriggerBitsD3PDObject = \
-  make_Void_D3PDObject (default_name = 'egammaTriggerBitsFiller')
-
-
-#
-# The egamma trigger bits are now added in ElectronD3PDObject and
-# PhotonD3PDObject; this file is kept just for backwards compatibility.
-#
diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/egammaTruthD3PDObject.py b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/egammaTruthD3PDObject.py
index f1e7f3ebcfb7d7b24f090b84f7edfe6e605fb828..4dd8811b9da9a2626c11829aa9e0640aa6de1216 100644
--- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/egammaTruthD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/python/egammaTruthD3PDObject.py
@@ -1,6 +1,5 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-# $Id$
 #
 # @file egammaD3PDMaker/python/egammaTruthD3PDObject.py
 # @author scott snyder <snyder@bnl.gov>
@@ -20,7 +19,6 @@ from D3PDMakerCoreComps.SimpleAssociation   import SimpleAssociation
 import D3PDMakerCoreComps
 import EventCommonD3PDMaker
 import TruthD3PDMaker
-import egammaD3PDAnalysis
 
 
 #FIXME: