Commit da53058f authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

egammaTools: cmake fixes, enable flake8

Remove CLHEP dependency by using Gaudi's `SystemOfUnits.h`. Update cmake
configuration and enable flake8.
parent 1613474a
################################################################################
# Package: egammaTools
################################################################################
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( egammaTools )
# Component(s) in the package:
atlas_add_component( egammaTools
src/*.cxx
src/components/*.cxx
INCLUDE_DIRS
LINK_LIBRARIES CaloConditions CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthenaBaseComps AthenaKernel
AthContainers StoreGateLib Identifier EventKernel EventPrimitives FourMom FourMomUtils xAODCaloEvent
xAODEgamma xAODTracking xAODTruth GaudiKernel LArRecConditions LArCablingLib LumiBlockCompsLib PATCoreLib
EgammaAnalysisInterfacesLib egammaRecEvent egammaUtils TrkEventPrimitives egammaInterfacesLib )
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps AthenaKernel CaloConditions CaloDetDescrLib CaloEvent CaloIdentifier CaloInterfaceLib CaloRecLib CaloUtilsLib EgammaAnalysisInterfacesLib EventPrimitives FourMom FourMomUtils GaudiKernel GeoPrimitives Identifier LArCablingLib LArRecConditions LumiBlockCompsLib PATCoreAcceptLib SGTools StoreGateLib TrkEventPrimitives egammaInterfacesLib egammaRecEvent egammaUtils xAODCaloEvent xAODEgamma xAODTracking )
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
......@@ -6,7 +6,6 @@ __author__ = "Bruno Lenzi"
from ROOT import egammaPID
import cppyy
from ElectronPhotonSelectorTools.ConfiguredAsgForwardElectronIsEMSelectors \
import ConfiguredAsgForwardElectronIsEMSelector
from .EMPIDBuilderBase import EMPIDBuilderPhotonBase
......@@ -22,8 +21,6 @@ from egammaRec import egammaKeys
# to set jobproperties.egammaRecFlags
from egammaRec.egammaRecFlags import jobproperties
import six
_clusterTypes = dict(
Ele35='ele35', Ele55='ele55', Ele37='ele37',
......@@ -35,10 +32,7 @@ _clusterTypes = dict(
# Configure fixed-size (non-supercell) corrections
def configureFixedSizeClusterCorrections(swTool):
"Add attributes ClusterCorrectionToolsXX to egammaSwTool object for fixed-size cluster corrections."
from CaloClusterCorrection.CaloSwCorrections import (
make_CaloSwCorrections, rfac, etaoff_b1, etaoff_e1,
etaoff_b2, etaoff_e2, phioff_b2, phioff_e2, update,
time, listBadChannel)
from CaloClusterCorrection.CaloSwCorrections import make_CaloSwCorrections
from CaloRec.CaloRecMakers import _process_tools
for attrName, clName in _clusterTypes.items():
......@@ -161,6 +155,6 @@ TightForwardElectronSelector = ToolFactory(
# -------------------------
# Import the factories that are not defined here
from .EMTrackMatchBuilder import EMTrackMatchBuilder
from .egammaOQFlagsBuilder import egammaOQFlagsBuilder
from .EMShowerBuilder import EMShowerBuilder
from .EMTrackMatchBuilder import EMTrackMatchBuilder # noqa: F401
from .egammaOQFlagsBuilder import egammaOQFlagsBuilder # noqa: F401
from .EMShowerBuilder import EMShowerBuilder # noqa: F401
......@@ -11,7 +11,7 @@
#include <cmath>
#include <vector>
#include "CLHEP/Units/SystemOfUnits.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "CaloConditions/CaloAffectedRegionInfoVec.h"
#include "CaloIdentifier/CaloCell_ID.h"
#include "CaloIdentifier/LArEM_ID.h"
......@@ -20,8 +20,6 @@
#include "StoreGate/ReadHandle.h"
#include "StoreGate/StoreGateSvc.h"
using CLHEP::GeV;
namespace {
bool
isbadtilecell(CaloCellList& ccl,
......@@ -194,7 +192,7 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx,
egammaOQFlagsBuilder::findCentralCell(cluster, cellCentrId);
// Set timing bit
const double absEnergyGeV = fabs(cluster->e() * (1. / GeV));
const double absEnergyGeV = fabs(cluster->e() * (1. / Gaudi::Units::GeV));
if (absEnergyGeV != 0 &&
fabs(cluster->time()) > m_TCut + m_TCutVsE / absEnergyGeV) {
iflag |= (0x1 << xAOD::EgammaParameters::OutTime);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment