From 35d09b0dd3078baea43cb6b63d906e4f94b08647 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Fri, 17 Jul 2020 11:29:07 +0200
Subject: [PATCH] TrigIDtrkMonitoring: cmake cleanup, enable flake8

---
 .../TrigIDtrkMonitoring/CMakeLists.txt        | 33 +++----------------
 .../python/TrigIDPhysValMonitoringConfig.py   | 20 +++++------
 2 files changed, 12 insertions(+), 41 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/CMakeLists.txt b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/CMakeLists.txt
index 05f54e069d4..f81901063f2 100644
--- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/CMakeLists.txt
+++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/CMakeLists.txt
@@ -1,43 +1,18 @@
-################################################################################
-# Package: TrigIDtrkMonitoring
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigIDtrkMonitoring )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Calorimeter/CaloEvent
-                          Calorimeter/CaloGeoHelpers
-                          Control/AthenaMonitoring
-                          Control/StoreGate
-                          GaudiKernel
-                          Reconstruction/Particle
-                          Reconstruction/RecoTools/RecoToolInterfaces
-                          Reconstruction/egamma/egammaEvent
-                          Reconstruction/egamma/egammaInterfaces
-                          Trigger/TrigAnalysis/TrigDecisionTool
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigMonitoring/TrigHLTMonitoring
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          PRIVATE
-                          Event/EventInfo
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent )
-
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 )
+find_package( ROOT COMPONENTS Core MathCore Hist )
 
 # Component(s) in the package:
 atlas_add_component( TrigIDtrkMonitoring
                      src/*.cxx src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloGeoHelpers GaudiKernel Particle RecoToolInterfaces 
-                     egammaEvent TrigCaloEvent TrigInDetEvent AthenaMonitoringLib StoreGateLib SGtests TrigDecisionToolLib 
-                     TrigHLTMonitoringLib EventInfo TrigParticle TrigSteeringEvent )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringLib CaloEvent CaloGeoHelpers EventInfo GaudiKernel Particle RecoToolInterfaces StoreGateLib TrigCaloEvent TrigDecisionToolLib TrigHLTMonitoringLib TrigInDetEvent TrigInDetToolInterfacesLib TrigParticle TrigSteeringEvent egammaEvent egammaInterfacesLib )
 
 # 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/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
index 1fc3ac1d3b0..aee67644317 100644
--- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
@@ -1,18 +1,15 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 def TrigIDPhysValMonitoringTool( legacy_monitoring=False ):
 
-  from AthenaCommon.Constants import INFO,ERROR,FALSE,TRUE,DEBUG,VERBOSE
-
   # dataTypes: userDefined = 0, monteCarlo, collisions, cosmics
-  if not 'DQMonFlags' in dir():
-    from AthenaMonitoring.DQMonFlags import DQMonFlags
-  dataType = DQMonFlags.monManDataType()
+  if 'DQMonFlags' not in dir():
+    from AthenaMonitoring.DQMonFlags import DQMonFlags   # noqa: F401
 
   # disable everything
   outputlist = []
 
-  if not 'rec' in dir():
+  if 'rec' not in dir():
     from RecExConfig.RecFlags  import rec
     
   from TriggerJobOpts.HLTTriggerResultGetter import EDMDecodingVersion
@@ -34,30 +31,29 @@ def TrigIDPhysValMonitoringTool( legacy_monitoring=False ):
       Monname = "TestIDPhysValMon" + name
       TestIDPhysValMon = TrigTestPhysValMon(name=Monname)
       TestIDPhysValMon.SliceTag = "HLT/IDMon/" + name
-      TestIDPhysValMon.OutputLevel = INFO
       TestIDPhysValMon.UseHighestPT = useHighestPT
 
       try:
         TestIDPhysValMon.EnableLumi = False
-      except:
+      except Exception:
         pass
 
       TestIDPhysValMon.buildNtuple = False
       TestIDPhysValMon.AnalysisConfig = "Tier0" #T0 Analysis
       # TestIDPhysValMon.AnalysisConfig = "nTuple" #nTuple Analysis
 
-      if (useOffline or rec.doTruth == False):
+      if (useOffline or rec.doTruth is False):
         TestIDPhysValMon.mcTruth = False
         TestIDPhysValMon.ntupleChainNames = ['Offline',name]
 #       use default values ? 
 #       TestIDPhysValMon.sctHitsOffline = 1
 #       TestIDPhysValMon.pixHitsOffline = 1
-        if (doFS == True):
+        if (doFS is True):
           TestIDPhysValMon.sctHitsOffline = 6
           TestIDPhysValMon.pixHitsOffline = 4
           TestIDPhysValMon.blayerHitsOffline = 1
           TestIDPhysValMon.pixHolesOffline = 1
-      elif (rec.doTruth == True):        
+      elif (rec.doTruth is True):
         TestIDPhysValMon.mcTruth = True
         TestIDPhysValMon.ntupleChainNames = ['Truth']
         TestIDPhysValMon.sctHitsOffline = -1
-- 
GitLab