Skip to content
Snippets Groups Projects
Commit fe37a84e authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'lumiblock_cleanup' into 'master'

LumiBlock: cmake cleanup, flake8, thread checker

See merge request atlas/athena!35078
parents d16e9c6b 74a8016a
No related branches found
No related tags found
No related merge requests found
# $Id: CMakeLists.txt 789876 2016-12-15 13:57:55Z krasznaa $ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
################################################################################
# Package: LumiBlockComps
################################################################################
# Declare the package name: # Declare the package name:
atlas_subdir( LumiBlockComps ) atlas_subdir( LumiBlockComps )
...@@ -79,7 +76,6 @@ atlas_add_test( LumiBlockMuWriterConfig_test ...@@ -79,7 +76,6 @@ atlas_add_test( LumiBlockMuWriterConfig_test
SCRIPT python -m LumiBlockComps.LumiBlockMuWriterConfig SCRIPT python -m LumiBlockComps.LumiBlockMuWriterConfig
LOG_SELECT_PATTERN "ComponentAccumulator|^---|^IOVDbSvc" ) LOG_SELECT_PATTERN "ComponentAccumulator|^---|^IOVDbSvc" )
atlas_add_test( BunchCrossingCondAlg atlas_add_test( BunchCrossingCondAlg
SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/BunchCrossingCondAlgTest.py SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/BunchCrossingCondAlgTest.py
POST_EXEC_SCRIPT " /usr/bin/diff BCData.txt ${CMAKE_CURRENT_SOURCE_DIR}/share/BCData.txt.ref > BC_diff.log " ) POST_EXEC_SCRIPT " /usr/bin/diff BCData.txt ${CMAKE_CURRENT_SOURCE_DIR}/share/BCData.txt.ref > BC_diff.log " )
################################################################################ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Package: LumiBlockData
################################################################################
# Declare the package name: # Declare the package name:
atlas_subdir( LumiBlockData ) atlas_subdir( LumiBlockData )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthenaKernel
Control/AthContainers )
# External dependencies:
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
# Component(s) in the package: # Component(s) in the package:
atlas_add_library( LumiBlockData atlas_add_library( LumiBlockData
src/*.cxx src/*.cxx
PUBLIC_HEADERS LumiBlockData PUBLIC_HEADERS LumiBlockData
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES AthenaKernel AthContainers )
LINK_LIBRARIES AthenaKernel AthContainers
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
atlas_add_dictionary( LumiBlockDataDict atlas_add_dictionary( LumiBlockDataDict
LumiBlockData/LumiBlockDataDict.h LumiBlockData/LumiBlockDataDict.h
LumiBlockData/selection.xml LumiBlockData/selection.xml
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES LumiBlockData )
LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel AthContainers LumiBlockData )
# Tests in the package:
atlas_add_test( LBDurationCondData_test atlas_add_test( LBDurationCondData_test
SOURCES test/LBDurationCondData_test.cxx SOURCES test/LBDurationCondData_test.cxx
LINK_LIBRARIES LumiBlockData ) LINK_LIBRARIES LumiBlockData )
...@@ -38,4 +26,3 @@ atlas_add_test( LuminosityCondData_test ...@@ -38,4 +26,3 @@ atlas_add_test( LuminosityCondData_test
atlas_add_test( TrigLiveFractionCondData_test atlas_add_test( TrigLiveFractionCondData_test
SOURCES test/TrigLiveFractionCondData_test.cxx SOURCES test/TrigLiveFractionCondData_test.cxx
LINK_LIBRARIES LumiBlockData ) LINK_LIBRARIES LumiBlockData )
################################################################################ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Package: LumiBlockAthenaPool
################################################################################
# Declare the package name: # Declare the package name:
atlas_subdir( LumiBlockAthenaPool ) atlas_subdir( LumiBlockAthenaPool )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Database/AthenaPOOL/AthenaPoolUtilities
PRIVATE
Database/AthenaPOOL/AthenaPoolCnvSvc
LumiBlock/LumiBlockData
LumiBlock/LumiBlockPers/LumiBlockTPCnv )
# Component(s) in the package: # Component(s) in the package:
atlas_add_poolcnv_library( LumiBlockAthenaPoolPoolCnv atlas_add_poolcnv_library( LumiBlockAthenaPoolPoolCnv
src/*.cxx src/*.cxx
FILES LumiBlockData/LumiBlockCollection.h FILES LumiBlockData/LumiBlockCollection.h
LINK_LIBRARIES AthenaPoolUtilities AthenaPoolCnvSvcLib LumiBlockData LumiBlockTPCnv ) LINK_LIBRARIES AthenaPoolCnvSvcLib LumiBlockData LumiBlockTPCnv )
################################################################################ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Package: LumiBlockTPCnv
################################################################################
# Declare the package name: # Declare the package name:
atlas_subdir( LumiBlockTPCnv ) atlas_subdir( LumiBlockTPCnv )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Database/AthenaPOOL/AthenaPoolCnvSvc
LumiBlock/LumiBlockData
PRIVATE
AtlasTest/TestTools
Control/AthenaKernel
GaudiKernel )
# External dependencies:
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
# Component(s) in the package: # Component(s) in the package:
atlas_add_tpcnv_library( LumiBlockTPCnv atlas_add_tpcnv_library( LumiBlockTPCnv
src/*.cxx src/*.cxx
PUBLIC_HEADERS LumiBlockTPCnv PUBLIC_HEADERS LumiBlockTPCnv
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES AthenaPoolCnvSvcLib LumiBlockData
LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LumiBlockData TestTools AthenaKernel GaudiKernel ) PRIVATE_LINK_LIBRARIES AthenaKernel )
atlas_add_dictionary( LumiBlockTPCnvDict atlas_add_dictionary( LumiBlockTPCnvDict
LumiBlockTPCnv/LumiBlockTPCnvDict.h LumiBlockTPCnv/LumiBlockTPCnvDict.h
LumiBlockTPCnv/selection.xml LumiBlockTPCnv/selection.xml
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES LumiBlockTPCnv )
LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LumiBlockData TestTools AthenaKernel GaudiKernel LumiBlockTPCnv )
# Tests in the package:
atlas_add_test( LumiBlockRangeCnv_p1_test atlas_add_test( LumiBlockRangeCnv_p1_test
SOURCES SOURCES
test/LumiBlockRangeCnv_p1_test.cxx test/LumiBlockRangeCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES GaudiKernel TestTools LumiBlockTPCnv )
LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LumiBlockData TestTools AthenaKernel GaudiKernel LumiBlockTPCnv )
atlas_add_test( LumiBlockRangeCnv_p2_test atlas_add_test( LumiBlockRangeCnv_p2_test
SOURCES SOURCES
test/LumiBlockRangeCnv_p2_test.cxx test/LumiBlockRangeCnv_p2_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES GaudiKernel TestTools LumiBlockTPCnv )
LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LumiBlockData TestTools AthenaKernel GaudiKernel LumiBlockTPCnv )
LumiBlock/LumiBlockPers/LumiBlockTPCnv
################################################################################ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Package: LumiCalc
################################################################################
# Declare the package name: # Declare the package name:
atlas_subdir( LumiCalc ) atlas_subdir( LumiCalc )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/CxxUtils
Control/AthenaKernel
DataQuality/GoodRunsLists
Event/xAOD/xAODLuminosity
LumiBlock/LumiBlockData
PRIVATE
Control/DataModelRoot
Database/APR/CollectionBase
Database/AthenaPOOL/DBDataModel
Database/CoolConvUtilities
Database/CoraCool )
# External dependencies: # External dependencies:
find_package( COOL COMPONENTS CoolKernel ) find_package( COOL COMPONENTS CoolKernel )
find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
# Component(s) in the package: # Component(s) in the package:
...@@ -33,8 +16,7 @@ atlas_add_library( LumiBlockCoolQuery ...@@ -33,8 +16,7 @@ atlas_add_library( LumiBlockCoolQuery
src/LumiBlockCollectionConverter.cxx src/LumiBlockCollectionConverter.cxx
PUBLIC_HEADERS LumiCalc PUBLIC_HEADERS LumiCalc
INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaKernel xAODLuminosity LumiBlockData GoodRunsListsLib LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel GoodRunsListsLib LumiBlockData xAODLuminosity )
PRIVATE_LINK_LIBRARIES DataModelRoot CollectionBase DBDataModel )
atlas_add_executable( iLumiCalc atlas_add_executable( iLumiCalc
src/iLumiCalc.cxx src/iLumiCalc.cxx
...@@ -43,10 +25,9 @@ atlas_add_executable( iLumiCalc ...@@ -43,10 +25,9 @@ atlas_add_executable( iLumiCalc
src/LumiBlockRangeContainerConverter.cxx src/LumiBlockRangeContainerConverter.cxx
src/LumiCalculator.cxx src/LumiCalculator.cxx
src/ReplicaSorter.cxx src/ReplicaSorter.cxx
INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} LINK_LIBRARIES LINK_LIBRARIES CollectionBase CxxUtils DBDataModel DataModelRoot LumiBlockCoolQuery )
LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaKernel GoodRunsListsLib xAODLuminosity LumiBlockData DataModelRoot CollectionBase DBDataModel LumiBlockCoolQuery )
# Install files from the package: # Install files from the package:
atlas_install_python_modules( python/*.py ) atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
atlas_install_scripts( share/*.py ) atlas_install_scripts( share/*.py )
...@@ -151,7 +151,7 @@ class LumiCalc: ...@@ -151,7 +151,7 @@ class LumiCalc:
if self.fileitem.filename: if self.fileitem.filename:
# strip any leading C: from windows # strip any leading C: from windows
if self.fileitem.filename[0:2] is 'C:': if self.fileitem.filename[0:2] == 'C:':
self.fileitem.filename = self.fileitem.filename[2:] self.fileitem.filename = self.fileitem.filename[2:]
# strip leading path from file name to avoid directory traversal attacks # strip leading path from file name to avoid directory traversal attacks
self.grlfn = os.path.basename(self.fileitem.filename) self.grlfn = os.path.basename(self.fileitem.filename)
...@@ -226,23 +226,23 @@ class LumiCalc: ...@@ -226,23 +226,23 @@ class LumiCalc:
# #
def parseOutput(self): def parseOutput(self):
matchrun = re.compile('Run ([0-9]+) LB \[([0-9]+)-([0-9]+)\]') matchrun = re.compile(r'Run ([0-9]+) LB \[([0-9]+)-([0-9]+)\]')
matchlumidel = re.compile(': IntL delivered \(ub\^-1\) : ([0-9\.e+]+)') matchlumidel = re.compile(r': IntL delivered \(ub\^-1\) : ([0-9\.e+]+)')
matchlumipre = re.compile(': IntL after livefraction \(ub\^-1\): ([0-9\.\e\+\-]+)') matchlumipre = re.compile(r': IntL after livefraction \(ub\^-1\): ([0-9\.\e\+\-]+)')
matchlumilar = re.compile(': IntL after LAr fraction \(ub\^-1\): ([0-9\.\e\+\-]+)') matchlumilar = re.compile(r': IntL after LAr fraction \(ub\^-1\): ([0-9\.\e\+\-]+)')
matchlumirec = re.compile(': IntL recorded after prescale \(ub\^-1\) : ([0-9\.\e\+\-]+)') matchlumirec = re.compile(r': IntL recorded after prescale \(ub\^-1\) : ([0-9\.\e\+\-]+)')
matchgoodlb = re.compile(': Good LBs : ([0-9]+)') matchgoodlb = re.compile(r': Good LBs : ([0-9]+)')
matchbadlb = re.compile(': Bad LBs : ([0-9]+)') matchbadlb = re.compile(r': Bad LBs : ([0-9]+)')
matchtotlumidel = re.compile(': Total IntL delivered \(ub\^-1\) : ([0-9\.\e\+\-]+)') matchtotlumidel = re.compile(r': Total IntL delivered \(ub\^-1\) : ([0-9\.\e\+\-]+)')
matchtotlumipre = re.compile(': Total IntL after livefraction \(ub\^-1\): ([0-9\.\e\+\-]+)') matchtotlumipre = re.compile(r': Total IntL after livefraction \(ub\^-1\): ([0-9\.\e\+\-]+)')
matchtotlumilar = re.compile(': Total IntL after LAr fraction \(ub\^-1\): ([0-9\.\e\+\-]+)') matchtotlumilar = re.compile(r': Total IntL after LAr fraction \(ub\^-1\): ([0-9\.\e\+\-]+)')
matchtotlumirec = re.compile(': Total IntL recorded \(ub\^-1\) : ([0-9\.\e\+\-]+)') matchtotlumirec = re.compile(r': Total IntL recorded \(ub\^-1\) : ([0-9\.\e\+\-]+)')
matchtotgoodlb = re.compile(': Total Good LBs : ([0-9]+)') matchtotgoodlb = re.compile(r': Total Good LBs : ([0-9]+)')
matchtotbadlb = re.compile(': Total Bad LBs : ([0-9]+)') matchtotbadlb = re.compile(r': Total Bad LBs : ([0-9]+)')
matchrealtime = re.compile(': Real time: ([0-9\.\e\+\-]+)') matchrealtime = re.compile(r': Real time: ([0-9\.\e\+\-]+)')
matchcputime = re.compile(': CPU time: ([0-9\.\e\+\-]+)') matchcputime = re.compile(r': CPU time: ([0-9\.\e\+\-]+)')
self.runset = set() self.runset = set()
self.lumidel = dict() self.lumidel = dict()
......
...@@ -20,7 +20,7 @@ lc.workdir = os.getcwd() ...@@ -20,7 +20,7 @@ lc.workdir = os.getcwd()
lc.subdir = os.path.basename(os.path.normpath(lc.workdir)) lc.subdir = os.path.basename(os.path.normpath(lc.workdir))
try: try:
lc.grlfn = os.path.basename(glob.glob(lc.workdir+'/*.xml')[0]) lc.grlfn = os.path.basename(glob.glob(lc.workdir+'/*.xml')[0])
except: except Exception:
lc.grlfn = '' lc.grlfn = ''
lc.f = open(lc.workdir+'/working.html', 'a') lc.f = open(lc.workdir+'/working.html', 'a')
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
from __future__ import print_function from __future__ import print_function
import cgi, os, sys
import glob import glob
import cgitb import cgitb
import subprocess import subprocess
......
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