From 627b6f23a07f6db4af9c66ba37a9cb2231075b10 Mon Sep 17 00:00:00 2001 From: Frank Winklmeier <fwinkl@cern> Date: Mon, 9 Nov 2020 14:42:45 +0100 Subject: [PATCH] CaloRingerTools: cmake cleanup, enable flake8 --- .../RecoTools/CaloRingerTools/CMakeLists.txt | 27 +++---------------- .../python/CaloRingerBuilderFactories.py | 2 +- .../python/CaloRingerInputReaderFactories.py | 1 - .../python/CaloRingerSelectorsBuilders.py | 2 +- 4 files changed, 5 insertions(+), 27 deletions(-) diff --git a/Reconstruction/RecoTools/CaloRingerTools/CMakeLists.txt b/Reconstruction/RecoTools/CaloRingerTools/CMakeLists.txt index 893fcf0eedc0..017d06e259b6 100644 --- a/Reconstruction/RecoTools/CaloRingerTools/CMakeLists.txt +++ b/Reconstruction/RecoTools/CaloRingerTools/CMakeLists.txt @@ -1,28 +1,8 @@ -################################################################################ -# Package: CaloRingerTools -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( CaloRingerTools ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthLinks - Event/xAOD/xAODBase - Event/xAOD/xAODCaloEvent - Event/xAOD/xAODCaloRings - GaudiKernel - PRIVATE - Calorimeter/CaloEvent - Calorimeter/CaloGeoHelpers - Calorimeter/CaloUtils - Control/AthenaBaseComps - Control/AthenaKernel - Control/CxxUtils - Event/xAOD/xAODEgamma - PhysicsAnalysis/AnalysisCommon/PATCore - PhysicsAnalysis/RingerSelectorTools ) - atlas_add_library( CaloRingerToolsLib CaloRingerTools/*.h INTERFACE @@ -33,8 +13,7 @@ atlas_add_library( CaloRingerToolsLib atlas_add_component( CaloRingerTools src/*.cxx src/components/*.cxx - LINK_LIBRARIES CaloRingerToolsLib xAODCaloRings CaloEvent CaloGeoHelpers CaloUtilsLib AthenaBaseComps AthenaKernel CxxUtils xAODEgamma PATCoreLib RingerSelectorToolsLib ) + LINK_LIBRARIES AthContainers AthLinks AthenaBaseComps AthenaKernel CaloEvent CaloGeoHelpers CaloRingerToolsLib CaloUtilsLib GaudiKernel PATCoreAcceptLib RingerSelectorToolsEnumsLib StoreGateLib xAODBase xAODCaloEvent xAODCaloRings xAODEgamma ) # 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/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerBuilderFactories.py b/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerBuilderFactories.py index 43e60ccda6ff..7b263c07e928 100644 --- a/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerBuilderFactories.py +++ b/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerBuilderFactories.py @@ -74,7 +74,7 @@ class AsymRings( object ): self.doPhiAxesDivision = doPhiAxesDivision def resizeNRingsAsymRings(self, obj): - if ((obj.doEtaAxesDivision == True) and (obj.doPhiAxesDivision == True)): + if ((obj.doEtaAxesDivision is True) and (obj.doPhiAxesDivision is True)): obj.NRings = [(rings-1)*4+1 for rings in obj.NRings] else: obj.NRings = [(rings-1)*2+1 for rings in obj.NRings] diff --git a/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerInputReaderFactories.py b/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerInputReaderFactories.py index fc8322a0d397..0da538d5b23d 100644 --- a/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerInputReaderFactories.py +++ b/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerInputReaderFactories.py @@ -60,7 +60,6 @@ CaloRingerElectronsReaderTool = PublicToolFactory(CaloRingerToolsConf.Ringer__Ca ) from CaloRingerAlgs.CaloRingerAlgorithmBuilder import checkBuildPhotonCaloRings -from CaloRingerAlgs.CaloRingerAlgorithmBuilder import checkDoPhotonIdentification CaloRingerPhotonsReaderTool = PublicToolFactory(CaloRingerToolsConf.Ringer__CaloRingerPhotonsReader, name = "CaloRingerPhotonsReaderTool", inputKey = CaloRingerKeys.inputPhotonKey(), diff --git a/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerSelectorsBuilders.py b/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerSelectorsBuilders.py index 686e6fc7fcd8..d0a9b71e4711 100644 --- a/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerSelectorsBuilders.py +++ b/Reconstruction/RecoTools/CaloRingerTools/python/CaloRingerSelectorsBuilders.py @@ -70,7 +70,7 @@ class CaloRingerElectronSelectorsBuilder ( Configured ): if not isinstance(customElectronSelectors,(list)): customElectronSelectors = list(customElectronSelectors) for selector in customElectronSelectors: - if not selector.getType() is "Ringer::AsgElectronRingerSelector": + if selector.getType() != "Ringer::AsgElectronRingerSelector": raise ValueError(("Selector must be of type Ringer::AsgElectronRingerSelector" "and is of type %s"),selector.getType()) self._customSelectors.extend( customElectronSelectors ) -- GitLab