diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/CMakeLists.txt
index 3d9ab004df548d5272481cba205f6b6ece841e42..ec53ce1d2b03e0ecc7690a5bf578f629efc31e0b 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/CMakeLists.txt
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/CMakeLists.txt
@@ -16,6 +16,6 @@ atlas_add_component( TruthD3PDMaker
                      LINK_LIBRARIES ${Boost_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel Navigation EventInfo xAODTruth GaudiKernel GeneratorObjects TruthUtils D3PDMakerInterfaces D3PDMakerUtils TruthD3PDAnalysisLib MCTruthClassifierLib McParticleEvent McParticleKernel JetEvent TrkToolInterfaces GenInterfacesLib )
 
 # 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/TruthD3PDMaker/python/Atlfast1ElectronD3PDObject.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1ElectronD3PDObject.py
index 8cc3725ea955a16eb12afb07730330b9811037a0..111afefc8002b6f98c69f9564bcfbe620b378131 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1ElectronD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1ElectronD3PDObject.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
 
-from egammaD3PDMaker.isem_version          import isem_version
 from EventCommonD3PDMaker.DRAssociation    import DRAssociation
 from D3PDMakerCoreComps.D3PDObject         import make_SGDataVector_D3PDObject
 from D3PDMakerCoreComps.SimpleAssociation  import SimpleAssociation
@@ -9,10 +8,7 @@ from TruthD3PDMaker.Atlfast1D3PDMakerFlags import Atlfast1D3PDMakerFlags
 from RecExConfig.RecFlags                  import rec
 import egammaD3PDMaker
 import EventCommonD3PDMaker
-import D3PDMakerCoreComps
 
-from ROOT import egammaParameters
-from ROOT import egammaPID
 
 Atlfast1ElectronD3PDObject = \
            make_SGDataVector_D3PDObject ('ElectronContainer',
@@ -29,7 +25,7 @@ Atlfast1ElectronD3PDObject.defineBlock (0, 'Charge',
                                         EventCommonD3PDMaker.ChargeFillerTool)
 
 if rec.doTruth():
-    import TruthD3PDMaker.MCTruthClassifierConfig
+    import TruthD3PDMaker.MCTruthClassifierConfig  # noqa: F401 (import side-effect)
     Atlfast1ElectronD3PDObject.defineBlock (1, 'TruthClassification',
                                             egammaD3PDMaker.egammaTruthClassificationFillerTool)
     Atlfast1ElectronGenPartAssoc = SimpleAssociation \
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1MissingETD3PDObject.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1MissingETD3PDObject.py
index adbb5738cb1993249a05b98cd77c9a2d4bc97163..6cf07a528921bae8e92182beca426b39687b29d1 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1MissingETD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1MissingETD3PDObject.py
@@ -1,11 +1,9 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 import MissingETD3PDMaker
-import D3PDMakerCoreComps
-from D3PDMakerCoreComps.D3PDObject import D3PDObject
 from D3PDMakerCoreComps.D3PDObject import make_SG_D3PDObject
 from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
-from MissingETD3PDMaker.MissingETD3PDMakerFlags import *
+from MissingETD3PDMaker.MissingETD3PDMakerFlags import MissingETD3PDMakerFlags
 
 Atlfast1MissingETD3PDObject = \
                       make_SG_D3PDObject ('MissingET',
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1PhotonD3PDObject.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1PhotonD3PDObject.py
index 61a009a401408fe779cbd711b1dbd2f1c491a819..3fdcefad52f9fd7d845c35caad039be87c4bd6b6 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1PhotonD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/Atlfast1PhotonD3PDObject.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
 
-from egammaD3PDMaker.isem_version          import isem_version
 from EventCommonD3PDMaker.DRAssociation    import DRAssociation
 from D3PDMakerCoreComps.D3PDObject         import make_SGDataVector_D3PDObject
 from D3PDMakerCoreComps.SimpleAssociation  import SimpleAssociation
@@ -9,10 +8,6 @@ from TruthD3PDMaker.Atlfast1D3PDMakerFlags import Atlfast1D3PDMakerFlags
 from RecExConfig.RecFlags                  import rec
 import egammaD3PDMaker
 import EventCommonD3PDMaker
-import D3PDMakerCoreComps
-
-from ROOT import egammaParameters
-from ROOT import egammaPID
 
 
 Atlfast1PhotonD3PDObject = \
@@ -28,7 +23,7 @@ Atlfast1PhotonD3PDObject.defineBlock (0, 'Kinematics',
                                       WriteRect = True)
 
 if rec.doTruth():
-    import TruthD3PDMaker.MCTruthClassifierConfig
+    import TruthD3PDMaker.MCTruthClassifierConfig  # noqa: F401 (import side-effect)
     Atlfast1PhotonD3PDObject.defineBlock (1, 'TruthClassification',
                                           egammaD3PDMaker.egammaTruthClassificationFillerTool)
     Atlfast1PhotonGenPartAssoc = SimpleAssociation \
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenEventD3PDObject.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenEventD3PDObject.py
index 89e6bb49ff9e9a0cc947e58d5e0d1a6619bc7028..aa69372d00552fd0569b21f903da5a67eb67c548 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenEventD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenEventD3PDObject.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 #
 ## @file TruthD3PDMaker/python/GenParticleD3PDObject.py
@@ -7,8 +7,6 @@
 ## @date Nov, 2010
 ##
 
-from AthenaCommon.AppMgr import ToolSvc
-
 import TruthD3PDMaker
 
 import D3PDMakerCoreComps
@@ -17,7 +15,6 @@ from D3PDMakerConfig.D3PDMakerFlags  import D3PDMakerFlags
 
 from TruthD3PDAnalysis.AllTruthFilterTool import AllTruthFilterTool
 from TruthD3PDMaker.TruthD3PDMakerKeys import TruthD3PDKeys
-from TruthD3PDMaker.TruthD3PDMakerFlags import TruthD3PDFlags
 
 def make_GenEvent_D3PDObject( default_prefix, default_sgkey,
                               default_object_name = "",
@@ -28,9 +25,9 @@ def make_GenEvent_D3PDObject( default_prefix, default_sgkey,
                   getter = None, sgkey = None, filter = default_filter,
                   label = default_label, **kw ):
 
-        if sgkey == None: sgkey = default_sgkey
-        if label == None: label = TruthD3PDKeys.GenEventGetterLabel()
-        if getter == None:
+        if sgkey is None: sgkey = default_sgkey
+        if label is None: label = TruthD3PDKeys.GenEventGetterLabel()
+        if getter is None:
             getter = TruthD3PDMaker.GenEventGetterTool( name + '_Getter',
                                                         Label = label,
                                                         Selector = filter,
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenParticleD3PDObject.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenParticleD3PDObject.py
index d1c4ecb0614b43ce73f49e6581c05cb09d63491f..410fa23e6a5862c9c537bd5b67e917a688f1a254 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenParticleD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenParticleD3PDObject.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 #
 ## @file TruthD3PDMaker/python/GenParticleD3PDObject.py
@@ -31,9 +31,9 @@ def make_GenParticle_D3PDObject( default_prefix, default_sgkey,
                   getter = None, sgkey = None, filter = default_filter,
                   label = default_label, **kw ):
 
-        if sgkey == None: sgkey = default_sgkey
-        if label == None: label = prefix
-        if getter == None:
+        if sgkey is None: sgkey = default_sgkey
+        if label is None: label = prefix
+        if getter is None:
             getter = TruthD3PDMaker.GenParticleGetterTool (name + "_Getter",
                                                            Label = label,
                                                            SGKey = sgkey,
@@ -62,14 +62,14 @@ GenParticleD3PDObject = make_GenParticle_D3PDObject( TruthD3PDKeys.GenParticlePr
 GenParticleD3PDObject.defineBlock( 0, 'GenParticle',
                                    TruthD3PDMaker.GenParticleFillerTool )
 
-if TruthD3PDFlags.GenEventAssocLabel() != None and TruthD3PDFlags.GenEventAssocLabel() != "": 
+if TruthD3PDFlags.GenEventAssocLabel() is not None and TruthD3PDFlags.GenEventAssocLabel() != "":
     GenPartEventAssoc = IndexAssociation( GenParticleD3PDObject,
                                           TruthD3PDMaker.GenParticleEventAssociationTool,
                                           TruthD3PDFlags.GenEventAssocLabel(),
                                           blockname = "GenPartEventAssoc",
                                           prefix = 'mcevt_' )
 
-if TruthD3PDFlags.GenVertexAssocLabel() != None and TruthD3PDFlags.GenVertexAssocLabel() != "":
+if TruthD3PDFlags.GenVertexAssocLabel() is not None and TruthD3PDFlags.GenVertexAssocLabel() != "":
     GenPartProdVertexAssoc = IndexAssociation( GenParticleD3PDObject,
                                                TruthD3PDMaker.GenParticleVertexAssociationTool,
                                                TruthD3PDFlags.GenVertexAssocLabel(),
@@ -91,7 +91,7 @@ if TruthD3PDFlags.GenParticleMother():
                                                 prefix = 'mother_',
                                                 InParticles = True)
 
-if TruthD3PDFlags.GenVertexAssocLabel() != None and TruthD3PDFlags.GenVertexAssocLabel() != "":
+if TruthD3PDFlags.GenVertexAssocLabel() is not None and TruthD3PDFlags.GenVertexAssocLabel() != "":
     GenPartDecayVertexAssoc = IndexAssociation( GenParticleD3PDObject,
                                                 TruthD3PDMaker.GenParticleVertexAssociationTool,
                                                 TruthD3PDFlags.GenVertexAssocLabel(),
@@ -113,7 +113,7 @@ if TruthD3PDFlags.GenParticleChild():
                                                prefix = 'child_',
                                                InParticles = False )
 
-if TruthD3PDFlags.TruthTrackAssocLabel() != None and TruthD3PDFlags.TruthTrackAssocLabel() != "":
+if TruthD3PDFlags.TruthTrackAssocLabel() is not None and TruthD3PDFlags.TruthTrackAssocLabel() != "":
     GenPartTruthTrackAssoc = IndexAssociation( GenParticleD3PDObject,
                                                TruthD3PDMaker.GenParticleParticleAssociationTool,
                                                TruthD3PDFlags.TruthTrackAssocLabel(),
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenVertexD3PDObject.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenVertexD3PDObject.py
index 7e5462cda3ec6c1c17cc1066d24146f34044255c..035d510283a6ca12a12b2e6054c2925e55f1a7f2 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenVertexD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/GenVertexD3PDObject.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 #
 ## @file TruthD3PDMaker/python/GenParticleD3PDObject.py
@@ -29,9 +29,9 @@ def make_GenVertex_D3PDObject( default_prefix, default_sgkey,
                   getter = None, sgkey = None, filter = default_filter,
                   label = default_label, **kw ):
 
-        if sgkey == None: sgkey = default_sgkey
-        if label == None: label = TruthD3PDKeys.GenVertexGetterLabel()
-        if getter == None:
+        if sgkey is None: sgkey = default_sgkey
+        if label is None: label = TruthD3PDKeys.GenVertexGetterLabel()
+        if getter is None:
             getter = TruthD3PDMaker.GenVertexGetterTool( name + '_Getter',
                                                          Label = label,
                                                          Selector = filter,
@@ -60,7 +60,7 @@ GenVertexD3PDObject.defineBlock( 0,
                                  TruthD3PDMaker.GenVertexFillerTool,
                                  WriteID=TruthD3PDFlags.WriteTruthVertexIDs() )
 
-if TruthD3PDFlags.GenParticleAssocLabel() != None and TruthD3PDFlags.GenParticleAssocLabel() != "":
+if TruthD3PDFlags.GenParticleAssocLabel() is not None and TruthD3PDFlags.GenParticleAssocLabel() != "":
     if TruthD3PDFlags.GenVertexInPartAssoc():
         GenVertexPartInAssoc = \
            IndexMultiAssociation( GenVertexD3PDObject,
@@ -79,7 +79,7 @@ if TruthD3PDFlags.GenParticleAssocLabel() != None and TruthD3PDFlags.GenParticle
                                   prefix = 'outpart_',
                                   InParticles = False )
 
-if TruthD3PDFlags.GenEventAssocLabel() != None and TruthD3PDFlags.GenEventAssocLabel() != "": 
+if TruthD3PDFlags.GenEventAssocLabel() is not None and TruthD3PDFlags.GenEventAssocLabel() != "":
     GenVertexEventAssoc = IndexAssociation( GenVertexD3PDObject,
                                             TruthD3PDMaker.GenVertexEventAssociationTool,
                                             TruthD3PDFlags.GenEventAssocLabel(),
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/HforConfig.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/HforConfig.py
index ac8720e1ec515bebbb7fcca451fc3a38fdc3f8a4..58e38bb33173dc66efc08ce0a6c273a557bfc112 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/HforConfig.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/HforConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 class HforConfig:
     """
@@ -35,7 +35,6 @@ class HforConfig:
         self.getConfigFile(runArgs, filepath)
         self.getDSID(runArgs)
         self.getHforType()
-        #self.checkConsistency()
         return self.config_String
 
 
@@ -50,12 +49,11 @@ class HforConfig:
         """
 
         #Identify Hfor type
-        from AthenaCommon.Utils.unixtools import FindFile
-        import sys, os
+        import sys
 
         try:
             self.file = open(filepath)
-        except:
+        except Exception:
             currentError = "Exiting. Configuration file should be in "+str(filepath)
             self.hforLog.error(currentError)
             sys.exit(0)
@@ -87,7 +85,7 @@ class HforConfig:
                 try:
                     #try to get the DSID from runArgs
                     self.curr_DSID = runArgs.RunNumber
-                except:
+                except Exception:
                     #if cannot access runargs parse input file name for DSID
                     if len(self.fList) != 0:
                         files = self.fList 
@@ -98,7 +96,7 @@ class HforConfig:
                                 self.curr_DSID = firstFile[index+1]
                         try:
                             int(self.curr_DSID)
-                        except:
+                        except Exception:
                             self.hforLog.error("Could not find DSID from filename. The Hfor tool will not be correctly configured! Have you obeyed the naming convention?")
                             self.curr_DSID = 0
 
@@ -139,33 +137,3 @@ class HforConfig:
 
             if self.config_String == "fail":
                 self.hforLog.warning("failed to find DSID in configuration file. Hfor has not been activated. Does this sample require Hfor? ")
-
-
-
-
-    def checkConsistency(self):
-            """
-            Checks that all the files have the same DSID
-            Currently not used - remove?
-
-            """
-            import re
-
-
-            #check that all samples are of the same Hfor type otherwise exit
-            #What to do in case of runArgs being used?
-            for newfile in self.fList:
-                tmp2 = newfile.split(".")
-                for index, x in enumerate(tmp2):
-                    if re.search('mc[1234567890]{2}', x) is not None:
-                        thisDSID = index
-
-                try:
-                    if proc_dict[tmp2[thisDSID+1]] != self.config_String:
-                        self.hforLog.error("This tool must be used with samples of the same Hfor type. Terminating now")
-                        sys.exit(0)
-                except:
-                    
-                    self.hforLog.error("failure when checking if all DSIDs are of same type")
-
-
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/PartonJetConfig.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/PartonJetConfig.py
index b46163c34a40778ad7738cb28e051556834bf971..32577c8e7ad349cffa7c3c3bc796ca0aaf3e0839 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/PartonJetConfig.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/PartonJetConfig.py
@@ -9,19 +9,11 @@
 #        Reconstruction/Jet/JetSimTools/PartonTruthJets_jobOptions.py
 #
 
-
-import EventCommonD3PDMaker
-from D3PDMakerConfig.D3PDMakerFlags           import D3PDMakerFlags
-from AthenaCommon.AlgSequence                 import AlgSequence
+from AthenaCommon.SystemOfUnits import GeV
 from RecExConfig.ObjKeyStore                  import cfgKeyStore
 from RecExConfig.RecFlags                     import rec
 
-from JetRec.JetMomentGetter import make_JetMomentGetter
-from JetRec.JetGetters import *  
-
-from AthenaCommon.SystemOfUnits import MeV, GeV
-from JetRec.JetRecConf import JetAlgorithm
-
+from JetRec.JetGetters import make_StandardJetGetter
 from JetSimTools.JetSimToolsConf import JetPartonSelectorTool
 
 def PartonJetConfig (finder    = 'AntiKt',
@@ -50,11 +42,10 @@ def PartonJetConfig (finder    = 'AntiKt',
     jetPartonSelectorTool.DoPythia = doPythia
     jetPartonSelectorTool.DoHerwig = doHerwig
     jetPartonSelectorTool.max_absEta = absEtaMax
-    #jetPartonSelectorTool.OutputLevel = INFO
     ToolSvc += jetPartonSelectorTool
 
     # Configure jets builder
-    if inputCollections != None:
+    if inputCollections is not None:
         partonJetAlg = make_StandardJetGetter(finder,size,'Truth',inputSuff='Parton'+suffix,
                                               inputCollectionNames=inputCollections,
                                               inputTools=[jetPartonSelectorTool]).jetAlgorithmHandle()
@@ -63,7 +54,5 @@ def PartonJetConfig (finder    = 'AntiKt',
     else:
         partonJetAlg = make_StandardJetGetter(finder,size,'Truth',inputSuff='Parton'+suffix).jetAlgorithmHandle()
     partonJetAlg.AlgTools['JetFinalPtCut'].MinimumSignal = minJetPt
-    #partonJetAlg.AlgTools['InputToJet'].InputSelector = jetPartonSelectorTool
-    #partonJetAlg.OutputLevel = INFO
 
     return
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/PileUpInfoD3PDObject.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/PileUpInfoD3PDObject.py
index b0b4c96010ecd0d9b801e7312a9aec255cacadc5..1a29127936b9944ea765595eb3275816248897d8 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/PileUpInfoD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/PileUpInfoD3PDObject.py
@@ -1,10 +1,7 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 import TruthD3PDMaker
-import D3PDMakerCoreComps
-from D3PDMakerCoreComps.D3PDObject import *
-from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
-from TruthD3PDMaker.TruthD3PDMakerConf import *
+from D3PDMakerCoreComps.D3PDObject import make_SG_D3PDObject
 from D3PDMakerCoreComps.ContainedVectorMultiAssociation import ContainedVectorMultiAssociation
 
 
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthJetD3PDObject.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthJetD3PDObject.py
index e3b5b17e614377f5739fb9e1f6a611744c8739ee..c8d57d3a164a94700fe291ccacd0b6e77456d34c 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthJetD3PDObject.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthJetD3PDObject.py
@@ -1,9 +1,7 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-import D3PDMakerCoreComps
 import EventCommonD3PDMaker
 import JetD3PDMaker
-from D3PDMakerCoreComps.D3PDObject      import D3PDObject
 from D3PDMakerCoreComps.D3PDObject      import make_SGDataVector_D3PDObject
 from D3PDMakerConfig.D3PDMakerFlags     import D3PDMakerFlags
 from RecExConfig.RecFlags               import rec
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthJetFilterConfig.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthJetFilterConfig.py
index dd93bf3c72a3d3f45298dfb7a6e83fd33196358c..c19a5236101c5f7be99096add7574dc042aaf5fc 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthJetFilterConfig.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthJetFilterConfig.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 TruthD3PDMaker/python/TruthJetFilterConfig.py
 # @author Renaud Bruneliere <Renaud.Bruneliere@cern.ch>
@@ -8,11 +7,9 @@
 # @brief Build truth container to be used for parton-jet building
 #
 
-import EventCommonD3PDMaker
 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 AthenaCommon                             import CfgMgr
 from TruthD3PDMaker.TruthD3PDMakerConf        import D3PD__TruthJetFilterTool
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthLeptonParentAssociation.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthLeptonParentAssociation.py
index 975f5b841d3a7b3e8643d184646f250cc9109e7e..e1c6a2d64a7e81594fef61f93c790de167823118 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthLeptonParentAssociation.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthLeptonParentAssociation.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 TruthD3PDMaker/python/TruthLeptonParentAssociation.py
 # @author Zach Marshall <zach.marshall@cern.ch>
@@ -18,7 +17,7 @@ def TruthLeptonParentAssociation (parent,
                    *args, **kw):
     """Helper for setting up an association to lepton parents in the truth record"""
 
-    if blockname == None:
+    if blockname is None:
         blockname = prefix + 'LeptonParentMultiAssoc'
 
     return IndexMultiAssociation (parent,
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleChildAssociation.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleChildAssociation.py
index 795b767121eea2196b17ba3adb15a573d814fb4c..e071911ab3f113cdc5c65dd6408e0821e92ccc50 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleChildAssociation.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleChildAssociation.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 TruthD3PDMaker/python/TruthParticleChildAssociation.py
 # @author Ryan Reece <ryan.reece@cern.ch>
@@ -10,9 +9,7 @@
 #
 
 
-import D3PDMakerCoreComps
 import TruthD3PDMaker
-from D3PDMakerCoreComps.D3PDObject import D3PDObject
 from D3PDMakerCoreComps.IndexMultiAssociation import IndexMultiAssociation
 
 
@@ -25,7 +22,7 @@ def TruthParticleChildAssociation (parent,
     """Helper for setting up an association for truth particle
 children by index.
 """
-    if blockname == None:
+    if blockname is None:
         blockname = prefix + 'TruthParticleChildAssociation'
 
     return IndexMultiAssociation (parent,
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleFakerObject.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleFakerObject.py
index 3ad98ababf79e6cd04023ae3b3014dbcce70230d..d36f9a04b027bb01f16c7a06f4b31b69c5f9db06 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleFakerObject.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleFakerObject.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 ## @file TruthD3PDMaker/python/TruthParticleFakerObject.py
 ## @brief Truth D3PD object for single particles
@@ -13,9 +13,6 @@ from D3PDMakerCoreComps.D3PDObject import D3PDObject
 from D3PDMakerConfig.D3PDMakerFlags  import D3PDMakerFlags
 
 from TruthD3PDAnalysis.AllTruthFilterTool import AllTruthFilterTool
-from TruthD3PDAnalysis.StableChargedTruthFilterTool import StableChargedTruthFilterTool
-from TruthD3PDMaker.TruthD3PDMakerKeys import TruthD3PDKeys
-from TruthD3PDMaker.TruthD3PDMakerFlags import TruthD3PDFlags
 
 from AthenaCommon.SystemOfUnits import GeV
 
@@ -28,9 +25,9 @@ def make_TruthParticleFaker_D3PDObject( default_prefix, default_sgkey,
                   getter = None, sgkey = None, filter = default_filter,
                   label = default_label, **kw ):
 
-        if sgkey == None: sgkey = default_sgkey
-        if label == None: label = prefix
-        if getter == None:
+        if sgkey is None: sgkey = default_sgkey
+        if label is None: label = prefix
+        if getter is None:
             getter = TruthD3PDMaker.GenParticleGetterTool (name + "_Getter",
                                                            Label = label,
                                                            SGKey = sgkey,
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleParentAssociation.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleParentAssociation.py
index f0ee62e6ac07a7e1645b80cbcbc8b0ba6ccbf2a1..2b34e7984799b7f177cc353c12c083d24afc4093 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleParentAssociation.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthParticleParentAssociation.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 TruthD3PDMaker/python/TruthParticleParentAssociation.py
 # @author Ryan Reece <ryan.reece@cern.ch>
@@ -10,9 +9,7 @@
 #
 
 
-import D3PDMakerCoreComps
 import TruthD3PDMaker
-from D3PDMakerCoreComps.D3PDObject import D3PDObject
 from D3PDMakerCoreComps.IndexMultiAssociation import IndexMultiAssociation
 
 
@@ -25,7 +22,7 @@ def TruthParticleParentAssociation (parent,
     """Helper for setting up an association for truth particle
 parents by index.
 """
-    if blockname == None:
+    if blockname is None:
         blockname = prefix + 'TruthParticleParentAssociation'
 
     return IndexMultiAssociation (parent,
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthTauDecayAssociation.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthTauDecayAssociation.py
index 0f70fffb537b414ff733888686e7668e8d9c4157..1abfaf6e357fd63e3f24e51457717ab870183461 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthTauDecayAssociation.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/TruthTauDecayAssociation.py
@@ -1,15 +1,12 @@
-# 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 TruthD3PDMaker/python/TruthTauDecayAssociation.py
 # @author Zach Marshall <zach.marshall@cern.ch>
 # @date June 2013
 # @brief Helper for setting up an association to tau decay products in the truth record
 
-#import D3PDMakerCoreComps
 import TruthD3PDMaker
-#from D3PDMakerCoreComps.D3PDObject import D3PDObject
 from D3PDMakerCoreComps.IndexMultiAssociation import IndexMultiAssociation
 
 def TruthTauDecayAssociation (parent,
@@ -20,7 +17,7 @@ def TruthTauDecayAssociation (parent,
                    *args, **kw):
     """Helper for setting up an association to tau decay products in the truth record"""
 
-    if blockname == None:
+    if blockname is None:
         blockname = prefix + 'TauDecayMultiAssoc'
 
     return IndexMultiAssociation (parent,
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/atlfast1D3PD.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/atlfast1D3PD.py
index bf4cd19a34fbc12c382c4d9456c2f403306f25c5..0f9616d9f4dc253be617952db8617e0b88572c9a 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/atlfast1D3PD.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/atlfast1D3PD.py
@@ -1,6 +1,5 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-# $Id$
 #
 # @file TruthD3PDMaker/python/atlfast1D3PD.py
 # @author Renaud Bruneliere <Renaud.Bruneliere@cern.ch>
@@ -10,8 +9,6 @@
 
 
 import D3PDMakerCoreComps
-from D3PDMakerConfig.D3PDMakerFlags                  import D3PDMakerFlags
-
 
 from EventCommonD3PDMaker.EventInfoD3PDObject        import EventInfoD3PDObject
 from TruthD3PDMaker.Atlfast1ElectronD3PDObject       import Atlfast1ElectronD3PDObject
@@ -19,17 +16,11 @@ from TruthD3PDMaker.Atlfast1PhotonD3PDObject         import Atlfast1PhotonD3PDOb
 from MuonD3PDMaker.MuonD3PDObject                    import MuonD3PDObject
 from JetD3PDMaker.JetD3PDObject                      import JetD3PDObject
 from TruthD3PDMaker.TruthJetD3PDObject               import TruthJetD3PDObject
-#from TauD3PDMaker.TauD3PDObject                      import TauD3PDObject
-from MissingETD3PDMaker.MissingETD3PDMakerFlags      import MissingETD3PDMakerFlags
 from TruthD3PDMaker.Atlfast1MissingETD3PDObject      import Atlfast1MissingETD3PDObject
 from TruthD3PDMaker.Atlfast1MissingETD3PDObject      import TruthMETD3PDObject
-from EventCommonD3PDMaker.LBMetadataConfig           import LBMetadataConfig
-from HforD3PDObject                                  import HforD3PDObject
-
 
 from TruthD3PDMaker.GenEventD3PDObject               import GenEventD3PDObject
 from TruthD3PDAnalysis.truthParticleConfig           import truthParticleConfig
-#from TruthD3PDAnalysis.TruthJetFilterConfig          import TruthJetFilterConfig
 from TruthD3PDMaker.TruthParticleD3PDObject          import TruthParticleD3PDObject
 from TruthD3PDMaker.PartonJetConfig                  import PartonJetConfig
 from RecExConfig.RecFlags                            import rec
@@ -73,6 +64,5 @@ def atlfast1D3PD (file,
         alg += TruthMETD3PDObject (level=10)
         alg += TruthJetD3PDObject (level=10, sgkey='AntiKt4TruthJets', prefix='AntiKt4TruthJets_')
         alg += TruthJetD3PDObject (level=10, sgkey='AntiKt4TruthPartonJets', prefix='AntiKt4TruthPartonJets_')
-        alg += HforD3PDObject             (**_args (0, 'HforInfo', kw))    
 
     return alg
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/evgenD3PD.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/evgenD3PD.py
index 207221d26a7c11307de23cf48941826b41d787dc..d3a17cc0a05908f5f451a024664c3de80d2eb921 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/evgenD3PD.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/python/evgenD3PD.py
@@ -9,13 +9,9 @@
 
 
 import D3PDMakerCoreComps
-from D3PDMakerConfig.D3PDMakerFlags                  import D3PDMakerFlags
-
 
 from EventCommonD3PDMaker.EventInfoD3PDObject        import EventInfoD3PDObject
-from JetD3PDMaker.JetD3PDObject                      import JetD3PDObject
 from TruthD3PDMaker.TruthJetD3PDObject               import TruthJetD3PDObject
-from MissingETD3PDMaker.MissingETD3PDMakerFlags      import MissingETD3PDMakerFlags
 from TruthD3PDMaker.Atlfast1MissingETD3PDObject      import TruthMETD3PDObject
 
 from TruthD3PDMaker.GenEventD3PDObject               import GenEventD3PDObject
@@ -24,7 +20,7 @@ from TruthD3PDMaker.TruthJetFilterConfig             import TruthJetFilterConfig
 from TruthD3PDMaker.TruthParticleD3PDObject          import TruthParticleD3PDObject
 from TruthD3PDMaker.PartonJetConfig                  import PartonJetConfig
 from RecExConfig.RecFlags                            import rec
-from JetRec.JetGetters                               import *  
+from JetRec.JetGetters                               import make_StandardJetGetter
 
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
@@ -76,8 +72,8 @@ def evgenD3PD (file,
         antikt6truthAlg.AlgTools['InputToJet'].InputCollectionKeys = ['FilteredD3PDTruth']
         if doExcludeWZdecays:
             # Reconstruct standard ATLAS truth jets
-            antikt4truthAlgStd = make_StandardJetGetter('AntiKt',0.4,'Truth',disable=False).jetAlgorithmHandle()
-            antikt6truthAlgStd = make_StandardJetGetter('AntiKt',0.6,'Truth',disable=False).jetAlgorithmHandle()
+            antikt4truthAlgStd = make_StandardJetGetter('AntiKt',0.4,'Truth',disable=False).jetAlgorithmHandle()  # noqa: F841
+            antikt6truthAlgStd = make_StandardJetGetter('AntiKt',0.6,'Truth',disable=False).jetAlgorithmHandle()  # noqa: F841
 
 
     #--------------------------------------------------------------------------
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/share/GenD3PDExample_jobOptions.py b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/share/GenD3PDExample_jobOptions.py
index d01dcc54d2fbd5aafbb6618d1f70d830900758af..fb0777e983f30315fedcd63b25bfac8d6a4587fe 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/share/GenD3PDExample_jobOptions.py
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/share/GenD3PDExample_jobOptions.py
@@ -64,8 +64,5 @@ alg += GenParticleD3PDObject( 10, filter = AllTrackFilterTool() )
 from TruthD3PDMaker.GenParticleD3PDObject import GenTruthTrackD3PDObject
 alg += GenTruthTrackD3PDObject( 10, filter = TruthTrackFilterTool() )
 
-#from TruthD3PDMaker.HforD3PDObject import HforD3PDObject
-#alg += HforD3PDObject(**_args(0,'HforInfo',kw))
-
 ### you can link to the gen particle (e.g from tracks or btag truth lepton info)
 ### using the gen particle getter label: TruthD3PDKeys.GenParticleGetterLabel()