From 03e0cfdce0db416b2a2c82bf78b2bdca61d32c05 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Tue, 30 Jun 2020 15:34:04 +0200
Subject: [PATCH] TrigBjetMonitoring: CMake cleanup and enable flake8

Also move header to src directory.
---
 .../TrigBjetMonitoring/CMakeLists.txt         | 39 +--------
 .../TrigBjetMonitoring/doc/README.h           | 81 -------------------
 .../python/TrigBjetMonitCategory.py           |  3 -
 .../python/TrigBjetMonitoringConfig.py        | 10 +--
 .../TrigBjetMonitoring/src/HLTBjetMonTool.cxx |  2 +-
 .../HLTBjetMonTool.h                          |  0
 .../components/TrigBjetMonitoring_entries.cxx |  2 +-
 7 files changed, 9 insertions(+), 128 deletions(-)
 delete mode 100644 Trigger/TrigMonitoring/TrigBjetMonitoring/doc/README.h
 rename Trigger/TrigMonitoring/TrigBjetMonitoring/{TrigBjetMonitoring => src}/HLTBjetMonTool.h (100%)
 mode change 100755 => 100644

diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/CMakeLists.txt b/Trigger/TrigMonitoring/TrigBjetMonitoring/CMakeLists.txt
index 3734d09a783..584d844c288 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/CMakeLists.txt
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/CMakeLists.txt
@@ -1,48 +1,17 @@
-################################################################################
-# Package: TrigBjetMonitoring
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigBjetMonitoring )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          GaudiKernel
-                          Trigger/TrigAnalysis/TrigDecisionTool
-                          Trigger/TrigMonitoring/TrigHLTMonitoring
-                          Trigger/TrigTools/TrigTrackJetFinderTool
-                          PRIVATE
-                          Control/AthenaMonitoring
-                          DetectorDescription/GeoPrimitives
-                          Event/EventPrimitives
-                          Event/FourMomUtils
-                          Event/xAOD/xAODBTagging
-                          Event/xAOD/xAODEventInfo
-                          Event/xAOD/xAODTracking
-                          InnerDetector/InDetConditions/InDetBeamSpotService
-                          Reconstruction/Jet/JetEvent
-                          Reconstruction/Jet/JetUtils
-                          Reconstruction/MuonIdentification/muonEvent
-                          Reconstruction/Particle
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/DecisionHandling )
-
 # 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 Hist MathCore )
 
 # Component(s) in the package:
 atlas_add_component( TrigBjetMonitoring
                      src/*.cxx src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel TrigDecisionToolLib TrigHLTMonitoringLib AthenaMonitoringLib
-                     GeoPrimitives EventPrimitives FourMomUtils xAODBTagging xAODEventInfo xAODTracking JetEvent JetUtils 
-                     muonEvent Particle TrigInDetEvent TrigMuonEvent TrigParticle TrigSteeringEvent DecisionHandlingLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringKernelLib AthenaMonitoringLib EventPrimitives FourMomUtils GaudiKernel GeoPrimitives JetEvent JetUtils Particle StoreGateLib TrigDecisionToolLib TrigHLTMonitoringLib TrigParticle TrigTrackJetFinderToolLib muonEvent xAODBTagging xAODEventInfo xAODMuon xAODTracking )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-atlas_install_headers( TrigBjetMonitoring )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
-
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/doc/README.h b/Trigger/TrigMonitoring/TrigBjetMonitoring/doc/README.h
deleted file mode 100644
index 80efecc245a..00000000000
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/doc/README.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**************
-
-The TrigBjetMonitoring package provides histograms for 
-monitoring the b-jet trigger performances offline on
-Tier 0 reconstructed data.
-
-It is steared by the HLTBjetMonTool class, see 
-https://svnweb.cern.ch/trac/atlasoff/browser/Trigger/TrigMonitoring/TrigBjetMonitoring/trunk/TrigBjetMonitoring/HLTBjetMonTool.h
-and
-https://svnweb.cern.ch/trac/atlasoff/browser/Trigger/TrigMonitoring/TrigBjetMonitoring/trunk/src/HLTBjetMonTool.cxx
-
-The main methods of the HLTBjetMonTool class are:
-
-HLTBjetMonTool::book()
-which books histograms and
-HLTBjetMonTool::fill()
-which checks if the triggers forseen for monitoring have been configured and fired,
-and if yes, it fills the relevant histograms.
-
-At present the following histograms are provided:
-(for their description see also at https://twiki.cern.ch/twiki/bin/viewauth/Atlas/InnerDetectorBJetOnCall#BJets)
-
-1. Primary vertices (PV) reconstructed off-line based on <xAOD::VertexContainer>("PrimaryVertices"):
-      Number of PV
-      x, y and z coordinates of the PV's
-
-2. Quantities which passed the online trigger in different combinations:
-
-   2.1 PV based on <xAOD::VertexContainer>("EFHistoPrmVtx"):
-          Number of PV  
-          x, y and z coordinates of the PV's 
-          difference of the z coordinates of the each online PV and the first offline PV
-       Note that alternatively, PV's based on <xAOD::VertexContainer>("xPrimVx") can be filled by commenting out
-          the #define HISTO directive.
-
-   2.2 Tracks based on <xAOD::TrackParticleContainer>():
-          Number of tracks
-          d0, z0 of tracks and their errors: ed0 and ez0
-          z0 of tracks wrt the first off-line PV and that normalized to ez0 (significance)
-          pT of tracks
-          Phi vs Eta of tracks
-
-   2.3 Jets based on <xAOD::JetContainer>():
-          Number of jets
-          pT of jets
-          Phi vs Eta of jets
-
-   2.4 b-jets based on <xAOD::BTaggingContainer>():
-          Likelihood of the 3 dimensional impact parameter (IP3D) of light, c- and b-jets
-          Logarithm of IP3D likelihood ratios of b- to light jets
-          Logarithm of secondary vertex (SV1) likelihood ratios of b- to light jets
-          Logarithm of joint IP3D and SV1 likelihood ratios of b- to light jets
-  
-   2.5 b-jets based on <TrigEFBjetContainer>(): 
-          MV1 discriminant of the multivariate b-tagging algorithm
-          Invariant mass of tracks from secondary vertices
-          Number of secondary vertices
-   
-3. There is a possibility to retrieve "truth jets" in case of simulation, but for the moment no
-         histograms are filled for these objects.
-
-The triggers forseen are enumerated in the
-https://svnweb.cern.ch/trac/atlasoff/browser/Trigger/TrigMonitoring/TrigBjetMonitoring/trunk/python/TrigBjetMonitoringConfig.py
-and 
-https://svnweb.cern.ch/trac/atlasoff/browser/Trigger/TrigMonitoring/TrigBjetMonitoring/trunk/python/TrigBjetMonitCategory.py
-python configuration files.
-
-Finally, in the TrigBjetMonitoring package we definitely eliminated several classes: 
-    BjetLikelihoodMon
-    BjetProbabilityMon
-    TaggerHelper
-    TuningLikelihood
-which were used in Run 1 and used no more in Run 2 to resolve coverity issues present in these classes. 
-     
-
-***************/
-
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitCategory.py b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitCategory.py
index 7e2afc667e6..903a3eeb5b9 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitCategory.py
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitCategory.py
@@ -2,9 +2,6 @@
 
 from __future__ import print_function
 
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-
 
 # Used for combination MC, collisions or cosmics
 
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitoringConfig.py b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitoringConfig.py
index 4d7817e832b..26ad20b61fc 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitoringConfig.py
@@ -1,12 +1,10 @@
-# 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 AthenaCommon.AppMgr import ToolSvc
-	
 def TrigBjetMonitoringConfig():
 	
 	from TrigBjetMonitoring.TrigBjetMonitoringConf import HLTBjetMonTool
 	
-	HLTBjetMon = HLTBjetMonTool(name = 'HLTBjetMon', histoPathBase = "/Trigger/HLT");
+	HLTBjetMon = HLTBjetMonTool(name = 'HLTBjetMon', histoPathBase = "/Trigger/HLT")
 
 
 	from TrigHLTMonitoring.HLTMonTriggerList import hltmonList  # access to central tool
@@ -14,9 +12,7 @@ def TrigBjetMonitoringConfig():
 	HLTBjetMon.monitoring_bjet = hltmonList.monitoring_bjet
 
 
-	#from AthenaCommon.AppMgr import ToolSvc
-	#ToolSvc += HLTBjetMon;
-	list = [ HLTBjetMon ];
+	list = [ HLTBjetMon ]
 	
 	return list
 
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx
index 05c6df13cca..f6176ab7981 100755
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx
@@ -66,7 +66,7 @@
 
 
 
-#include "TrigBjetMonitoring/HLTBjetMonTool.h"
+#include "HLTBjetMonTool.h"
 
 #include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
 
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/TrigBjetMonitoring/HLTBjetMonTool.h b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h
old mode 100755
new mode 100644
similarity index 100%
rename from Trigger/TrigMonitoring/TrigBjetMonitoring/TrigBjetMonitoring/HLTBjetMonTool.h
rename to Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx
index 1aa3814b0b4..eacb278d2c7 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/components/TrigBjetMonitoring_entries.cxx
@@ -1,7 +1,7 @@
 /* 
 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration

 */
-#include "TrigBjetMonitoring/HLTBjetMonTool.h"
+#include "../HLTBjetMonTool.h"
 #include "../TrigBjetMonitorAlgorithm.h"
 
 DECLARE_COMPONENT( HLTBjetMonTool )
-- 
GitLab