Skip to content
Snippets Groups Projects
Commit 4a8d36aa authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

TrigCost: cmake cleanup and enable flake8

- remove atlas_depends_on_subdirs
- update link dependencies
- enable flake8 where applicable
parent 419a97a5
No related branches found
No related tags found
No related merge requests found
################################################################################
# Package: EnhancedBiasWeighter
################################################################################
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( EnhancedBiasWeighter )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthToolSupport/AsgTools
Event/xAOD/xAODEventInfo
GaudiKernel
PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces
Trigger/TrigAnalysis/TrigAnalysisInterfaces
PRIVATE
AtlasTest/TestTools
Tools/PathResolver )
# External dependencies:
find_package( COOL COMPONENTS CoolKernel CoolApplication )
find_package( CORAL COMPONENTS CoralKernel )
find_package( ROOT COMPONENTS XMLIO XMLParser Core )
find_package( LibXml2 )
# tag NEEDS_CORAL_BASE was not recognized in automatic conversion in cmt2cmake
# Component(s) in the package:
atlas_add_library( EnhancedBiasWeighterLib
Root/*.cxx
PUBLIC_HEADERS EnhancedBiasWeighter
INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR}
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${COOL_LIBRARIES} AsgTools xAODEventInfo GaudiKernel ${LIBXML2_LIBRARIES}
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} TestTools PathResolver )
PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${COOL_LIBRARIES} ${LIBXML2_LIBRARIES} AsgTools DerivationFrameworkInterfaces GaudiKernel TrigAnalysisInterfaces xAODEventInfo
PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} PathResolver )
atlas_add_component( EnhancedBiasWeighter
src/components/*.cxx
INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR}
LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${LIBXML2_LIBRARIES} AsgTools xAODEventInfo GaudiKernel TestTools PathResolver EnhancedBiasWeighterLib )
LINK_LIBRARIES EnhancedBiasWeighterLib )
atlas_add_dictionary( EnhancedBiasWeighterDict
EnhancedBiasWeighter/EnhancedBiasWeighterDict.h
EnhancedBiasWeighter/selection.xml
INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR}
LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${LIBXML2_LIBRARIES} AsgTools xAODEventInfo GaudiKernel TestTools PathResolver EnhancedBiasWeighterLib )
# No tests at the moment
#atlas_add_test( ut_EnhancedBiasWeighter_test
# SOURCES
# test/ut_EnhancedBiasWeighter_test.cxx
# INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR}
# LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${LIBXML2_LIBRARIES} AsgTools xAODEventInfo GaudiKernel TestTools PathResolver EnhancedBiasWeighterLib )
LINK_LIBRARIES EnhancedBiasWeighterLib )
################################################################################
# Package: RatesAnalysis
################################################################################
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( RatesAnalysis )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthAnalysisBaseComps
GaudiKernel
Trigger/TrigAnalysis/TrigDecisionTool
Trigger/TrigCost/EnhancedBiasWeighter
PRIVATE
Event/xAOD/xAODEventInfo
Trigger/TrigConfiguration/TrigConfL1Data )
# External dependencies:
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
......@@ -24,18 +12,18 @@ atlas_add_library( RatesAnalysisLib
PUBLIC_HEADERS RatesAnalysis
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthAnalysisBaseCompsLib TrigDecisionToolLib EnhancedBiasWeighterLib
PRIVATE_LINK_LIBRARIES xAODEventInfo )
PRIVATE_LINK_LIBRARIES AthenaBaseComps EventInfo TrigConfL1Data xAODEventInfo )
# Component(s) in the package:
atlas_add_component( RatesAnalysis
src/FullMenu.cxx
src/components/RatesAnalysis_entries.cxx
LINK_LIBRARIES GaudiKernel RatesAnalysisLib TrigConfL1Data )
LINK_LIBRARIES RatesAnalysisLib )
atlas_add_test( RatesAnalysis_test
SOURCES test/RatesAnalysis_test.cxx
LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthAnalysisBaseCompsLib RatesAnalysisLib TrigDecisionToolLib EnhancedBiasWeighterLib xAODEventInfo )
LINK_LIBRARIES RatesAnalysisLib )
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_scripts( share/RatesAnalysisFullMenu.py share/RatesAnalysisPostProcessing.py )
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
atlas_install_scripts( share/RatesAnalysisFullMenu.py share/RatesAnalysisPostProcessing.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
......@@ -7,8 +7,7 @@
@brief Accumulator class to buffer data for a single trigger and export this to JSON or CSV
'''
import ROOT
import math
import math
from enum import Enum
class RatesBins(Enum):
......
......@@ -37,8 +37,8 @@ def toJson(fileName, metadata, L1Triggers, HLTTriggers):
def getMetadata(inputFile):
metatree = inputFile.Get("metadata");
if metatree == None:
metatree = inputFile.Get("metadata")
if metatree is None:
return None
metatree.GetEntry(0)
......
......@@ -39,7 +39,6 @@ if __name__=='__main__':
# Set the Athena configuration flags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.AutoConfigFlags import GetFileMD
# Set the Athena configuration flags
ConfigFlags.Input.Files = ["root://eosatlas.cern.ch//eos/atlas/atlasdatadisk/rucio/data16_13TeV/8d/de/AOD.10654269._000566.pool.root.1"]
......@@ -74,7 +73,6 @@ if __name__=='__main__':
cfgsvc = CompFactory.TrigConf.xAODConfigSvc('xAODConfigSvc')
cfg.addService(cfgsvc)
from TrigEDMConfig.TriggerEDM import EDMLibraries
tdt = CompFactory.Trig.TrigDecisionTool('TrigDecisionTool')
tdt.TrigConfigSvc = cfgsvc
tdt.NavigationFormat = "TrigComposite"
......
......@@ -11,12 +11,10 @@
'''
import ROOT
from RatesAnalysis.RatesTrigger import RatesTrigger
from RatesAnalysis.Util import getMetadata, populateTriggers, getGlobalGroup, toJson
from AthenaCommon.Logging import logging
def main():
import sys
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('--file', default='RatesHistograms.root',
......@@ -43,7 +41,6 @@ def main():
metadata['n_evts'] = normHist.GetBinContent(2)
HLTGlobalGroup = getGlobalGroup(inputFile, 'Main')
HLTExpressGroup = getGlobalGroup(inputFile, 'Express')
L1GlobalGroup = getGlobalGroup(inputFile, 'L1')
L1Triggers = populateTriggers(inputFile, metadata, L1GlobalGroup, 'L1_')
......
################################################################################
# Package: TrigCostAnalysis
################################################################################
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( TrigCostAnalysis )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthAnalysisBaseComps
GaudiKernel
PRIVATE
Trigger/TrigAnalysis/TrigDecisionTool
Trigger/TrigCost/EnhancedBiasWeighter
Event/xAOD/xAODEventInfo
Trigger/TrigConfiguration/TrigConfData )
# External dependencies:
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
find_package( Boost )
find_package( ROOT COMPONENTS Core Hist RIO )
# Athena algorithm to do cost analysis and produce histograms
atlas_add_component( TrigCostAnalysis
src/*.cxx src/monitors/*.cxx src/counters/*.cxx src/components/TrigCostAnalysis_entries.cxx
src/*.cxx src/monitors/*.cxx src/counters/*.cxx src/components/TrigCostAnalysis_entries.cxx
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthAnalysisBaseCompsLib TrigDecisionToolLib EnhancedBiasWeighterLib xAODEventInfo PathResolver TrigConfData )
# Small helper library used by trigCostHistToCSV
......@@ -29,12 +16,11 @@ atlas_add_library( TrigCostAnalysisLib
TrigCostAnalysis/*.h Root/*.cxx TrigCostAnalysis/TableConstructors/*.h Root/TableConstructors/*.cxx
PUBLIC_HEADERS TrigCostAnalysis
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel)
LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AthenaBaseComps )
# Lightweight post processing of cost histograms to produce CSV output
atlas_add_executable( trigCostHistToCSV
util/trigCostHistToCSV.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel TrigCostAnalysisLib )
LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AthenaBaseComps TrigCostAnalysisLib )
atlas_install_joboptions( share/*.py )
################################################################################
# Package: TrigCostRootAnalysis
################################################################################
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( TrigCostRootAnalysis )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Trigger/TrigCost/TrigCostD3PD
PRIVATE
Tools/PathResolver
Trigger/TrigAnalysis/TrigRootAnalysis )
# External dependencies:
find_package( ROOT COMPONENTS Graf Gpad MathCore XMLIO XMLParser Core Tree
Hist RIO )
......@@ -26,13 +17,11 @@ atlas_add_library( TrigCostRootAnalysisLib
atlas_add_executable( RunTrigCostD3PD
util/RunTrigCostD3PD.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TrigCostRootAnalysisLib )
LINK_LIBRARIES TrigCostRootAnalysisLib )
atlas_add_executable( TrigCostD3PD_UserSkeleton
util/TrigCostD3PD_UserSkeleton.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} PathResolver TrigCostRootAnalysisLib )
LINK_LIBRARIES PathResolver TrigCostRootAnalysisLib )
# Install files from the package:
atlas_install_runtime( data/*.xml )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment