diff --git a/Calorimeter/CaloClusterCorrection/CMakeLists.txt b/Calorimeter/CaloClusterCorrection/CMakeLists.txt index c25ec3234ed0c210110e573d5d757c5802a77c67..82f0813fb6642a2b8621a68805e2896bfafc819a 100644 --- a/Calorimeter/CaloClusterCorrection/CMakeLists.txt +++ b/Calorimeter/CaloClusterCorrection/CMakeLists.txt @@ -14,8 +14,8 @@ atlas_add_library( CaloClusterCorrectionLib PUBLIC_HEADERS CaloClusterCorrection PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES AthenaKernel CaloConditions CaloEvent CaloInterfaceLib CaloRecLib CaloUtilsLib CxxUtils GaudiKernel StoreGateLib TileConditionsLib xAODCaloEvent - PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthContainers AthenaBaseComps CaloDetDescrLib CaloGeoHelpers CaloIdentifier LArRecConditions PathResolver ) + LINK_LIBRARIES AthenaKernel CaloConditions CaloEvent CaloInterfaceLib CaloRecLib CaloUtilsLib CxxUtils GaudiKernel LArRecConditions StoreGateLib TileConditionsLib xAODCaloEvent + PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthContainers AthenaBaseComps CaloDetDescrLib CaloGeoHelpers CaloIdentifier PathResolver ) atlas_add_component( CaloClusterCorrection src/components/*.cxx @@ -28,7 +28,12 @@ atlas_add_test( interpolate_test INCLUDE_DIRS ${Boost_INCLUDE_DIRS} LINK_LIBRARIES ${Boost_LIBRARIES} CaloClusterCorrectionLib ) +atlas_add_test( config_test + SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/config_t.py + ENVIRONMENT FRONTIER_SERVER=$ENV{FRONTIER_SERVER} + LOG_IGNORE_PATTERN "Current filenames|by peeking" ) + # Install files from the package: -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) diff --git a/Calorimeter/CaloClusterCorrection/python/CaloClusterBadChannelListCorr.py b/Calorimeter/CaloClusterCorrection/python/CaloClusterBadChannelListCorr.py index 3bb425f293bbf4acbe15208ca49cd09100aaaf14..1b7b29a733de954b893f312caf1fdfa8e2e1f877 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloClusterBadChannelListCorr.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloClusterBadChannelListCorr.py @@ -1,12 +1,11 @@ -# 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 AthenaConfiguration.ComponentFactory import CompFactory def CaloClusterBadChannelListCorr() : - from CaloBadChannelTool.CaloBadChannelToolConf import CaloBadChanTool - theCaloBadChannelTool = CaloBadChanTool() + theCaloBadChannelTool = CompFactory.CaloBadChanTool() # CaloBadChannelTool - from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterBadChannelList - corr = CaloClusterBadChannelList() - #ToolSvc += corr + corr = CompFactory.CaloClusterBadChannelList() # CaloClusterCorrection corr.badChannelTool = theCaloBadChannelTool return corr diff --git a/Calorimeter/CaloClusterCorrection/python/CaloClusterListBadChannel.py b/Calorimeter/CaloClusterCorrection/python/CaloClusterListBadChannel.py index 7e729068e730832d2cc5382567404e71517f94d6..51882d0820d39958d14388efe2559334cda849c5 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloClusterListBadChannel.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloClusterListBadChannel.py @@ -1,9 +1,11 @@ -# 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 CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_NOPOOL, CALOCORR_DEFAULT_KEY +from CaloClusterCorrection.common import makecorr -from CaloClusterCorrection import CaloClusterCorrectionConf -cls = CaloClusterCorrectionConf.CaloClusterBadChannelList +cls = CompFactory.CaloClusterBadChannelList # CaloClusterCorrection CaloClusterListBadChannel_versions = [ ['', cls, @@ -11,7 +13,8 @@ CaloClusterListBadChannel_versions = [ CALOCORR_NOPOOL]], ] -def make_CaloClusterListBadChannel (corrclass, +def make_CaloClusterListBadChannel (flags, + corrclass, name = None, suffix = None, version = None, @@ -20,7 +23,8 @@ def make_CaloClusterListBadChannel (corrclass, confclass = None, **kw): - return makecorr(versions= CaloClusterListBadChannel_versions, + return makecorr(flags, + versions= CaloClusterListBadChannel_versions, name = name, basename = 'listBadChannels', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloClusterRemoveBad.py b/Calorimeter/CaloClusterCorrection/python/CaloClusterRemoveBad.py index cbae62648d1de657211cb9a052a9816e5e3de16d..ad56df9f3f05a349c3c7f0df71a0246f859330cd 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloClusterRemoveBad.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloClusterRemoveBad.py @@ -1,28 +1,32 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # File: CaloClusterCorrection/python/CaloClusterRemoveBad.py # Created: July 2010 Hong Ma # Purpose: Steering module for bad cluster removal -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_NOPOOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr -cls = CaloClusterCorrectionConf.CaloClusterRemoveBad +cls = CompFactory.CaloClusterRemoveBad # CaloCusterCorrection CaloClusterRemoveBad_versions = [ ['', cls, ['CaloClusterRemoveBad.CaloClusterRemoveBad_parms', CALOCORR_NOPOOL]], ] -def make_CaloClusterRemoveBad (name = None, - suffix = None, - version = None, - key = CALOCORR_DEFAULT_KEY, - source = None, - confclass = None, - **kw): - return makecorr (versions = CaloClusterRemoveBad_versions, +def make_CaloClusterRemoveBad (flags, + name = None, + suffix = None, + version = None, + key = CALOCORR_DEFAULT_KEY, + source = None, + confclass = None, + **kw): + return makecorr (flags, + versions = CaloClusterRemoveBad_versions, name = name, basename = 'removebad', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloClusterRemoveDuplicates.py b/Calorimeter/CaloClusterCorrection/python/CaloClusterRemoveDuplicates.py index 9680f3a9cb61ad0d12588752d7b23347eb497264..585a1fae053d4746ae740b32e3e8decb948c8fc1 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloClusterRemoveDuplicates.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloClusterRemoveDuplicates.py @@ -1,28 +1,32 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # File: CaloClusterCorrection/python/CaloClusterRemoveDuplicates.py # Created: May, 2008, M. Cooke # Purpose: Steering module for duplicate removal tool -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_NOPOOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr -cls = CaloClusterCorrectionConf.CaloClusterRemoveDuplicates +cls = CompFactory.CaloClusterRemoveDuplicates # CaloClusterCorrection CaloClusterRemoveDuplicates_versions = [ ['', cls, ['CaloClusterRemoveDuplicates.CaloClusterRemoveDuplicates_parms', CALOCORR_NOPOOL]], ] -def make_CaloClusterRemoveDuplicates (name = None, +def make_CaloClusterRemoveDuplicates (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, source = None, confclass = None, **kw): - return makecorr (versions = CaloClusterRemoveDuplicates_versions, + return makecorr (flags, + versions = CaloClusterRemoveDuplicates_versions, name = name, basename = 'removeduplicates', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloComputeSWcellWeights.py b/Calorimeter/CaloClusterCorrection/python/CaloComputeSWcellWeights.py index a200ac127e1ee626fb3b6306d5f6247be089640e..5b3b314a3ba0448fe00f8bb2ad746fdc17c4fa21 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloComputeSWcellWeights.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloComputeSWcellWeights.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloComputeSWcellWeights.py,v 1.4 2007-10-17 21:05:52 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloComputeSWcellWeights.py # Created: Nov 2006, sss @@ -17,15 +15,17 @@ # Following this, the layer variables need to be recalculated. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_NOPOOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -cls = CaloClusterCorrectionConf.CaloComputeSWcellWeights +cls = CompFactory.CaloComputeSWcellWeights # CaloClusterCorrection CaloComputeSWcellWeights_versions = [ ['', cls, ['CaloComputeSWcellWeights.CaloComputeSWcellWeights_parms', @@ -35,6 +35,7 @@ CaloComputeSWcellWeights_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -52,14 +53,16 @@ CaloComputeSWcellWeights_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloComputeSWcellWeights (name = None, +def make_CaloComputeSWcellWeights (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, source = None, confclass = None, **kw): - return makecorr (versions = CaloComputeSWcellWeights_versions, + return makecorr (flags, + versions = CaloComputeSWcellWeights_versions, name = name, basename = 'weightsEM', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration.py index 7371a5924a2e2a6549f131a9d1df6a20d8ba6b94..0a9d099d5b401f37a3e5c0adc7f5686f46d4a703 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # File: CaloClusterCorrection/python/CaloSwCalibHitsCalibration.py @@ -14,15 +14,17 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloSwCalibHitsCalibration +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls = CompFactory.CaloSwCalibHitsCalibration # CaloClusterCorrection CaloSwCalibHitsCalibration_versions = [ # 12.0.3 simulation and reconstruction, with ideal (calib0) geometry. @@ -120,6 +122,7 @@ CaloSwCalibHitsCalibration_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -137,7 +140,8 @@ CaloSwCalibHitsCalibration_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwCalibHitsCalibration (name = None, +def make_CaloSwCalibHitsCalibration (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -145,7 +149,8 @@ def make_CaloSwCalibHitsCalibration (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloSwCalibHitsCalibration_versions, + return makecorr (flags, + versions = CaloSwCalibHitsCalibration_versions, name = name, basename = 'calhits', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v1.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v1.py index e4b3aadd1d1985e6e88198724afac926355d1df2..f36f521d08e23293a4a08d7a982420dd9798adfb 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v1.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v1.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ####################################################################### # File: CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v1.py @@ -27,7 +27,7 @@ # 5) CaloSWCalHitsEfront_slope_v1_gam ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -1972,7 +1972,7 @@ samplings_depths = [ [ 2.4625 , 0.0 , 3.4 , 19.525 , 36.25 ], [ 2.4825 , 0.0 , 3.475 , 19.925 , 36.875 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v2.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v2.py index f97325d16c511e740565dca0adc530a372674d9a..f15c609e49e0d61a42ea96d9339f01dd626f8429 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v2.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v2.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ####################################################################### @@ -28,7 +28,7 @@ # 5) CaloSWCalHitsEfront_slope_v2_gam ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -1935,7 +1935,7 @@ samplings_depths = [ [ 2.4625 , 0.0 , 3.77207 , 15.3194 , 31.8341 ], [ 2.4875 , 0.0 , 3.83388 , 15.5645 , 32.2648 ], -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v5.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v5.py index 4b6b88ca73dbfc565de212484043189a8c7d2411..6181160594f43a5c7c2e4203e8bf3dadc23fd612 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v5.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v5.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ####################################################################### @@ -29,7 +29,7 @@ # 5) CaloSWCalHitsEfront_slope_v5_gam ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -1938,7 +1938,7 @@ samplings_depths = [ [ 2.4625 , 0.0 , 3.4 , 19.525 , 36.25 ], [ 2.4825 , 0.0 , 3.475 , 19.925 , 36.875 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v5_1.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v5_1.py index f77b5fd2fb49ce419e12c6b2ec5ffbfa53cac70d..f1382945127344dbf2279e550c89ba178188f05c 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v5_1.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v5_1.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ####################################################################### @@ -30,7 +30,7 @@ # 5) CaloSWCalHitsEfront_slope_v5_1_gam ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -1938,7 +1938,7 @@ samplings_depths = [ [ 2.4375 , 0.0 , 3.84839 , 15.3758 , 31.5893 ], [ 2.4625 , 0.0 , 3.7751 , 15.3528 , 31.7805 ], [ 2.4875 , 0.0 , 3.82319 , 15.5724 , 32.3008 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v6.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v6.py index 1265c413b84d45b1419270b6577225b2fa31bdf1..6f286f3f046c0924db73847ed5523d25b212b240 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v6.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v6.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ####################################################################### @@ -33,7 +33,7 @@ # Where YY is "conv" for converted or "unconv" for unconverted ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -2683,7 +2683,7 @@ samplings_depths = [ [ 2.4375 , 0.0 , 3.84839 , 15.3758 , 31.5893 ], [ 2.4625 , 0.0 , 3.7751 , 15.3528 , 31.7805 ], [ 2.4875 , 0.0 , 3.82319 , 15.5724 , 32.3008 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v6leakdata.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v6leakdata.py index 5d14ca11c5b1c2e51433e483c46287bc613032be..b578eaf159f6e8c16617d15cf94fd0336d044f72 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v6leakdata.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v6leakdata.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ####################################################################### @@ -36,7 +36,7 @@ # Where YY is "conv" for converted or "unconv" for unconverted ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -2686,7 +2686,7 @@ samplings_depths = [ [ 2.4375 , 0.0 , 3.84839 , 15.3758 , 31.5893 ], [ 2.4625 , 0.0 , 3.7751 , 15.3528 , 31.7805 ], [ 2.4875 , 0.0 , 3.82319 , 15.5724 , 32.3008 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v8.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v8.py index 36f9a01aa55077d866785dd33da6cab0ec5da694..21018faf63c81bd5b5e91c8beb287f9233703b23 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v8.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v8.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ####################################################################### @@ -37,7 +37,7 @@ # R. Turra. ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -2736,7 +2736,7 @@ samplings_depths = [ [ 2.4375 , 0.0 , 4.5959 , 15.9977 , 32.1175 ], [ 2.4625 , 0.0 , 4.68513 , 16.2385 , 32.5042 ], [ 2.4875 , 0.0 , 4.7232 , 16.4144 , 33.028 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v8leakdata.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v8leakdata.py index f816bf8a48112b999a25a5bc26fb48b127510906..4f78cdfef5edf68a31d60e7689703e544c5318fb 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v8leakdata.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v8leakdata.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ####################################################################### @@ -41,7 +41,7 @@ # R. Turra. ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -2739,7 +2739,7 @@ samplings_depths = [ [ 2.4375 , 0.0 , 4.5959 , 15.9977 , 32.1175 ], [ 2.4625 , 0.0 , 4.68513 , 16.2385 , 32.5042 ], [ 2.4875 , 0.0 , 4.7232 , 16.4144 , 33.028 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v9.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v9.py index 0cc3c5c5b1800d72d73754f5e49d60fc0b8448ca..d7340559bed906088e45b8eaaa8ba4fbd826924c 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v9.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v9.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ####################################################################### @@ -41,7 +41,7 @@ # R. Turra. ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -2740,7 +2740,7 @@ samplings_depths = [ [ 2.4375 , 0.0 , 4.5959 , 15.9977 , 32.1175 ], [ 2.4625 , 0.0 , 4.68513 , 16.2385 , 32.5042 ], [ 2.4875 , 0.0 , 4.7232 , 16.4144 , 33.028 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v9leakdata.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v9leakdata.py index 03b6e241c2ed6c0d5ba6d6c3d69aa9008ef11ffb..eaa353bfd4da32051266812449453a52f193dcd6 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v9leakdata.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCalibHitsCalibration_v9leakdata.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ####################################################################### @@ -41,7 +41,7 @@ # R. Turra. ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -2739,7 +2739,7 @@ samplings_depths = [ [ 2.4375 , 0.0 , 4.5959 , 15.9977 , 32.1175 ], [ 2.4625 , 0.0 , 4.68513 , 16.2385 , 32.5042 ], [ 2.4875 , 0.0 , 4.7232 , 16.4144 , 33.028 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwClcon.py b/Calorimeter/CaloClusterCorrection/python/CaloSwClcon.py index 143987badc56bc80e2589ccb3c80713c853912fb..f599f1d0abf0332f16b0a8355d962ab4e23cc7a2 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwClcon.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwClcon.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwClcon.py,v 1.8 2009-04-19 02:41:06 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwClcon.py # Created: Nov 2006, sss @@ -20,16 +18,18 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls_g3 = CaloClusterCorrectionConf.CaloSwClcon_g3 -cls_v2 = CaloClusterCorrectionConf.CaloSwClcon_v2 +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls_g3 = CompFactory.CaloSwClcon_g3 # CaloClusterCorrection +cls_v2 = CompFactory.CaloSwClcon_v2 # CaloClusterCorrection CaloSwClcon_versions = [ # The original G3-based correction, translated from the @@ -55,6 +55,7 @@ CaloSwClcon_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -72,7 +73,8 @@ CaloSwClcon_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwClcon (name = None, +def make_CaloSwClcon (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -80,7 +82,8 @@ def make_CaloSwClcon (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloSwClcon_versions, + return makecorr (flags, + versions = CaloSwClcon_versions, name = name, basename = 'clcon', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_dc2.py b/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_dc2.py index e7fb313f8b3be0a05a439aed98493bf1499a1516..a4bd7f2810c59156b11808e2d6bc25dafec9fcbb 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_dc2.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_dc2.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwClcon_dc2.py,v 1.3 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwClcon_dc2.py # Created: Nov 2006, sss @@ -17,7 +15,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_CLUSTER from AthenaCommon.SystemOfUnits import GeV diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_dc2new.py b/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_dc2new.py index 258715b0ea499a1ba14fdbc72c1488670b890adc..90004ba47cd6e5e5399a0d31a33c3857c53ef109 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_dc2new.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_dc2new.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwClcon_dc2new.py,v 1.3 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwClcon_dc2new.py # Created: Nov 2006, sss @@ -17,7 +15,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_CLUSTER from AthenaCommon.SystemOfUnits import GeV diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_g3.py b/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_g3.py index 11dd9e2b360567d9259330810cde37a518b613e0..087b65c2e32eca1156532ae4187b2378aa7c7503 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_g3.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwClcon_g3.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwClcon_g3.py,v 1.3 2009-04-21 21:16:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwClcon_g3.py # Created: Nov 2006, sss @@ -12,10 +10,7 @@ # -import string - - - # 3x3 cluster size corrections +# 3x3 cluster size corrections qclcon_g3_correction_33 = \ [ 1.078375, 1.073588, 1.068029, 1.067124, 1.065353, 1.063478, 1.063487, 1.064091, 1.064620, 1.065535, 1.065928, 1.064441, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwClusterUpdate.py b/Calorimeter/CaloClusterCorrection/python/CaloSwClusterUpdate.py index 0893dc3743cf96fc0bec871fc3c72d288774b7be..11ba25a19cb5f73cb711d66128ea1dfde53df25f 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwClusterUpdate.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwClusterUpdate.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwClusterUpdate.py,v 1.3 2009-04-25 17:57:00 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwClusterUpdate.py # Created: Nov 2006, sss @@ -15,30 +13,34 @@ # leaves the total cluster energy unchanged. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -cls = CaloClusterCorrectionConf.CaloClusterUpdate +cls = CompFactory.CaloClusterUpdate # CaloClusterCorrection +from CaloClusterCorrection.constants import sw_valid_keys as keys CaloSwClusterUpdate_versions = [ # This version doesn't recalculate the total cluster energy. ['dont_update_e', cls, ['CaloSwClusterUpdate.CaloSwClusterUpdate_dont_update_e_parms', - 'caloswcorr_pool', CALOCORR_COOL]], + 'caloswcorr_pool', CALOCORR_COOL], keys], # This version does recalculate the total cluster energy. ['', cls, ['CaloSwClusterUpdate.CaloSwClusterUpdate_parms', - 'caloswcorr_pool', CALOCORR_COOL]], + 'caloswcorr_pool', CALOCORR_COOL], keys], ] # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -56,14 +58,16 @@ CaloSwClusterUpdate_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwClusterUpdate (name = None, +def make_CaloSwClusterUpdate (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, source = None, confclass = None, **kw): - return makecorr (versions = CaloSwClusterUpdate_versions, + return makecorr (flags, + versions = CaloSwClusterUpdate_versions, name = name, basename = 'larupdate', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwCorrections.py b/Calorimeter/CaloClusterCorrection/python/CaloSwCorrections.py index 189f170d9518b44543f0628e440e7770f3b83613..d3e798b8c1297ef1929de832a6ce769d5a7ab063 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwCorrections.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwCorrections.py @@ -1,20 +1,19 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwCorrections.py,v 1.40 2009-04-30 20:29:53 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwCorrections.py # Created: Nov 2006, sss # Purpose: Top-level configuration file for EM cluster corrections. # -# The main entry point here is make_CaloSwCorrections, which returns +# The main entry point here is make_CaloSwCorrectionsCfg, which returns +# ComponentAccumulator with # a list of correction tools. It can be used either `le menu' --- selecting # a predefined list of correction tools, or `a la carte' --- explicitly # specifying the list of tools you want to run. # # The simplest way of using it is like this: # -# make_CaloSwCorrections (key) +# ca = make_CaloSwCorrectionsCfg (flags, key) # # Here, `key' is a string that denotes the type of cluster which you # are correcting. It should be something like `ele55' for 5x5 electrons, @@ -29,7 +28,7 @@ # By default, the latest version of the corrections appropriate to the # geometry being used will be chosen. You can override this selection # by supplying the `version' argument. It may also be overridden -# with caloClusterCorrectionFlags.CaloSwWhichCorrection. +# with Calo.ClusterCorrection.CaloSwWhichCorrection. # For the list of known version # names, see the variable `CaloSwCorrection_versions' below. # In particular, using version `none' turns off the corrections. @@ -39,7 +38,7 @@ # the version to be used for individual correction by adding # parameters of the form CORRECTION_version. For example: # -# make_CaloSwCorrections (key, version='v4', lwc_version='v3') +# make_CaloSwCorrectionsCfg (flags ,key, version='v4', lwc_version='v3') # # uses the `v4' corrections, except that we use version `v3' of the # layer weight corrections. You can also specify CORRECTION_key @@ -47,7 +46,7 @@ # and CORRECTION_XXX to override any individual parameter # of a correction. For example: # -# make_CaloSwCorrections (key, lwc_degree=2) +# make_CaloSwCorrectionsCfg (flags, key, lwc_degree=2) # # makes the full standard set of corrections, except that the interpolation # degree for the layer weights correction is changed to 2. @@ -55,13 +54,13 @@ # You can explicitly specify a list of corrections to run with the # `corrlist' argument. For example, # -# make_CaloSwCorrections (key, corrlist=[[layers], [update], [gap]]) +# make_CaloSwCorrectionsCfg (flags, key, corrlist=[[layers], [update], [gap]]) # # runs only the `layers', `update', and `gap' corrections. The names # used here, like `layers' should be functions defined with this # signature: # -# def layers (cells_name, suffix, version, key, source, **kw): +# def layers (flags, cells_name, suffix, version, key, source, **kw): # # Definitions for all the standard corrections are contained in this file. # Note that the names of these functions are what are used to recognize @@ -81,9 +80,10 @@ # settings may be specified as following (name, value) tuples # in the list. For example: # -# make_CaloSwCorrections (key, corrlist=[[layers], -# [update], -# [gap, 'v3', ('degree', 2)]]) +# make_CaloSwCorrectionsCfg (flags, +# key, corrlist=[[layers], +# [update], +# [gap, 'v3', ('degree', 2)]]) # # says to use version `v3' of the gap correction, and in addition, # to override the interpolation degree to be 2. @@ -92,27 +92,27 @@ # list will be augmented so that cells will be weighted to avoid # double-counting the energy of cells that are in more than one cluster. # This may also be enabled by adding the string `_wt' to the end -# of the correction version name, or by setting the DoSlidingWindowCellWeights -# flag. +# of the correction version name, or by setting the +# Calo.ClusterCorrections.doSlidingWindowCellWeights flag. # # Similarly, if the parameter `remdup' is set to True, then the standard # correction list will be augmented so that if there are multiple clusters # too close together, all but one will be removed. # This may also be enabled by adding the string `_remdup' to the end # of the correction version name, or by setting the -# DoSlidingWindowRemoveDuplicates flag. +# Calo.ClusterCorrection.doSlidingWindowRemoveDuplicates flag. # # Also, if the parameter `rembad' is set to True, then the standard # correction list will be augmented so that clusters deemed to be # bad (below an energy threshold) will be removed. # This may also be enabled by adding the string `_rembad' to the end # of the correction version name, or by setting the -# DoSlidingWindowRemoveBad flag. +# Calo.ClusterCorrection.doSlidingWindowRemoveBad flag. # # There are three ways in which a correction can get configured: from # job options, from pool, or from cool. You can specify which ones -# to use by adding the `source' argument to make_CaloSwCorrections. -# This is one of the following (defined in common.py): +# to use by adding the `source' argument to make_CaloSwCorrectionsCfg. +# This is one of the following (defined in constants.py): # # - CALOCORR_JO: Configure from job options # - CALOCORR_POOL: Configure from a pool file @@ -123,7 +123,7 @@ # # This parameter may be specified as a list of any of these values; in that # case, all the possibilities will be tried in order. The default is taken -# from caloClusterCorrectionFlags.DefaultSource +# from Calo.ClusterCorrection.defaultSource # if it hasn't been explicitly set. The usual setting is to try first # cool, then pool, then job options. (Note that there are a couple # corrections which are not saved to pool/cool and can thus only @@ -136,112 +136,122 @@ # with a string of the form `MODULE.NAME'. # -import sys -import re -from CaloClusterCorrection.CaloClusterCorrectionFlags \ - import caloClusterCorrectionFlags -from CaloClusterCorrection.CaloComputeSWcellWeights \ - import make_CaloComputeSWcellWeights -from CaloClusterCorrection.CaloSwLayers import make_CaloSwLayers -from CaloClusterCorrection.CaloSwRfac import make_CaloSwRfac -from CaloClusterCorrection.CaloSwEtaoff import make_CaloSwEtaoff -from CaloClusterCorrection.CaloSwPhioff import make_CaloSwPhioff -from CaloClusterCorrection.CaloSwEtamod import make_CaloSwEtamod -from CaloClusterCorrection.CaloSwPhimod import make_CaloSwPhimod -from CaloClusterCorrection.CaloSwClusterUpdate \ - import make_CaloSwClusterUpdate -from CaloClusterCorrection.CaloSwGap import make_CaloSwGap -from CaloClusterCorrection.CaloSwLongWeights import make_CaloSwLongWeights -from CaloClusterCorrection.CaloSwCalibHitsCalibration import make_CaloSwCalibHitsCalibration -from CaloClusterCorrection.CaloSwDeadOTX_ps import make_CaloSwDeadOTX_ps -from CaloClusterCorrection.CaloSwDeadOTX_back import make_CaloSwDeadOTX_back -from CaloClusterCorrection.CaloSwTransitionRegionsCorr import make_CaloSwTransitionRegionsCorr -from CaloClusterCorrection.CaloClusterListBadChannel import make_CaloClusterListBadChannel -from CaloClusterCorrection.CaloSwClcon import make_CaloSwClcon -from CaloClusterCorrection.CaloSwTime import make_CaloSwTime -from CaloClusterCorrection.common import * -from CaloClusterCorrection.CaloClusterCorrectionFlags \ - import caloClusterCorrectionFlags - -from CaloClusterCorrection.CaloClusterRemoveDuplicates import make_CaloClusterRemoveDuplicates -from CaloClusterCorrection.CaloClusterRemoveBad import make_CaloClusterRemoveBad +# Need to be sure that we always get run3 configurables in the imported +# steering modules. +from AthenaCommon.Configurable import Configurable + +try: + _wasRun3 = Configurable.configurableRun3Behavior + Configurable.configurableRun3Behavior = True + + import re + from CaloClusterCorrection.CaloComputeSWcellWeights \ + import make_CaloComputeSWcellWeights + from CaloClusterCorrection.CaloSwLayers import make_CaloSwLayers + from CaloClusterCorrection.CaloSwRfac import make_CaloSwRfac + from CaloClusterCorrection.CaloSwEtaoff import make_CaloSwEtaoff + from CaloClusterCorrection.CaloSwPhioff import make_CaloSwPhioff + from CaloClusterCorrection.CaloSwEtamod import make_CaloSwEtamod + from CaloClusterCorrection.CaloSwPhimod import make_CaloSwPhimod + from CaloClusterCorrection.CaloSwClusterUpdate \ + import make_CaloSwClusterUpdate + from CaloClusterCorrection.CaloSwGap import make_CaloSwGap + from CaloClusterCorrection.CaloSwLongWeights import make_CaloSwLongWeights + from CaloClusterCorrection.CaloSwCalibHitsCalibration import make_CaloSwCalibHitsCalibration + from CaloClusterCorrection.CaloSwDeadOTX_ps import make_CaloSwDeadOTX_ps + from CaloClusterCorrection.CaloSwDeadOTX_back import make_CaloSwDeadOTX_back + from CaloClusterCorrection.CaloSwTransitionRegionsCorr import make_CaloSwTransitionRegionsCorr + from CaloClusterCorrection.CaloClusterListBadChannel import make_CaloClusterListBadChannel + from CaloClusterCorrection.CaloSwClcon import make_CaloSwClcon + from CaloClusterCorrection.CaloSwTime import make_CaloSwTime + from CaloClusterCorrection.constants import \ + CALOCORR_SW, EMB1, EME1, EMB2, EME2 + from CaloClusterCorrection.common import CaloClusterCorrSetup + from CaloClusterCorrection.compat import makeFlags, unpackCA + + from CaloClusterCorrection.CaloClusterRemoveDuplicates import make_CaloClusterRemoveDuplicates + from CaloClusterCorrection.CaloClusterRemoveBad import make_CaloClusterRemoveBad + +finally: + Configurable.configurableRun3Behavior = _wasRun3 + ############################################################################## # Here we define wrapper functions to set up all of the standard corrections. # In the case where a correction has multiple versions for different # samplings, we define multiple wrappers here. # These are the names to use in the correction list and in the -# arguments to make_CaloSwCorrection. +# arguments to make_CaloSwCorrectionCfg. # -def layers (cells_name, *args, **kw): - return make_CaloSwLayers (None, cells_name=cells_name, *args, **kw) +def layers (flags, cells_name, *args, **kw): + return make_CaloSwLayers (flags, None, cells_name=cells_name, *args, **kw) -def weight (cells_name, *args, **kw): - return make_CaloComputeSWcellWeights (None, *args, **kw) +def weight (flags, cells_name, *args, **kw): + return make_CaloComputeSWcellWeights (flags, None, *args, **kw) -def rfac (cells_name, *args, **kw): - return make_CaloSwRfac (None, *args, **kw) +def rfac (flags, cells_name, *args, **kw): + return make_CaloSwRfac (flags, None, *args, **kw) -def etaoff_b1 (cells_name, *args, **kw): - return make_CaloSwEtaoff (EMB1, None, *args, **kw) +def etaoff_b1 (flags, cells_name, *args, **kw): + return make_CaloSwEtaoff (flags, EMB1, None, *args, **kw) -def etaoff_b2 (cells_name, *args, **kw): - return make_CaloSwEtaoff (EMB2, None, *args, **kw) +def etaoff_b2 (flags, cells_name, *args, **kw): + return make_CaloSwEtaoff (flags, EMB2, None, *args, **kw) -def etaoff_e1 (cells_name, *args, **kw): - return make_CaloSwEtaoff (EME1, None, *args, **kw) +def etaoff_e1 (flags, cells_name, *args, **kw): + return make_CaloSwEtaoff (flags, EME1, None, *args, **kw) -def etaoff_e2 (cells_name, *args, **kw): - return make_CaloSwEtaoff (EME2, None, *args, **kw) +def etaoff_e2 (flags, cells_name, *args, **kw): + return make_CaloSwEtaoff (flags, EME2, None, *args, **kw) -def phioff_b2 (cells_name, *args, **kw): - return make_CaloSwPhioff (EMB2, None, *args, **kw) +def phioff_b2 (flags, cells_name, *args, **kw): + return make_CaloSwPhioff (flags, EMB2, None, *args, **kw) -def phioff_e2 (cells_name, *args, **kw): - return make_CaloSwPhioff (EME2, None, *args, **kw) +def phioff_e2 (flags, cells_name, *args, **kw): + return make_CaloSwPhioff (flags, EME2, None, *args, **kw) -def phimod (cells_name, *args, **kw): - return make_CaloSwPhimod (None, *args, **kw) +def phimod (flags, cells_name, *args, **kw): + return make_CaloSwPhimod (flags, None, *args, **kw) -def etamod (cells_name, *args, **kw): - return make_CaloSwEtamod (None, *args, **kw) +def etamod (flags, cells_name, *args, **kw): + return make_CaloSwEtamod (flags, None, *args, **kw) -def update (cells_name, *args, **kw): - return make_CaloSwClusterUpdate (None, *args, **kw) +def update (flags, cells_name, *args, **kw): + return make_CaloSwClusterUpdate (flags, None, *args, **kw) -def gap (cells_name, *args, **kw): - return make_CaloSwGap (None, cells_name=cells_name, *args, **kw) +def gap (flags, cells_name, *args, **kw): + return make_CaloSwGap (flags, None, cells_name=cells_name, *args, **kw) -def lwc (cells_name, *args, **kw): - return make_CaloSwLongWeights (None, *args, **kw) +def lwc (flags, cells_name, *args, **kw): + return make_CaloSwLongWeights (flags, None, *args, **kw) -def calhits (cells_name, *args, **kw): - return make_CaloSwCalibHitsCalibration (None, *args, **kw) +def calhits (flags, cells_name, *args, **kw): + return make_CaloSwCalibHitsCalibration (flags, None, *args, **kw) -def trcorr (cells_name, *args, **kw): - return make_CaloSwTransitionRegionsCorr (None, *args, **kw) +def trcorr (flags, cells_name, *args, **kw): + return make_CaloSwTransitionRegionsCorr (flags, None, *args, **kw) -def deadOTXps (cells_name, *args, **kw): - return make_CaloSwDeadOTX_ps ( None, *args, **kw ) +def deadOTXps (flags, cells_name, *args, **kw): + return make_CaloSwDeadOTX_ps (flags, None, *args, **kw ) -def deadOTXback (cells_name, *args, **kw): - return make_CaloSwDeadOTX_back ( None, *args, **kw ) +def deadOTXback (flags, cells_name, *args, **kw): + return make_CaloSwDeadOTX_back (flags, None, *args, **kw ) -def clcon (cells_name, *args, **kw): - return make_CaloSwClcon (None, *args, **kw) +def clcon (flags, cells_name, *args, **kw): + return make_CaloSwClcon (flags, None, *args, **kw) -def removeduplicates (cells_name, *args, **kw): - return make_CaloClusterRemoveDuplicates (None, *args, **kw) +def removeduplicates (flags, cells_name, *args, **kw): + return make_CaloClusterRemoveDuplicates (flags, None, *args, **kw) -def removebad (cells_name, *args, **kw): - return make_CaloClusterRemoveBad (None, *args, **kw) +def removebad (flags, cells_name, *args, **kw): + return make_CaloClusterRemoveBad (flags, None, *args, **kw) -def listBadChannel (cells_name, *args, **kw): - return make_CaloClusterListBadChannel (CALOCORR_SW, None, *args, **kw) +def listBadChannel (flags, cells_name, *args, **kw): + return make_CaloClusterListBadChannel (flags, CALOCORR_SW, None, *args, **kw) -def time (cells_name, *args, **kw): - return make_CaloSwTime (None, *args, **kw) +def time (flags, cells_name, *args, **kw): + return make_CaloSwTime (flags, None, *args, **kw) ############################################################################## @@ -261,8 +271,8 @@ def _version_match (version, fragment): class CaloSwCorrectionsSetup (CaloClusterCorrSetup): name = "EM sliding-window" - version_override_flag = caloClusterCorrectionFlags.CaloSwWhichCorrection - correction_generation_flag = caloClusterCorrectionFlags.CaloSwGeneration + version_override_flag_name = 'caloSwWhichCorrection' + correction_generation_flag_name = 'caloSwGeneration' correction_generation_default = "00-02-13" ########################################################################## @@ -506,8 +516,8 @@ class CaloSwCorrectionsSetup (CaloClusterCorrSetup): [etamod, 'v4', 502], [time, 801], [listBadChannel, 820]], - - + + # Calibration hits and transition region corrections updated # for release 14.0.0 geometry (ATLAS-CSC-05-00-00). # Other corrections still based on 12. @@ -1107,10 +1117,8 @@ class CaloSwCorrectionsSetup (CaloClusterCorrSetup): ########################################################################## # Code to handle cell weighting. # - def make_corrections (self, **kw_in): - kw = {} - if caloClusterCorrectionFlags.CaloSwCorrectionArgs.statusOn: - kw = caloClusterCorrectionFlags.CaloSwCorrectionArgs().copy() + def make_corrections (self, flags, **kw_in): + kw = flags.Calo.ClusterCorrection.caloSwCorrectionArgs kw.update (kw_in) for kk in ['weighting', 'remdup', 'rembad']: @@ -1118,32 +1126,34 @@ class CaloSwCorrectionsSetup (CaloClusterCorrSetup): setattr (self, kk, kw[kk]) del kw[kk] - return CaloClusterCorrSetup.make_corrections (self, **kw) + return CaloClusterCorrSetup.make_corrections (self, flags, **kw) - def lookup_version (self, version): + def lookup_version (self, flags, version, corrclass): # Special cases: # If the version name includes `_wt', turn on weighting. (self.weighting, version) = _version_match (version, 'wt') - # If the version name includes with `_remdup', + # If the version name includes `_remdup', # turn on duplicate removal. (self.remdup, version) = _version_match (version, 'remdup') - # If the version name includes with `_rembad', + # If the version name includes `_rembad', # turn on bad cluster removal. (self.rembad, version) = _version_match (version, 'rembad') # Now, find the standard list of corrections to use. (vcorrlist, version) = CaloClusterCorrSetup.lookup_version (self, - version) + flags, + version, + corrclass) # Check global flags. - if caloClusterCorrectionFlags.DoSlidingWindowCellWeights(): + if flags.Calo.ClusterCorrection.doSlidingWindowCellWeights: self.weighting = 1 - if caloClusterCorrectionFlags.DoSlidingWindowRemoveDuplicates(): + if flags.Calo.ClusterCorrection.doSlidingWindowRemoveDuplicates: self.remdup = 1 - if caloClusterCorrectionFlags.DoSlidingWindowRemoveBad(): + if flags.Calo.ClusterCorrection.doSlidingWindowRemoveBad: self.rembad = 1 # If weighting or rembad is turned on, make the appropriate additions @@ -1154,7 +1164,7 @@ class CaloSwCorrectionsSetup (CaloClusterCorrSetup): if c[0] == layers: ilayers = i break - if ilayers != None: + if ilayers is not None: vcorrlist = vcorrlist[:] if self.rembad: vcorrlist.insert (ilayers + 1, [removebad, 121]) @@ -1182,11 +1192,12 @@ CaloSwCorrections = CaloSwCorrectionsSetup() ############################################################################## -# Main entry point to create a list of correction tools. +# Main entry point to create a list of correction tools # # -# Create and return a list of correction tools. +# Create and return a CA of correction tools. +# FLAGS are the configuration flags. # KEY is a string that specifies the correction type. # SUFFIX is a string to add to the end of each tool name. # VERSION specifies which version of corrections to use. @@ -1203,17 +1214,19 @@ CaloSwCorrections = CaloSwCorrectionsSetup() # # For more detailed information, see the comments at the start of this file. # -def make_CaloSwCorrections (key = None, - suffix = '', - version = None, - corrlist = None, - cells_name = None, - source = None, - weighting = False, - remdup = False, - rembad = False, - **kw): - return CaloSwCorrections.make_corrections (corrclass = CALOCORR_SW, +def make_CaloSwCorrectionsCfg (flags, + key = None, + suffix = '', + version = None, + corrlist = None, + cells_name = None, + source = None, + weighting = False, + remdup = False, + rembad = False, + **kw): + return CaloSwCorrections.make_corrections (flags, + corrclass = CALOCORR_SW, key = key, suffix = suffix, version = version, @@ -1228,8 +1241,58 @@ def make_CaloSwCorrections (key = None, ############################################################################## -# Compatibility hacks. +# Backwards compatibility: +# Main entry point to create a list of correction tools (old configuration) +# + +# +# Create and return a list of correction tools. +# KEY is a string that specifies the correction type. +# SUFFIX is a string to add to the end of each tool name. +# VERSION specifies which version of corrections to use. +# CORRLIST can be used to explicitly specify which corrections to run. +# CELLS_NAME is the SG key to use to find the calorimeter cells, +# for those corrections that require it. +# SOURCE specifies the source(s) from which tools are configured. +# See above for details. +# None means to use the default. +# If WEIGHTING is true, then cells are weighted to avoid +# double-counting energy for cells that are shared between clusters. +# If REMDUP is true, then in groups of clusters that are very close +# together, we drop all but one. +# +# For more detailed information, see the comments at the start of this file. # +def make_CaloSwCorrections (key = None, + suffix = '', + version = None, + corrlist = None, + cells_name = None, + source = None, + weighting = False, + remdup = False, + rembad = False, + **kw): + try: + wasRun3 = Configurable.configurableRun3Behavior + Configurable.configurableRun3Behavior = True + ca = CaloSwCorrections.make_corrections (makeFlags(), + corrclass = CALOCORR_SW, + key = key, + suffix = suffix, + version = version, + corrlist = corrlist, + cells_name = cells_name, + source = source, + weighting = weighting, + remdup = remdup, + rembad = rembad, + **kw) + finally: + Configurable.configurableRun3Behavior = wasRun3 + return unpackCA (ca) + + # # Creating an instance of this class gives you something which @@ -1243,7 +1306,7 @@ class CaloSwCorrections_compat: self.version = version return def set (self, alg, suffix='', corrlist ='ele55', key = None): - if type (corrlist) == type (''): + if isinstance (corrlist, str): key = corrlist corrlist = None diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_back.py b/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_back.py index 0a35839f1f0fe0b67e1d6dbbfb64efca96ab03a4..7c222d07b55e63122342daa51c2a0fcdcd6a9b32 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_back.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_back.py @@ -6,15 +6,16 @@ # Purpose: Steering module for dead OTX correction in the back # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloSwDeadOTX_back +cls = CompFactory.CaloSwDeadOTX_back # CaloClusterCorrection CaloSwDeadOTX_back_versions = [ # ['v1', cls, ['CaloSwDeadOTX_back_v1.' + @@ -31,6 +32,7 @@ CaloSwDeadOTX_back_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -47,19 +49,21 @@ CaloSwDeadOTX_back_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwDeadOTX_back(name = None, - suffix = None, - version = None, - key = CALOCORR_DEFAULT_KEY, - source = None, - confclass = None, - **kw): +def make_CaloSwDeadOTX_back(flags, + name = None, + suffix = None, + version = None, + key = CALOCORR_DEFAULT_KEY, + source = None, + confclass = None, + **kw): - from CaloTools.CaloToolsConf import CaloAffectedTool + CaloAffectedTool = CompFactory.CaloAffectedTool # CaloTools theAffectedTool = CaloAffectedTool("CaloAffectedForDeadOTX_back") # Make the tool. - return makecorr (versions = CaloSwDeadOTX_back_versions, + return makecorr (flags, + versions = CaloSwDeadOTX_back_versions, name = name, basename = 'deadOTXback', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_back_v1.py b/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_back_v1.py index 5a1b5c1297ba401c3396a53218c9a41453cdbc62..acb792f18e8cf1e4f532731c00e0a6f91da36710 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_back_v1.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_back_v1.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ########################################################################## @@ -15,7 +15,7 @@ # ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### @@ -443,7 +443,7 @@ samplings_depths = [ [ 2.4375 , 0.0 , 4.5959 , 15.9977 , 32.1175 ], [ 2.4625 , 0.0 , 4.68513 , 16.2385 , 32.5042 ], [ 2.4875 , 0.0 , 4.7232 , 16.4144 , 33.028 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_ps.py b/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_ps.py index 57c226f9eab54603d53bb16b65e6e4e4c7689439..b6b42570378e0bcad7a9aef66eb471a18b788d65 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_ps.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_ps.py @@ -6,15 +6,16 @@ # Purpose: Steering module for dead OTX correction in the PS # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloSwDeadOTX_ps +cls = CompFactory.CaloSwDeadOTX_ps # CaloClusterCorrection CaloSwDeadOTX_ps_versions = [ # ['v1', cls, ['CaloSwDeadOTX_ps_v1.' + @@ -31,6 +32,7 @@ CaloSwDeadOTX_ps_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -47,19 +49,21 @@ CaloSwDeadOTX_ps_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwDeadOTX_ps(name = None, - suffix = None, - version = None, - key = CALOCORR_DEFAULT_KEY, - source = None, - confclass = None, - **kw): +def make_CaloSwDeadOTX_ps(flags, + name = None, + suffix = None, + version = None, + key = CALOCORR_DEFAULT_KEY, + source = None, + confclass = None, + **kw): - from CaloTools.CaloToolsConf import CaloAffectedTool + CaloAffectedTool = CompFactory.CaloAffectedTool # CaloTools theAffectedTool = CaloAffectedTool("CaloAffectedToolForDeadOTX_ps") # Make the tool. - return makecorr (versions = CaloSwDeadOTX_ps_versions, + return makecorr (flags, + versions = CaloSwDeadOTX_ps_versions, name = name, basename = 'deadOTXps', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_ps_v1.py b/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_ps_v1.py index a5055ffef9315b56470614d8a537825c64847a4d..a82165e7b6e4204d77cbd1f6be1db37df527515e 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_ps_v1.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_ps_v1.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # ########################################################################## @@ -16,7 +16,7 @@ # ####################################################################### -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### CaloSWCalHitsEfrontOff_ele_NoPS_v1 = [ @@ -1060,7 +1060,7 @@ samplings_depths = [ [ 2.4375 , 0.0 , 4.5959 , 15.9977 , 32.1175 ], [ 2.4625 , 0.0 , 4.68513 , 16.2385 , 32.5042 ], [ 2.4875 , 0.0 , 4.7232 , 16.4144 , 33.028 ] -]; +] ####################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod.py index 8a0802a3d4e9a0b05bb16ddc1bc21e8f1331f096..119fe8ff37b83f4f1893eec0f1190bcbb4b85de2 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtamod.py,v 1.9 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtamod.py # Created: Nov 2006, sss @@ -23,16 +21,18 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls_g3 = CaloClusterCorrectionConf.CaloSwEtamod_g3 -cls_v2 = CaloClusterCorrectionConf.CaloSwEtamod_v2 +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls_g3 = CompFactory.CaloSwEtamod_g3 # CaloClusterCorrection +cls_v2 = CompFactory.CaloSwEtamod_v2 # CaloClusterCorrection CaloSwEtamod_versions = [ # The original G3-based correction, translated from the @@ -64,6 +64,7 @@ CaloSwEtamod_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -81,7 +82,8 @@ CaloSwEtamod_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwEtamod (name = None, +def make_CaloSwEtamod (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -89,7 +91,8 @@ def make_CaloSwEtamod (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloSwEtamod_versions, + return makecorr (flags, + versions = CaloSwEtamod_versions, name = name, basename = 'etamod', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod_v2.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod_v2.py index 7ad1d86fd73a99e6981fd974bba096f2c4b0dd82..d1186027f6e79c4d3febafa7103fd10a393c8cfe 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod_v2.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod_v2.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtamod_v2.py,v 1.1 2006-11-14 14:51:28 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtamod_v2.py # Created: Nov 2006, sss @@ -26,9 +24,9 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 from AthenaCommon.SystemOfUnits import GeV -from CaloClusterCorrection.CaloSwEtaphimod_v2_rfac import * +from CaloClusterCorrection.CaloSwEtaphimod_v2_rfac import CaloSwEtaphimod_v2_rfac # Energies at which corrections were tabulated. diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod_v4.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod_v4.py index adf235c13beb4eb07576e179fb4dbe7df481dee7..29895952bcccbf06e0cabda5afe7c95767fb6762 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod_v4.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtamod_v4.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtamod_v4.py,v 1.1 2006-11-17 16:46:56 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtamod_v4.py # Created: Nov 2006, sss @@ -15,7 +13,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 from AthenaCommon.SystemOfUnits import GeV diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff.py index 650df39bbb22f41d0820e86c6fd5e823eb6fb707..67485251cdddd2e9adb00110534f64893e9ab2e8 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtaoff.py,v 1.10 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtaoff.py # Created: Nov 2006, sss @@ -20,20 +18,23 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW, \ + EMB1, EME1, EMB2, EME2 +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls_g3 = {EMB1 : CaloClusterCorrectionConf.CaloSwEta1b_g3, - EMB2 : CaloClusterCorrectionConf.CaloSwEta2b_g3, - EME1 : CaloClusterCorrectionConf.CaloSwEta1e_g3, - EME2 : CaloClusterCorrectionConf.CaloSwEta2e_g3} -cls_v2 = CaloClusterCorrectionConf.CaloSwEtaoff_v2 -cls_v3 = CaloClusterCorrectionConf.CaloSwEtaoff_v3 +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls_g3 = {EMB1 : CompFactory.CaloSwEta1b_g3, # CaloClusterCorrection + EMB2 : CompFactory.CaloSwEta2b_g3, # CaloClusterCorrection + EME1 : CompFactory.CaloSwEta1e_g3, # CaloClusterCorrection + EME2 : CompFactory.CaloSwEta2e_g3} # CaloClusterCorrection +cls_v2 = CompFactory.CaloSwEtaoff_v2 # CaloClusterCorrection +cls_v3 = CompFactory.CaloSwEtaoff_v3 # CaloClusterCorrection CaloSwEtaoff_versions = [ # The original G3-based correction, translated from the @@ -84,6 +85,7 @@ CaloSwEtaoff_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # SAMPLING is the calorimeter sampling (EMB1, EMB2, EME1, EME2) to which # this correction will be applied. # NAME is the base name for this tool. If defaulted, a name will @@ -103,7 +105,8 @@ CaloSwEtaoff_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwEtaoff (sampling, +def make_CaloSwEtaoff (flags, + sampling, name = None, suffix = None, version = None, @@ -112,7 +115,8 @@ def make_CaloSwEtaoff (sampling, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloSwEtaoff_versions, + return makecorr (flags, + versions = CaloSwEtaoff_versions, name = name, basename = 'etaoff', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_g3.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_g3.py index 2c5f9567e6d08e57085aaa6d38bead23156a1d41..b279a77156fffe0dc46891542430ab910002b95e 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_g3.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_g3.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtaoff_g3.py,v 1.3 2009-04-19 02:41:06 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtaoff_g3.py # Created: Nov 2006, sss @@ -12,7 +10,9 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB1, CALOCORR_EMB2, CALOCORR_EME1, CALOCORR_EME2, \ + EMB1, EME1, EMB2, EME2 ############################################################################# diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v2.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v2.py index c74927e64dac7fa41b80da8466623b5bf8f583ff..e32c4679c69d1bf44e11c39d7bb28d1666396620 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v2.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v2.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtaoff_v2.py,v 1.1 2006-11-10 03:47:26 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtaoff_v2.py # Created: Nov 2006, sss @@ -16,7 +14,9 @@ # See CaloSwEtaoff_v2.h for more details. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB1, CALOCORR_EMB2, CALOCORR_EME1, CALOCORR_EME2, \ + EMB1, EME1, EMB2, EME2 from AthenaCommon.SystemOfUnits import GeV diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v3.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v3.py index 9ecc4cf286d6fe1e3caf84f9c8d3eefc54c22530..31d3887b147f87b6ba4d7ace304caeb7b9da96f1 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v3.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v3.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtaoff_v3.py,v 1.5 2006-11-10 03:47:26 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtaoff_v3.py # Created: Nov 2006, sss @@ -15,7 +13,9 @@ # See CaloSwEtaoff_v3.h for more details. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB1, CALOCORR_EMB2, CALOCORR_EME1, CALOCORR_EME2, \ + EMB1, EME1, EMB2, EME2 from AthenaCommon.SystemOfUnits import GeV ############################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v4.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v4.py index ea8f17975619389fcc0930a10d5f78f538d3f13c..e831829c977bf2061507a1577fe6b358118c8902 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v4.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v4.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtaoff_v4.py,v 1.1 2006-11-10 03:47:26 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtaoff_v4.py # Created: Nov 2006, sss @@ -15,7 +13,9 @@ # See CaloSwEtaoff_v3.h for more details. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB1, CALOCORR_EMB2, CALOCORR_EME1, CALOCORR_EME2, \ + EMB1, EME1, EMB2, EME2 from AthenaCommon.SystemOfUnits import GeV ############################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v4_1.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v4_1.py index 10fcd874ed98775b0613e311a0e9a7c2c403031f..0da014c6b12b7ded1166a21fd2375458c37471ce 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v4_1.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v4_1.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtaoff_v4_1.py,v 1.2 2007-02-01 22:20:54 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtaoff_v4_1.py # Created: Jan 2007, sss @@ -20,7 +18,9 @@ # See CaloSwEtaoff_v3.h for more details. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB1, CALOCORR_EMB2, CALOCORR_EME1, CALOCORR_EME2, \ + EMB1, EME1, EMB2, EME2 from AthenaCommon.SystemOfUnits import GeV ############################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v5.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v5.py index 9dcd7e3e4bb87eefa94687c054053113bf935c5e..e0069fe9b30cb13ba8d856470bc23bcb16f5dccd 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v5.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaoff_v5.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtaoff_v5.py 579330 2014-01-21 12:59:55Z ehill $ # # File: CaloClusterCorrection/python/CaloSwEtaoff_v5.py # Created: November 19 2013, Ewan Hill @@ -19,7 +17,9 @@ # See CaloSwEtaoff_v3.h for more details. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB1, CALOCORR_EMB2, CALOCORR_EME1, CALOCORR_EME2, \ + EMB1, EME1, EMB2, EME2 from AthenaCommon.SystemOfUnits import GeV ############################################################################### diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaphimod_v2_rfac.py b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaphimod_v2_rfac.py index c832c600aca2b3df86a68e5f59f6efffe03b5c52..132d7f0820ade5d9a4341f0fa3b7b56440926da3 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwEtaphimod_v2_rfac.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwEtaphimod_v2_rfac.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwEtaphimod_v2_rfac.py,v 1.1 2006-11-14 14:51:28 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwEtaphimod_v2_rfac.py # Created: Nov 2006, sss diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwGap.py b/Calorimeter/CaloClusterCorrection/python/CaloSwGap.py index afce2701df0c6556345b68c30481628135317437..2fcf981012f667a30b484df1281e0eb776d9c02a 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwGap.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwGap.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwGap.py,v 1.7 2007-10-17 21:05:52 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwGap.py # Created: Nov 2006, sss @@ -19,17 +17,19 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls_g3 = CaloClusterCorrectionConf.CaloSwGap_g3 -cls_v2 = CaloClusterCorrectionConf.CaloSwGap_v2 -cls_v3 = CaloClusterCorrectionConf.CaloSwGap_v3 +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls_g3 = CompFactory.CaloSwGap_g3 # CaloClusterCorrection +cls_v2 = CompFactory.CaloSwGap_v2 # CaloClusterCorrection +cls_v3 = CompFactory.CaloSwGap_v3 # CaloClusterCorrection CaloSwGap_versions = [ # The original G3-based gap correction, translated from the # original fortran version. @@ -75,6 +75,7 @@ CaloSwGap_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -95,7 +96,8 @@ CaloSwGap_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwGap (name = None, +def make_CaloSwGap (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -104,11 +106,12 @@ def make_CaloSwGap (name = None, cells_name = None, **kw): - if cells_name != None: + if cells_name is not None: kw['cells_name'] = cells_name # Make the tool. - return makecorr (versions = CaloSwGap_versions, + return makecorr (flags, + versions = CaloSwGap_versions, name = name, basename = 'gap', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v2.py b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v2.py index 1c4f01c05c0d520c2f47df9145fb9d3c44b208ef..7ae26c94b3fbf62b2ee6050fa937de08444bff9d 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v2.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v2.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwGap_v2.py,v 1.2 2006-11-16 07:07:45 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwGap_v2.py # Created: Nov 2006, sss @@ -112,7 +110,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_CLUSTER ############################################################################# diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v3.py b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v3.py index cd9f809294d1d2c88876ec6d4c298bad239512f0..bf6d8f7058fad1703a9b1aa8aeb12fb6449aefff 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v3.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v3.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwGap_v3.py,v 1.3 2006-11-10 03:47:27 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwGap_v3.py # Created: Nov 2006, sss @@ -21,7 +19,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_CLUSTER ############################################################################# # Gap energy correction for versions 12.x.x and later diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v4.py b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v4.py index b28383216dd54db654404b067105e6c9e6571ff6..38dd18bcf0e388d62b6547c830ec5b74c9608947 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v4.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v4.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwGap_v4.py,v 1.1 2006-11-10 03:47:27 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwGap_v4.py # Created: Nov 2006, sss @@ -13,7 +11,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_CLUSTER ############################################################################# diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v5.py b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v5.py index ef4c8af6daae3c957f4fa40adf6b999fcb626dc8..f43d9fd8b93291864fef796a092a0c02ca02d31a 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v5.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v5.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwGap_v5.py,v 1.1 2012-03-03 laplace Exp $ # # File: CaloClusterCorrection/python/CaloSwGap_v5.py # Created: March 2012, SL @@ -18,7 +16,7 @@ # - for now, use the electron corrections for the photons as well # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ############################################################################# diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v6.py b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v6.py index bafca69d52f7baefb09920ef0b299b58a397de9f..773b7b05d0fb1ae0d747863733388aa6fe780911 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v6.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwGap_v6.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwGap_v6.py,v 1.1 2012-03-03 laplace Exp $ # # File: CaloClusterCorrection/python/CaloSwGap_v6.py # Created: March 2012, SL @@ -20,7 +18,7 @@ # "bad phi" regions with TG3 cells missing # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ############################################################################# diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLayers.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLayers.py index 2cd29dfdad21fa2c55d4a48cf24e529748aed98c..744e67b20dc05c1b9eaffbcd78de32764cf40299 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLayers.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLayers.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwLayers.py,v 1.7 2009-03-16 12:28:40 lcarmina Exp $ # # File: CaloClusterCorrection/python/CaloSwLayers.py # Created: Nov 2006, sss @@ -24,15 +22,17 @@ # are recalculated based on these cells. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_NOPOOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr import string # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -cls = CaloClusterCorrectionConf.CaloFillRectangularCluster +cls = CompFactory.CaloFillRectangularCluster # CaloClusterCorrection CaloSwLayers_versions = [ ['wt', cls, ['CaloSwLayers.CaloSwLayersWt_parms', CALOCORR_NOPOOL]], ['', cls, ['CaloSwLayers.CaloSwLayers_parms', CALOCORR_NOPOOL]], @@ -41,6 +41,7 @@ CaloSwLayers_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -61,7 +62,8 @@ CaloSwLayers_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwLayers (name = None, +def make_CaloSwLayers (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -70,10 +72,11 @@ def make_CaloSwLayers (name = None, cells_name = None, **kw): - if cells_name != None: + if cells_name is not None: kw['cells_name'] = cells_name - return makecorr (versions = CaloSwLayers_versions, + return makecorr (flags, + versions = CaloSwLayers_versions, name = name, basename = 'layers', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights.py index 443981133b88c3e27589ce7574212f7e1a8e3dcb..652b51e01b250311d9161d13429a5177dd6817d7 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwLongWeights.py,v 1.10 2009-04-22 17:26:22 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwLongWeights.py # Created: Nov 2006, sss @@ -24,15 +22,17 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloSwLongWeights +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls = CompFactory.CaloSwLongWeights # CaloClusterCorrection CaloSwLongWeights_versions = [ # From SP and KL. The original version. @@ -93,13 +93,14 @@ CaloSwLongWeights_versions = [ ['atlfast_v1', cls, ['CaloSwLongWeights_atlfast_v1.CaloSwLongWeights_atlfast_v1_parms', 'caloswcorr_pool', CALOCORR_COOL], keys], - + ] # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -117,7 +118,8 @@ CaloSwLongWeights_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwLongWeights (name = None, +def make_CaloSwLongWeights (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -125,7 +127,8 @@ def make_CaloSwLongWeights (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloSwLongWeights_versions, + return makecorr (flags, + versions = CaloSwLongWeights_versions, name = name, basename = 'lwc', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_904.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_904.py index 3b505a08bd46fa148668699d8cdd3f2c3870ee17..37507dd56811d5cac893e0106a92f0a7f8460728 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_904.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_904.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwLongWeights_904.py,v 1.1 2006-11-10 03:47:27 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwLongWeights_904.py # Created: Nov 2006, sss @@ -12,7 +10,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### # Stathes's weights from 9.0.4 MC, 5x5 cluster size. diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_atlfast_v1.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_atlfast_v1.py index 6b64413642f55e2beec9b548a8d102b8394c3f14..2a9dcf1ade6b329a03f208751c534b0aa4a7a0b6 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_atlfast_v1.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_atlfast_v1.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # File: CaloClusterCorrection/python/CaloSwLongWeights_atlfast_v1.py @@ -10,7 +10,7 @@ # # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### # 5x5 cluster size electrons. diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_old.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_old.py index 9705fdb4edc2606f9139ff20b06588c02faae599..e899b20f71817cce1b72290f212f7de2e800a1d3 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_old.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_old.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwLongWeights_old.py,v 1.3 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwLongWeights_old.py # Created: Nov 2006, sss @@ -21,7 +19,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### # The old layer weights corrections, that were used in release 9 + 10.0.0. diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_pi0_v1.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_pi0_v1.py index 392bc7b3a13fecfd76273d2d7a606bea4a268e64..64ad8ce4d8dbb8e137ee71e8a5bace666c950c6b 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_pi0_v1.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_pi0_v1.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # File: CaloClusterCorrection/python/CaloSwLongWeights_pi0v1.py # Created: Feb 2010 GU @@ -8,7 +8,7 @@ # should be applied to low energy 3x5 seeded by EM topo -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### ####################################################################### # 3x5 cluster size photons. diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v3.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v3.py index 1d6955eacfe5dbcf68ffe07e0143f52971ccd9fd..dff4e2a208b2115de17092be7d9ca3cf394be978 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v3.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v3.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwLongWeights_v3.py,v 1.2 2006-11-10 03:47:27 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwLongWeights_v3.py # Created: Nov 2006, sss @@ -21,7 +19,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### # 5x5 cluster size electrons. diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v4.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v4.py index f4b9014f933a86cade70ac813ac29e180898f838..5a811433753638e4274d3dbab45838c94c1b94a5 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v4.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v4.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwLongWeights_v4.py,v 1.3 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwLongWeights_v3.py # Created: Nov 2006, sss @@ -18,7 +16,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### # 5x5 cluster size electrons. diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v5.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v5.py index 01827c1d3e5f752657c289051090df928deba03d..b5a6d98317959474a2801b8fd1e6fe3a3dbe5e28 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v5.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v5.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # File: CaloClusterCorrection/python/CaloSwLongWeights_v5.py # Created: July 2008, NK, SP @@ -7,7 +7,7 @@ # These corrections were derived by Nicolas Kerschen and Stathes Paganis # The geometry is ATLAS-CSC-05-00-00 -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### # 5x5 cluster size electrons. diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v6.py b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v6.py index 8c3979d08824818c2575be966840be6941e00512..7e13a7f0a79f1163bd93ae938d74ed4dcbc8e4a1 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v6.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwLongWeights_v6.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # File: CaloClusterCorrection/python/CaloSwLongWeights_v6.py # Created: July 2008, NK, SP @@ -8,7 +8,7 @@ # The geometry is ATLAS-CSC-05-00-00 -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 ####################################################################### # 5x5 cluster size electrons. CaloSwLongWeights_v6_ele55 = [ diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod.py index b2db0c0380677059f1567caf9857f2443503244a..d446d273b895aa4e7e9c28b26ba56c91a0573ad6 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwPhimod.py,v 1.8 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwPhimod.py # Created: Nov 2006, sss @@ -42,16 +40,18 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls_g3 = CaloClusterCorrectionConf.CaloSwPhimod_g3 -cls_v2 = CaloClusterCorrectionConf.CaloSwPhimod_v2 +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls_g3 = CompFactory.CaloSwPhimod_g3 # CaloClusterCorrection +cls_v2 = CompFactory.CaloSwPhimod_v2 # CaloClusterCorrection CaloSwPhimod_versions = [ # The original G3-based correction, translated from the @@ -88,6 +88,7 @@ CaloSwPhimod_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -105,7 +106,8 @@ CaloSwPhimod_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwPhimod (name = None, +def make_CaloSwPhimod (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -113,7 +115,8 @@ def make_CaloSwPhimod (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloSwPhimod_versions, + return makecorr (flags, + versions = CaloSwPhimod_versions, name = name, basename = 'phimod', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v2.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v2.py index 7dec6e6eec26c87ef7b8e0b26e278ba82099f1fa..16a921d17cb893fdd5aad3d4b4f7fc2936c7fedb 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v2.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v2.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwPhimod_v2.py,v 1.1 2006-11-14 14:51:28 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwPhimod_v2.py # Created: Nov 2006, sss @@ -26,9 +24,9 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 from AthenaCommon.SystemOfUnits import GeV -from CaloClusterCorrection.CaloSwEtaphimod_v2_rfac import * +from CaloClusterCorrection.CaloSwEtaphimod_v2_rfac import CaloSwEtaphimod_v2_rfac # Energies at which corrections were tabulated. CaloSw_sample_energies = [50*GeV, 100*GeV, 200*GeV] diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v4.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v4.py index cca1cf1101477f9939ff8ad8d00d3fb28d17c2e0..3733358c6eadc2592d575e03b4d84627e5a23ce9 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v4.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v4.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwPhimod_v4.py,v 1.1 2006-11-20 03:18:40 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwPhimod_v4.py # Created: Nov 2006, sss @@ -15,7 +13,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 from AthenaCommon.SystemOfUnits import GeV diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v4data.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v4data.py index 9f878db6b1cce56cd07666b5b28f5a23051a50a0..e3af7d150598454f24ef9d72f544e66c74cd571d 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v4data.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhimod_v4data.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id$ # # File: CaloClusterCorrection/python/CaloSwPhimod_v4_data.py # Created: Sep 2010, sss @@ -20,7 +18,6 @@ # this correction identical under a phi -> -phi transformation. # -from CaloClusterCorrection.common import * from CaloClusterCorrection.CaloSwPhimod_v4 import CaloSwPhimod_v4_parms @@ -39,6 +36,7 @@ def _flip_phi (corr): def _copy_parms (src, dst): for (k, v) in src.__dict__.items(): + if k[0] == '_': continue if k == 'correction': v = _flip_phi (v) setattr (dst, k, v) diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff.py index 325394b1d7410d1b2850ed3a45df591ada04fb12..f24a627febbb2271ff7a518f341f2136e7f9c40f 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwPhioff.py,v 1.7 2007-10-17 21:05:52 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwPhioff.py # Created: Nov 2006, sss @@ -17,15 +15,17 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloSwPhioff_v2 +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls = CompFactory.CaloSwPhioff_v2 # CaloClusterCorrection CaloSwPhioff_versions = [ # The original G3-based correction, translated from the @@ -72,6 +72,7 @@ CaloSwPhioff_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # SAMPLING is the calorimeter sampling (EMB1, EMB2, EME1, EME2) to which # this correction will be applied. # NAME is the base name for this tool. If defaulted, a name will @@ -91,7 +92,8 @@ CaloSwPhioff_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwPhioff (sampling, +def make_CaloSwPhioff (flags, + sampling, name = None, suffix = None, version = None, @@ -100,7 +102,8 @@ def make_CaloSwPhioff (sampling, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloSwPhioff_versions, + return makecorr (flags, + versions = CaloSwPhioff_versions, name = name, basename = 'phioff', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_g3.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_g3.py index 75dbd1e9fdb18e41337599451abb28ee45b46e88..927496acc0f586e9722132e72893e6425f2a0a29 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_g3.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_g3.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwPhioff_g3.py,v 1.2 2006-11-16 07:07:45 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwPhioff_g3.py # Created: Nov 2006, sss @@ -12,7 +10,8 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB2, CALOCORR_EME2, EMB2, EME2 ############################################################################# diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v2.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v2.py index f7e7d1a7e41907cdce7779ecc889a7759a4e08fa..8e6439c3a03ebe89f8cf46cdd01a2ad52d33e535 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v2.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v2.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwPhioff_v2.py,v 1.2 2006-11-16 07:07:45 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwPhioff_v2.py # Created: Nov 2006, sss @@ -14,7 +12,8 @@ # This was added in LArClusterRec-02-05-12, in 8.6.0. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB2, CALOCORR_EME2, EMB2, EME2 from AthenaCommon.SystemOfUnits import GeV import math diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v3.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v3.py index 6808861c5923e45c25869e8288c7d7a35a42f422..ae801d6a27ae7272255f619c6bdd62f73de7d425 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v3.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v3.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwPhioff_v3.py,v 1.6 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwPhioff_v3.py # Created: Nov 2006, sss @@ -13,8 +11,8 @@ # This correction was in CaloClusterCorrection-00-02-58, in 12.0.3. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB2, CALOCORR_EME2, EMB2, EME2 from AthenaCommon.SystemOfUnits import GeV diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v4.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v4.py index 7d8984e038cc983bdb0dff1920713924dc596ea4..41035a94fc3213ae605a91400223d7e2eb764077 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v4.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v4.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwPhioff_v4.py,v 1.2 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwPhioff_v4.py # Created: Nov 2006, sss @@ -13,8 +11,8 @@ # This correction was in CaloClusterCorrection-xxx, in 12.0.4. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB2, CALOCORR_EME2, EMB2, EME2 from AthenaCommon.SystemOfUnits import GeV diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v4data.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v4data.py index 9549b451043bef39ca05b69cffd27e4f5f355f72..7e79a85ead512b5d199277e26ebf94704c31d87f 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v4data.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v4data.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id$ # # File: CaloClusterCorrection/python/CaloSwPhioff_v4_data.py # Created: Sep 2010, sss @@ -14,7 +12,7 @@ # in the barrel. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import EME2, EMB2 from CaloClusterCorrection.CaloSwPhioff_v4 import \ CaloSwPhioff_v4_b2_parms, CaloSwPhioff_v4_e2_parms @@ -33,6 +31,7 @@ def _flip_phi (corr): def _copy_parms (src, dst): for (k, v) in src.__dict__.items(): + if k[0] == '_': continue if k == 'correction': v = _flip_phi (v) setattr (dst, k, v) diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v5.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v5.py index 8998397e10ba356186f4909c1315b4d4f2468e9b..52cb5548bf1a4d284a8a7270c30a6a9f482cb05a 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v5.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v5.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwPhioff_v5.py,v 1.2 2013-11-30 ehill # # File: CaloClusterCorrection/python/CaloSwPhioff_v5.py # Created: Nov 2013, Ewan Hill @@ -13,8 +11,8 @@ # This correction was in CaloClusterCorrection-xxx, in ??????. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import \ + CALOCORR_EMB2, CALOCORR_EME2, EMB2, EME2 from AthenaCommon.SystemOfUnits import GeV diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v5data.py b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v5data.py index 6a11bc7ed176f060299ad65120e58fe5e0f78e45..82a3bd5650730b582a54b128a87a0957369d38ce 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v5data.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwPhioff_v5data.py @@ -12,7 +12,7 @@ # in the barrel. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import EMB2, EME2 from CaloClusterCorrection.CaloSwPhioff_v5 import \ CaloSwPhioff_v5_b2_parms, CaloSwPhioff_v5_e2_parms diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwRfac.py b/Calorimeter/CaloClusterCorrection/python/CaloSwRfac.py index cfa848526e1a56944905b51d510516dc1cd6a967..eda1ca2c054368461c8910cca6ef49ecde5f5948 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwRfac.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwRfac.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwRfac.py,v 1.8 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwRfac.py # Created: Nov 2006, sss @@ -28,15 +26,17 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloScaleCluster +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls = CompFactory.CaloScaleCluster # CaloClusterCorrection CaloSwRfac_versions = [ # From 11.0.41 simulation and 12.0.0 reconstruction. # In CaloClusterCorrection-00-02-38, 12.0.0. @@ -64,6 +64,7 @@ CaloSwRfac_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -81,7 +82,8 @@ CaloSwRfac_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwRfac (name = None, +def make_CaloSwRfac (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -89,7 +91,8 @@ def make_CaloSwRfac (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloSwRfac_versions, + return makecorr (flags, + versions = CaloSwRfac_versions, name = name, basename = 'rfac', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v3.py b/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v3.py index 0b7b13309170a8f3a15081e5c69b68e2a1641707..acf607369daccbc6023089bbba5a2add01157da5 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v3.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v3.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwRfac_v3.py,v 1.4 2006-11-10 03:47:27 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwRfac_v3.py # Created: Nov 2006, sss @@ -11,7 +9,7 @@ # E=100 GeV electrons/photons were used. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 # # The correction is tabulated as a function of eta separately for diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v4.py b/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v4.py index 16279a5cac739e6b5d097a3184c636463c026ad5..24656e0bb1c14a6b3941d841dc62b21dcb88e452 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v4.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v4.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwRfac_v4.py,v 1.1 2006-11-10 03:47:27 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwRfac_v4.py # Created: Nov 2006, sss @@ -14,7 +12,7 @@ # It was added in CaloClusterCorrection-00-02-61, in 12.0.4. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 # # The correction is tabulated as a function of eta separately for diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v5.py b/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v5.py index b0013c0185d8cdf6aa0d77fd7f0d89becb129d8d..796aa943cb3201df9185855f1187076790b0f4b7 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v5.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwRfac_v5.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwRfac_v5.py 579330 2014-01-21 12:59:55Z ehill $ # # File: CaloClusterCorrection/python/CaloSwRfac_v5.py # Created: Nov 2013, Ewan Hill @@ -15,7 +13,7 @@ # It was added in CaloClusterCorrection-00-??-??, in ??.?.?. # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COMBINED2 # # The correction is tabulated as a function of eta separately for diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwTime.py b/Calorimeter/CaloClusterCorrection/python/CaloSwTime.py index 2fb6ea86f63007c09723d84daf977c4f4cfa27ca..5e309587fff22fd8d079687f8ac6e1a624e7dc63 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwTime.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwTime.py @@ -1,28 +1,32 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # File: CaloClusterCorrection/python/CaloSwTime.py # Created: May, 2008, M. Cooke # Purpose: Steering module for duplicate removal tool -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_NOPOOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr -cls = CaloClusterCorrectionConf.CaloSwTime +cls = CompFactory.CaloSwTime # CaloClusterCorrection CaloSwTime_versions = [ ['', cls, ['CaloSwTime.CaloSwTime_parms', CALOCORR_NOPOOL]], ] -def make_CaloSwTime (name = None, - suffix = None, - version = None, - key = CALOCORR_DEFAULT_KEY, - source = None, - confclass = None, - **kw): - return makecorr (versions = CaloSwTime_versions, +def make_CaloSwTime (flags, + name = None, + suffix = None, + version = None, + key = CALOCORR_DEFAULT_KEY, + source = None, + confclass = None, + **kw): + return makecorr (flags, + versions = CaloSwTime_versions, name = name, basename = 'time', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr.py b/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr.py index afffaa75cb12ee635c052037ecdd669fb0969ed4..ee4c86e9272ee79e23b5bb540d84380a60c02487 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwTransitionRegionsCorr.py,v 1.5 2009-04-22 17:26:22 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwTransitionRegionsCorr.py # Created: Dec, 2007, L. Carminati @@ -15,15 +13,17 @@ # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import sw_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloSwTransitionRegionsCorr +from CaloClusterCorrection.constants import sw_valid_keys as keys +cls = CompFactory.CaloSwTransitionRegionsCorr # CaloClusterCorrection CaloSwTransitionRegionsCorr_versions = [ # 12.0.3 simulation and reconstruction, with ideal (calib0) geometry. @@ -45,6 +45,7 @@ CaloSwTransitionRegionsCorr_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -61,16 +62,18 @@ CaloSwTransitionRegionsCorr_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloSwTransitionRegionsCorr (name = None, - suffix = None, - version = None, - key = CALOCORR_DEFAULT_KEY, - source = None, - confclass = None, - **kw): +def make_CaloSwTransitionRegionsCorr (flags, + name = None, + suffix = None, + version = None, + key = CALOCORR_DEFAULT_KEY, + source = None, + confclass = None, + **kw): # Make the tool. - return makecorr (versions = CaloSwTransitionRegionsCorr_versions, + return makecorr (flags, + versions = CaloSwTransitionRegionsCorr_versions, name = name, basename = 'trcorr', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v1.py b/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v1.py index 8d68c830cb46b6ccb5e3cb0e726151de6aefbfaa..8affb74ab1e6da787605550b29714b930e51bf47 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v1.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v1.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwTransitionRegionsCorr_v1.py,v 1.2 2008-01-25 04:14:21 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwTransitionRegionCorr_v1.py # Created: Dec, 2007, L. Carminati @@ -9,7 +7,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_CLUSTER ############################################################################# diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v5.py b/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v5.py index b27bcd795dae60c490d0fb25fb4b992d94884762..be28e9a6e2dc23b8e02a1fed93cc0b73c158847b 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v5.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v5.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwTransitionRegionsCorr_v5.py,v 1.2 2008-07-29 15:45:02 lcarmina Exp $ # # File: CaloClusterCorrection/python/CaloSwTransitionRegionCorr_v5.py # Created: Dec, 2007, L. Carminati @@ -9,7 +7,7 @@ # -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_CLUSTER ############################################################################# diff --git a/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v5_1.py b/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v5_1.py index dc9bdc4741aee34ea4926812fa36817c8aade7c9..b91ef34650c8affc24e6b6e4ec296c09e49cd3fd 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v5_1.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloSwTransitionRegionsCorr_v5_1.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloSwTransitionRegionsCorr_v5_1.py,v 1.1 2009-03-05 08:44:06 lcarmina Exp $ # # File: CaloClusterCorrection/python/CaloSwTransitionRegionCorr_v5_1.py # Created: Dec, 2007, L. Carminati @@ -10,7 +8,7 @@ # This version implement some fixes for eta=0 and eta=0.8 -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_CLUSTER ############################################################################# diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMClusterUpdate.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMClusterUpdate.py index 59eacb6e343964f4039435db136731c06b2a6571..8dc31d24597258ce757a8a133c8552d063762db2 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMClusterUpdate.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMClusterUpdate.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMClusterUpdate.py,v 1.3 2009-04-25 17:57:00 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloTopoEMClusterUpdate.py # Created: Nov 2006, sss @@ -15,15 +13,17 @@ # leaves the total cluster energy unchanged. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -cls = CaloClusterCorrectionConf.CaloClusterUpdate +cls = CompFactory.CaloClusterUpdate # CaloClusterCorrection CaloTopoEMClusterUpdate_versions = [ # This version doesn't recalculate the total cluster energy. ['dont_update_e', cls, @@ -39,6 +39,7 @@ CaloTopoEMClusterUpdate_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -56,14 +57,16 @@ CaloTopoEMClusterUpdate_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloTopoEMClusterUpdate (name = None, +def make_CaloTopoEMClusterUpdate (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, source = None, confclass = None, **kw): - return makecorr (versions = CaloTopoEMClusterUpdate_versions, + return makecorr (flags, + versions = CaloTopoEMClusterUpdate_versions, name = name, basename = 'larupdate', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMCorrections.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMCorrections.py index 0daad8ca803c3a5bf9f8ae5343f4439a239c4875..3670202000d4b8e3fe0b77c1daeff710ae331aea 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMCorrections.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMCorrections.py @@ -1,20 +1,18 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMCorrections.py,v 1.16 2009-04-30 20:29:53 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloSwCorrections.py # Created: Mar 2007, sss # Purpose: Top-level configuration file for EM topo cluster corrections. # -# The main entry point here is make_CaloTopoEMCorrections, which returns +# The main entry point here is make_CaloTopoEMCorrectionsCfg, which returns # a list of correction tools. It can be used either `le menu' --- selecting # a predefined list of correction tools, or `a la carte' --- explicitly # specifying the list of tools you want to run. # # The simplest way of using it is like this: # -# make_CaloTopoEMCorrections (key) +# make_CaloTopoEMCorrectionsCfg (flags, key) # # Here, `key' is a string that denotes the type of cluster which you # are correcting. It should be something like `ele420' for 4-2-0 electrons, @@ -28,7 +26,7 @@ # By default, the latest version of the corrections appropriate to the # geometry being used will be chosen. You can override this selection # by supplying the `version' argument. It may also be overridden -# with caloClusterCorrectionFlags.CaloTopoEMWhichCorrection. +# with Calo.ClusterCorrection.CaloTopoEMWhichCorrection. # For the list of known version # names, see the variable `CaloTopoEMCorrection_versions' below. # In particular, using version `none' turns off the corrections. @@ -38,7 +36,7 @@ # the version to be used for individual correction by adding # parameters of the form CORRECTION_version. For example: # -# make_CaloTopoEMCorrections (key, version='v4', lwc_version='v3') +# make_CaloTopoEMCorrectionsCfg (flags, key, version='v4', lwc_version='v3') # # uses the `v4' corrections, except that we use version `v3' of the # layer weight corrections. You can also specify CORRECTION_key @@ -46,7 +44,7 @@ # and CORRECTION_XXX to override any individual parameter # of a correction. For example: # -# make_CaloTopoEMCorrections (key, lwc_degree=2) +# make_CaloTopoEMCorrectionsCfg (flags, key, lwc_degree=2) # # makes the full standard set of corrections, except that the interpolation # degree for the layer weights correction is changed to 2. @@ -54,13 +52,13 @@ # You can explicitly specify a list of corrections to run with the # `corrlist' argument. For example, # -# make_CaloTopoEMCorrections (key, corrlist=[[layers], [update], [gap]]) +# make_CaloTopoEMCorrectionsCfg (flags, key, corrlist=[[layers], [update], [gap]]) # # runs only the `layers', `update', and `gap' corrections. The names # used here, like `layers' should be functions defined with this # signature: # -# def layers (cells_name, suffix, version, key, source, **kw): +# def layers (flags, cells_name, suffix, version, key, source, **kw): # # Definitions for all the standard corrections are contained in this file. # Note that the names of these functions are what are used to recognize @@ -80,17 +78,18 @@ # settings may be specified as following (name, value) tuples # in the list. For example: # -# make_CaloTopoEMCorrections (key, corrlist=[[layers], -# [update], -# [gap, 'v3', ('degree', 2)]]) +# make_CaloTopoEMCorrectionsCfg (flags, +# key, corrlist=[[layers], +# [update], +# [gap, 'v3', ('degree', 2)]]) # # says to use version `v3' of the gap correction, and in addition, # to override the interpolation degree to be 2. # # There are three ways in which a correction can get configured: from # job options, from pool, or from cool. You can specify which ones -# to use by adding the `source' argument to make_CaloTopoEMCorrections. -# This is one of the following (defined in common.py): +# to use by adding the `source' argument to make_CaloTopoEMCorrectionsCfg. +# This is one of the following (defined in constants.py): # # - CALOCORR_JO: Configure from job options # - CALOCORR_POOL: Configure from a pool file @@ -101,7 +100,7 @@ # # This parameter may be specified as a list of any of these values; in that # case, all the possibilities will be tried in order. The default is taken -# from caloClusterCorrectionFlags.DefaultSource +# from Calo.ClusterCorrection.defaultSource # if it hasn't been explicitly set. The usual setting is to try first # cool, then pool, then job options. (Note that there are a couple # corrections which are not saved to pool/cool and can thus only @@ -114,22 +113,33 @@ # with a string of the form `MODULE.NAME'. # -import sys -from CaloClusterCorrection.CaloTopoEMmoments import make_CaloTopoEMmoments -from CaloClusterCorrection.CaloTopoEMlayers import make_CaloTopoEMlayers -from CaloClusterCorrection.CaloTopoEMetaoff import make_CaloTopoEMetaoff -from CaloClusterCorrection.CaloTopoEMetaoffSW import make_CaloTopoEMetaoffSW -from CaloClusterCorrection.CaloTopoEMphioff import make_CaloTopoEMphioff -from CaloClusterCorrection.CaloTopoEMphimod import make_CaloTopoEMphimod -from CaloClusterCorrection.CaloTopoEMClusterUpdate \ - import make_CaloTopoEMClusterUpdate -from CaloClusterCorrection.CaloTopoEMgap import make_CaloTopoEMgap -from CaloClusterCorrection.CaloClusterListBadChannel import make_CaloClusterListBadChannel -from CaloClusterCorrection.CaloTopoEMlongWeights \ - import make_CaloTopoEMlongWeights -from CaloClusterCorrection.common import * -from CaloClusterCorrection.CaloClusterCorrectionFlags \ - import caloClusterCorrectionFlags +# Need to be sure that we always get run3 configurables in the imported +# steering modules. +from AthenaCommon.Configurable import Configurable + +try: + _wasRun3 = Configurable.configurableRun3Behavior + Configurable.configurableRun3Behavior = True + + from CaloClusterCorrection.CaloTopoEMmoments import make_CaloTopoEMmoments + from CaloClusterCorrection.CaloTopoEMlayers import make_CaloTopoEMlayers + from CaloClusterCorrection.CaloTopoEMetaoff import make_CaloTopoEMetaoff + from CaloClusterCorrection.CaloTopoEMetaoffSW import make_CaloTopoEMetaoffSW + from CaloClusterCorrection.CaloTopoEMphioff import make_CaloTopoEMphioff + from CaloClusterCorrection.CaloTopoEMphimod import make_CaloTopoEMphimod + from CaloClusterCorrection.CaloTopoEMClusterUpdate \ + import make_CaloTopoEMClusterUpdate + from CaloClusterCorrection.CaloTopoEMgap import make_CaloTopoEMgap + from CaloClusterCorrection.CaloClusterListBadChannel import make_CaloClusterListBadChannel + from CaloClusterCorrection.CaloTopoEMlongWeights \ + import make_CaloTopoEMlongWeights + from CaloClusterCorrection.constants import CALOCORR_EMTOPO, EMB1, EME1 + from CaloClusterCorrection.common import CaloClusterCorrSetup + from CaloClusterCorrection.compat import makeFlags, unpackCA + +finally: + Configurable.configurableRun3Behavior = _wasRun3 + @@ -138,43 +148,43 @@ from CaloClusterCorrection.CaloClusterCorrectionFlags \ # In the case where a correction has multiple versions for different # samplings, we define multiple wrappers here. # These are the names to use in the correction list and in the -# arguments to make_CaloTopoEMCorrection. +# arguments to make_CaloTopoEMCorrectionCfg. # -def moments (cells_name, *args, **kw): - return make_CaloTopoEMmoments (None, *args, **kw) +def moments (flags, cells_name, *args, **kw): + return make_CaloTopoEMmoments (flags, None, *args, **kw) -def layers (cells_name, *args, **kw): - return make_CaloTopoEMlayers (None, cells_name=cells_name, *args, **kw) +def layers (flags, cells_name, *args, **kw): + return make_CaloTopoEMlayers (flags, None, cells_name=cells_name, *args, **kw) -def etaoff_sw_b1 (cells_name, *args, **kw): - return make_CaloTopoEMetaoffSW (EMB1, None, *args, **kw) +def etaoff_sw_b1 (flags, cells_name, *args, **kw): + return make_CaloTopoEMetaoffSW (flags, EMB1, None, *args, **kw) -def etaoff_sw_e1 (cells_name, *args, **kw): - return make_CaloTopoEMetaoffSW (EME1, None, *args, **kw) +def etaoff_sw_e1 (flags, cells_name, *args, **kw): + return make_CaloTopoEMetaoffSW (flags, EME1, None, *args, **kw) # Eta offset in sampling 2. -def etaoff_2 (cells_name, *args, **kw): - return make_CaloTopoEMetaoff (None, *args, **kw) +def etaoff_2 (flags, cells_name, *args, **kw): + return make_CaloTopoEMetaoff (flags, None, *args, **kw) # Phi offset in sampling 2. -def phioff (cells_name, *args, **kw): - return make_CaloTopoEMphioff (None, *args, **kw) +def phioff (flags, cells_name, *args, **kw): + return make_CaloTopoEMphioff (flags, None, *args, **kw) -def phimod (cells_name, *args, **kw): - return make_CaloTopoEMphimod (None, *args, **kw) +def phimod (flags, cells_name, *args, **kw): + return make_CaloTopoEMphimod (flags, None, *args, **kw) -def update (cells_name, *args, **kw): - return make_CaloTopoEMClusterUpdate (None, *args, **kw) +def update (flags, cells_name, *args, **kw): + return make_CaloTopoEMClusterUpdate (flags, None, *args, **kw) -def lwc (cells_name, *args, **kw): - return make_CaloTopoEMlongWeights (None, *args, **kw) +def lwc (flags, cells_name, *args, **kw): + return make_CaloTopoEMlongWeights (flags, None, *args, **kw) -def gap (cells_name, *args, **kw): - return make_CaloTopoEMgap (None, *args, **kw) +def gap (flags, cells_name, *args, **kw): + return make_CaloTopoEMgap (flags, None, *args, **kw) -def listBadChannel (cells_name, *args, **kw): - return make_CaloClusterListBadChannel (CALOCORR_EMTOPO, None, *args, **kw) +def listBadChannel (flags, cells_name, *args, **kw): + return make_CaloClusterListBadChannel (flags, CALOCORR_EMTOPO, None, *args, **kw) ############################################################################## @@ -185,8 +195,8 @@ def listBadChannel (cells_name, *args, **kw): class CaloTopoEMCorrectionsSetup (CaloClusterCorrSetup): name = "EM topo" - version_override_flag= caloClusterCorrectionFlags.CaloTopoEMWhichCorrection - correction_generation_flag= caloClusterCorrectionFlags.CaloTopoEMGeneration + version_override_flag_name = 'caloTopoEMWhichCorrection' + correction_generation_flag_name = 'caloTopoEMGeneration' correction_generation_default = "00-02-00" ########################################################################## @@ -289,13 +299,12 @@ class CaloTopoEMCorrectionsSetup (CaloClusterCorrSetup): # Handle CaloTopoEMCorrectionArgs. - def make_corrections (self, **kw_in): + def make_corrections (self, flags, **kw_in): kw = {} - if caloClusterCorrectionFlags.CaloTopoEMCorrectionArgs.statusOn: - kw = caloClusterCorrectionFlags.CaloTopoEMCorrectionArgs().copy() + kw = flags.Calo.ClusterCorrection.caloTopoEMCorrectionArgs kw.update (kw_in) - return CaloClusterCorrSetup.make_corrections (self, **kw) + return CaloClusterCorrSetup.make_corrections (self, flags, **kw) CaloTopoEMCorrections = CaloTopoEMCorrectionsSetup() @@ -305,6 +314,45 @@ CaloTopoEMCorrections = CaloTopoEMCorrectionsSetup() # Main entry point to create a list of correction tools. # +# +# Create and return a CA of correction tools. +# FLAGS are the configuration flags. +# KEY is a string that specifies the correction type. +# SUFFIX is a string to add to the end of each tool name. +# VERSION specifies which version of corrections to use. +# CORRLIST can be used to explicitly specify which corrections to run. +# CELLS_NAME is the SG key to use to find the calorimeter cells, +# for those corrections that require it. +# SOURCE specifies the source(s) from which tools are configured. +# See above for details. +# None means to use the default. +# +# For more detailed information, see the comments at the start of this file. +# +def make_CaloTopoEMCorrectionsCfg (flags, + key = None, + suffix = '', + version = None, + corrlist = None, + cells_name = None, + source = None, + **kw): + return CaloTopoEMCorrections.make_corrections (flags, + corrclass = CALOCORR_EMTOPO, + key = key, + suffix = suffix, + version = version, + corrlist = corrlist, + cells_name = cells_name, + source = source, + **kw) + + +############################################################################## +# Backwards compatibility: +# Main entry point to create a list of correction tools (old configuration) +# + # # Create and return a list of correction tools. # KEY is a string that specifies the correction type. @@ -326,11 +374,18 @@ def make_CaloTopoEMCorrections (key = None, cells_name = None, source = None, **kw): - return CaloTopoEMCorrections.make_corrections (corrclass = CALOCORR_EMTOPO, - key = key, - suffix = suffix, - version = version, - corrlist = corrlist, - cells_name = cells_name, - source = source, - **kw) + try: + wasRun3 = Configurable.configurableRun3Behavior + Configurable.configurableRun3Behavior = True + ca = CaloTopoEMCorrections.make_corrections (makeFlags(), + corrclass = CALOCORR_EMTOPO, + key = key, + suffix = suffix, + version = version, + corrlist = corrlist, + cells_name = cells_name, + source = source, + **kw) + finally: + Configurable.configurableRun3Behavior = wasRun3 + return unpackCA (ca) diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMetaoff.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMetaoff.py index 393cc904694c6d001981366cd4c1eac8799dc43f..f271f8fc17fe7b0b2531e9fd3d63d7d8e3a216b4 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMetaoff.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMetaoff.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMetaoff.py,v 1.4 2007-10-17 21:05:53 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloTopoEMetaoff.py # Created: Mar 2007, sss, from earlier job options. @@ -9,15 +7,17 @@ # for TopoEM clusters. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO, CALOCORR_COMBINED2 +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import topoem_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloTopoEMsshape +from CaloClusterCorrection.constants import topoem_valid_keys as keys +cls = CompFactory.CaloTopoEMsshape # CaloClusterCorrection CaloTopoEMetaoff_versions = [ # v1 --- from the original job options file. @@ -29,6 +29,7 @@ CaloTopoEMetaoff_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -46,7 +47,8 @@ CaloTopoEMetaoff_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloTopoEMetaoff (name = None, +def make_CaloTopoEMetaoff (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -54,7 +56,8 @@ def make_CaloTopoEMetaoff (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloTopoEMetaoff_versions, + return makecorr (flags, + versions = CaloTopoEMetaoff_versions, name = name, basename = 'topoetaoff', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMetaoffSW.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMetaoffSW.py index a7f9d9c309defb499b20b6dc5e8a9123dba37115..1385ca4ae4af8d9ac9fa1081659a7369285d610b 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMetaoffSW.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMetaoffSW.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMetaoffSW.py,v 1.1 2009-04-23 05:24:30 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloTopoEMetaoffSW.py # Created: Apr, 2009, sss @@ -12,15 +10,17 @@ # We need to get a copy of it under the topoem hierarchy. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import topoem_valid_keys as keys -cls_v2 = CaloClusterCorrectionConf.CaloSwEtaoff_v2 +from CaloClusterCorrection.constants import topoem_valid_keys as keys +cls_v2 = CompFactory.CaloSwEtaoff_v2 # CaloClusterCorrection CaloTopoEMetaoffSW_versions = [ # Copied from SW. @@ -35,6 +35,7 @@ CaloTopoEMetaoffSW_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # SAMPLING is the calorimeter sampling (EMB1, EMB2, EME1, EME2) to which # this correction will be applied, or None. # NAME is the base name for this tool. If defaulted, a name will @@ -54,7 +55,8 @@ CaloTopoEMetaoffSW_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloTopoEMetaoffSW (sampling, +def make_CaloTopoEMetaoffSW (flags, + sampling, name = None, suffix = None, version = None, @@ -63,7 +65,8 @@ def make_CaloTopoEMetaoffSW (sampling, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloTopoEMetaoffSW_versions, + return makecorr (flags, + versions = CaloTopoEMetaoffSW_versions, name = name, basename = 'topoetaoffsw', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMgap.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMgap.py index 0376ab066155bfb67b3a582ec77ecf9b6a988d90..3d96931e5dba1dc5d251e1f35c828f98005b8962 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMgap.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMgap.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMgap.py,v 1.5 2009-04-20 16:59:16 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloTopoEMgap.py # Created: Mar 2007, sss, from earlier job options. @@ -9,15 +7,17 @@ # for TopoEM clusters. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO, CALOCORR_CLUSTER +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import topoem_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloTopoEMGap +from CaloClusterCorrection.constants import topoem_valid_keys as keys +cls = CompFactory.CaloTopoEMGap # CaloClusterCorrection CaloTopoEMgap_versions = [ # v1 --- from the original DC3 job options file. @@ -29,6 +29,7 @@ CaloTopoEMgap_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -46,7 +47,8 @@ CaloTopoEMgap_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloTopoEMgap (name = None, +def make_CaloTopoEMgap (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -54,7 +56,8 @@ def make_CaloTopoEMgap (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloTopoEMgap_versions, + return makecorr (flags, + versions = CaloTopoEMgap_versions, name = name, basename = 'topogap', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMlayers.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMlayers.py index d6d0e3def1568ad820962e4c5afb4f552a3d2d14..1b3fa90bd8af75fad2e5ae8a1743dbb87aebf57c 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMlayers.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMlayers.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMlayers.py,v 1.3 2007-10-19 15:13:05 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloTopoEMlayers.py # Created: Mar 2007, sss, from old job options. @@ -13,14 +11,16 @@ # # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_NOPOOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -cls = CaloClusterCorrectionConf.CaloTopoEMlayers +cls = CompFactory.CaloTopoEMlayers # CaloClusterCorrection CaloTopoEMlayers_versions = [ ['', cls, ['CaloTopoEMlayers.CaloTopoEMlayers_parms', CALOCORR_NOPOOL]], ] @@ -28,6 +28,7 @@ CaloTopoEMlayers_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -36,6 +37,7 @@ CaloTopoEMlayers_versions = [ # KEY is a string to specify the type of cluster to which the correction # applies. The convention is to use `ele55' for 5x5 electron clusters, # `gam35' for 3x5 photon clusters, and so on. + # SOURCE tells from where we should read the calibration constants. # See common.py for a description of the possibilities. # None means to use the default. @@ -48,7 +50,8 @@ CaloTopoEMlayers_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloTopoEMlayers (name = None, +def make_CaloTopoEMlayers (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -57,10 +60,11 @@ def make_CaloTopoEMlayers (name = None, cells_name = None, **kw): - if cells_name != None: + if cells_name is not None: kw['cells_name'] = cells_name - return makecorr (versions = CaloTopoEMlayers_versions, + return makecorr (flags, + versions = CaloTopoEMlayers_versions, name = name, basename = 'layers', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMlongWeights.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMlongWeights.py index 839a7ed855afea54c77cf9b4a9b212eee6dda439..11c339cdc49d107f496936702f027a27a8082f7d 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMlongWeights.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMlongWeights.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMlongWeights.py,v 1.5 2009-04-20 16:59:16 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloTopoEMlongWeights.py # Created: Mar 2007, sss, from earlier job options. @@ -9,15 +7,17 @@ # for TopoEM clusters. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO, CALOCORR_COMBINED2 +from CaloClusterCorrection.common import makecorr # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import topoem_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloTopoEMLongWeights +from CaloClusterCorrection.constants import topoem_valid_keys as keys +cls = CompFactory.CaloTopoEMLongWeights # CaloClusterCorrection CaloTopoEMlongWeights_versions = [ # v1 --- from the original DC3 job options file. @@ -29,6 +29,7 @@ CaloTopoEMlongWeights_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -46,7 +47,8 @@ CaloTopoEMlongWeights_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloTopoEMlongWeights (name = None, +def make_CaloTopoEMlongWeights (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -54,7 +56,8 @@ def make_CaloTopoEMlongWeights (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloTopoEMlongWeights_versions, + return makecorr (flags, + versions = CaloTopoEMlongWeights_versions, name = name, basename = 'topolw', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMmoments.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMmoments.py index 6d6c00be6f4dc0c0adb57aa39ef03fa230e50005..a42b6ed47547b1d811f46155ae8d4f63ce6c053b 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMmoments.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMmoments.py @@ -1,7 +1,5 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMmoments.py,v 1.4 2008-12-04 08:05:51 menke Exp $ # # File: CaloClusterCorrection/python/CaloTopoEMmoments.py # Created: Mar 2007, sss, from old job options. @@ -12,8 +10,10 @@ # # -from CaloRec import CaloRecConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_NOPOOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO +from CaloClusterCorrection.common import makecorr from AthenaCommon.SystemOfUnits import deg from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg @@ -23,7 +23,7 @@ CaloNoiseCondAlg() # This table lists all available versions of this correction. # See common.py for a description of the contents. # -cls = CaloRecConf.CaloClusterMomentsMaker +cls = CompFactory.CaloClusterMomentsMaker # CaloRec CaloTopoEMmoments_versions = [ ['', cls, ['CaloTopoEMmoments.CaloTopoEMmoments_parms', CALOCORR_NOPOOL]], ] @@ -31,6 +31,7 @@ CaloTopoEMmoments_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -48,7 +49,8 @@ CaloTopoEMmoments_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloTopoEMmoments (name = None, +def make_CaloTopoEMmoments (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -57,7 +59,8 @@ def make_CaloTopoEMmoments (name = None, cells_name = None, **kw): - return makecorr (versions = CaloTopoEMmoments_versions, + return makecorr (flags, + versions = CaloTopoEMmoments_versions, name = name, basename = 'EMTopoMoments', suffix = suffix, @@ -99,23 +102,3 @@ class CaloTopoEMmoments_parms: ,"ENG_POS" ,"SIGNIFICANCE" ] - - AODMomentsNames = [ - "FIRST_PHI" - ,"FIRST_ETA" - ,"SECOND_R" - ,"SECOND_LAMBDA" - ,"CENTER_MAG" - ,"CENTER_LAMBDA" - ,"FIRST_ENG_DENS" - ,"SECOND_ENG_DENS" - ,"LATERAL" - ,"LONGITUDINAL" - ,"ENG_FRAC_MAX" - ,"ISOLATION" - ,"ENG_BAD_CELLS" - ,"N_BAD_CELLS" - ,"BADLARQ_FRAC" - ,"ENG_POS" - ,"SIGNIFICANCE" - ] diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMphimod.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMphimod.py index 5410ef247727a2964bff62bfadb0cf9d29162d80..0ea03817bd07aa925c55dc92a2ae6d47d4f614ad 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMphimod.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMphimod.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMphimod.py,v 1.4 2007-10-17 21:05:53 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloTopoEMphimod.py # Created: Mar 2007, sss, from earlier job options. @@ -9,15 +7,18 @@ # for TopoEM clusters. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO, CALOCORR_COMBINED2 +from CaloClusterCorrection.common import makecorr + # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import topoem_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloTopoEMphimod +from CaloClusterCorrection.constants import topoem_valid_keys as keys +cls = CompFactory.CaloTopoEMphimod # CaloClusterCorrection CaloTopoEMphimod_versions = [ # v1 --- from the original job options file. @@ -29,6 +30,7 @@ CaloTopoEMphimod_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -46,7 +48,8 @@ CaloTopoEMphimod_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloTopoEMphimod (name = None, +def make_CaloTopoEMphimod (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -54,7 +57,8 @@ def make_CaloTopoEMphimod (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloTopoEMphimod_versions, + return makecorr (flags, + versions = CaloTopoEMphimod_versions, name = name, basename = 'topophimod', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMphioff.py b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMphioff.py index 96411505240e6961a965dff204734a24ec62c3a5..c4a1d497d0a4b725660acf8c93293f072fd85ae8 100755 --- a/Calorimeter/CaloClusterCorrection/python/CaloTopoEMphioff.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloTopoEMphioff.py @@ -1,7 +1,5 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: CaloTopoEMphioff.py,v 1.5 2008-01-25 04:14:22 ssnyder Exp $ # # File: CaloClusterCorrection/python/CaloTopoEMphioff.py # Created: Mar 2007, sss, from earlier job options. @@ -9,16 +7,18 @@ # for TopoEM clusters. # -from CaloClusterCorrection import CaloClusterCorrectionConf -from CaloClusterCorrection.common import * +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection.constants import \ + CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO, CALOCORR_COMBINED2 +from CaloClusterCorrection.common import makecorr import math # # This table lists all available versions of this correction. # See common.py for a description of the contents. # -from CaloClusterCorrection.common import topoem_valid_keys as keys -cls = CaloClusterCorrectionConf.CaloTopoEMphioff +from CaloClusterCorrection.constants import topoem_valid_keys as keys +cls = CompFactory.CaloTopoEMphioff # CaloClusterCorrection CaloTopoEMphioff_versions = [ # v1 --- from the original job options file. @@ -35,6 +35,7 @@ CaloTopoEMphioff_versions = [ # # Create a new tool instance. +# FLAGS is the configuration flags instance. # NAME is the base name for this tool. If defaulted, a name will # be constructed from the name of the correction, the version, and the key. # If SUFFIX is not None, it will be added onto the end of the tool name. @@ -52,7 +53,8 @@ CaloTopoEMphioff_versions = [ # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def make_CaloTopoEMphioff (name = None, +def make_CaloTopoEMphioff (flags, + name = None, suffix = None, version = None, key = CALOCORR_DEFAULT_KEY, @@ -60,7 +62,8 @@ def make_CaloTopoEMphioff (name = None, confclass = None, **kw): # Make the tool. - return makecorr (versions = CaloTopoEMphioff_versions, + return makecorr (flags, + versions = CaloTopoEMphioff_versions, name = name, basename = 'topophioff', suffix = suffix, diff --git a/Calorimeter/CaloClusterCorrection/python/MakeHierTags.py b/Calorimeter/CaloClusterCorrection/python/MakeHierTags.py index 0d7c733bd9e02968b5c7949d25f747ae94d981eb..ff511d1f89de7e1e56fca2697f8292106a9c0195 100644 --- a/Calorimeter/CaloClusterCorrection/python/MakeHierTags.py +++ b/Calorimeter/CaloClusterCorrection/python/MakeHierTags.py @@ -1,7 +1,5 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: MakeHierTags.py,v 1.5 2009-04-30 20:29:53 ssnyder Exp $ # # File: CaloClusterCorrection/python/MakeHierTags.py # Created: Apr 2009, sss @@ -21,7 +19,8 @@ from __future__ import print_function from PyCool import cool import CoolConvUtilities.AtlCoolLib as AtlCoolLib -from CaloClusterCorrection.common import * +from CaloClusterCorrection.constants import CALOCORR_COOL, CALOCORR_JO +from CaloClusterCorrection.common import split_version_spec import sys @@ -30,7 +29,7 @@ class MakeHierTags: self.corrtop = corrtop self.dryrun = dryrun self.domagic = domagic - dbsvc = cool.DatabaseSvcFactory.databaseService() + cool.DatabaseSvcFactory.databaseService() if dbfile.endswith ('.db'): connstring = "sqlite://;schema=%s;dbname=OFLP200" % dbfile @@ -71,7 +70,7 @@ class MakeHierTags: def run (self, generation=None): - if generation == None: + if generation is None: generation = self.corrtop.correction_generation_default if generation != '': generation = generation + '-' @@ -89,12 +88,12 @@ class MakeHierTags: htag = None for toolspec in toollist: toolfunc = toolspec[0] - if len(toolspec) >= 2 and type(toolspec[1]) == type(''): + if len(toolspec) >= 2 and isinstance(toolspec[1], str): toolversion = toolspec[1] else: toolversion = '' - if not toolfunc in self.funcmap: + if toolfunc not in self.funcmap: print ("WARNING: skipping tagging for tool", toolfunc.__name__) continue folder = self.funcmap[toolfunc] @@ -102,7 +101,7 @@ class MakeHierTags: (dum1, dum2, corrclass, basename) = folder.split ('/') htmp = corrclass + '-' + generation + version - if htag == None: + if htag is None: htag = htmp print (htag) else: @@ -114,7 +113,7 @@ class MakeHierTags: self.set_tag (folder, tag, htag) - if htag == None: + if htag is None: return for folder in self.folders: @@ -131,7 +130,7 @@ class MakeHierTags: for g in geom_strings: (globver, tryhier) = self.corrtop.geom_match('MakeHierTags', g) if globver[0] == '@': continue - (vlist, version) = self.corrtop.lookup_version (globver) + (vlist, version) = self.corrtop.lookup_version (globver, None) for f in self.folders: self.make_magic_target (f, g, vlist, generation) print ("Made magic targets for", g) @@ -201,21 +200,21 @@ class MakeHierTags: return oldtag = self.tags.get ((folder, htag)) - if oldtag == None: + if oldtag is None: self.tags[(folder,htag)] = tag if not self.db.existsFolder(folder): print ("ERROR: Folder %s doesn't exist" % folder) sys.exit(1) dbf = self.db.getFolder(folder) if check: - if not tag in dbf.listTags(): + if tag not in dbf.listTags(): print ("ERROR: Tag %s doesn't exist in folder %s" % (tag,folder)) sys.exit(1) try: - zz=dbf.findTagRelation(htag) # will throw if htag doesn't exist + dbf.findTagRelation(htag) # will throw if htag doesn't exist dbf.deleteTagRelation(htag) - except: + except Exception: pass dbf.createTagRelation (htag, tag) #print ('set_tag', folder, tag, htag) diff --git a/Calorimeter/CaloClusterCorrection/python/StandardCellWeightCalib.py b/Calorimeter/CaloClusterCorrection/python/StandardCellWeightCalib.py index 1c372020eb3f82ec032f5a5279e7e11ba9e05859..fc65f22a61e63569b79303d8944c822e5bb69395 100644 --- a/Calorimeter/CaloClusterCorrection/python/StandardCellWeightCalib.py +++ b/Calorimeter/CaloClusterCorrection/python/StandardCellWeightCalib.py @@ -5,6 +5,7 @@ #-- #-- Note the input for this calibration is jet driven. The fitted default +from AthenaConfiguration.ComponentFactory import CompFactory from AthenaCommon.Logging import logging from AthenaCommon.GlobalFlags import globalflags @@ -165,20 +166,20 @@ class H1Calibration(object): if 'Topo' in input: return H1Calibration.getCalibDBParams('Cone',0.4,'H1Topo',onlyCellWeight,isMC) else: return H1Calibration.getCalibDBParams('Cone',0.4,'H1Tower',onlyCellWeight,isMC) # else try to find a good fall back - _logger.warning("getCalibDBParams: no dedicated calibration for %s %s %s"%(finder,mainparam,input)) + _logger.warning("getCalibDBParams: no dedicated calibration for %s %s %s", finder,mainparam,input) if finder not in [ 'Kt', 'Cone' ] : finder = 'Cone' # fall back to ATLAS Cone if input not in [ 'Topo', 'Tower' ] : input = 'Tower' # fall back to Tower if finder == 'Kt' : l = [ 0.4, 0.6 ] else: l = [ 0.4, 0.7 ] (m,mainparam) = min( [ (abs(p-mainparam),p) for p in l ] ) # main parameter optimization (??) - _logger.warning("getCalibDBParams: defaulted calibration to %s %s %s"%(finder,mainparam,input)) + _logger.warning("getCalibDBParams: defaulted calibration to %s %s %s", finder,mainparam,input) return H1Calibration.getCalibDBParams(finder,mainparam,input,onlyCellWeight,isMC) #-- load DB folder @staticmethod def loadCaloFolder(folder,tag,isMC=False): from IOVDbSvc.CondDB import conddb from AthenaCommon.AppMgr import ServiceMgr - from IOVDbSvc.IOVDbSvcConf import IOVDbSvc + IOVDbSvc = CompFactory.IOVDbSvc # IOVDbSvc ServiceMgr += IOVDbSvc() IOVDbSvc = ServiceMgr.IOVDbSvc if isMC: @@ -203,7 +204,7 @@ def getCellWeightTool(finder="Cone",mainparam=0.4,input="Topo", onlyCellWeight=F input/str : input objects triggers calibration weights mainparam/float: size parameter for jet """ - from CaloClusterCorrection.CaloClusterCorrectionConf import H1WeightToolCSC12Generic + H1WeightToolCSC12Generic = CompFactory.H1WeightToolCSC12Generic # CaloClusterCorrection if globalflags.DataSource()=='data': isMC=False diff --git a/Calorimeter/CaloClusterCorrection/python/common.py b/Calorimeter/CaloClusterCorrection/python/common.py index f71b6117e59e99c9fef26ad7c888c1d719576114..03557911a23316e5d62fe7ebb63362f2f0c69315 100755 --- a/Calorimeter/CaloClusterCorrection/python/common.py +++ b/Calorimeter/CaloClusterCorrection/python/common.py @@ -1,7 +1,5 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id: common.py,v 1.39 2009-05-20 20:48:52 ssnyder Exp $ # # File: CaloClusterCorrection/python/common.py # Created: Nov 2006, sss @@ -10,21 +8,17 @@ from __future__ import print_function +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory from AthenaCommon.Logging import logging -from AthenaCommon.AppMgr import ServiceMgr -from AthenaCommon.JobProperties import jobproperties -from AthenaCommon.GlobalFlags import globalflags -from AthenaCommon.Configurable import Configurable -from IOVDbSvc.CondDB import conddb from fnmatch import fnmatchcase -import sys -import string from CaloClusterCorrection.poolfiles import poolfiles -from CaloClusterCorrection.CaloClusterCorrectionConf import \ - CaloRunClusterCorrections, CaloDummyCorrection -from CaloClusterCorrection.constants import * +from CaloClusterCorrection.constants import \ + CALOCORR_JO, CALOCORR_POOL, CALOCORR_COOL, \ + CALOCORR_NOPOOL, CALOCORR_TOPOOL, CALOCORR_DEFAULT_KEY, \ + sampnames # Used for reporting configuration errors. class CaloCorrectionConfigError (Exception): @@ -42,63 +36,6 @@ _alltools = {} -class MetatoolPropDummy: - def __init__ (self, obj): - self.obj = obj - def __getitem__ (self, i): - return self.obj.__dict__.get (i, '') - return '' - def has_key (self, k): - if k == 'isDummy': - return False - return True - def __contains__ (self, k): - return self.has_key (k) - -class MetatoolHelper: - def __init__ (self, confclass, name): - self.__dict__["clsname"] = confclass.__name__ - self.__dict__["name"] = name - self.__dict__["prefix"] = "" - self.__dict__["DBHandleKey"] = None - self.__dict__["props"] = {} - self.__dict__["_propdum"] = MetatoolPropDummy (self) - return - - - def getName (self): - return self.name - - def __setattr__ (self, k, v): - if k in self.__dict__: - self.__dict__[k] = v - else: - if isinstance (v, Configurable): - v = v.getFullName() - self.props[k] = str(v) - return - - - def properties (self): - return self._propdum - - - def corrspec (self): - if self.DBHandleKey == None: - location = '+' + self.clsname - elif self.DBHandleKey.find ('/') >= 0: - location = '@' + self.DBHandleKey - else: - location = self.DBHandleKey - spec = [self.name, - location, - self.prefix] - for (k, v) in self.props.items(): - spec += [k, v] - spec.append ("") - return spec - - ########################################################################### # Code to handle creating the list of correction tools. # @@ -109,12 +46,13 @@ class MetatoolHelper: # name: A short descriptive name of the type of cluster # (to be written to the log file) # -# version_override_flag: A job property. +# version_override_flag_name: +# Name of flag. # If set, it overrides the selected correction # version. # -# correction_generation_flag: -# A job property. +# correction_generation_flag_name: +# Name of flag. # If set, this gives the correction generation # string that's embedded in tags written to the # database. This string should be changed for @@ -148,11 +86,11 @@ class MetatoolHelper: # It may also be `@', in which case the global # version string is used instead. # -# ORDER is an integer. When the metatool is used, -# tools will be executed in increasing order -# of the ORDER parameter. Note that a given -# tool/version must have the same ORDER each -# time it's used. +# ORDER is an integer, giving the order in which +# the tools are intended to run. +# Not currently used (they were used by the metatool), +# but retained in case we want to use this +# for checking. # # The remainder of the list should be a set # of (NAME,VALUE) tuples giving correction parameters @@ -189,29 +127,52 @@ def split_version_spec (cspec): version = '' order = 0 ii = 1 - if ii < len(cspec) and type(cspec[ii]) == type(''): + if ii < len(cspec) and isinstance (cspec[ii], str): version = cspec[ii] ii += 1 - if ii < len(cspec) and type(cspec[ii]) == type(1): + if ii < len(cspec) and isinstance (cspec[ii], int): order = cspec[ii] ii += 1 extra_args = cspec[ii:] return (func, version, order, extra_args) +# Given a cool tag (or GLOBAL for the currently-configured global tag), +# return the version of the correction set to use. +def _find_version_from_cool_tag (flags, coolTag, corrclass): + if coolTag == 'GLOBAL': + coolTag = flags.IOVDb.GlobalTag + + if flags.Input.isMC: + folderset = "/CALO/Ofl/" + corrclass + connstring = 'COOLOFL_CALO/OFLP200' + else: + folderset = "/CALO/" + corrclass + connstring = 'COOLONL_CALO/' + flags.IOVDb.DatabaseInstance + + from CoolConvUtilities import AtlCoolLib + db = AtlCoolLib.indirectOpen (connstring, readOnly=True, oracle=True) + ff = db.getFolderSet (folderset) + t = ff.resolveTag (coolTag) + # CaloOflSwClusterCorrections.00-02-12-calhits-v9 + l = t.split ('-') + return '-'.join (l[4:]) + + class CaloClusterCorrSetup: # Must be overridden in derived classes. See above for their meaning. # name = XXX - # version_override_flag = XXX - # correction_generation_flag = XXX + # version_override_flag_name = XXX + # correction_generation_flag_name = XXX # correction_generation_default = XXX # versions = XXX # geom_versions = XXX # newest_version = XXX # - # Create and return a list of correction tools. - # CORRCLASS is the correction class string, as defined above. + # Create and return a CA of correction tools. + # FLAGS is the configuration flags. + # CORRCLASS is the correction class string, as defined in constants.py. # KEY is a string that specifies the correction type. # SUFFIX is a string to add to the end of each tool name. # VERSION specifies which version of corrections to use. @@ -221,16 +182,14 @@ class CaloClusterCorrSetup: # in the version table, we look for one with a version of `@'. # If no match for that is found, the last entry in the table # will be used. - # If VERSION starts with `@', USE_METATOOL must be enabled. # CORRLIST can be used to explicitly specify which corrections to run. # CELLS_NAME is the SG key to use to find the calorimeter cells, # for those corrections that require it. # SOURCE specifies the source(s) from which tools are configured. # None means to use the default. - # If USE_METATOOL is true, then instead of making the list of tools here, - # return a single CaloRunClusterCorrections tool. # def make_corrections (self, + flags, corrclass, key = None, suffix = '', @@ -238,7 +197,6 @@ class CaloClusterCorrSetup: corrlist = None, cells_name = None, source = None, - use_metatool = False, **kw): # Make a logger. @@ -248,39 +206,38 @@ class CaloClusterCorrSetup: # First, find the appropriate overall version string to use, # if it wasn't specified explicitly. - if version == None: + if version is None: # First see if the flag was set to override the version. # at the top-level. - if self.version_override_flag.statusOn: - version = self.version_override_flag() + v = getattr (flags.Calo.ClusterCorrection, self.version_override_flag_name) + if v: + version = v - if version == None: + if version is None: # No explicitly specified version. # Try to guess it from the data source + geometry string. # Otherwise, use the latest version. - geom = jobproperties.Global.DetDescrVersion() - datasource = globalflags.DataSource() + geom = flags.GeoModel.AtlasVersion + datasource = 'geant4' if flags.Input.isMC else 'data' (version, tryhier) = self.geom_match (datasource, geom) - #if version[0] == '@' and not use_metatool: - # raise CaloCorrectionConfigError ('COOL tag requested but not metatool.') - # Get the correction generation. - generation = self.get_generation() + generation = self.get_generation(flags) # Use the default source if one wasn't specified. - if source == None: - from CaloClusterCorrection.CaloClusterCorrectionFlags \ - import caloClusterCorrectionFlags - source = caloClusterCorrectionFlags.DefaultSource() + if source is None: + source = flags.Calo.ClusterCorrection.defaultSource - if type(source) != type([]): + if not isinstance (source, list): source = [source] if CALOCORR_COOL not in source: tryhier = False if tryhier and version[0] != '@': - version = "@%s-%s%s" % (corrclass, generation, version) + cl = corrclass + if flags.Input.isMC: + cl = cl[0:4] + 'Ofl' + cl[4:] + version = "@%s-%s%s" % (cl, generation, version) # Only use COOL if we're actually trying to resolve a COOL tag. # Otherwise we can run into problems: it looks like `ununsed' @@ -289,21 +246,18 @@ class CaloClusterCorrSetup: if CALOCORR_COOL in source: source.remove (CALOCORR_COOL) - (vcorrlist, version) = self.lookup_version (version) + (vcorrlist, version) = self.lookup_version (flags, version, corrclass) # Default to the standard list if no explicit correction list. - if corrlist == None: + if corrlist is None: corrlist = vcorrlist - preserve_order = False - else: - # If list was given explicitly, don't reorder it. - preserve_order = True log.info ("%s corrections for %s (%s) using version %s" % (self.name, key, suffix, version)) # Now, walk through the list of corrections. - out = [] + out = ComponentAccumulator() + tools = [] for cspec in corrlist: (func, this_version, this_order, extra_args) = \ split_version_spec (cspec) @@ -353,31 +307,32 @@ class CaloClusterCorrSetup: this_args[k[len(corrname)+1:]] = v # Make the tool. - tool = func (this_cells_name, - this_suffix, - this_version, - this_key, - this_source, - generation = generation, - use_metatool = use_metatool, - order = this_order, - **this_args) - out.append (tool) - - if use_metatool: - out = [self.make_metatool (suffix + key, out, preserve_order)] - + ca = func (flags, + this_cells_name, + this_suffix, + this_version, + this_key, + this_source, + generation = generation, + order = this_order, + **this_args) + tools.append (out.popToolsAndMerge (ca)) + + out.setPrivateTools (tools) return out # Look up a specific correction version; return the correction # list and the version. Broken out to allow overriding, for # any special version-name handling needed. - def lookup_version (self, version): + def lookup_version (self, flags, version, corrclass): vcorrlist = self.versions.get (version) - if vcorrlist == None and version.startswith ('@'): - vcorrlist = self.versions.get ('@') - if vcorrlist == None: + if vcorrlist is None and version.startswith ('@'): + findvers = _find_version_from_cool_tag (flags, version[1:], corrclass) + vcorrlist = self.versions.get (findvers) + if vcorrlist is None: + vcorrlist = self.versions.get ('@') + if vcorrlist is None: raise CaloCorrectionConfigError\ ("Can't find global correction version %s." % version) return (vcorrlist, version) @@ -405,10 +360,11 @@ class CaloClusterCorrSetup: # Get the correction generation, with a `-' appended if appropriate. @classmethod - def get_generation (cls): + def get_generation (cls, flags): generation = cls.correction_generation_default - if cls.correction_generation_flag.statusOn: - generation = cls.correction_generation_flag() + gen2 = getattr (flags.Calo.ClusterCorrection, cls.correction_generation_flag_name) + if gen2: + generation = gen2 if generation != '': generation = generation + '-' return generation @@ -417,17 +373,21 @@ class CaloClusterCorrSetup: ##################################################################### # Code for writing to pool. # Make a set of corrections for writing to pool. - def make_ForPool (self, keys, corrclass): + + def make_ForPool (self, flags, keys, corrclass): # Map from SG key to a list of tool instances. sgkeys = {} - # Map from tool names to instances. - tools = {} + # Names of all tools made so far + tool_names = set() # Map from (func, version) to (order, globversion). # For consistency checking. ordermap = {} + result = ComponentAccumulator() + tools = [] + # Go through each version, and make corrections. for (v,l) in self.versions.items(): if v.startswith ('@'): continue @@ -454,37 +414,53 @@ class CaloClusterCorrSetup: ("Tool %s has order %d in %s but order %d in %s!" % (func.__name__, order, v, ordermap[okey][0], ordermap[okey][1])) - + # Find the list of valid keys for this tool. - valid_keys = func (None, + valid_keys = func (flags, + None, version = version, key = '@VALID_KEYS') - if valid_keys == None: + if valid_keys is None: valid_keys = keys for key in valid_keys: - self.maybe_make_correction_for_pool (sgkeys, tools, key, c, - corrclass) + ca = self.maybe_make_correction_for_pool (flags, + sgkeys, + tool_names, + key, c, + corrclass) + if ca: + tools.append (ca.popPrivateTools()) + result.merge (ca) + + result.setPrivateTools (tools) - return sgkeys + return (sgkeys, result) - def maybe_make_correction_for_pool (self, sgkeys, tools, key, cspec, + def maybe_make_correction_for_pool (self, flags, + sgkeys, tool_names, key, cspec, corrclass): (func, version, order, extra_args) = split_version_spec (cspec) name = func.__name__ + '_' + version + '_' + key - if name in tools: - return - tool = func (None, '', version, key, CALOCORR_TOPOOL, - generation = self.get_generation(), - order = order) - if tool != None and folder(tool).find ('/' + corrclass + '/') >= 0: - tools[name] = tool + if name in tool_names: + return None + ca = func (flags, + None, '', version, key, CALOCORR_TOPOOL, + generation = self.get_generation (flags), + order = order) + if ca is None: + return None + tool = ca.popPrivateTools() + if tool is not None and folder(tool).find ('/' + corrclass + '/') >= 0: + tool_names.add (name) sgkeys.setdefault (sgkey(tool), []).append (tool) - return + ca.setPrivateTools (tool) + return ca # Add a dummy correction object to each folder. def add_dummies (self, sgkeys, valid_keys, generation): + CaloDummyCorrection = CompFactory.CaloDummyCorrection # CaloClusterCorrection toolnames = {} for sgkey in sgkeys.keys(): ll = sgkey.split ('-') @@ -509,17 +485,17 @@ class CaloClusterCorrSetup: # Configure algorithms for writing to pool. - def config_for_pool (self, keys, corrclass): - from CaloRec.CaloRecMakers import make_CaloClusterCorrDBWriter - from AthenaCommon.AlgSequence import AlgSequence - topalg = AlgSequence ("TopAlg") + def config_for_pool (self, flags, keys, corrclass): + result = ComponentAccumulator() corr_output_list = [] tag_list = [] - generation = self.get_generation() + generation = self.get_generation (flags) - sgkeys = self.make_ForPool (keys, corrclass) + (sgkeys, ca) = self.make_ForPool (flags, keys, corrclass) + ca.popPrivateTools() + result.merge (ca) self.add_dummies (sgkeys, keys, generation) for (sgkey, tools) in sgkeys.items(): @@ -527,8 +503,12 @@ class CaloClusterCorrSetup: name = 'write_' + sgkey name = name.replace ('.', '_') - alg = make_CaloClusterCorrDBWriter (name, sgkey, tools) - topalg += alg + # In CaloRec + alg = CompFactory.CaloClusterCorrDBWriter (name, + key = sgkey, + ClusterCorrectionTools = tools) + result.addEventAlgo (alg) + corr_output_list.append ('CaloRec::ToolConstants#' + sgkey + '#' + @@ -539,53 +519,14 @@ class CaloClusterCorrSetup: print (corr_output_list) print (tag_list) - return (corr_output_list, tag_list) - - - # Given a list of MetatoolHelper objects, construct an appropriate - # Configurable for a CaloRunClusterCorrections tool to run - # the desired corrections. - def make_metatool (self, suffix, tools, preserve_order): - name = 'CaloRunClusterCorrections' + suffix - if name in _alltools: - nsuff = 2 - while (name + str (nsuff)) in _alltools: - nsuff += 1 - name = name + str (nsuff) - _alltools[name] = (None, None, None) - metatool = CaloRunClusterCorrections (name) - specs = sum ([t.corrspec() for t in tools], []) - metatool.CorrSpecs = specs - metatool.PreserveOrder = preserve_order - log = logging.getLogger ('CaloClusterCorrection') - log.debug (" making metatool %s" % metatool.getName()) - log.debug (" specs: %s", specs) - - # # If we're running this to make the trigger DB, turn on - # # NoClearProps. But try to avoid importing trigger packages - # # if they haven't already been read. - # import sys - # if sys.modules.has_key ('TriggerJobOpts.TriggerFlags'): - # TriggerFlags = sys.modules['TriggerJobOpts.TriggerFlags'] - # if hasattr (TriggerFlags, 'TriggerFlags'): - # TriggerFlags = TriggerFlags.TriggerFlags - # if hasattr (TriggerFlags, 'Online'): - # Online = TriggerFlags.Online - # if Online.doDBConfig(): - # metatool.NoClearProps = True - - # Ok, clearing the properties was an interesting idea, but in the - # usual configuration it won't save very much, and it causes problems - # with trying to clone algorithms for Hive. Just disable it for now. - metatool.NoClearProps = True - - return metatool + return (corr_output_list, tag_list, result) ########################################################################### # # Create a correction tool. +# FLAGS is the corrections flag object. # VERSIONS is a table listing all the available versions of the corrections. # It is a list of 4-element lists. The last row should correspond to the # most recent version of the correction. @@ -658,7 +599,6 @@ class CaloClusterCorrSetup: # in the version table, we look for one with a version of `@'. # If no match for that is found, the last entry in the table # will be used. -# If VERSION starts with `@', USE_METATOOL must be enabled. # # KEY is a string to specify the type of cluster to which the correction # applies. The convention is to use `ele55' for 5x5 electron clusters, @@ -694,15 +634,13 @@ class CaloClusterCorrSetup: # # GENERATION is the generation string to embed in COOL tags. # -# If USE_METATOOL is true, then instead of making a Configurable, -# return a MetatoolHelper object. -# # ORDER specifies the relative order in which this tool should be executed. # # Additional keyword arguments may be passed to override any tool # parameters/constants. # -def makecorr (versions, +def makecorr (flags, + versions, name, basename, suffix, @@ -713,12 +651,11 @@ def makecorr (versions, confclass, corrclass, generation = '', - use_metatool = False, order = 0, **kw): # If no version specified, use the last one in the table. - if version == None: + if version is None: version = versions[-1][0] # Try to find the requested version. @@ -749,10 +686,8 @@ def makecorr (versions, return valid_keys # Use the default source if one wasn't specified. - if source == None: - from CaloClusterCorrection.CaloClusterCorrectionFlags \ - import caloClusterCorrectionFlags - source = caloClusterCorrectionFlags.DefaultSource() + if source is None: + source = flags.Calo.ClusterCorrection.defaultSource # Test to see if this correction specifies nopool. nopool = CALOCORR_NOPOOL in v[2] @@ -762,11 +697,7 @@ def makecorr (versions, return None # Find the SG key and cool tag. - # If the tag is specified in the version, then we must be using - # the metatool, and the SG key doesn't get specified. - # Otherwise, the tag name is the same as the SG key. if version.startswith ('@'): - #assert use_metatool sgkey = None if version == '@GLOBAL': fulltag = version @@ -785,7 +716,7 @@ def makecorr (versions, fulltag = "%s.%s%s" % (corrclass, generation, tmp) # The cool folder name. - if globalflags.DataSource() == 'data': + if not flags.Input.isMC: folder = "/CALO/%s/%s" % (corrclass, basename) else: folder = "/CALO/Ofl/%s/%s" % (corrclass, basename) @@ -794,7 +725,7 @@ def makecorr (versions, prefix = key + sampnames[sampling] + "." # Construct a default tool name if one isn't specified. - if name == None: + if name is None: name = basename name = name + sampnames[sampling] if version != '': @@ -807,7 +738,7 @@ def makecorr (versions, name = name + "_" + key # Add a suffix if given. - if suffix != None: + if suffix is not None: name = name + suffix # If we're not writing to pool, we need to make sure the name's unique. @@ -819,26 +750,24 @@ def makecorr (versions, _alltools[name] = (folder, fulltag, sgkey) # If no class was explicitly specified, take it from the table. - if confclass == None: + if confclass is None: confclass = v[1] # It may be sampling-dependent. - if type (confclass) == type ({}) and sampling != None: + if isinstance (confclass, dict) and sampling is not None: confclass = confclass[sampling] + result = ComponentAccumulator() + # Create the tool! - if use_metatool: - corr = MetatoolHelper (confclass, name) - else: - _maybe_patchclass (confclass) - corr = confclass (name) + corr = confclass (name) # Set the prefix for all pool-capable tools. if not nopool: corr.prefix = prefix # Try to find a source from which to configure it. - if type(source) != type([]): + if not isinstance (source, list): source = [source] avail = v[2] wherefrom = None @@ -851,21 +780,25 @@ def makecorr (versions, wherefrom = sel[0] break - # elif s == CALOCORR_POOL: - # sel = [x for x in avail if _is_pool_source (x)] - # if len (sel) > 0 and _config_from_pool (corr, sel[0], sgkey): - # if not use_metatool: - # _mung_prefix (corr, key, valid_keys) - # wherefrom = sel[0] - # break + elif s == CALOCORR_POOL: + sel = [x for x in avail if _is_pool_source (x)] + if len (sel) > 0: + ca2 = _config_from_pool (flags, corr, sel[0], sgkey) + if ca2: + result.merge (ca2) + _mung_prefix (corr, key, valid_keys) + wherefrom = sel[0] + break elif s == CALOCORR_COOL: sel = [x for x in avail if _is_cool_source (x)] - if len (sel) > 0 and config_from_cool (corr, folder, fulltag): - if not use_metatool: + if len (sel) > 0: + ca2 = _config_from_cool (flags, corr, folder, fulltag) + if ca2: + result.merge (ca2) _mung_prefix (corr, key, valid_keys) - wherefrom = 'cool' - break + wherefrom = 'cool' + break elif _is_jo_source (s): if _config_from_jo (corr, s, key, sampling, valid_keys, order): @@ -873,13 +806,14 @@ def makecorr (versions, break elif _is_pool_source (s): - if _config_from_pool (corr, s, sgkey): - if not use_metatool: - _mung_prefix (corr, key, valid_keys) + ca2 = _config_from_pool (flags, corr, s, sgkey) + if ca2: + result.merge (ca2) + _mung_prefix (corr, key, valid_keys) wherefrom = s break - if wherefrom == None: + if wherefrom is None: raise CaloCorrectionConfigError \ ("Can't find any source to configure tool `%s'. Sources: %s" % (name, source)) @@ -891,19 +825,12 @@ def makecorr (versions, # If any other keyword arguments were passed, make those assignments. # This will override anything otherwise read from JO/pool. for (k, val) in kw.items(): - if val != None: - _setprop (corr, k, val) + if val is not None: + setattr (corr, k, val) # Done! - return corr - - -# Helper for setting a correction tool property/constant. -def _setprop (obj, k, val): - if type(val) == type([]) and type(obj.properties()[k]) != type([]): - val = str(val) - setattr (obj, k, val) - return + result.setPrivateTools (corr) + return result # Test to see if S looks like a job options source. @@ -942,13 +869,13 @@ def _config_from_jo (corr, jo, key, sampling, valid_keys, order): parms = getattr (mod, paramclass) # It may be sampling-dependent. - if type (parms) == type ({}) and sampling != None: + if isinstance (parms, dict) and sampling is not None: parms = parms[sampling] - if order != 0 and 'order' in corr.properties(): - _setprop (corr, 'order', order) - if 'isDummy' in corr.properties(): - _setprop (corr, 'isDummy', 0) + if order != 0 and hasattr (corr, 'order'): + setattr (corr, 'order', order) + if hasattr (corr, 'isDummy'): + setattr (corr, 'isDummy', 0) log = logging.getLogger ('CaloClusterCorrection') @@ -981,50 +908,48 @@ def _config_from_jo (corr, jo, key, sampling, valid_keys, order): # Can't look up a key in val --- just use val as-is. pass - _setprop (corr, k, val) + setattr (corr, k, val) return True # Configure a correction tool from POOL. -def _config_from_pool (corr, poolfile, sgkey): +def _config_from_pool (flags, corr, poolfile, sgkey): if not poolfile or not poolfiles[poolfile]: return False - # Tell the tool to look in pool for this key. - corr.DBHandleKey = sgkey + ca = ComponentAccumulator() # If this is the first time we've seen this file, # add it to CondProxyProvider. - # Pick up the provider by looking in the top-level global scope. - global ServiceMgr if poolfile not in _poolfiles_seen: - _poolfiles_seen[poolfile] = 1 - try: - ServiceMgr.CondProxyProvider.InputCollections += \ - [poolfiles[poolfile]] - except AttributeError: - # CondProxyProvider hasn't been made yet? - from EventSelectorAthenaPool.EventSelectorAthenaPoolConf \ - import CondProxyProvider - ServiceMgr += CondProxyProvider() - ServiceMgr.ProxyProviderSvc.ProviderNames += ["CondProxyProvider"] - ServiceMgr.CondProxyProvider.InputCollections += \ - [poolfiles[poolfile]] - return True + from EventSelectorAthenaPool.CondProxyProviderConfig import CondProxyProviderCfg + ca.merge (CondProxyProviderCfg (flags, [poolfiles[poolfile]])) + + # Tell the tool to look in pool for this key. + corr.DBHandleKey = sgkey + + # Set up a conditions algorithm to convert from the data in DetectorStore + # to a conditions object. + ToolConstantsCondAlg = CompFactory.ToolConstantsCondAlg # CaloRec + + name = 'ToolConstantsCondAlg_' + sgkey.replace ('.', '_') + alg = ToolConstantsCondAlg (name, + DetStoreKey = sgkey, + ToolConstantsKey = sgkey) + ca.addCondAlgo (alg) + return ca # Configure a correction tool from COOL. -def config_from_cool (corr, folder, tag): +def _config_from_cool (flags, corr, folder, tag): # Folder name has form /CALO/CORRCLASS/NAME # Find the subdetector name string to use. fsplit = folder.split ('/') - if fsplit[1] == 'Ofl': - corrclass = folder.split ('/')[3] + if fsplit[2] == 'Ofl': + corrclass = folder.split ('/')[4] else: - corrclass = folder.split ('/')[2] - from CaloClusterCorrection.CaloClusterCorrectionFlags \ - import caloClusterCorrectionFlags - sndict = caloClusterCorrectionFlags.DBSubdetName() + corrclass = folder.split ('/')[3] + sndict = flags.Calo.ClusterCorrection.dbSubdetName subdetname = sndict.get (corrclass) if not subdetname: subdetname = sndict.get (None) @@ -1033,21 +958,26 @@ def config_from_cool (corr, folder, tag): # We can't use more than one tag from a folder. oldtag = _folders_used.get (folder) - if oldtag != None and oldtag != tag: + if oldtag is not None and oldtag != tag: return False + ca = ComponentAccumulator() + _folders_used[folder] = tag - if oldtag == None: - if tag != '@GLOBAL': - folder = folder + ' <tag>%s</tag>' % tag + if oldtag is None: + from IOVDbSvc.IOVDbSvcConfig import addFolders + tagstr = '' if tag =='@GLOBAL' else tag sdsuffix = '_OFL' if 'Ofl' in folder else '' - conddb.addFolder (subdetname + sdsuffix, - folder, - className = 'CaloRec::ToolConstants') + ca.merge (addFolders (flags, + folder, + detDb = subdetname + sdsuffix, + className = 'CaloRec::ToolConstants', + tag = tagstr)) + log = logging.getLogger ('CaloClusterCorrection') log.debug ("Adding cool folder `%s' for subdetector name %s" % (folder, subdetname)) - return True + return ca # When we're reading from pool/cool, the prefix _must_ be one that @@ -1059,9 +989,9 @@ def _matchlen (a, b): i = i+1 return i def _longest_match (key, valid_keys): - if type(valid_keys) != type([]): + if not isinstance (valid_keys, list): valid_keys = [valid_keys] - if valid_keys == None or key in valid_keys: + if valid_keys is None or key in valid_keys: return key new_key = valid_keys[0] for k in valid_keys[1:]: @@ -1069,7 +999,7 @@ def _longest_match (key, valid_keys): new_key = k return new_key def _mung_prefix (corr, key, valid_keys): - if valid_keys == None or key in valid_keys: return + if valid_keys is None or key in valid_keys: return # Find the best match. new_key = _longest_match (key, valid_keys) @@ -1094,47 +1024,3 @@ def sgkey (tool): -############################################################################## -# Hack around a problem with the interaction between Configurable -# and reading tool constants from pool. -# -# When ToolWithConstantsMixin reads constants from pool, we still want -# to allow overriding the constants from job options. So, if TWCM sees -# a setProperty call for a given property, it assumes that this is being -# overridden from JO, and will use what's set in the setProperty call -# instead of what's read from pool. -# -# This worked fine for non-Configurable setup. However, when one uses -# Configurable to set up ones class, it ends up setting _all_ the properties, -# even those that are still defaulted. So, what we end up seeing -# is that TWCM::setProperty gets called for _all_ properties with -# the default --- i.e., null --- values, so the values read from pool -# never get used. -# -# The code here patches the Configurable classes for the corrections -# so that setup() does not transport to C++ those properties that -# were defaulted. -# - -from AthenaCommon.Configurable import Configurable -def _calocorr_setup (self): - save_properties = {} - try: - for (k, v) in list(self._properties.items()): - if self in v.history and len (v.history[self]) >= 1: - pass - else: - save_properties[k] = v - del self._properties[k] - Configurable.setup (self) - finally: - for (k, v) in save_properties.items(): - self._properties[k] = v - return - -def _maybe_patchclass (cls): - if '_calocorr_patched' in cls.__dict__: - return - cls.setup = _calocorr_setup - cls._calocorr_patched = 1 - return diff --git a/Calorimeter/CaloClusterCorrection/python/compat.py b/Calorimeter/CaloClusterCorrection/python/compat.py new file mode 100644 index 0000000000000000000000000000000000000000..b39ea3799756db0538ab4f3666d002f5d84f7534 --- /dev/null +++ b/Calorimeter/CaloClusterCorrection/python/compat.py @@ -0,0 +1,58 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +# +# File: CaloClusterCorrection/python/compat.py +# Created: Aug 2020, sss +# Purpose: Backwards-compatbility helpers. +# +# Helpers for configuring cluster corrections using old configuration. +# + + +from AthenaConfiguration.ComponentAccumulator import \ + conf2toConfigurable, appendCAtoAthena +import string + + +# +# Return a new-style configuration flags object containing information +# from old flags. +# +def makeFlags(): + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.loadAllDynamicFlags() + flags = ConfigFlags.clone() + + from CaloClusterCorrection.CaloClusterCorrectionFlags \ + import caloClusterCorrectionFlags + + for name in dir(caloClusterCorrectionFlags): + if name[0] not in string.ascii_uppercase: + continue + flag = getattr (caloClusterCorrectionFlags, name) + if not flag.isDefault(): + if name == 'DBSubdetName': + name2 = 'dbSubdetName' + else: + name2 = name[0].lower() + name[1:] + val = flag.get_Value() + setattr (flags.Calo.ClusterCorrection, name2, val) + + from AthenaCommon.JobProperties import jobproperties + from AthenaCommon.GlobalFlags import globalflags + + flags.GeoModel.AtlasVersion = jobproperties.Global.DetDescrVersion() + flags.Input.isMC = globalflags.DataSource() != 'data' + flags.IOVDb.GlobalTag = globalflags.ConditionsTag() + + return flags + + +# +# Apply the results of a ComponentAccumulator to Athena. +# Returns the list of configured correction tools. +# +def unpackCA (ca): + tools = [conf2toConfigurable(c) for c in ca.popPrivateTools()] + appendCAtoAthena (ca) + return tools diff --git a/Calorimeter/CaloClusterCorrection/python/constants.py b/Calorimeter/CaloClusterCorrection/python/constants.py index 99236261486ba28dfca141215cbd88914a241aa7..8db368c1e8cb298e28a7f5cb5ef631d7e327fbbb 100644 --- a/Calorimeter/CaloClusterCorrection/python/constants.py +++ b/Calorimeter/CaloClusterCorrection/python/constants.py @@ -1,7 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# $Id$ # # File: CaloClusterCorrection/python/constants.py # Created: Nov 2009, sss diff --git a/Calorimeter/CaloClusterCorrection/python/linkDummyTags.py b/Calorimeter/CaloClusterCorrection/python/linkDummyTags.py index dece0a043470af6ee1467ad752ef5cb14bbcef59..5204f4775bd24f4340be39162e8b1249d81b95cf 100644 --- a/Calorimeter/CaloClusterCorrection/python/linkDummyTags.py +++ b/Calorimeter/CaloClusterCorrection/python/linkDummyTags.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # File: CaloClusterCorrection/python/linkDummyTags.py @@ -23,8 +23,8 @@ def get_htags (folder): htags = [] for t in tags: try: - rtag = subf.resolveTag(t) - except: + subf.resolveTag(t) + except Exception: htags.append (t) tags = subf.listTags() @@ -40,7 +40,7 @@ def link_tag (f, htag, dtag): try: f.findTagRelation(htag) f.deleteTagRelation(htag) - except: + except Exception: pass f.createTagRelation (htag, dtag) print ('Linked', htag) diff --git a/Calorimeter/CaloClusterCorrection/share/CaloSwCorrectionsToPool.py b/Calorimeter/CaloClusterCorrection/share/CaloSwCorrectionsToPool.py index 08ba9b22672108ba670218301962aaaf71d49334..042050500d0ad05f61a7210a1f6c4af9e657fe14 100755 --- a/Calorimeter/CaloClusterCorrection/share/CaloSwCorrectionsToPool.py +++ b/Calorimeter/CaloClusterCorrection/share/CaloSwCorrectionsToPool.py @@ -20,9 +20,13 @@ CaloSwCorrKeys = ['ele55', 'ele35', 'ele37', from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections from CaloClusterCorrection.common import CALOCORR_SW -(corr_output_list, tag_list) =\ - CaloSwCorrections.config_for_pool (CaloSwCorrKeys, +from CaloClusterCorrection.compat import makeFlags +from AthenaConfiguration.ComponentAccumulator import appendCAtoAthena +(corr_output_list, tag_list, ca) =\ + CaloSwCorrections.config_for_pool (makeFlags(), + CaloSwCorrKeys, CALOCORR_SW) +appendCAtoAthena (ca) # include the basic setup for the conditions output stream pool_file = CALOCORR_POOLFILE diff --git a/Calorimeter/CaloClusterCorrection/share/CaloTopoEMCorrectionsToPool.py b/Calorimeter/CaloClusterCorrection/share/CaloTopoEMCorrectionsToPool.py index 9b81f152a1642b35e8f33d52171a598e193c90bf..cf915f2e378efb4d5b52918398dcde0bd4000d80 100755 --- a/Calorimeter/CaloClusterCorrection/share/CaloTopoEMCorrectionsToPool.py +++ b/Calorimeter/CaloClusterCorrection/share/CaloTopoEMCorrectionsToPool.py @@ -19,9 +19,13 @@ CaloTopoEMCorrKeys = ['ele633', 'ele420', 'gam633'] from CaloClusterCorrection.CaloTopoEMCorrections import CaloTopoEMCorrections from CaloClusterCorrection.common import CALOCORR_EMTOPO -(corr_output_list, tag_list) =\ - CaloTopoEMCorrections.config_for_pool (CaloTopoEMCorrKeys, +from CaloClusterCorrection.compat import makeFlags +from AthenaConfiguration.ComponentAccumulator import appendCAtoAthena +(corr_output_list, tag_list, ca) =\ + CaloTopoEMCorrections.config_for_pool (makeFlags(), + CaloTopoEMCorrKeys, CALOCORR_EMTOPO) +appendCAtoAthena (ca) # include the basic setup for the conditions output stream pool_file = CALOCORR_POOLFILE diff --git a/Calorimeter/CaloClusterCorrection/share/config_test.ref b/Calorimeter/CaloClusterCorrection/share/config_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..a1c732ce440b8f2ecb429cb4c986f57e1906c17b --- /dev/null +++ b/Calorimeter/CaloClusterCorrection/share/config_test.ref @@ -0,0 +1,26 @@ +Py:Athena INFO using release [?-22.0.0] [?] [?/?] -- built on [?] +Py:CaloClusterCorrection INFO EM sliding-window corrections for ele35 () using version v12_calh +Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into /home/sss/nobackup/referencefiles/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 +Py:MetaReader INFO Current mode used: peeker +Py:MetaReader INFO Current filenames: ['/home/sss/nobackup/referencefiles/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1'] +Py:CaloClusterCorrection INFO EM sliding-window corrections for gam35_conv () using version @GLOBAL +Py:CaloClusterCorrection INFO EM sliding-window corrections for gam35 () using version @GLOBAL +Py:CaloClusterCorrection INFO EM sliding-window corrections for gam35 () using version v6_lwc +Py:CaloClusterCorrection INFO EM sliding-window corrections for gam35 () using version v6_lwc +Py:CaloClusterCorrection INFO EM sliding-window corrections for gam35 () using version @CaloOflSwClusterCorrections-00-02-01-v6_calh +PrivateToolHandleArray WARNING CaloDummyCorrection('larupdatee-dummy', prefix='e.') with instance name 'larupdatee-dummy' already in list. Not adding CaloDummyCorrection('larupdatee-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('etaoffe-dummy', prefix='e.') with instance name 'etaoffe-dummy' already in list. Not adding CaloDummyCorrection('etaoffe-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('phioffe-dummy', prefix='e.') with instance name 'phioffe-dummy' already in list. Not adding CaloDummyCorrection('phioffe-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('phimode-dummy', prefix='e.') with instance name 'phimode-dummy' already in list. Not adding CaloDummyCorrection('phimode-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('etamode-dummy', prefix='e.') with instance name 'etamode-dummy' already in list. Not adding CaloDummyCorrection('etamode-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('clcone-dummy', prefix='e.') with instance name 'clcone-dummy' already in list. Not adding CaloDummyCorrection('clcone-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('gape-dummy', prefix='e.') with instance name 'gape-dummy' already in list. Not adding CaloDummyCorrection('gape-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('lwce-dummy', prefix='e.') with instance name 'lwce-dummy' already in list. Not adding CaloDummyCorrection('lwce-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('rface-dummy', prefix='e.') with instance name 'rface-dummy' already in list. Not adding CaloDummyCorrection('rface-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('calhitse-dummy', prefix='e.') with instance name 'calhitse-dummy' already in list. Not adding CaloDummyCorrection('calhitse-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('trcorre-dummy', prefix='e.') with instance name 'trcorre-dummy' already in list. Not adding CaloDummyCorrection('trcorre-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('deadOTXpse-dummy', prefix='e.') with instance name 'deadOTXpse-dummy' already in list. Not adding CaloDummyCorrection('deadOTXpse-dummy', prefix='e.') +PrivateToolHandleArray WARNING CaloDummyCorrection('deadOTXbacke-dummy', prefix='e.') with instance name 'deadOTXbacke-dummy' already in list. Not adding CaloDummyCorrection('deadOTXbacke-dummy', prefix='e.') +Final OutputList: +['CaloRec::ToolConstants#CaloSwClusterCorrections.larupdate#/CALO/CaloSwClusterCorrections/larupdate', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etaoff-g3#/CALO/CaloSwClusterCorrections/etaoff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phioff-g3#/CALO/CaloSwClusterCorrections/phioff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phimod-g3#/CALO/CaloSwClusterCorrections/phimod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etamod-g3#/CALO/CaloSwClusterCorrections/etamod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.larupdate-dont_update_e#/CALO/CaloSwClusterCorrections/larupdate', 'CaloRec::ToolConstants#CaloSwClusterCorrections.clcon-g3#/CALO/CaloSwClusterCorrections/clcon', 'CaloRec::ToolConstants#CaloSwClusterCorrections.gap-g3#/CALO/CaloSwClusterCorrections/gap', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etaoff-v2#/CALO/CaloSwClusterCorrections/etaoff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phioff-v2#/CALO/CaloSwClusterCorrections/phioff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phimod-v2#/CALO/CaloSwClusterCorrections/phimod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etamod-v2#/CALO/CaloSwClusterCorrections/etamod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.gap-v2#/CALO/CaloSwClusterCorrections/gap', 'CaloRec::ToolConstants#CaloSwClusterCorrections.clcon-dc2#/CALO/CaloSwClusterCorrections/clcon', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-old#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-904#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.clcon-dc2new#/CALO/CaloSwClusterCorrections/clcon', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-904gap#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.gap-v3#/CALO/CaloSwClusterCorrections/gap', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-v3#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.rfac-v3#/CALO/CaloSwClusterCorrections/rfac', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etaoff-v3#/CALO/CaloSwClusterCorrections/etaoff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phioff-v3#/CALO/CaloSwClusterCorrections/phioff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.gap-v3_1#/CALO/CaloSwClusterCorrections/gap', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-v3_1#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phimod-v3#/CALO/CaloSwClusterCorrections/phimod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etamod-v3#/CALO/CaloSwClusterCorrections/etamod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.rfac-v4#/CALO/CaloSwClusterCorrections/rfac', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etaoff-v4#/CALO/CaloSwClusterCorrections/etaoff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phioff-v4#/CALO/CaloSwClusterCorrections/phioff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.gap-v4#/CALO/CaloSwClusterCorrections/gap', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-v4#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phimod-v4#/CALO/CaloSwClusterCorrections/phimod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etamod-v4#/CALO/CaloSwClusterCorrections/etamod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etaoff-v4_1#/CALO/CaloSwClusterCorrections/etaoff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v1#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v2#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.trcorr-v1#/CALO/CaloSwClusterCorrections/trcorr', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-v5#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-v6#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v5#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.trcorr-v5#/CALO/CaloSwClusterCorrections/trcorr', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v5_1#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.trcorr-v5_1#/CALO/CaloSwClusterCorrections/trcorr', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v6#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phioff-v4data#/CALO/CaloSwClusterCorrections/phioff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phimod-v4data#/CALO/CaloSwClusterCorrections/phimod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v6leakdata#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.deadOTXps-v1#/CALO/CaloSwClusterCorrections/deadOTXps', 'CaloRec::ToolConstants#CaloSwClusterCorrections.deadOTXback-v1#/CALO/CaloSwClusterCorrections/deadOTXback', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v8#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v8leakdata#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v9#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-v9leakdata#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.gap-v5#/CALO/CaloSwClusterCorrections/gap', 'CaloRec::ToolConstants#CaloSwClusterCorrections.gap-v6#/CALO/CaloSwClusterCorrections/gap', 'CaloRec::ToolConstants#CaloSwClusterCorrections.rfac-v5#/CALO/CaloSwClusterCorrections/rfac', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etaoff-v5#/CALO/CaloSwClusterCorrections/etaoff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phioff-v5#/CALO/CaloSwClusterCorrections/phioff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phioff-v5data#/CALO/CaloSwClusterCorrections/phioff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-atlfast_v1#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-pi0_v1#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.larupdate-dummy#/CALO/CaloSwClusterCorrections/larupdate', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etaoff-dummy#/CALO/CaloSwClusterCorrections/etaoff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phioff-dummy#/CALO/CaloSwClusterCorrections/phioff', 'CaloRec::ToolConstants#CaloSwClusterCorrections.phimod-dummy#/CALO/CaloSwClusterCorrections/phimod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.etamod-dummy#/CALO/CaloSwClusterCorrections/etamod', 'CaloRec::ToolConstants#CaloSwClusterCorrections.clcon-dummy#/CALO/CaloSwClusterCorrections/clcon', 'CaloRec::ToolConstants#CaloSwClusterCorrections.gap-dummy#/CALO/CaloSwClusterCorrections/gap', 'CaloRec::ToolConstants#CaloSwClusterCorrections.lwc-dummy#/CALO/CaloSwClusterCorrections/lwc', 'CaloRec::ToolConstants#CaloSwClusterCorrections.rfac-dummy#/CALO/CaloSwClusterCorrections/rfac', 'CaloRec::ToolConstants#CaloSwClusterCorrections.calhits-dummy#/CALO/CaloSwClusterCorrections/calhits', 'CaloRec::ToolConstants#CaloSwClusterCorrections.trcorr-dummy#/CALO/CaloSwClusterCorrections/trcorr', 'CaloRec::ToolConstants#CaloSwClusterCorrections.deadOTXps-dummy#/CALO/CaloSwClusterCorrections/deadOTXps', 'CaloRec::ToolConstants#CaloSwClusterCorrections.deadOTXback-dummy#/CALO/CaloSwClusterCorrections/deadOTXback'] +['CaloSwClusterCorrections.00-02-13-larupdate', 'CaloSwClusterCorrections.00-02-13-etaoff-g3', 'CaloSwClusterCorrections.00-02-13-phioff-g3', 'CaloSwClusterCorrections.00-02-13-phimod-g3', 'CaloSwClusterCorrections.00-02-13-etamod-g3', 'CaloSwClusterCorrections.00-02-13-larupdate-dont_update_e', 'CaloSwClusterCorrections.00-02-13-clcon-g3', 'CaloSwClusterCorrections.00-02-13-gap-g3', 'CaloSwClusterCorrections.00-02-13-etaoff-v2', 'CaloSwClusterCorrections.00-02-13-phioff-v2', 'CaloSwClusterCorrections.00-02-13-phimod-v2', 'CaloSwClusterCorrections.00-02-13-etamod-v2', 'CaloSwClusterCorrections.00-02-13-gap-v2', 'CaloSwClusterCorrections.00-02-13-clcon-dc2', 'CaloSwClusterCorrections.00-02-13-lwc-old', 'CaloSwClusterCorrections.00-02-13-lwc-904', 'CaloSwClusterCorrections.00-02-13-clcon-dc2new', 'CaloSwClusterCorrections.00-02-13-lwc-904gap', 'CaloSwClusterCorrections.00-02-13-gap-v3', 'CaloSwClusterCorrections.00-02-13-lwc-v3', 'CaloSwClusterCorrections.00-02-13-rfac-v3', 'CaloSwClusterCorrections.00-02-13-etaoff-v3', 'CaloSwClusterCorrections.00-02-13-phioff-v3', 'CaloSwClusterCorrections.00-02-13-gap-v3_1', 'CaloSwClusterCorrections.00-02-13-lwc-v3_1', 'CaloSwClusterCorrections.00-02-13-phimod-v3', 'CaloSwClusterCorrections.00-02-13-etamod-v3', 'CaloSwClusterCorrections.00-02-13-rfac-v4', 'CaloSwClusterCorrections.00-02-13-etaoff-v4', 'CaloSwClusterCorrections.00-02-13-phioff-v4', 'CaloSwClusterCorrections.00-02-13-gap-v4', 'CaloSwClusterCorrections.00-02-13-lwc-v4', 'CaloSwClusterCorrections.00-02-13-phimod-v4', 'CaloSwClusterCorrections.00-02-13-etamod-v4', 'CaloSwClusterCorrections.00-02-13-etaoff-v4_1', 'CaloSwClusterCorrections.00-02-13-calhits-v1', 'CaloSwClusterCorrections.00-02-13-calhits-v2', 'CaloSwClusterCorrections.00-02-13-trcorr-v1', 'CaloSwClusterCorrections.00-02-13-lwc-v5', 'CaloSwClusterCorrections.00-02-13-lwc-v6', 'CaloSwClusterCorrections.00-02-13-calhits-v5', 'CaloSwClusterCorrections.00-02-13-trcorr-v5', 'CaloSwClusterCorrections.00-02-13-calhits-v5_1', 'CaloSwClusterCorrections.00-02-13-trcorr-v5_1', 'CaloSwClusterCorrections.00-02-13-calhits-v6', 'CaloSwClusterCorrections.00-02-13-phioff-v4data', 'CaloSwClusterCorrections.00-02-13-phimod-v4data', 'CaloSwClusterCorrections.00-02-13-calhits-v6leakdata', 'CaloSwClusterCorrections.00-02-13-deadOTXps-v1', 'CaloSwClusterCorrections.00-02-13-deadOTXback-v1', 'CaloSwClusterCorrections.00-02-13-calhits-v8', 'CaloSwClusterCorrections.00-02-13-calhits-v8leakdata', 'CaloSwClusterCorrections.00-02-13-calhits-v9', 'CaloSwClusterCorrections.00-02-13-calhits-v9leakdata', 'CaloSwClusterCorrections.00-02-13-gap-v5', 'CaloSwClusterCorrections.00-02-13-gap-v6', 'CaloSwClusterCorrections.00-02-13-rfac-v5', 'CaloSwClusterCorrections.00-02-13-etaoff-v5', 'CaloSwClusterCorrections.00-02-13-phioff-v5', 'CaloSwClusterCorrections.00-02-13-phioff-v5data', 'CaloSwClusterCorrections.00-02-13-lwc-atlfast_v1', 'CaloSwClusterCorrections.00-02-13-lwc-pi0_v1', 'CaloSwClusterCorrections.00-02-13-larupdate-dummy', 'CaloSwClusterCorrections.00-02-13-etaoff-dummy', 'CaloSwClusterCorrections.00-02-13-phioff-dummy', 'CaloSwClusterCorrections.00-02-13-phimod-dummy', 'CaloSwClusterCorrections.00-02-13-etamod-dummy', 'CaloSwClusterCorrections.00-02-13-clcon-dummy', 'CaloSwClusterCorrections.00-02-13-gap-dummy', 'CaloSwClusterCorrections.00-02-13-lwc-dummy', 'CaloSwClusterCorrections.00-02-13-rfac-dummy', 'CaloSwClusterCorrections.00-02-13-calhits-dummy', 'CaloSwClusterCorrections.00-02-13-trcorr-dummy', 'CaloSwClusterCorrections.00-02-13-deadOTXps-dummy', 'CaloSwClusterCorrections.00-02-13-deadOTXback-dummy'] diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveBad.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveBad.cxx index 9e99d4f3d3c4d83b5a40c67b975bfba6617cb6d9..7d82941633cfeae15d2c1a5e7cd20b49febf927b 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveBad.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveBad.cxx @@ -35,9 +35,6 @@ CaloClusterRemoveBad::CaloClusterRemoveBad(const std::string& type, // Energy threshold for cluster removal. declareProperty ("EMin", m_eThreshold = 0.0, "Energy threshold for cluster removal."); - - // Not used, but required to use this with CaloRunClusterCorrections. - declareProperty ("order", m_order = 0); } diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveBad.h b/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveBad.h index 9870d1ecf44c9993fd233eddc3ecabd764c3b23e..f3c5c7a4962d1ab36821a2bb4ef5431c8627ea06 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveBad.h +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveBad.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOCLUSTERCORRECTION_CALOCLUSTERREMOVEBAD_H @@ -67,9 +67,6 @@ public: // property, energy threshold below which a cluster will be rejected. float m_eThreshold ; - - // Not used, but required to use this with CaloRunClusterCorrections. - int m_order; }; #endif diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveDuplicates.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveDuplicates.cxx index cae9b28be7cfac1d3c3dc5092351349e58a60467..68d66f1f72c630f17f1acb16d3c550dec7d69883 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveDuplicates.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveDuplicates.cxx @@ -35,9 +35,6 @@ CaloClusterRemoveDuplicates::CaloClusterRemoveDuplicates(const std::string& type { declareProperty ("deta_cut", m_deta_cut = 0.05 ); declareProperty ("dphi_cut", m_dphi_cut = 0.05 ); - - // Not used, but required to use this with CaloRunClusterCorrections. - declareProperty ("order", m_order = 0); } StatusCode diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveDuplicates.h b/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveDuplicates.h index fc7b7ff65198d04013423b7fcce5675887eb1156..ce2605ec90892a5c3baeb03d83486d014b947579 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveDuplicates.h +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterRemoveDuplicates.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOCLUSTERCORRECTION_CALOCLUSTERREMOVEDUPLICATES_H @@ -47,9 +47,6 @@ class CaloClusterRemoveDuplicates : public AthAlgTool, virtual public CaloClust // If two cluster are within deta_cut and dphi_cut, lower ET one will be removed float m_deta_cut; float m_dphi_cut; - - // Not used, but required to use this with CaloRunClusterCorrections. - int m_order; }; #endif diff --git a/Calorimeter/CaloClusterCorrection/src/CaloComputeSWcellWeights.cxx b/Calorimeter/CaloClusterCorrection/src/CaloComputeSWcellWeights.cxx index 8bef5210d9b947fc54c403194e41a830a8d2c6f9..9ce12cd1e73fbcc023027091eaf375a2e86396dd 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloComputeSWcellWeights.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloComputeSWcellWeights.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -39,8 +39,6 @@ CaloComputeSWcellWeights::CaloComputeSWcellWeights(const std::string& type, const IInterface* parent) : AthAlgTool(type, name, parent) { - // Not used, but required to use this with CaloRunClusterCorrections. - declareProperty ("order", m_order = 0); } // Make Corrections for SW cell weights diff --git a/Calorimeter/CaloClusterCorrection/src/CaloComputeSWcellWeights.h b/Calorimeter/CaloClusterCorrection/src/CaloComputeSWcellWeights.h index 5051f2c863de28407174dc6d2cd6f781c6a7dc0b..37047d20001fd1f8ef65ed8b9e1713d89711a18c 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloComputeSWcellWeights.h +++ b/Calorimeter/CaloClusterCorrection/src/CaloComputeSWcellWeights.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //Dear emacs, this is -*-c++-*- @@ -45,9 +45,6 @@ class CaloComputeSWcellWeights : public AthAlgTool, virtual public CaloClusterCo private: CaloComputeSWcellWeights(); - - // Not used, but required to use this with CaloRunClusterCorrections. - int m_order; }; #endif diff --git a/Calorimeter/CaloClusterCorrection/src/CaloRunClusterCorrections.cxx b/Calorimeter/CaloClusterCorrection/src/CaloRunClusterCorrections.cxx deleted file mode 100644 index f7e66be66c4fecfebdabbd60bf42fb6a58625258..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloClusterCorrection/src/CaloRunClusterCorrections.cxx +++ /dev/null @@ -1,872 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file CaloRunClusterCorrections.cxx - * @author scott snyder <snyder@bnl.gov> - * @date Apr, 2009 - * @brief Meta-tool to construct and run a list of correction tools. - * - * See the header file for a complete description. - */ - - -#include "CaloRunClusterCorrections.h" -#include "CaloClusterCorrection/CaloClusterCorrectionCommon.h" -#include "CaloRec/ToolWithConstantsMixin.h" -#include "CaloUtils/CaloClusterStoreHelper.h" -#include "xAODCaloEvent/CaloClusterContainer.h" -#include "xAODCaloEvent/CaloCluster.h" -#include "AthenaKernel/errorcheck.h" -#include "CxxUtils/Array.h" -#include "AthenaKernel/getMessageSvc.h" -#include "Gaudi/Property.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/IToolSvc.h" -#include <set> - - -using xAOD::CaloCluster; - -namespace { - - -/// Return the number of characters A and B have in common at the start. -size_t match_len (const std::string& a, const std::string& b) -{ - size_t len = 0; - while (len < a.size() && len < b.size() && a[len] == b[len]) - ++len; - return len; -} - - -} // anonymous namespace - - -/** - * @brief Constructor. - * @param type The type of the tool. - * @param name The name of the tool. - * @param parent The parent algorithm of the tool. - */ -CaloRunClusterCorrections::CaloRunClusterCorrections (const std::string& type, - const std::string& name, - const IInterface* parent) - : CaloClusterProcessor (type, name, parent), - m_jos ("JobOptionsSvc", name), - m_toolsvc ("ToolSvc", name), - m_coolInlineTool("Blob2ToolConstants",this) -{ - declareProperty ("CorrSpecs", m_corrspecs); - declareProperty ("KeepList", m_keeplist); - declareProperty ("PreserveOrder", m_preserveOrder = false); - declareProperty ("NoClearProps", m_noClearProps = false); - - declareProperty ("JobOptionsSvc", m_jos); - declareProperty ("ToolSvc", m_toolsvc); - declareProperty ("COOLFolder", m_folderName); -} - - -/** - * @brief Standard initialize method. - */ -StatusCode CaloRunClusterCorrections::initialize ATLAS_NOT_THREAD_SAFE /*Can Register callbacks but no need to be thread safe*/ () -{ - // Fetch services used. - CHECK( m_jos.retrieve() ); - CHECK( m_toolsvc.retrieve() ); - - // Parse input properties. - CHECK( parseCorrspecs() ); - CHECK( parseKeeplist() ); - - // Create tools that don't depend on DB. - CHECK( createTools() ); - - // Set up callbacks for tools do depend on the DB. - // Note: we _must_ return @c SUCCESS after doing this, or we may - // cause a crash. - registerCallbacks(); - - ATH_CHECK( m_affKey.initialize() ); - ATH_CHECK( m_LArBCKey.initialize() ); - ATH_CHECK( m_TileBCKey.initialize() ); - return StatusCode::SUCCESS; -} - - -/** - * @brief Standard finalize method. - */ -StatusCode CaloRunClusterCorrections::finalize() -{ - return StatusCode::SUCCESS; -} - - -/** - * @brief Execute on a single cluster. - * @param The cluster to process. - * @param ctx The event context. - * - * This will iterate over all correction tools and call them on the - * cluster. - * - * Warning: Any defined tools that cannot process single clusters - * (only cluster collections) will be skipped! - */ -StatusCode CaloRunClusterCorrections::execute (const EventContext& ctx, - CaloCluster* cluster) const -{ - // Loop over tools and run each one on the cluster. - for (unsigned int itool = 0; - itool < m_toolorder.size(); - ++itool) - { - const Tool& tool = m_tools[m_toolorder[itool]]; - if (tool.clusproc) - CHECK( tool.clusproc->execute (ctx, cluster) ); - else { - REPORT_MESSAGE (MSG::WARNING) - << "Tool " << tool.name - << " is not defined for individual clusters; skipped!"; - } - } - - return StatusCode::SUCCESS; -} - - -/** - * @brief Execute on an entire collection of clusters. - * @param The container of clusters. - * @param ctx The event context. - * - * This will iterate over all correction tools and call them on the - * cluster collection. - */ -StatusCode -CaloRunClusterCorrections::execute (const EventContext& ctx, - xAOD::CaloClusterContainer* collection) const -{ - // Loop over correction tools. - for (unsigned int itool = 0; - itool < m_toolorder.size(); - ++itool) - { - const Tool& tool = m_tools[m_toolorder[itool]]; - - // See if we should store an intermediate cluster container before - // the next correction. - if (!tool.save_container.empty()) { - xAOD::CaloClusterContainer* interimCont=CaloClusterStoreHelper::makeContainer(&(*evtStore()),tool.save_container,msg()); - CaloClusterStoreHelper::copyContainer(collection,interimCont); - CHECK(CaloClusterStoreHelper::finalizeClusters(&(*evtStore()),interimCont, tool.save_container, msg())); - } - - CHECK( tool.collproc->execute (ctx, collection) ); - } - - return StatusCode::SUCCESS; -} - - -/** - * @brief Change the name of the CaloCellContainer used by this tool. - * @param name The new container name. - */ -StatusCode -CaloRunClusterCorrections::setCaloCellContainerName - (const std::string& name) -{ - for (size_t itool = 0; itool < m_tools.size(); ++itool) { - ISetCaloCellContainerName* setter = m_tools[itool].setcellcontname; - if (setter) - CHECK (setter->setCaloCellContainerName (name) ); - } - return StatusCode::SUCCESS; -} - - -//**************************************************************************** - - -/** - * @brief Parse the supplied correction specification and create - * the Tools vector. Do not actually create the tools yet. - */ -StatusCode CaloRunClusterCorrections::parseCorrspecs ATLAS_NOT_THREAD_SAFE () -{ - size_t ispec = 0; - while (ispec < m_corrspecs.size()) { - // Starting a new tool. - Tool tool; - tool.collproc = nullptr; - tool.clusproc = nullptr; - tool.setcellcontname = nullptr; - - // -- Name. - tool.name = m_corrspecs[ispec++]; - std::string fullname = this->name() + "." + tool.name; - - // -- Key or class. - if (ispec >= m_corrspecs.size()) { - REPORT_ERROR(StatusCode::FAILURE) - << "Malformed corrections spec: missing location."; - return StatusCode::FAILURE; - } - - tool.use_callback = false; - if (m_corrspecs[ispec][0] == '+') { - // Initializing from JO. - tool.clsname = m_corrspecs[ispec].substr (1); - } - else if (m_corrspecs[ispec][0] == '@') { - // Initializing directly from detector store (POOL). - tool.sgkey = m_corrspecs[ispec].substr (1); - } - else { - // Initializing from COOL. - // The SG key here is the same as the folder name. - tool.sgkey = m_corrspecs[ispec]; - tool.use_callback = true; - } - - if (tool.clsname.empty() && tool.sgkey.empty()) { - REPORT_ERROR(StatusCode::FAILURE) - << "Malformed corrections spec: missing key-or-classname."; - return StatusCode::FAILURE; - } - - // Set tool properties needed to access the detector store. - // We don't want the tool itself to register a callback; we'll - // do that ourselves and forward callbacks as appropriate. - if (!tool.sgkey.empty()) { - m_jos->set (fullname + ".detStoreKey", tool.sgkey); - m_jos->set (fullname + ".useCallback", Gaudi::Utils::toString(false)); - m_jos->set (fullname + ".COOLFolder", m_folderName); - } - - ++ispec; - - // -- Prefix. - if (ispec >= m_corrspecs.size()) { - REPORT_ERROR(StatusCode::FAILURE) - << "Malformed corrections spec: missing prefix."; - return StatusCode::FAILURE; - } - tool.prefix = m_corrspecs[ispec++]; - tool.resolved_prefix = tool.prefix; - if (!tool.prefix.empty()) - m_jos->set (fullname + ".prefix", tool.prefix); - - // -- Put properties in the JO service. - while (ispec < m_corrspecs.size()) { - std::string key = m_corrspecs[ispec++]; - if (key.empty()) break; - - if (ispec >= m_corrspecs.size()) { - REPORT_ERROR(StatusCode::FAILURE) - << "Malformed corrections spec for tool " << tool.name - << ": No value for key " << key; - return StatusCode::FAILURE; - } - - m_jos->set (fullname + "." + key, m_corrspecs[ispec++]); - } - - // Done with this tool. - m_tools.push_back (tool); - REPORT_MESSAGE(MSG::DEBUG) << "Done parsing for tool" << tool.name; - } - - // We don't need the property value any more, and it can be pretty long. - // Clear it out to reclaim memory. - if (!m_noClearProps) { - m_jos->set (this->name() + ".CorrSpecs", ""); - } - m_corrspecs.clear(); - - return StatusCode::SUCCESS; -} - - -/** - * @brief Parse the supplied @c KeepList property. - */ -StatusCode CaloRunClusterCorrections::parseKeeplist() -{ - for (size_t ikeep = 0; ikeep < m_keeplist.size(); ikeep++) { - // Get the next tool name from the property. - std::string toolname = m_keeplist[ikeep++]; - - // Check that a following element exists. - if (ikeep >= m_keeplist.size()) { - REPORT_ERROR(StatusCode::FAILURE) - << "Malformed KeepList property."; - return StatusCode::FAILURE; - } - - // Find the tool in our vector. - Tool* tool = nullptr; - for (size_t itool = 0; itool < m_tools.size(); itool++) { - if (m_tools[itool].name == toolname) { - tool = &m_tools[itool]; - break; - } - - // Tool names are generally like `trcorr_GLOBAL_gam35'. - // Also try matching on the base part of the name, before - // the first underscore. - std::string::size_type pos = m_tools[itool].name.find ('_'); - if (pos != std::string::npos && - m_tools[itool].name.substr (0, pos) == toolname) - { - tool = &m_tools[itool]; - break; - } - } - - if (tool) { - // Save the requested container name. - tool->save_container = m_keeplist[ikeep]; - } - else { - REPORT_MESSAGE(MSG::WARNING) - << "Didn't find correction tool " << toolname - << " while reading KeepList."; - } - } - - return StatusCode::SUCCESS; -} - - -/** - * @brief Create all tools that we can during initialization. - * Set up to create remaining tools during a callback. - */ -StatusCode CaloRunClusterCorrections::createTools ATLAS_NOT_THREAD_SAFE /*Binds to callback*/() -{ - // Set to true if creation of any tools is deferred to a callback. - bool any_cb = false; - - // Loop over tools. - for (size_t itool = 0; itool < m_tools.size(); itool++) { - Tool& tool = m_tools[itool]; - const Tool& ctool = tool; - REPORT_MESSAGE(MSG::DEBUG) << "Start creating tool " << tool.name; - if (tool.sgkey.empty()) { - // No pool constants --- we should have been given the class name. - // Create the tool immediately. - REPORT_MESSAGE(MSG::DEBUG) << "No Pool constants"; - CHECK( makeTool (tool) ); - } - else if (tool.use_callback) { - REPORT_MESSAGE(MSG::DEBUG) << "With callback"; - // Reading this tool from COOL. - any_cb = true; - - // Set up a callback function. - // The tool will be actually created there. - - // But only register once for each db object! - if (std::find (m_registeredDBObjects.begin(), - m_registeredDBObjects.end(), - tool.sgkey) == - m_registeredDBObjects.end()) - { - m_registeredDBObjects.push_back (tool.sgkey); - // Note: Don't actually register the callback here. - // The reason is that if initialize() fails later on, - // then this CaloRunClusterCorrections tool will end up - // being deleted, leaving a dangling callback reference. - // (Also note that there's no way to delete a callback - // once it's been registered.) - // So defer the callback registration until after all other - // initialization steps have succeeded. - } - else { - // Already set up the callback. Just bind the handle. - tool.use_callback = false; - REPORT_MESSAGE(MSG::DEBUG) << "Callback already registered"; - CHECK( detStore()->bind (ctool.dbconstants, tool.sgkey) ); - } - } - else { - // Otherwise, configuring directly from the detector store. - // Read the payload now to find the class name and create the tool. - REPORT_MESSAGE(MSG::DEBUG) << "Constants from DetStore"; - CHECK( detStore()->bind (ctool.dbconstants, tool.sgkey) ); - CHECK( fixPrefix (tool) ); - CHECK( clsnameFromDBConstants (tool) ); - CHECK( makeTool (tool) ); - } - } - - // Put the corrections in the proper order. - CHECK( orderCorrections (any_cb) ); - - return StatusCode::SUCCESS; -} - - -/** - * @brief Register correction callbacks. - * - * Note that we cannot return @c FAILURE after the first callback - * has been registered (see comment in @c createTools). - */ -void -CaloRunClusterCorrections::registerCallbacks ATLAS_NOT_THREAD_SAFE /*Registers callback*/ () -{ - if (!m_folderName.empty()) { //COOL inline storage - - StatusCode sc=m_coolInlineTool.retrieve(); - if (sc.isFailure()) { - REPORT_ERROR(sc) << "Can't retrieve Blob2ToolConstants Tool"; - } - - - //std::vector<std::string> sgkeys; - std::vector<Tool>::const_iterator it=m_tools.begin(); - std::vector<Tool>::const_iterator it_e=m_tools.end(); - for (;it!=it_e;++it) { - sc=m_coolInlineTool->addFolder(m_folderName,it->sgkey); - if (sc.isFailure()) { - REPORT_ERROR(sc) << "Can't add folder to Blob2ToolConstants Tool"; - } - } - sc=detStore()->regFcn(&Blob2ToolConstants::fillObjects, - &(*m_coolInlineTool), - &CaloRunClusterCorrections::updateTools, - this, - true); - - if (sc.isFailure()) { - REPORT_ERROR(sc) - << "Can't register callback for COOL inline storage "; - //return sc; - } - } - else { //payload stored in POOL file - for (unsigned int itool = 0; itool < m_tools.size(); itool++) { - const Tool& ctool = m_tools[itool]; - if (ctool.use_callback) { - StatusCode sc = - detStore()->regFcn(&CaloRunClusterCorrections::updateTools, - this, - ctool.dbconstants, - ctool.sgkey, - true); - if (sc.isFailure()) { - // Note that once we've started registering callbacks, - // we cannot return FAILURE from initialize() --- otherwise, - // we'll be left with a dangling callback. - REPORT_ERROR(sc) - << "Can't register callback for tool " << ctool.name; - } - } - } - } -} - - -/** - * @brief Actually create a tool. - * @param tool The tool to create. - */ -StatusCode CaloRunClusterCorrections::makeTool (Tool& tool) -{ - // Release any old tool. - if (tool.collproc) - tool.collproc->release(); - - // Get the tool. - CHECK( m_toolsvc->retrieveTool (tool.clsname, - tool.name, - tool.collproc, - this) ); - - // Downcast as a other interfaces. - tool.clusproc = dynamic_cast<CaloClusterProcessor*> (tool.collproc); - tool.setcellcontname = - dynamic_cast<ISetCaloCellContainerName*> (tool.collproc); - - - REPORT_MESSAGE(MSG::DEBUG) << "Done making tool " << tool.name; - - return StatusCode::SUCCESS; -} - - -/** - * @brief DB callback function. - * @param i (Unused) - * @param keys List of DB folders with changes. - * - * This is called when tool constants read from the DB have changed - * (or after the DB is accessed for the first time). - */ -StatusCode -CaloRunClusterCorrections::updateTools ATLAS_NOT_THREAD_SAFE /*callbacks*/ (IOVSVC_CALLBACK_ARGS_P( i, keys)) -{ - REPORT_MESSAGE(MSG::DEBUG) << "In IOV Callback method updateTools"; - - if (!m_folderName.empty()) { - //COOL-inline case - if (std::find(keys.begin(),keys.end(),m_folderName)==keys.end()) { - REPORT_MESSAGE(MSG::DEBUG) - << "The cool folder we care about (" << m_folderName<< ") is not in the list of keys. Do nothing." << endmsg; - return StatusCode::SUCCESS; - } - else - REPORT_MESSAGE(MSG::DEBUG) - << "Found cool folder " << m_folderName << " in the list of keys." << endmsg; - } - - for (size_t itool = 0; itool < m_tools.size(); ++itool) { - Tool& tool = m_tools[itool]; - const Tool& ctool = m_tools[itool]; - if (!tool.sgkey.empty()) { // && tool.use_callback) { - // Found a tool that needs updating. - - // Verify that we have the constants. - // if (!ctool.dbconstants.isValid()) { - if (detStore()->retrieve(ctool.dbconstants,ctool.sgkey).isFailure()) { - REPORT_ERROR(StatusCode::FAILURE) - << "Constants for tool " << tool.name << " are not valid."; - return StatusCode::FAILURE; - } - - // If the class name has changed, recreate the tool. - // This will also create the tool the first time, - // since tool.clsname should be blank then. - if (ctool.dbconstants->clsname() != tool.clsname) { - CHECK( fixPrefix (tool) ); - CHECK( clsnameFromDBConstants (tool) ); - CHECK( makeTool (tool) ); - } - else { - // Otherwise, just update the constants. - CaloRec::ToolWithConstantsMixin* mixin = - dynamic_cast<CaloRec::ToolWithConstantsMixin*> (tool.collproc); - if (mixin) - CHECK( mixin->processConstantsFromDB (i, keys) ); - else { - REPORT_ERROR(StatusCode::FAILURE) - << "Attempted to read constants from database for tool " - << tool.name << " that does not derive from " - << "CaloRec::ToolWithConstantsMixin."; - return StatusCode::FAILURE; - } - }// end else create tool - }//end if found tool to update - }//end loop over tools - - // Put the corrections in the proper order. - CHECK( orderCorrections (false) ); - - return StatusCode::SUCCESS; -} - - -/** - * @brief Initialize the clsname member of the tool structure. - * @param tool The tool on which to operate. - * - * Fetch the class name from the @c ToolConstants structure. - * If needed, this will expand ${} constructions; these are available - * to allow tools which use difference C++ classes for different - * layers/regions to share the same @c ToolConstants structure. - * - * ${LAYER} in the class name will be expanded to either `1' or `2', - * and ${BE} will be expanded to either `b' or `e', depending on the - * setting of the @c region property. - */ -StatusCode -CaloRunClusterCorrections::clsnameFromDBConstants ATLAS_NOT_THREAD_SAFE (Tool& tool) -{ - const Tool& ctool = tool; - const CaloRec::ToolConstants& tc = *ctool.dbconstants; - tool.clsname = tc.clsname(); - - std::string::size_type ipos = 0; - while ((ipos = tool.clsname.find ('$', ipos)) != std::string::npos) { - if (tool.clsname.substr (ipos, 8) == "${LAYER}") { - int region; - CHECK( getConstant (tool, "region", region) ); - const char* out = "X"; - switch (region) { - case CaloClusterCorrectionCommon::EMB1: - case CaloClusterCorrectionCommon::EME1: - out = "1"; - break; - case CaloClusterCorrectionCommon::EMB2: - case CaloClusterCorrectionCommon::EME2: - out = "2"; - break; - default: - REPORT_ERROR(StatusCode::FAILURE) - << "Bad region code expanding ${LAYER} for tool " << tool.name; - return StatusCode::FAILURE; - } - tool.clsname.replace (ipos, 8, out); - } - else if (tool.clsname.substr (ipos, 5) == "${BE}") { - int region; - CHECK( getConstant (tool, "region", region) ); - const char* out = "X"; - switch (region) { - case CaloClusterCorrectionCommon::EMB2: - case CaloClusterCorrectionCommon::EMB1: - out = "b"; - break; - case CaloClusterCorrectionCommon::EME1: - case CaloClusterCorrectionCommon::EME2: - out = "e"; - break; - default: - REPORT_ERROR(StatusCode::FAILURE) - << "Bad region code expanding ${BE} for tool " << tool.name; - return StatusCode::FAILURE; - } - tool.clsname.replace (ipos, 5, out); - } - else - ++ipos; - } - - return StatusCode::SUCCESS; -} - - -/** - * @brief Initialize @c resolved_prefix for a tool. - * @param tool The tool on which to operate. - * - * If the prefix that was specified at configuration time does not - * exist in the @c ToolConstants structure, use instead the longest - * matching prefix. - */ -StatusCode CaloRunClusterCorrections::fixPrefix ATLAS_NOT_THREAD_SAFE (Tool& tool) -{ - const Tool& ctool = tool; - using Maptype = CaloRec::ToolConstants::Maptype; - const Maptype& map = ctool.dbconstants->map(); - if (map.empty()) { - // If there are no constants, then the prefix setting can't matter... - return StatusCode::SUCCESS; - } - - std::string prefix = tool.prefix; - - Maptype::const_iterator it = map.lower_bound (prefix); - - if (it == map.end() || it->first.substr (0, prefix.size()) != prefix) { - // Prefix not found. Try to find a match among the existing prefixes. - - // Strip a trailing dot and region code off the prefix. - std::string tail; - std::string::size_type len = prefix.size(); - if (len > 0 && prefix[len-1] == '.') { - tail = "."; - prefix.erase (len-1); - --len; - } - - if (len >= 2) { - std::string tmp = prefix.substr (len-2, 2); - if (tmp == "b1" || tmp == "b2" || tmp == "e1" || tmp == "e2") { - tail = tmp + tail; - prefix.erase (len-2); - len -= 2; - } - } - - // Extract matching prefixes; find the longest match. - int longest_len = -1; - std::string best_match; - for (it = map.begin(); it != map.end(); it++) { - std::string::size_type ipos = it->first.find (tail); - if (ipos != std::string::npos) { - int this_len = match_len (it->first, prefix); - if (this_len > longest_len) { - longest_len = this_len; - best_match = it->first.substr(0, ipos); - } - } - } - - if (longest_len < 0) { - REPORT_ERROR(StatusCode::FAILURE) - << "No matches for prefix " << tool.prefix - << " for tool " << tool.name; - return StatusCode::FAILURE; - } - - prefix = best_match + tail; - - // Warn if the match isn't long enough. - if (longest_len < 3) { - REPORT_MESSAGE(MSG::WARNING) - << "No good match for prefix " << tool.prefix - << " for tool " << tool.name - << "; using " << prefix; - } - - REPORT_MESSAGE(MSG::DEBUG) - << "For tool " << tool.name << " using prefix " << prefix - << " instead of requested prefix " << tool.prefix; - } - - // Set the prefix. - std::string fullname = this->name() + "." + tool.name; - m_jos->set (fullname + ".prefix", prefix); - tool.resolved_prefix = prefix; - - return StatusCode::SUCCESS; -} - - -/** - * @brief Fill in @c m_toolorder to run corrections in the proper order. - */ -StatusCode -CaloRunClusterCorrections::orderCorrections ATLAS_NOT_THREAD_SAFE (bool allowMissing) -{ - // Clear out any previous setting. - m_toolorder.clear(); - m_toolorder.reserve (m_tools.size()); - - // Loop over tools. - for (size_t itool = 0; itool < m_tools.size(); itool++) { - Tool& tool = m_tools[itool]; - const Tool& ctool = tool; - if (m_preserveOrder) { - // If PreserveOrder was requested, execute tools in the exact order - // in which they were listed. Don't check for dummies either. - tool.order = itool; - m_toolorder.push_back (itool); - } - else if (tool.sgkey.empty()) { - // Tool is being initialized from JO. Find the order property from JOS. - const std::string fullname = this->name() + "." + tool.name; - tool.order = std::stoi(m_jos->get(fullname + ".order", "-1")); - - // It's an error if it wasn't set. - if (tool.order == -1) { - REPORT_ERROR(StatusCode::FAILURE) - << "Tool " << tool.name - << " initialized from JO has no `order' property set."; - return StatusCode::FAILURE; - } - - // We want to sort this tool. - m_toolorder.push_back (itool); - } - else if (tool.collproc) { - // Initializing from detector store or cool. - // First check to see if this is a dummy. - int isDummy; - CHECK( getConstant (ctool, "isDummy", isDummy) ); - if (isDummy != 0) { - // It's a dummy. Skip this tool. - tool.order = -1; - } - else { - // Get the order parameter and sort this tool. - int order; - CHECK( getConstant (ctool, "order", order) ); - tool.order = order; - m_toolorder.push_back (itool); - } - } - else if (!allowMissing) { - // We don't have any valid constants for this tool. - REPORT_ERROR(StatusCode::FAILURE) - << "Tool " << tool.name << " has no valid constants."; - return StatusCode::FAILURE; - } - } - - // Put the list of tool indices in the proper order. - std::sort (m_toolorder.begin(), - m_toolorder.end(), - ToolorderSort (m_tools)); - - // Make a debugging dump of the results of the sort. - std::string names; - for (size_t ii = 0; ii < m_toolorder.size(); ii++) - names += m_tools[m_toolorder[ii]].name + " "; - REPORT_MESSAGE(MSG::DEBUG) - << "Sorted tools: " << names; - - return StatusCode::SUCCESS; -} - - -/** - * @brief Sorting helper: constructor. - * @param the_tools The vector of Tool structs. - */ -CaloRunClusterCorrections::ToolorderSort::ToolorderSort - (const std::vector<Tool>& the_tools) - : tools (the_tools) -{ -} - - -/** - * @brief Sorting helper: comparison. - * @param a Index of first tool to compare. - * @param b Index of second tool to compare. - */ -bool CaloRunClusterCorrections::ToolorderSort::operator() (int a, int b) const -{ - return tools[a].order < tools[b].order; -} - - -/** - * @brief Helper to get integer constant from a @c ToolConstants structure. - * @param tool The tool for which to retrieve the constant. - * @param pname The constant name (without prefix). - * @param out[out] The retrieved parameter. - */ -StatusCode -CaloRunClusterCorrections::getConstant ATLAS_NOT_THREAD_SAFE (const Tool& tool, - const std::string& pname, - int& out) -{ - if (!tool.dbconstants.isValid()) { - REPORT_ERROR(StatusCode::FAILURE) - << "DB Constants for tool " << tool.name << " are not valid."; - return StatusCode::FAILURE; - } - - try { - const CxxUtils::Arrayrep& rep = - tool.dbconstants->getrep (name(), tool.resolved_prefix + pname); - const CxxUtils::Array<0> arr (rep); - out = static_cast<int> (arr); - } - catch (const std::exception& e) { - REPORT_ERROR(StatusCode::FAILURE) - << "Caught exception retrieving property " - << tool.resolved_prefix + pname - << " for tool " << tool.name << ": " << e.what(); - std::ostringstream oss; - tool.dbconstants->writeConstants (oss, tool.name); - REPORT_ERROR(StatusCode::FAILURE) - << " " << oss.str(); - return StatusCode::FAILURE; - } - - return StatusCode::SUCCESS; -} - - diff --git a/Calorimeter/CaloClusterCorrection/src/CaloRunClusterCorrections.h b/Calorimeter/CaloClusterCorrection/src/CaloRunClusterCorrections.h deleted file mode 100644 index d6c32bd81538d0365b283b1fe41e7156e6604042..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloClusterCorrection/src/CaloRunClusterCorrections.h +++ /dev/null @@ -1,395 +0,0 @@ -// This file's extension implies that it's C, but it is really -*- C++ -*-. - -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -/* @file CaloRunClusterCorrections.h - * @author scott snyder <snyder@bnl.gov> - * @date Apr, 2009 - * @brief Meta-tool to construct and run a list of correction tools. - */ - - -#ifndef CALORUNCLUSTERCORRECTIONS_H -#define CALORUNCLUSTERCORRECTIONS_H - - -#include "CaloRec/CaloClusterProcessor.h" -#include "CaloConditions/ToolConstants.h" -#include "CaloInterface/ISetCaloCellContainerName.h" -#include "StoreGate/DataHandle.h" -#include "AthenaKernel/IOVSvcDefs.h" -#include <vector> -#include <string> -#include <set> - -#include "Gaudi/Interfaces/IOptionsSvc.h" -#include "GaudiKernel/ToolHandle.h" -#include "CaloRec/Blob2ToolConstants.h" - -#include "CaloConditions/CaloAffectedRegionInfoVec.h" -#include "TileConditions/TileBadChannels.h" -#include "LArRecConditions/LArBadChannelCont.h" -#include "StoreGate/ReadCondHandleKey.h" - -#include "CxxUtils/checker_macros.h" - -class MsgStream; -class IToolSvc; - - -/* - * @brief Meta-tool to construct and run a list of correction tools. - * - * The cluster corrections consist of a set of individual correction - * tools, each with a specific version, and run in a specific order. - * We want to be able to configure this set of corrections entirely - * from the database, given only only a global database tag. Since the - * set of tools run, their versions (including the proper C++ class to use), - * and the order in which they run all can depend on the global correction - * version, we cannot create the individual correction tools from - * job options. Instead, we must be able to defer that until the - * database is accessed. - * - * This is handled by this `metatool'. Rather than create individual - * correction tools, the job configuration creates an instance of this - * tool (which is itself a correction tool). The job configuration - * supplies this tool with a description of how to determine which - * tools to create; in general, this will involve looking in the database. - * During initialization, this tool will then figure out which tools - * need to be run and will create them. - * - * Consider first the case of reading from the database. We get a list - * of all possible correction tools that may be used; for each of these - * we get the corresponding database folder and the prefix to use to find - * this tool's properties in the @c ToolConstants objects (as well as any - * property overrides). - * - * For each tool, we look up the its data in the corresponding database - * folder; this will be a @c ToolConstants object. Now, the first issue - * is that in order to know in which folders we need to look, all possible - * correction tools need to be specified during job configuration; but - * in general, only some of those tools will be used for any given tag. - * For the folders that aren't used for a tag, that tag will be bound - * to a dummy @c ToolConstants object; i.e., it will have the @c isDummy - * property set to @c True. In this way, the unused tools can be skipped. - * - * We also need to know the order in which to execute tools. Each tool - * has an `order' property, which is an integer. Tools should be executed - * in increasing order of this parameter. - * - * In addition to being read from the database, tools may be initialized - * directly from the detector store (i.e., from a pool file) or entirely - * from job options. - * - * The needed configuration is communicated to this tool via the @c CorrSpecs - * property. This is a vector of strings with this layout: - * Each tool is defined by: - * TOOLNAME LOCATION PREFIX PARM-NAME PARM-VAL ... "" - * - * First element is the name of the tool to create. - * - * For the second element: - * - If it starts with `+', it should be followed by the C++ - * name of the class to create. - * - If it starts with `@', it should be followed by the SG - * detector store key, to be read directly from pool - * (i.e., don't use callbacks). - * - Otherwise, it should be a COOL folder name. - * - * Third element is the prefix for this tool's constants in the - * ToolConstants structure. (Can be blank if no ToolConstants - * structure is being used.) - * - * This is then followed by a set of property name/value pairs. - * These override anything read from the detector store. - * The list is terminated with an empty string. - * - * Such lists for all corrections are concatenated. - * - * Additional properties of interest include: - * - * @c KeepList This allows one to preserve in SG intermediate results - * from running the corrections. This is a vector of strings. - * These come in pairs; the first of a pair gives a correction - * tool name and the second a SG container name. Before the - * named tool executes, the cluster list will be saved to SG - * with the specified name. - * - * In addition to full tool names, which are usually of the - * form `larupdate_GLOBAL_gam37', one can also specify just - * the base part of the tool name; that is, before the - * first underscore. - * - * Note that this only operates when the correction is called - * for a list of clusters; it won't work if the correction - * is called for individual clusters. - * - * @c PreserveOrder If true, corrections will be executed strictly in the - * order in which they're listed in @c CorrSpecs - * (ignoring the @c order properties of the tools). - * - * Service/tool names used may also be overridden through properties. - */ -class CaloRunClusterCorrections - : public CaloClusterProcessor, - public ISetCaloCellContainerName -{ -public: - /** - * @brief Constructor. - * @param type The type of the tool. - * @param name The name of the tool. - * @param parent The parent algorithm of the tool. - */ - CaloRunClusterCorrections (const std::string& type, - const std::string& name, - const IInterface* parent); - - - /// Standard initialize method. - virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE /*Can Register callbacks but no need to be thread safe*/ () override; - - - /// Standard finalize method. - virtual StatusCode finalize() override; - - using CaloClusterProcessor::execute; - - /** - * @brief Execute on a single cluster. - * @param The cluster to process. - * @param ctx The event context. - * - * Warning: Any defined tools that cannot process single clusters - * (only cluster collections) will be skipped! - */ - virtual StatusCode execute (const EventContext& ctx, - xAOD::CaloCluster* cluster) const override; - - - /** - * @brief Execute on an entire collection of clusters. - * @param The container of clusters. - * @param ctx The event context. - * - * This will iterate over all the clusters in @c collection - * and call @c execute on each one individually. - */ - virtual StatusCode execute (const EventContext& ctx, - xAOD::CaloClusterContainer* collection) const override; - - - /** - * @brief Change the name of the CaloCellContainer used by this tool. - * @param name The new container name. - */ - virtual StatusCode setCaloCellContainerName (const std::string& name) override; - - -private: - /// Internal structure to hold information about a correction tool. - struct Tool { - // Not thread-safe due to the use of DataHandle. - Tool() ATLAS_CTORDTOR_NOT_THREAD_SAFE = default; - Tool(const Tool&) ATLAS_CTORDTOR_NOT_THREAD_SAFE = default; - ~Tool() ATLAS_CTORDTOR_NOT_THREAD_SAFE = default; - - /// The name of the tool. - std::string name; - - /// Key of this tool in the detector store. - /// Empty if being initialized from JO. - std::string sgkey; - - /// Name of the C++ class for this tool. - std::string clsname; - - /// Prefix to use in the @c ToolConstants structure, - /// as specified in @c CorrSpecs. - std::string prefix; - - /// Actual @c ToolConstants prefix to use (after resolving the request - /// among those prefixes actually existing). - std::string resolved_prefix; - - /// Order in which this tool should be executed. - /// Set to -1 for a dummy tool. - int order; - - /// True if we should set up a callback for this tool. - bool use_callback; - - /// If non-empty, copy cluster list and save to SG with this name - /// before running this tool. - std::string save_container; - - /// Handle to the constants structure. - // Note1: Don't access this until the vector<Tool> is complete. - // Note2: This must always be accessed via a const reference. - DataHandle<CaloRec::ToolConstants> dbconstants; - - /// Pointer to the correction tool. - CaloClusterCollectionProcessor* collproc; - - /// Pointer to the correction tool as a @c CaloClusterProcessor, - /// or 0 if that interface isn't supported by this tool. - CaloClusterProcessor* clusproc; - - /// Pointer to the correction tool as an @c ISetCaloCellContainerName, - /// or 0 if that interface isn't supported by this tool. - ISetCaloCellContainerName* setcellcontname; - }; - - - /// Helper for ordering tools. - struct ToolorderSort { - ToolorderSort (const std::vector<Tool>& the_tools); - bool operator() (int a, int b) const; - const std::vector<Tool>& tools; - }; - - - /** - * @brief Parse the supplied correction specification and create - * the Tools vector. Do not actually create the tools yet. - */ - StatusCode parseCorrspecs ATLAS_NOT_THREAD_SAFE (); - - - /** - * @brief Parse the supplied @c KeepList property. - */ - StatusCode parseKeeplist(); - - - /** - * @brief Create all tools that we can during initialization. - * Set up to create remaining tools during a callback. - */ - StatusCode createTools ATLAS_NOT_THREAD_SAFE /*Binds to CallBack*/ (); - - - /** - * @brief Register correction callbacks. - * - * Note that we cannot return @c FAILURE after the first callback - * has been registered (see comment in @c createTools). - */ - void registerCallbacks ATLAS_NOT_THREAD_SAFE /*Registers callback*/ (); - - - /** - * @brief Actually create a tool. - * @param tool The tool to create. - */ - StatusCode makeTool (Tool& tool); - - - /** - * @brief DB callback function. - * @param i (Unused) - * @param keys List of DB folders with changes. - * - * This is called when tool constants read from the DB have changed - * (or after the DB is accessed for the first time). - */ - StatusCode updateTools ATLAS_NOT_THREAD_SAFE /*callbacks*/ (IOVSVC_CALLBACK_ARGS); - - - - /** - * @brief Initialize the clsname member of the tool structure. - * @param tool The tool on which to operate. - * - * Fetch the class name from the @c ToolConstants structure. - * If needed, this will expand ${} constructions; these are available - * to allow tools which use difference C++ classes for different - * layers/regions to share the same @c ToolConstants structure. - * - * ${LAYER} in the classname will be expanded to either `1' or `2', - * and ${BE} will be expanded to either `b' or `e', depending on the - * setting of the @c region property. - */ - StatusCode clsnameFromDBConstants ATLAS_NOT_THREAD_SAFE (Tool& tool); - - - /** - * @brief Initialize @c resolved_prefix for a tool. - * @param tool The tool on which to operate. - * - * If the prefix that was specified at configuration time does not - * exist in the @c ToolConstants structure, use instead the longest - * matching prefix. - */ - StatusCode fixPrefix ATLAS_NOT_THREAD_SAFE (Tool& tool); - - - /** - * @brief Fill in @c m_toolorder to run corrections in the proper order. - */ - StatusCode orderCorrections ATLAS_NOT_THREAD_SAFE (bool allowMissing); - - - /** - * @brief Helper to get integer constant from a @c ToolConstants structure. - * @param tool The tool for which to retrieve the constant. - * @param pname The constant name (without prefix). - * @param out[out] The retrieved parameter. - */ - StatusCode getConstant ATLAS_NOT_THREAD_SAFE (const Tool& tool, - const std::string& pname, - int& out); - - //----------- - // Properties - - /// Correction specifications. See above for format. - std::vector<std::string> m_corrspecs; - - /// List of intermediate results to preserve. See above for format. - std::vector<std::string> m_keeplist; - - /// If true, execute tools exactly in the specified order - /// (ignore order information from DB). - bool m_preserveOrder; - - /// If true, don't clear out the values of long properties. - bool m_noClearProps; - - /// The job options service. - ServiceHandle<Gaudi::Interfaces::IOptionsSvc> m_jos; - - /// The tool service. - ServiceHandle<IToolSvc> m_toolsvc; - - /// Information about tools we're managing. - std::vector<Tool> m_tools; - - /// Vector of indices into the @c m_tools list. - /// The tools will be executed in the order of appearance in this list. - std::vector<int> m_toolorder; - - /// List of folders for which we've already registered callbacks. - std::vector<std::string> m_registeredDBObjects; - - /// COOL folder name in case of COOL inline storage - std::string m_folderName; - - /// AlgTool to convert COOL inline data into ToolConstants objects - ToolHandle<Blob2ToolConstants> m_coolInlineTool; - - // FIXME: Dependencies don't get propagated from dynamically-created - // correction tools. Hardcode this dependency as a workaround. - SG::ReadCondHandleKey<CaloAffectedRegionInfoVec> m_affKey{this, - "LArAffectedRegionKey", "LArAffectedRegionInfo", "SG key for affected regions cond object"}; - SG::ReadCondHandleKey<LArBadChannelCont> m_LArBCKey { this, - "LArBadChanKey","LArBadChannel","SG Key of LArBadChannelCont object"}; - SG::ReadCondHandleKey<TileBadChannels> m_TileBCKey{this, - "TileBadChanKey", "TileBadChannels", "Input Tile bad channel status"}; - -}; - - -#endif // not CALORUNCLUSTERCORRECTIONS_H diff --git a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx index a20f094759b0de7e59bc802e87877cf5e625defa..7daea0b61ea7f2980f9ea314d0fc18916f171480 100644 --- a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx +++ b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx @@ -49,7 +49,6 @@ #include "../CaloClusterRemoveDuplicates.h" #include "../CaloClusterRemoveBad.h" -#include "../CaloRunClusterCorrections.h" #include "../CaloDummyCorrection.h" @@ -104,6 +103,5 @@ DECLARE_COMPONENT( CaloClusterBadChannelList ) DECLARE_COMPONENT( CaloClusterRemoveDuplicates ) DECLARE_COMPONENT( CaloClusterRemoveBad ) -DECLARE_COMPONENT( CaloRunClusterCorrections ) DECLARE_COMPONENT( CaloDummyCorrection ) diff --git a/Calorimeter/CaloClusterCorrection/test/config_t.py b/Calorimeter/CaloClusterCorrection/test/config_t.py new file mode 100644 index 0000000000000000000000000000000000000000..6492bbff88dba2f8cb75a96c37167609d8a92c7d --- /dev/null +++ b/Calorimeter/CaloClusterCorrection/test/config_t.py @@ -0,0 +1,1128 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +# +# File: CaloClusterCorrection/test/config_t.py +# Created: Aug, 2020 +# Purpose: Regression tests CaloCluterCorrection configuration +# + +from __future__ import print_function + + +from PyUtils import coverage +c = coverage.Coverage ('CaloClusterCorrection.common') + + +from AthenaConfiguration.ComponentFactory import CompFactory +from CaloClusterCorrection import common +from CaloClusterCorrection.CaloSwCorrections import make_CaloSwCorrectionsCfg + +class TestTool: + def __init__ (self, name, **kw): + self.name = name + self.args = kw + return + + def check (self, config): + assert self.__class__.__name__ == config.__class__.__name__ + if self.name != config.getName(): + print ('name mismatch: ', self.__class__.__name__, self.name, config.getName()) + assert self.name == config.getName() + props = config._properties.copy() + for k, v in self.args.items(): + assert k in props + if isinstance (v, TestTool): + v.check (props[k]) + else: + p = props[k] + if isinstance (v, list): + p = list(p) + if v and isinstance (v[0], list): + p = [list(x) for x in p] + if p != v: + print ('match fail: ', self.__class__.__name__, self.name, k, p, v) + assert p == v + del props[k] + assert not props + return + + +def checkTools (tools, expected): + for i in range(min (len(tools), len(expected))): + expected[i].check (tools[i]) + assert len(tools) == len(expected) + return + + +class CaloFillRectangularCluster (TestTool): pass +class CaloClusterRemoveBad (TestTool): pass +class CaloScaleCluster (TestTool): pass +class CaloSwEtaoff_v3 (TestTool): pass +class CaloSwPhioff_v2 (TestTool): pass +class CaloClusterUpdate (TestTool): pass +class CaloSwGap_v2 (TestTool): pass +class CaloSwGap_v3 (TestTool): pass +class CaloSwCalibHitsCalibration (TestTool): pass +class CaloSwTransitionRegionsCorr (TestTool): pass +class CaloSwDeadOTX_ps (TestTool): pass +class CaloSwDeadOTX_back (TestTool): pass +class CaloSwPhimod_v2 (TestTool): pass +class CaloSwEtamod_v2 (TestTool): pass +class CaloSwTime (TestTool): pass +class CaloClusterBadChannelList (TestTool): pass +class CaloAffectedTool (TestTool): pass +class CaloTopoEMGap (TestTool): pass +class ToolConstantsCondAlg (TestTool): pass +class ProxyProviderSvc (TestTool): pass +class CondProxyProvider (TestTool): pass +class CondInputLoader (TestTool): pass +class IOVDbSvc (TestTool): pass +class PoolSvc (TestTool): pass +class CondSvc (TestTool): pass + + +# Default corrections, with fixed version. +def test1 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.lock() + + ca = make_CaloSwCorrectionsCfg (flags, version = 'v12_calh', key = 'ele35') + tools = ca.popPrivateTools() + + checkTools \ + (tools, + [CaloFillRectangularCluster ('layers_ele35', + order=100, + isDummy=False, + fill_cluster=True, + eta_size=3, + phi_size=5), + CaloClusterRemoveBad ('removebad_ele35', EMin=0.0), + CaloScaleCluster ('rfac_v5_ele35', + prefix='ele35.', + DBHandleKey='CaloSwClusterCorrections.rfac-v5'), + CaloSwEtaoff_v3 ('etaoffb1_v5_ele35', + prefix='ele35b1.', + DBHandleKey='CaloSwClusterCorrections.etaoff-v5'), + CaloSwEtaoff_v3 ('etaoffe1_v5_ele35', + prefix='ele35e1.', + DBHandleKey='CaloSwClusterCorrections.etaoff-v5'), + CaloSwEtaoff_v3 ('etaoffb2_v5_ele35', + prefix='ele35b2.', + DBHandleKey='CaloSwClusterCorrections.etaoff-v5'), + CaloSwEtaoff_v3 ('etaoffe2_v5_ele35', + prefix='ele35e2.', + DBHandleKey='CaloSwClusterCorrections.etaoff-v5'), + CaloSwPhioff_v2 ('phioffb2_v5_ele35', + prefix='ele35b2.', + DBHandleKey='CaloSwClusterCorrections.phioff-v5'), + CaloSwPhioff_v2 ('phioffe2_v5_ele35', + prefix='ele35e2.', + DBHandleKey='CaloSwClusterCorrections.phioff-v5'), + CaloClusterUpdate ('larupdate_ele35', + prefix='ele35.', + DBHandleKey='CaloSwClusterCorrections.larupdate'), + CaloSwGap_v3 ('gap_v6_ele35', + prefix='ele35.', + DBHandleKey='CaloSwClusterCorrections.gap-v6'), + CaloSwCalibHitsCalibration ('calhits_v9_ele35', + prefix='ele35.', + DBHandleKey='CaloSwClusterCorrections.calhits-v9'), + CaloSwTransitionRegionsCorr ('trcorr_v5_1_ele35', + prefix='ele35.', + DBHandleKey='CaloSwClusterCorrections.trcorr-v5_1'), + CaloSwDeadOTX_ps ('deadOTXps_v1_ele35', + prefix='ele35.', + DBHandleKey='CaloSwClusterCorrections.deadOTXps-v1', + AffectedTool=CaloAffectedTool('CaloAffectedToolForDeadOTX_ps')), + CaloSwDeadOTX_back ('deadOTXback_v1_ele35', + prefix='ele35.', + DBHandleKey='CaloSwClusterCorrections.deadOTXback-v1', + AffectedTool=CaloAffectedTool('CaloAffectedForDeadOTX_back')), + CaloSwPhimod_v2 ('phimod_v4_ele35', + prefix='ele35.', + DBHandleKey='CaloSwClusterCorrections.phimod-v4'), + CaloSwEtamod_v2 ('etamod_v4_ele35', + prefix='ele35.', + DBHandleKey='CaloSwClusterCorrections.etamod-v4'), + CaloSwTime ('time_ele35', + order=801, + isDummy=False), + CaloClusterBadChannelList ('listBadChannels_ele35', + order=820, + isDummy=False), + ]) + + + checkTools \ + (ca._conditionsAlgs, + [ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_rfac-v5', + DetStoreKey='CaloSwClusterCorrections.rfac-v5', + ToolConstantsKey='CaloSwClusterCorrections.rfac-v5'), + ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_etaoff-v5', + DetStoreKey='CaloSwClusterCorrections.etaoff-v5', + ToolConstantsKey='CaloSwClusterCorrections.etaoff-v5'), + ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_phioff-v5', + DetStoreKey='CaloSwClusterCorrections.phioff-v5', + ToolConstantsKey='CaloSwClusterCorrections.phioff-v5'), + ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_larupdate', + DetStoreKey='CaloSwClusterCorrections.larupdate', + ToolConstantsKey='CaloSwClusterCorrections.larupdate'), + ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_gap-v6', + DetStoreKey='CaloSwClusterCorrections.gap-v6', + ToolConstantsKey='CaloSwClusterCorrections.gap-v6'), + ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_calhits-v9', + DetStoreKey='CaloSwClusterCorrections.calhits-v9', + ToolConstantsKey='CaloSwClusterCorrections.calhits-v9'), + ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_trcorr-v5_1', + DetStoreKey='CaloSwClusterCorrections.trcorr-v5_1', + ToolConstantsKey='CaloSwClusterCorrections.trcorr-v5_1'), + ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_deadOTXps-v1', + DetStoreKey='CaloSwClusterCorrections.deadOTXps-v1', + ToolConstantsKey='CaloSwClusterCorrections.deadOTXps-v1'), + ToolConstantsCondAlg('ToolConstantsCondAlg_CaloSwClusterCorrections_deadOTXback-v1', + DetStoreKey='CaloSwClusterCorrections.deadOTXback-v1', + ToolConstantsKey='CaloSwClusterCorrections.deadOTXback-v1'), + ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_phimod-v4', + DetStoreKey='CaloSwClusterCorrections.phimod-v4', + ToolConstantsKey='CaloSwClusterCorrections.phimod-v4'), + ToolConstantsCondAlg ('ToolConstantsCondAlg_CaloSwClusterCorrections_etamod-v4', + DetStoreKey='CaloSwClusterCorrections.etamod-v4', + ToolConstantsKey='CaloSwClusterCorrections.etamod-v4'), + ]) + + + checkTools \ + (ca.getServices(), + [ProxyProviderSvc ('ProxyProviderSvc', + ProviderNames=['CondProxyProvider']), + CondProxyProvider ('CondProxyProvider', + InputCollections=['FID:BC292F26-AE73-9041-BF5C-BCE6C5C651EC']), + ]) + + + ca.wasMerged() + return + + +# Default corrections, global COOL tag, MC. +def test2 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.Input.isMC = True + flags.IOVDb.GlobalTag = 'OFLCOND-RUN12-SDR-31' + flags.Input.Files = defaultTestFiles.RDO + flags.lock() + + ca = make_CaloSwCorrectionsCfg (flags, version = '@GLOBAL', + key = 'gam35_conv') + tools = ca.popPrivateTools() + + checkTools \ + (tools, + [CaloFillRectangularCluster ('layers_gam35_conv', + order=100, + isDummy=False, + fill_cluster=True, + eta_size=3, + phi_size=5), + CaloClusterRemoveBad ('removebad_gam35_conv', EMin=0.0), + CaloScaleCluster ('rfac_v5_gam35_conv', + prefix='gam35.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/rfac'), + CaloSwEtaoff_v3 ('etaoffb1_v5_gam35_conv', + prefix='gam35b1.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/etaoff'), + CaloSwEtaoff_v3 ('etaoffe1_v5_gam35_conv', + prefix='gam35e1.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/etaoff'), + CaloSwEtaoff_v3 ('etaoffb2_v5_gam35_conv', prefix='gam35b2.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/etaoff'), + CaloSwEtaoff_v3 ('etaoffe2_v5_gam35_conv', prefix='gam35e2.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/etaoff'), + CaloSwPhioff_v2 ('phioffb2_v5data_gam35_conv', prefix='gam35b2.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/phioff'), + CaloSwPhioff_v2 ('phioffe2_v5data_gam35_conv', + prefix='gam35e2.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/phioff'), + CaloClusterUpdate ('larupdate_gam35_conv', + prefix='gam35.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/larupdate'), + CaloSwGap_v3 ('gap_v6_gam35_conv', + prefix='gam35.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/gap'), + CaloSwCalibHitsCalibration ('calhits_v9_gam35_conv', + prefix='gam35_conv.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/calhits'), + CaloSwTransitionRegionsCorr ('trcorr_v5_1_gam35_conv', + prefix='gam35.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/trcorr'), + CaloSwDeadOTX_ps ('deadOTXps_v1_gam35_conv', + prefix='gam35_conv.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/deadOTXps', + AffectedTool=CaloAffectedTool('CaloAffectedToolForDeadOTX_ps')), + CaloSwDeadOTX_back ('deadOTXback_v1_gam35_conv', + prefix='gam35_conv.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/deadOTXback', + AffectedTool=CaloAffectedTool('CaloAffectedForDeadOTX_back')), + CaloSwPhimod_v2 ('phimod_v4_gam35_conv', + prefix='gam35.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/phimod'), + CaloSwEtamod_v2 ('etamod_v4_gam35_conv', + prefix='gam35.', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/etamod'), + CaloSwTime ('time_gam35_conv', + order=801, + isDummy=False), + CaloClusterBadChannelList ('listBadChannels_gam35_conv', + order=820, + isDummy=False), + ]) + + checkTools \ + (ca._conditionsAlgs, + [CondInputLoader ('CondInputLoader', + Load=[['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/rfac'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/etaoff'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/phioff'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/larupdate'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/gap'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/calhits'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/trcorr'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/deadOTXps'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/deadOTXback'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/phimod'], + ['CaloRec::ToolConstants', + '/CALO/Ofl/CaloSwClusterCorrections/etamod']]), + ]) + + + exp = IOVDbSvc ('IOVDbSvc', + dbConnection='sqlite://;schema=mycool.db;dbname=OFLP200', + DBInstance='OFLP200', + CacheAlign=3, + GlobalTag='OFLCOND-RUN12-SDR-31', + Folders = ['/CALO/Ofl/CaloSwClusterCorrections/rfac<tag>CaloSwClusterCorrections.00-02-13-rfac-v5</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/etaoff<tag>CaloSwClusterCorrections.00-02-13-etaoff-v5</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/phioff<tag>CaloSwClusterCorrections.00-02-13-phioff-v5data</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/larupdate<tag>CaloSwClusterCorrections.00-02-13-larupdate</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/gap<tag>CaloSwClusterCorrections.00-02-13-gap-v6</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/calhits<tag>CaloSwClusterCorrections.00-02-13-calhits-v9</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/trcorr<tag>CaloSwClusterCorrections.00-02-13-trcorr-v5_1</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/deadOTXps<tag>CaloSwClusterCorrections.00-02-13-deadOTXps-v1</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/deadOTXback<tag>CaloSwClusterCorrections.00-02-13-deadOTXback-v1</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/phimod<tag>CaloSwClusterCorrections.00-02-13-phimod-v4</tag><db>COOLOFL_CALO/OFLP200</db>', + '/CALO/Ofl/CaloSwClusterCorrections/etamod<tag>CaloSwClusterCorrections.00-02-13-etamod-v4</tag><db>COOLOFL_CALO/OFLP200</db>']) + exp.check (ca.getService ('IOVDbSvc')) + + ca.wasMerged() + return + + +# Correction subset, version defaulted, with overrides. +def test3 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.Input.ProjectName = 'data18' + flags.lock() + + from CaloClusterCorrection.CaloSwCorrections import layers, update, gap, calhits + from CaloClusterCorrection.constants import CALOCORR_JO, CALOCORR_POOL + from CaloClusterCorrection.poolfiles import poolfiles + ca = make_CaloSwCorrectionsCfg (flags, key = 'gam35', + corrlist = [[layers], + [update], + [gap, 'v3', ('degree', 2)], + [calhits], + ], + layers_suffix = 'lsuff', + layers_key = 'gam35_conv', + layers_cells_name = 'xcells', + layers_source = 'CaloSwLayers.CaloSwLayers_parms', + gap_source = 'caloswcorr_pool', + layers_order = 101, + calhits_version = 'v8', + calhits_update_sampling_energies = True) + tools = ca.popPrivateTools() + checkTools \ + (tools[:4], + [CaloFillRectangularCluster ('layers_gam35_convlsuff', + order=101, + isDummy=False, + fill_cluster=True, + eta_size=3, + phi_size=5, + cells_name = 'xcells'), + CaloClusterUpdate ('larupdate_GLOBAL_gam35', + prefix='gam35.', + DBHandleKey='/CALO/CaloSwClusterCorrections/larupdate'), + CaloSwGap_v2 ('gap_v3_gam35', + prefix='gam35.', + DBHandleKey='CaloSwClusterCorrections.gap-v3', + degree=2), + CaloSwCalibHitsCalibration ('calhits_v8_gam35', + prefix='gam35_conv.', + DBHandleKey='/CALO/CaloSwClusterCorrections/calhits', + update_sampling_energies=True), + ]) + + exp = IOVDbSvc ('IOVDbSvc', + dbConnection='sqlite://;schema=mycool.db;dbname=CONDBR2', + DBInstance='CONDBR2', + CacheAlign=3, + GlobalTag='CONDBR2-BLKPA-2017-05', + Folders=['/CALO/CaloSwClusterCorrections/larupdate<tag></tag><db>COOLONL_CALO/CONDBR2</db>', + '/CALO/CaloSwClusterCorrections/calhits<tag>CaloSwClusterCorrections.00-02-13-calhits-v8</tag><db>COOLONL_CALO/CONDBR2</db>']) + + exp.check (ca.getService ('IOVDbSvc')) + + ca.wasMerged() + + return + + +# makecorr details 1 +def test4 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW + from CaloClusterCorrection.common import makecorr + from CaloClusterCorrection.CaloSwGap import CaloSwGap_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + ca = makecorr (flags, + CaloSwGap_versions, + None, # name + 'gap', + None, # suffix + '@xvers', # version + 'ele35', # key + None, # sampling + None, # source + None, # confclass + CALOCORR_SW) + tools = ca.popPrivateTools() + exp = CaloSwGap_v3 ('gap_xvers_ele35', + prefix='ele35.', + DBHandleKey='/CALO/CaloSwClusterCorrections/gap') + exp.check (tools) + ca.wasMerged() + + exp = IOVDbSvc('IOVDbSvc', + dbConnection='sqlite://;schema=mycool.db;dbname=CONDBR2', + DBInstance='CONDBR2', + CacheAlign=3, + GlobalTag='CONDBR2-BLKPA-2017-05', + Folders=['/CALO/CaloSwClusterCorrections/gap<tag>xvers</tag><db>COOLONL_CALO/CONDBR2</db>']) + exp.check (ca.getService ('IOVDbSvc')) + + + return + + + +# makecorr details 2 +def test5 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW + from CaloClusterCorrection.common import makecorr, CaloCorrectionConfigError + from CaloClusterCorrection.CaloSwGap import CaloSwGap_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + try: + makecorr (flags, + CaloSwGap_versions, + None, # name + 'gap', + None, # suffix + 'lsdkfjsdklfj', # version + 'ele35', # key + None, # sampling + None, # source + None, # confclass + CALOCORR_SW) + assert 0 + except CaloCorrectionConfigError as e: + assert e.args[0] == "Can't find version `lsdkfjsdklfj' for correction named `gap'." + + return + + +# makecorr details 3 +def test6 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW + from CaloClusterCorrection.common import makecorr, CaloCorrectionConfigError + from CaloClusterCorrection.CaloSwGap import CaloSwGap_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + try: + makecorr (flags, + CaloSwGap_versions, + None, # name + 'gap', + None, # suffix + None, #version + 'ele35', # key + None, # sampling + 'asdasd', # source + None, # confclass + CALOCORR_SW) + assert 0 + except CaloCorrectionConfigError as e: + assert e.args[0] == "Can't find any source to configure tool `gap_v6_ele35'. Sources: ['asdasd']" + + return + + +# makecorr details 4 +def test7 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW + from CaloClusterCorrection.common import makecorr + from CaloClusterCorrection.CaloSwGap import CaloSwGap_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + ca = makecorr (flags, + CaloSwGap_versions, + None, # name + 'gap', + None, # suffix + '@GLOBAL', # version + 'ele35', # key + None, # sampling + None, # source + None, # confclass + CALOCORR_SW) + tools = ca.popPrivateTools() + exp = CaloSwGap_v3('gap_GLOBAL_ele35', + prefix='ele35.', + DBHandleKey='/CALO/CaloSwClusterCorrections/gap') + exp.check (tools) + + ca.wasMerged() + exp = IOVDbSvc ('IOVDbSvc', + dbConnection='sqlite://;schema=mycool.db;dbname=CONDBR2', + DBInstance='CONDBR2', + CacheAlign=3, + GlobalTag='CONDBR2-BLKPA-2017-05', + Folders=['/CALO/CaloSwClusterCorrections/gap<tag></tag><db>COOLONL_CALO/CONDBR2</db>']) + exp.check (ca.getService ('IOVDbSvc')) + + return + + + +# makecorr details 5 +def test8 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW, CALOCORR_COOL + from CaloClusterCorrection.common import makecorr + from CaloClusterCorrection.CaloSwGap import CaloSwGap_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + cls_v2 = CompFactory.CaloSwGap_v2 # CaloClusterCorrection + ca = makecorr (flags, + [['@', cls_v2, [CALOCORR_COOL], ['ele35']]], + None, # name + 'gap', + None, # suffix + '@xvers', # version + 'ele35', # key + None, # sampling + None, # source + None, # confclass + CALOCORR_SW) + tools = ca.popPrivateTools() + exp = CaloSwGap_v2 ('gap_xvers_ele35', + prefix='ele35.', + DBHandleKey='/CALO/CaloSwClusterCorrections/gap') + exp.check (tools) + + ca.wasMerged() + exp = IOVDbSvc ('IOVDbSvc', + dbConnection='sqlite://;schema=mycool.db;dbname=CONDBR2', + DBInstance='CONDBR2', + CacheAlign=3, + GlobalTag='CONDBR2-BLKPA-2017-05', + Folders=['/CALO/CaloSwClusterCorrections/gap<tag>xvers</tag><db>COOLONL_CALO/CONDBR2</db>']) + exp.check (ca.getService ('IOVDbSvc')) + + return + + + +# makecorr details 6 +def test9 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW, CALOCORR_COOL + from CaloClusterCorrection.common import makecorr + from CaloClusterCorrection.CaloSwGap import CaloSwGap_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + ca = makecorr (flags, + CaloSwGap_versions, + None, # name + 'gap', + None, # suffix + '@xvers', # version + '@VALID_KEYS', # key + None, # sampling + None, # source + None, # confclass + CALOCORR_SW) + assert (ca == ['ele55', 'ele35', 'ele37', 'gam55', 'gam35', 'gam37']) + return + + + +# makecorr details 7 +def test10 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW, CALOCORR_NOPOOL, CALOCORR_TOPOOL + from CaloClusterCorrection.common import makecorr + from CaloClusterCorrection.CaloSwGap import CaloSwGap_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + cls_v2 = CompFactory.CaloSwGap_v2 # CaloClusterCorrection + ca = makecorr (flags, + [['@', cls_v2, [CALOCORR_NOPOOL], ['ele35']]], + None, # name + 'gap', + None, # suffix + '@xvers', # version + 'ele35', # key + None, # sampling + CALOCORR_TOPOOL, # source + None, # confclass + CALOCORR_SW) + assert (ca is None) + + return + + +# makecorr details 8 +def test11 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {'gapb2_GLOBAL_ele35' : 1} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW, EMB1, EMB2, CALOCORR_COOL + from CaloClusterCorrection.common import makecorr + from CaloClusterCorrection.CaloSwGap import CaloSwGap_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + cls_v2 = CompFactory.CaloSwGap_v2 # CaloClusterCorrection + cls_v3 = CompFactory.CaloSwGap_v3 # CaloClusterCorrection + ca = makecorr (flags, + [['@', {EMB1 : cls_v2, EMB2: cls_v3}, [CALOCORR_COOL], ['ele35']]], + None, # name + 'gap', + None, # suffix + '@GLOBAL', # version + 'ele35', # key + EMB2, # sampling + None, # source + None, # confclass + CALOCORR_SW) + tools = ca.popPrivateTools() + exp = CaloSwGap_v3 ('gapb2_GLOBAL_ele352', + prefix='ele35b2.', + DBHandleKey='/CALO/CaloSwClusterCorrections/gap') + exp.check (tools) + ca.wasMerged() + + ca = makecorr (flags, + CaloSwGap_versions, + None, # name + 'gap', + None, # suffix + '@GLOBAL', # version + 'ele35', # key + EMB2, # sampling + None, # source + None, # confclass + CALOCORR_SW) + tools = ca.popPrivateTools() + exp = CaloSwGap_v3 ('gapb2_GLOBAL_ele353', + prefix='ele35b2.', + DBHandleKey='/CALO/CaloSwClusterCorrections/gap') + exp.check (tools) + ca.wasMerged() + + return + + +# makecorr details 9 +def test12 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {'gapb2_GLOBAL_ele35' : 1} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW, EMB1, EMB2, CALOCORR_JO + from CaloClusterCorrection.common import makecorr + from CaloClusterCorrection.CaloSwPhioff import CaloSwPhioff_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + ca = makecorr (flags, + CaloSwPhioff_versions, + None, # name + 'phioff', + None, # suffix + None, # version + 'ele35', # key + EMB2, # sampling + CALOCORR_JO, # source + None, # confclass + CALOCORR_SW) + tools = ca.popPrivateTools() + tools.correction = [[[]]] + tools.energies = [] + exp = CaloSwPhioff_v2 ('phioffb2_v5data_ele35', + prefix='ele35b2.', + isDummy=False, + region=1, + correction_coef=0.001, + interp_barriers=[0.8], + degree=3, + flip_phi=True, + energy_degree=2, + energies=[], correction=[[[]]]) + exp.check (tools) + ca.wasMerged() + + return + + +# makecorr details 10 (config_from_jo) +def test13 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {'gapb2_GLOBAL_ele35' : 1} + + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.constants import CALOCORR_SW, CALOCORR_EMTOPO, EMB1, EMB2, CALOCORR_JO + from CaloClusterCorrection.common import makecorr + from CaloClusterCorrection.CaloSwGap import CaloSwGap_versions + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + ca = makecorr (flags, + CaloSwGap_versions, + None, # name + 'gap', + None, # suffix + None, # version + 'ele35_conv', # key + EMB2, # sampling + CALOCORR_JO, # source + None, # confclass + CALOCORR_SW) + tools = ca.popPrivateTools() + tools.correctionGoodPhi = [] + tools.correctionBadPhi = [] + exp = CaloSwGap_v3 ('gapb2_v6_ele35_conv', + prefix='ele35_convb2.', + isDummy=False, + correctionGoodPhi=[], + correctionBadPhi=[], + etamin_crack=1.425, + etamax_crack=1.55, + degree=3, + use_raw_eta=False, + use_raw_eta_boundaries=True, + region=4) + exp.check (tools) + ca.wasMerged() + + + from CaloClusterCorrection.CaloTopoEMgap import CaloTopoEMgap_versions + ca = makecorr (flags, + CaloTopoEMgap_versions, + None, # name + 'gap', + None, # suffix + None, # version + 'ele633_conv', # key + EMB2, # sampling + CALOCORR_JO, # source + None, # confclass + CALOCORR_EMTOPO) + tools = ca.popPrivateTools() + tools.correction = [[]] + exp = CaloTopoEMGap ('gapb2_v1_ele633_conv', + prefix='ele633_convb2.', + isDummy=False, + region=5, + etamin_crack=1.425, + etamax_crack=1.55, + degree=3, + use_raw_eta=False, + correction=[[]]) + exp.check (tools) + ca.wasMerged() + + from CaloClusterCorrection.common import _config_from_jo + corr = CompFactory.CaloSwPhioff_v2 ('foo') + _config_from_jo (corr, 'CaloSwPhioff_v5data.CaloSwPhioff_v5data_parms', + 'gam33_conv', EMB2, [], 101) + corr.correction = [[[]]] + corr.energies = [] + exp = CaloSwPhioff_v2 ('foo', + order=101, + isDummy=False, + region=1, + correction_coef=0.001, + interp_barriers=[0.8], + degree=3, + flip_phi=True, + energy_degree=2, + energies=[], correction=[[[]]]) + exp.check (corr) + return + + +# config_from_pool +def test14 (flags_in): + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.common import _config_from_pool + corr = CompFactory.CaloSwPhioff_v2 ('foo') + + ca = _config_from_pool (flags, corr, None, None) + assert ca is False + return + + +# config_from_cool +def test15 (flags_in): + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.common import _config_from_cool + corr = CompFactory.CaloSwPhioff_v2 ('foo') + + ca = _config_from_cool (flags, corr, '/CALO/Ofl/CaloSwClusterCorrections/phioff', 'tag1') + exp = CaloSwPhioff_v2 ('foo', + DBHandleKey='/CALO/Ofl/CaloSwClusterCorrections/phioff') + exp.check (corr) + + exp = IOVDbSvc ('IOVDbSvc', + dbConnection='sqlite://;schema=mycool.db;dbname=CONDBR2', + DBInstance='CONDBR2', + CacheAlign=3, + GlobalTag='CONDBR2-BLKPA-2017-05', + Folders=['/CALO/Ofl/CaloSwClusterCorrections/phioff<tag>tag1</tag><db>COOLOFL_CALO/CONDBR2</db>']) + exp.check (ca.getService ('IOVDbSvc')) + + ca.wasMerged() + + ca = _config_from_cool (flags, corr, '/CALO/Ofl/CaloSwClusterCorrections/phioff', 'tag2') + assert ca is False + + return + + +# longest_match +def test16 (flags_in): + from CaloClusterCorrection.common import _longest_match + + assert _longest_match ('a', 'abc') == 'abc' + assert _longest_match ('a', ['b', 'a', 'd']) == 'a' + assert _longest_match ('abc', ['a', 'ab', 'ad']) == 'ab' + + return + + +# make_corrections details +def test17 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.Input.ProjectName = 'data18' + flags.Calo.ClusterCorrection.caloSwWhichCorrection = 'v6_lwc' + flags.lock() + + from CaloClusterCorrection.CaloSwCorrections import layers, update, gap, calhits + from CaloClusterCorrection.constants import CALOCORR_JO, CALOCORR_POOL + from CaloClusterCorrection.poolfiles import poolfiles + ca = make_CaloSwCorrectionsCfg (flags, key = 'gam35', + corrlist = [[gap]]) + tools = ca.popPrivateTools() + + checkTools \ + (tools, + [CaloSwGap_v2 ('gap_v4_gam35', + prefix='gam35.', + DBHandleKey='CaloSwClusterCorrections.gap-v4') + ]) + + ca.wasMerged() + + return + + +# make_corrections details +def test18 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.Input.ProjectName = 'data18' + flags.lock() + + from CaloClusterCorrection.CaloSwCorrections import layers, update, gap, calhits + from CaloClusterCorrection.constants import CALOCORR_JO, CALOCORR_POOL, CALOCORR_COOL + from CaloClusterCorrection.poolfiles import poolfiles + ca = make_CaloSwCorrectionsCfg (flags, key = 'gam35', + corrlist = [[gap]], + version = 'v6_lwc', + source = CALOCORR_POOL) + tools = ca.popPrivateTools() + + checkTools \ + (tools, + [CaloSwGap_v2 ('gap_v4_gam35', + prefix='gam35.', + DBHandleKey='CaloSwClusterCorrections.gap-v4') + ]) + + ca.wasMerged() + + return + + +# make_corrections details +def test19 (flags_in): + common._poolfiles_seen = {} + common._folders_used = {} + common._alltools = {} + + flags = flags_in.clone() + flags.Input.isMC = True + flags.GeoModel.AtlasVersion = 'ATLAS-CSC-05-xx' + flags.IOVDb.GlobalTag = 'OFLCOND-RUN12-SDR-31' + flags.Calo.ClusterCorrection.caloSwGeneration = '00-02-01' + flags.lock() + + from CaloClusterCorrection.CaloSwCorrections import layers, update, gap, calhits + from CaloClusterCorrection.constants import CALOCORR_JO, CALOCORR_POOL, CALOCORR_COOL + from CaloClusterCorrection.poolfiles import poolfiles + ca = make_CaloSwCorrectionsCfg (flags, key = 'gam35', + corrlist = [[gap]], + source = [CALOCORR_POOL, CALOCORR_COOL]) + tools = ca.popPrivateTools() + checkTools \ + (tools, + [CaloSwGap_v2 ('gap_v4_gam35', + prefix='gam35.', + DBHandleKey='CaloSwClusterCorrections.gap-v4') + ]) + ca.wasMerged() + + return + + +# lookup_version +def test20 (flags_in): + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections, layers, update, removebad + from CaloClusterCorrection.constants import CALOCORR_SW + + vlist = CaloSwCorrections.lookup_version (flags, 'none', CALOCORR_SW) + + from CaloClusterCorrection.common import CaloCorrectionConfigError + try: + vlist = CaloSwCorrections.lookup_version (flags, 'alsdjk', CALOCORR_SW) + assert 0 + except CaloCorrectionConfigError as e: + assert e.args[0] == "Can't find global correction version alsdjk." + return + + +# geom_match +def test21 (flags_in): + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + + ret = CaloSwCorrections.geom_match ('geant4', 'CSC-01') + assert ret == ('v4_1_calh', True) + + ret = CaloSwCorrections.geom_match ('geant4', 'asdasd') + assert ret == ('@GLOBAL', True) + + from CaloClusterCorrection.common import CaloClusterCorrSetup + class TestCorr (CaloClusterCorrSetup): + geom_versions = [ ['foo', 'NOHIER#bar'] ] + testCorr = TestCorr() + ret = testCorr.geom_match ('geant4', 'foo') + assert ret == ('bar', False) + + return + + +# writing to pool +def test22 (flags_in): + flags = flags_in.clone() + flags.lock() + + from CaloClusterCorrection.CaloSwCorrections import CaloSwCorrections + from CaloClusterCorrection.constants import CALOCORR_SW + + (corr_output_list, tag_list, ca) = \ + CaloSwCorrections.config_for_pool (flags, + 'ele35', + CALOCORR_SW) + ca.wasMerged() + # FIXME: validate return? + return + + +# make_ForPool details +def test23 (flags_in): + flags = flags_in.clone() + flags.lock() + + def f1(*args, **kw): pass + def f2(*args, **kw): pass + + from CaloClusterCorrection.common import CaloClusterCorrSetup + class TestCorr1 (CaloClusterCorrSetup): + correction_generation_default = '00-00-00' + correction_generation_flag_name = 'caloSwGeneration' + versions = { + 'a' : [[f1, 200], + [f2, 100]]} + testCorr1 = TestCorr1() + from CaloClusterCorrection.common import CaloCorrectionConfigError + try: + testCorr1.make_ForPool (flags, ['asd'], 'asd') + assert 0 + except CaloCorrectionConfigError as e: + assert e.args[0] == "Tools for global version a are not in order! 100(f2) < 200(f1)" + + class TestCorr2 (CaloClusterCorrSetup): + correction_generation_default = '00-00-00' + correction_generation_flag_name = 'caloSwGeneration' + versions = { + 'a' : [[f1, 100], + [f2, 200]], + 'b' : [[f1, 100], + [f2, 201]], + } + testCorr2 = TestCorr2() + try: + testCorr2.make_ForPool (flags, ['asd'], 'asd') + assert 0 + except CaloCorrectionConfigError as e: + assert e.args[0] == "Tool f2 has order 201 in b but order 200 in a!" + return + + +from AthenaConfiguration.TestDefaults import defaultTestFiles +from AthenaCommon.Configurable import Configurable +Configurable.configurableRun3Behavior = 1 + +from AthenaConfiguration.AllConfigFlags import ConfigFlags +ConfigFlags.loadAllDynamicFlags() +ConfigFlags.Input.Files = defaultTestFiles.RAW + +test1 (ConfigFlags) +test2 (ConfigFlags) +test3 (ConfigFlags) +test4 (ConfigFlags) +test5 (ConfigFlags) +test6 (ConfigFlags) +test7 (ConfigFlags) +test8 (ConfigFlags) +test9 (ConfigFlags) +test10 (ConfigFlags) +test11 (ConfigFlags) +test12 (ConfigFlags) +test13 (ConfigFlags) +test14 (ConfigFlags) +test15 (ConfigFlags) +test16 (ConfigFlags) +test17 (ConfigFlags) +test18 (ConfigFlags) +test19 (ConfigFlags) +test20 (ConfigFlags) +test21 (ConfigFlags) +test22 (ConfigFlags) +test23 (ConfigFlags) + + +c.analyze() diff --git a/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobBase.h b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobBase.h index 34b8cd85b60e46d5545dba276a702c43aa407784..a3a12915cc227a0c45c78677da03ae75379e3949 100644 --- a/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobBase.h +++ b/Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/CaloCondBlobBase.h @@ -152,8 +152,8 @@ class CaloCondBlobBase{ /** @brief Returns the BLOB start address as uint32_t pointer. */ uint32_t* getBlobStart(); - /** @brief Non-const reference to the BLOB - (Only present if we were created with a non-const blob. */ + /** @brief Non-const reference to the BLOB. + (Only present if we were created with a non-const blob.) */ coral::Blob* m_blob_nc; /** @brief Const reference to the BLOB (always there) */ diff --git a/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py b/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py index 136e4c3b1ffa7586dedafd621aa94f1e598e6f2c..95ad04801a81587cf8795e49b742b2c8561ff871 100644 --- a/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py +++ b/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py @@ -1,5 +1,5 @@ #************** ESD list ************************************************ - +from CaloRec.CaloRecFlags import jobproperties from AthenaCommon.JobProperties import jobproperties from AthenaCommon.Logging import logging diff --git a/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h b/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h index ba5023b3c087c6ed4da59a00349f37bf132c123d..d58d79b057cb86e2492aa9ea8c39b6ad5840018b 100644 --- a/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h +++ b/Calorimeter/CaloInterface/CaloInterface/IToolWithConstants.h @@ -15,7 +15,7 @@ #include "CaloConditions/ToolConstants.h" -#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/IAlgTool.h" #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/EventContext.h" #include <string> @@ -27,7 +27,7 @@ * Defines operations needed by CaloClusterCorrDBWriter. */ class IToolWithConstants - : virtual public IInterface + : virtual public IAlgTool { public: DeclareInterfaceID (IToolWithConstants, 1, 0); diff --git a/Calorimeter/CaloRec/src/CaloClusterCorrDBWriter.cxx b/Calorimeter/CaloRec/src/CaloClusterCorrDBWriter.cxx index 28f5b2c4b1d7821acef68addc41f0de772eab0da..1ea957fb5ec0bfd4ab2ff815f275c9dc198a72c3 100644 --- a/Calorimeter/CaloRec/src/CaloClusterCorrDBWriter.cxx +++ b/Calorimeter/CaloRec/src/CaloClusterCorrDBWriter.cxx @@ -9,76 +9,23 @@ #include "CaloClusterCorrDBWriter.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/StatusCode.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/ListItem.h" +#include "GaudiKernel/ThreadLocalContext.h" #include "CaloRec/ToolWithConstantsMixin.h" #include "CaloConditions/ToolConstants.h" #include "AthenaKernel/errorcheck.h" -//#include "ToolConstants2Blob.h" - using namespace CaloRec; -//############################################################################# -CaloClusterCorrDBWriter::CaloClusterCorrDBWriter(const std::string& name, - ISvcLocator* pSvcLocator) - : AthAlgorithm(name, pSvcLocator), - m_blobTool("Blob2ToolConstants") -{ - // Name(s) of Cluster Correction Tools - declareProperty("ClusterCorrectionTools", m_correctionToolNames); - declareProperty("key",m_key=""); - declareProperty("COOLInlineFolder",m_inlineFolder); -} - -//############################################################################# - -CaloClusterCorrDBWriter::~CaloClusterCorrDBWriter() -{ } - //############################################################################# StatusCode CaloClusterCorrDBWriter::initialize() { - //Get ToolSvc - IToolSvc* p_toolSvc; - CHECK( service("ToolSvc", p_toolSvc) ); - - CHECK( m_blobTool.retrieve()); - - - // allocate tools derived from ToolsWithConstants - std::vector<std::string>::const_iterator firstTool=m_correctionToolNames.begin(); - std::vector<std::string>::const_iterator lastTool =m_correctionToolNames.end(); - for ( ; firstTool != lastTool; ++firstTool ) { - IAlgTool* algToolPtr; - ListItem clusAlgoTool(*firstTool); - StatusCode scTool = p_toolSvc->retrieveTool(clusAlgoTool.type(), - clusAlgoTool.name(), - algToolPtr, - this); - if ( scTool.isFailure() ) { - REPORT_MESSAGE(MSG::ERROR) << "Cannot find tool for " << *firstTool; - } - else { - REPORT_MESSAGE(MSG::INFO) << m_key << ": " - << "Found tool for " << *firstTool; - - // check for tool type - CaloRec::ToolWithConstantsMixin* theTool = - dynamic_cast<CaloRec::ToolWithConstantsMixin*>(algToolPtr); - if ( theTool != nullptr ) { - m_correctionTools.push_back(theTool); - } - } - } + ATH_CHECK( m_blobTool.retrieve()); + ATH_CHECK( m_tools.retrieve()); REPORT_MESSAGE(MSG::INFO) << m_key << ": " - << "Found " << m_correctionTools.size() << + << "Found " << m_tools.size() << " tools."; return StatusCode::SUCCESS; } @@ -87,6 +34,7 @@ StatusCode CaloClusterCorrDBWriter::initialize() StatusCode CaloClusterCorrDBWriter::finalize() { + const EventContext& ctx = Gaudi::Hive::currentContext(); if (!m_inlineFolder.empty()) { CaloRec::ToolConstants tc; std::string toolnames; @@ -100,15 +48,15 @@ StatusCode CaloClusterCorrDBWriter::finalize() CHECK(detStore()->record(attrColl,m_inlineFolder)); } - for (size_t i = 0; i < m_correctionTools.size(); i++) { - CHECK( m_correctionTools[i]->mergeConstants (tc) ); - toolnames += m_correctionTools[i]->name() + " "; + for (size_t i = 0; i < m_tools.size(); i++) { + CHECK( m_tools[i]->mergeConstants (tc, ctx) ); + toolnames += m_tools[i]->name() + " "; } coral::AttributeList* attrList=m_blobTool->ToolConstantsToAttrList(&tc); if (!attrList) return StatusCode::FAILURE; - const std::string& tName=m_key;//m_correctionTools[i]->name(); + const std::string& tName=m_key; attrColl->add(coolChannelNbr,tName); attrColl->add(coolChannelNbr,*attrList); @@ -121,9 +69,9 @@ StatusCode CaloClusterCorrDBWriter::finalize() else { auto tc = std::make_unique<CaloRec::ToolConstants>(); std::string toolnames; - for (size_t i = 0; i < m_correctionTools.size(); i++) { - CHECK( m_correctionTools[i]->mergeConstants (*tc) ); - toolnames += m_correctionTools[i]->name() + " "; + for (size_t i = 0; i < m_tools.size(); i++) { + CHECK( m_tools[i]->mergeConstants (*tc, ctx) ); + toolnames += m_tools[i]->name() + " "; } CHECK( detStore()->record (std::move(tc), m_key) ); @@ -142,7 +90,7 @@ StatusCode CaloClusterCorrDBWriter::finalize() //############################################################################# -StatusCode CaloClusterCorrDBWriter::execute() +StatusCode CaloClusterCorrDBWriter::execute (const EventContext& /*ctx*/) const { return StatusCode::SUCCESS; } diff --git a/Calorimeter/CaloRec/src/CaloClusterCorrDBWriter.h b/Calorimeter/CaloRec/src/CaloClusterCorrDBWriter.h index 4955af8e4c5e92081d54df8ffcfc216f292f90fb..319da945ca39b74640ca397dfd69ba40977b94f7 100644 --- a/Calorimeter/CaloRec/src/CaloClusterCorrDBWriter.h +++ b/Calorimeter/CaloRec/src/CaloClusterCorrDBWriter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOREC_CALOCLUSTERCORRDBWRITER @@ -20,42 +20,40 @@ -#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "GaudiKernel/ToolHandle.h" -#include "CaloRec/ToolWithConstantsMixin.h" +#include "CaloInterface/IToolWithConstants.h" #include "CaloRec/Blob2ToolConstants.h" #include <vector> #include <string> -class CaloClusterCorrDBWriter : public AthAlgorithm +class CaloClusterCorrDBWriter : public AthReentrantAlgorithm { public: + using AthReentrantAlgorithm::AthReentrantAlgorithm; - CaloClusterCorrDBWriter(const std::string& name, ISvcLocator* pSvcLocator); - virtual ~CaloClusterCorrDBWriter(); - virtual StatusCode initialize(); - virtual StatusCode execute(); - virtual StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext& ctx) const override; + virtual StatusCode finalize() override; private: - - /** @brief The list of tool names (jobOptions)*/ - std::vector<std::string> m_correctionToolNames; + /** @brief The list of tools */ + ToolHandleArray<IToolWithConstants> m_tools + { this, "ClusterCorrectionTools", {}, "Cluster correction tools" }; /** @brief Key for the DetectorStore (jobOptions) * The ToolConstants will be recorded with this key. */ - std::string m_key; - - std::string m_inlineFolder; + StringProperty m_key + { this, "key", "" }; - /** @brief the actual list of tools corresponding to above names */ - std::vector<CaloRec::ToolWithConstantsMixin*> m_correctionTools; + StringProperty m_inlineFolder + { this, "COOLInlineFolder", "" }; - ToolHandle<Blob2ToolConstants> m_blobTool; - + ToolHandle<Blob2ToolConstants> m_blobTool + { this, "Blob2ToolConstants", "Blob2ToolConstants" }; }; #endif // CALOREC_CALOCLUSTERCORRDBWRITER diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloCellESelector.h b/Calorimeter/CaloUtils/CaloUtils/CaloCellESelector.h deleted file mode 100644 index ce75755be268141dfd7d65ae46fc0900c5bb85d6..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/CaloUtils/CaloCellESelector.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CALOUTILS_CALOCELLESELECTOR_H -#define CALOUTILS_CALOCELLESELECTOR_H - -#include "CaloInterface/ICaloCellSelector.h" - -class CaloCell; - -class CaloCellESelector : public ICaloCellSelector -{ - public: - - CaloCellESelector(); - CaloCellESelector(double minE, double maxE=-1.); - - virtual ~CaloCellESelector(); - - virtual bool accept(const CaloCell* aCell) const; - - private: - - double m_minE, m_maxE; -}; -#endif diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloCellESort.h b/Calorimeter/CaloUtils/CaloUtils/CaloCellESort.h deleted file mode 100644 index 0a367a1d7e638f1ba5790bab449dd32a2d336c66..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/CaloUtils/CaloCellESort.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CALOCELLESORT_H -#define CALOCELLESORT_H -//----------------------------------------------------------------------- -// File and Version Information: -// $Id: CaloCellESort.h,v 1.1 2005-06-14 20:33:49 menke Exp $ -// -// Description: E sorting for CaloCell -// -// Environment: -// Software developed for the ATLAS Detector at the CERN LHC -// -// Author List: -// Sven Menke -// -//----------------------------------------------------------------------- - -#include "CaloEvent/CaloCell.h" - -namespace CaloCellESort{ -// comparison, order Cell by E -class compare - { - - public: - inline compare() {} ; - inline bool operator () (const CaloCell* c1, - const CaloCell* c2) - { - return c1->e() > c2->e() ; - } - - }; -} - -#endif // CALOCELLESORT_H - diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloCellEtSelector.h b/Calorimeter/CaloUtils/CaloUtils/CaloCellEtSelector.h deleted file mode 100644 index 33f7c82aff4dd617eb8ee5bda2607f3fc1a69cb2..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/CaloUtils/CaloCellEtSelector.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CALOUTILS_CALOCELLETSELECTOR_H -#define CALOUTILS_CALOCELLETSELECTOR_H - -#include "CaloInterface/ICaloCellSelector.h" - -class CaloCell; - -class CaloCellEtSelector : public ICaloCellSelector -{ - public: - - CaloCellEtSelector(); - CaloCellEtSelector(double minEt, double maxEt=-1.); - - virtual ~CaloCellEtSelector(); - - virtual bool accept(const CaloCell* aCell) const; - - private: - - double m_minEt, m_maxEt; -}; -#endif diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloCellSamplingAcceptor.h b/Calorimeter/CaloUtils/CaloUtils/CaloCellSamplingAcceptor.h deleted file mode 100644 index 36a9ea5711c1f88467601464f96f60aff8d49b92..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/CaloUtils/CaloCellSamplingAcceptor.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CALOUTILS_CALOCELLSAMPLINGACCEPTOR_H -#define CALOUTILS_CALOCELLSAMPLINGACCEPTOR_H - -#include "CaloUtils/CaloCellSamplingSelectorBase.h" - -template<typename LIST> -class CaloCellSamplingAcceptor - : public CaloCellSamplingSelectorBase<LIST> -{ - -public: - - CaloCellSamplingAcceptor(); - CaloCellSamplingAcceptor(const LIST& samplings); - virtual ~CaloCellSamplingAcceptor() { }; - -protected: - - virtual bool checkSampling(const CaloSampling::CaloSample& aSampling) const; - -}; - -template<typename LIST> -CaloCellSamplingAcceptor<LIST>::CaloCellSamplingAcceptor() - : CaloCellSamplingSelectorBase<LIST>() -{ } - -template<typename LIST> -CaloCellSamplingAcceptor<LIST>::CaloCellSamplingAcceptor(const LIST& - samplings) - : CaloCellSamplingSelectorBase<LIST>(samplings) -{ } - - -template<typename LIST> -bool -CaloCellSamplingAcceptor<LIST>::checkSampling(const CaloSampling::CaloSample& - aSampling) const -{ - return - std::find(this->m_listOfSamplings.begin(),this->m_listOfSamplings.end(),aSampling) - != this->m_listOfSamplings.end(); -} -#endif diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloCellSamplingRejector.h b/Calorimeter/CaloUtils/CaloUtils/CaloCellSamplingRejector.h deleted file mode 100644 index b78ec6708a60128a48712992ad56a7ae75a45221..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/CaloUtils/CaloCellSamplingRejector.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CALOUTILS_CALOCELLSAMPLINGREJECTOR_H -#define CALOUTILS_CALOCELLSAMPLINGREJECTOR_H - -#include "CaloUtils/CaloCellSamplingSelectorBase.h" - -template<typename LIST> -class CaloCellSamplingRejector - : public CaloCellSamplingSelectorBase<LIST> -{ - -public: - - CaloCellSamplingRejector(); - CaloCellSamplingRejector(const LIST& samplings); - virtual ~CaloCellSamplingRejector() { }; - -protected: - - virtual bool checkSampling(const CaloSampling::CaloSample& aSampling) const; -}; - -template<typename LIST> -CaloCellSamplingRejector<LIST>::CaloCellSamplingRejector() - : CaloCellSamplingSelectorBase<LIST>() -{ } - -template<typename LIST> -CaloCellSamplingRejector<LIST>::CaloCellSamplingRejector(const LIST& - samplings) - : CaloCellSamplingSelectorBase<LIST>(samplings) -{ } - - -template<typename LIST> -bool -CaloCellSamplingRejector<LIST>::checkSampling(const CaloSampling::CaloSample& - aSampling) const -{ - return - std::find(this->m_listOfSamplings.begin(),this->m_listOfSamplings.end(),aSampling) - == this->m_listOfSamplings.end(); -} -#endif diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloCellSamplingSelectorBase.h b/Calorimeter/CaloUtils/CaloUtils/CaloCellSamplingSelectorBase.h deleted file mode 100644 index d03f3001c67a9f2ff5e12ef855a2398631ab148d..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/CaloUtils/CaloCellSamplingSelectorBase.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CALOUTILS_CALOCELLSAMPLINGSELECTORBASE_H -#define CALOUTILS_CALOCELLSAMPLINGSELECTORBASE_H - -#include "CaloInterface/ICaloCellSelector.h" - -#include "CaloGeoHelpers/CaloSampling.h" - -#include <algorithm> -#include <iterator> - -class CaloCell; - -template<typename LIST> -class CaloCellSamplingSelectorBase : virtual public ICaloCellSelector -{ -public: - - CaloCellSamplingSelectorBase(); - CaloCellSamplingSelectorBase(const LIST& samplings); - - virtual ~CaloCellSamplingSelectorBase(); - - virtual bool accept(const CaloCell* pCell) const; - -protected: - - LIST m_listOfSamplings; - - virtual bool - checkSampling(const CaloSampling::CaloSample& aSampling) const = 0; - -}; - -template<typename LIST> -CaloCellSamplingSelectorBase<LIST>::CaloCellSamplingSelectorBase() -{ } - -template<typename LIST> -CaloCellSamplingSelectorBase<LIST>:: -CaloCellSamplingSelectorBase(const LIST& samplings) -{ - std::copy(samplings.begin(),samplings.end(), - std::back_insert_iterator<LIST>(m_listOfSamplings)); -} - -template<typename LIST> -CaloCellSamplingSelectorBase<LIST>::~CaloCellSamplingSelectorBase() -{ } - -template<typename LIST> -bool -CaloCellSamplingSelectorBase<LIST>::accept(const CaloCell* pCell) const -{ - CaloSampling::CaloSample theSampling = pCell->caloDDE()->getSampling(); - return theSampling != CaloSampling::Unknown - ? this->checkSampling(theSampling) - : false; -} -#endif diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloSampleEnergies.h b/Calorimeter/CaloUtils/CaloUtils/CaloSampleEnergies.h deleted file mode 100644 index 5c5abf2f15870ef382a2fb21c7554c8f8f083cce..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/CaloUtils/CaloSampleEnergies.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CALOUTILS_CALOSAMPLEENERGIRES_H -#define CALOUTILS_CALOSAMPLEENERGIRES_H - -/* Purpose: Given a CaloTower, CaloCluster, or iterator pair of - CaloCells, return a vector of energy in each sampling -*/ - -#include "CaloEvent/CaloCell.h" -#include "CaloGeoHelpers/CaloSampling.h" - -class CaloTower; -class CaloCluster; - -#include <vector> -#include <math.h> - -class CaloSampleEnergies -{ - - public: - - typedef std::vector<double> E_VECTOR ; - typedef E_VECTOR::const_iterator E_ITERATOR; - - CaloSampleEnergies( ); - ~CaloSampleEnergies(); - - /** Return energy in each Sampling for CaloTower - */ - const E_VECTOR& getEnergies(const CaloTower*) ; - /** Return energy in each Sampling for CaloCluster - */ - const E_VECTOR& getEnergies(const CaloCluster*) ; - - /** Return energy in each Sampling for a pair of interators - */ - template <class ITER > - const E_VECTOR& getEnergies( ITER t1, ITER t2); - - private: - E_VECTOR m_vec ; - -}; - -template <class ITER> -const CaloSampleEnergies::E_VECTOR& CaloSampleEnergies::getEnergies(ITER it1, - ITER it2) -{ - - int nEntry = CaloSampling::Unknown ; - - for(int i=0; i<nEntry; ++i) m_vec[i]=0; - - for(; it1!=it2;++it1) - { - const CaloCell* cell = *it1; - int sam = cell->caloDDE()->getSampling(); - m_vec[sam] += cell->energy(); - } - - return m_vec; - -} - -#endif - - - - - - - diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloTopoTowerBuilderToolBase.h b/Calorimeter/CaloUtils/CaloUtils/CaloTopoTowerBuilderToolBase.h index 6bf04b0609a884c966cf0584252185f6e4bfb262..82b8f718e4bc247a9cb0075d924ab5d8cbaffa79 100644 --- a/Calorimeter/CaloUtils/CaloUtils/CaloTopoTowerBuilderToolBase.h +++ b/Calorimeter/CaloUtils/CaloUtils/CaloTopoTowerBuilderToolBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOREC_CALOTOPOTOWERBUILDERTOOLBASE_H @@ -20,7 +20,6 @@ #include "GaudiKernel/ToolHandle.h" #include "CaloInterface/ICaloTopoTowerBuilderToolBase.h" #include "CaloEvent/CaloTowerSeg.h" -#include "StoreGate/StoreGate.h" #include <string> class CaloTowerContainer; diff --git a/Calorimeter/CaloUtils/src/CaloCellESelector.cxx b/Calorimeter/CaloUtils/src/CaloCellESelector.cxx deleted file mode 100644 index 803a9ca9ac799e57a78ea7c7b892d20dbdbc3197..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/src/CaloCellESelector.cxx +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - - -#include "CaloEvent/CaloCell.h" - -#include "CaloUtils/CaloCellESelector.h" - -CaloCellESelector::CaloCellESelector(double minE,double maxE) - : ICaloCellSelector() - , m_minE(minE), m_maxE(maxE) -{ } - -CaloCellESelector::~CaloCellESelector() -{ } - -bool CaloCellESelector::accept(const CaloCell* aCell) const -{ - if (!aCell) return false; - return m_maxE > m_minE - ? aCell->e() >= m_minE && aCell->e() <= m_maxE - : aCell->e() >= m_minE; -} diff --git a/Calorimeter/CaloUtils/src/CaloCellEtSelector.cxx b/Calorimeter/CaloUtils/src/CaloCellEtSelector.cxx deleted file mode 100644 index 88641f7a994cda8b758253cf02a0eb108980a10e..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/src/CaloCellEtSelector.cxx +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - - -#include "CaloEvent/CaloCell.h" - -#include "CaloUtils/CaloCellEtSelector.h" - -CaloCellEtSelector::CaloCellEtSelector(double minEt,double maxEt) - : ICaloCellSelector() - , m_minEt(minEt), m_maxEt(maxEt) -{ } - -CaloCellEtSelector::~CaloCellEtSelector() -{ } - -bool CaloCellEtSelector::accept(const CaloCell* aCell) const -{ - if (!aCell) return false; - return m_maxEt > m_minEt && aCell != nullptr - ? aCell->et() >= m_minEt && aCell->et() <= m_maxEt - : aCell->et() >= m_minEt; -} diff --git a/Calorimeter/CaloUtils/src/CaloSampleEnergies.cxx b/Calorimeter/CaloUtils/src/CaloSampleEnergies.cxx deleted file mode 100644 index 17d261744d6f405721b0bb9fe2c973ede9f40e6d..0000000000000000000000000000000000000000 --- a/Calorimeter/CaloUtils/src/CaloSampleEnergies.cxx +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CaloUtils/CaloSampleEnergies.h" -#include "CaloEvent/CaloTower.h" -#include "CaloEvent/CaloCluster.h" - -// constructor -CaloSampleEnergies::CaloSampleEnergies() : m_vec((int)(CaloSampling::Unknown)) -{ } - -// destructor -CaloSampleEnergies::~CaloSampleEnergies() { } - - -// CaloTower -const CaloSampleEnergies::E_VECTOR& - CaloSampleEnergies::getEnergies( const CaloTower* obj ) -{ - return getEnergies(obj->cell_begin(),obj->cell_end() ); -} - -// CaloCluster -const CaloSampleEnergies::E_VECTOR& - CaloSampleEnergies::getEnergies( const CaloCluster* obj ) -{ - return getEnergies(obj->cell_begin(),obj->cell_end() ); -} diff --git a/Calorimeter/CaloUtils/test/CaloLayerCalculator_test.cxx b/Calorimeter/CaloUtils/test/CaloLayerCalculator_test.cxx index c5f9809daaef14895f273043a702bfc95805c972..7b0e31f4cb7cc709ea392114a51d8d0f65f176e2 100644 --- a/Calorimeter/CaloUtils/test/CaloLayerCalculator_test.cxx +++ b/Calorimeter/CaloUtils/test/CaloLayerCalculator_test.cxx @@ -37,7 +37,6 @@ ATLAS_NO_CHECK_FILE_THREAD_SAFETY; #include "CaloIdentifier/TileID.h" #include "StoreGate/StoreGateSvc.h" #include "IdDictParser/IdDictParser.h" -#include "StoreGate/StoreGate.h" #include "TestTools/initGaudi.h" #include "GaudiKernel/Bootstrap.h" #include "CLHEP/Units/SystemOfUnits.h" diff --git a/Control/AthenaCommon/share/athena3.py b/Control/AthenaCommon/share/athena3.py deleted file mode 100755 index c563db0e1ce48c3e9bb6170e78b21d0dcc213758..0000000000000000000000000000000000000000 --- a/Control/AthenaCommon/share/athena3.py +++ /dev/null @@ -1,214 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# -# athena.py is born as shell script to preload some optional libraries -# -"""date" - -# defaults -export USETCMALLOC=0 -export USEIMF=0 - -# but use tcmalloc by default if TCMALLOCDIR is defined -if [ -n "$TCMALLOCDIR" ]; then - export USETCMALLOC=1 -fi - -# parse command line arguments -for a in ${@} -do - case "$a" in - --leak-check*) USETCMALLOC=0;; - --delete-check*) USETCMALLOC=0;; - --stdcmalloc) USETCMALLOC=0;; - --tcmalloc) USETCMALLOC=1;; - --stdcmath) USEIMF=0;; - --imf) USEIMF=1;; - --preloadlib*) export ATHENA_ADD_PRELOAD=${a#*=};; - --drop-and-reload) export ATHENA_DROP_RELOAD=1;; - esac -done - -# Do the actual preloading via LD_PRELOAD -source `which athena_preload.sh ` - -# Now resurrect ourselves as python script -python_path=`which python3` -"exec" "$python_path" "-tt" "$0" "$@"; - -""" - - -# File: athena.py -# Author: Wim Lavrijsen (WLavrijsen@lbl.gov) -# " -# This script allows you to run Athena from python. It is developed against -# the cppyy based GaudiPython and python 2.6/7.x. -# -# Debugging is supported with the '-d' option (hook debugger after running -# all user scripts, and just before calling initialize) and the --debug -# option (requires "conf", "init", or "exec" and will hook just before that -# stage). The hook will give you the gdb prompt, from where you can set -# break points, load additional shared libraries, or drop into interactive -# athena mode (if -i specified on the cli). Alternatively, you can start -# with gdb, like so: -# -# $ gdb python -# (gdb) run `which athena.py` [options] [<file1>.py [<file2>.py ... -# -# Usage of valgrind is supported, but it requires full paths and explicit -# arguments in its run, like so: -# -# $ valgrind `which python` `which athena.py` [options] [<file1>.py ... -# -# or, alternatively (valgrind 3.2.0 and up): -# -# $ valgrind --trace-children=yes `which athena.py` [options] [<file1>.py ... -# -# Note that any error messages/leaks that valgrind reports on python can be -# ignored, as valgrind is wrong (see the file Misc/README.valgrind in the -# python installation). -# -# Additional details on debugging are available on the Wiki: -# -# https://uimon.cern.ch/twiki/bin/view/Atlas/StartingDebuggerWithAthenaPy -# - -__version__ = '3.3.0' -__author__ = 'Wim Lavrijsen (WLavrijsen@lbl.gov)' -__doc__ = 'For details about athena.py, run "less `which athena.py`"' - -import sys, os -import getopt - -ldpreload = os.getenv( 'LD_PRELOAD' ) or '' - -### parse the command line arguments ----------------------------------------- -import AthenaCommon.AthOptionsParser as aop -opts = aop.parse() -_help_and_exit = aop._help_and_exit - -### remove preload hack for proper execution of child-processes -------------- -if ldpreload: - if 'TCMALLOCDIR' in os.environ: - tcmlib = os.getenv( 'TCMALLOCDIR' ) + "/libtcmalloc.so" - ldpreload = ldpreload.replace(tcmlib, '' ) - tcmlib = os.getenv( 'TCMALLOCDIR' ) + "/libtcmalloc_minimal.so" - ldpreload = ldpreload.replace(tcmlib, '' ) - del tcmlib - if os.getenv( 'ATHENA_ADD_PRELOAD' ): - ldpreload = ldpreload.replace(os.getenv( 'ATHENA_ADD_PRELOAD' ), '' ) - os.unsetenv( 'ATHENA_ADD_PRELOAD' ) - ldpreload = ldpreload.replace( '::', ':') - ldpreload = ldpreload.strip(':') - - if not ldpreload: - del os.environ[ 'LD_PRELOAD' ] - else: - os.environ[ 'LD_PRELOAD' ] = ldpreload -del ldpreload - -### start profiler, if requested -if opts.profile_python: - import cProfile - # profiler is created and controlled programmatically b/c a CLI profiling of - # athena.py doesn't work (globals are lost from include() execfile() calls), - # and because this allows easy excluding of the (all C++) Gaudi run - cProfile._athena_python_profiler = cProfile.Profile() - cProfile._athena_python_profiler.enable() - -### debugging setup -from AthenaCommon.Debugging import DbgStage -DbgStage.value = opts.dbg_stage - -### python interpreter configuration ----------------------------------------- -if not os.getcwd() in sys.path: - sys.path = [ os.getcwd() ] + sys.path - -if not '' in sys.path: - sys.path = [ '' ] + sys.path - - -## rename ourselfs to athena, both the prompt and the process (for top & ps) -sys.ps1 = 'athena> ' -sys.ps2 = '. ... ' - -try: - import ctypes - from ctypes.util import find_library as ctypes_find_library - libc = ctypes.cdll.LoadLibrary( ctypes_find_library('c') ) - libc.prctl( 15, 'athena.py', 0, 0, 0 ) -except Exception: - pass # don't worry about it failing ... - -## user session history (deleted in Preparation.py) -fhistory = os.path.expanduser( '~/.athena.history' ) - - -## interface setup as appropriate -if opts.run_batch and not opts.dbg_stage: - # in batch there is no need for stdin - if sys.stdin and os.isatty( sys.stdin.fileno() ): - os.close( sys.stdin.fileno() ) -else: - # Make sure ROOT gets initialized early, so that it shuts down last. - # Otherwise, ROOT can get shut down before Gaudi, leading to crashes - # when Athena components dereference ROOT objects that have been deleted. - import ROOT - - # readline support - import rlcompleter, readline - - readline.parse_and_bind( 'tab: complete' ) - readline.parse_and_bind( 'set show-all-if-ambiguous On' ) - - # history support - if os.path.exists( fhistory ): - readline.read_history_file( fhistory ) - readline.set_history_length( 1024 ) - - del readline, rlcompleter - -## use of shell escapes in interactive mode -if not opts.run_batch: - import AthenaCommon.ShellEscapes as ShellEscapes - sys.excepthook = ShellEscapes.ShellEscapes() - del ShellEscapes - - -### logging and messages ----------------------------------------------------- -from AthenaCommon.Logging import * -_msg = log # from above import... - -## test and set log level -try: - _msg.setLevel (getattr(logging, opts.msg_lvl)) -except: - _help_and_exit() - - -### default file name for ease of use ---------------------------------------- -if not opts.scripts and os.path.exists(opts.default_jobopt): - _msg.info("using default file %s", opts.default_jobopt) - opts.scripts.append(opts.default_jobopt) - -if not (opts.scripts or opts.fromdb) and opts.run_batch: - _msg.error( "batch mode requires at least one script" ) - from AthenaCommon.ExitCodes import INCLUDE_ERROR - _help_and_exit( INCLUDE_ERROR ) -del _help_and_exit - - -### file inclusion and tracing ----------------------------------------------- -from AthenaCommon.Include import IncludeError, include -include.setShowIncludes(opts.showincludes) -include.setClean(opts.drop_cfg) - - -### pre-execution step ------------------------------------------------------- -include( "AthenaCommon/Preparation.py" ) - - -### execution of user script and drop into batch or interactive mode --------- -include( "AthenaCommon/Execution.py" ) diff --git a/Control/AthenaMPTools/src/SharedEvtQueueConsumer.cxx b/Control/AthenaMPTools/src/SharedEvtQueueConsumer.cxx index a903b29b873ec83d955f3ffa07d720f2c95f6407..6b65d29c9868b9d7f0f2d0bd1c31bfc84aba7a0a 100644 --- a/Control/AthenaMPTools/src/SharedEvtQueueConsumer.cxx +++ b/Control/AthenaMPTools/src/SharedEvtQueueConsumer.cxx @@ -384,11 +384,12 @@ std::unique_ptr<AthenaInterprocess::ScheduledWork> SharedEvtQueueConsumer::boots } if(m_useSharedWriter && m_dataShare) { - if(!m_dataShare->makeClient(m_rankId + 1).isSuccess()) { - ATH_MSG_ERROR("Failed to make the conversion service a share client"); + IProperty* propertyServer = dynamic_cast<IProperty*>(m_dataShare); + if (propertyServer==0 || propertyServer->setProperty("MakeStreamingToolClient", m_rankId + 1).isFailure()) { + ATH_MSG_ERROR("Could not change AthenaPoolCnvSvc MakeClient Property"); return outwork; } else { - ATH_MSG_DEBUG("Successfully made the conversion service a share client"); + ATH_MSG_DEBUG("Successfully made the conversion service a share client"); } } diff --git a/Control/CxxUtils/CxxUtils/vec.h b/Control/CxxUtils/CxxUtils/vec.h index db70b62758bd2193b6a692d0b3767934c0854d3c..3ab1c057ea22d5f8706e0ad97e5793f807c97ae2 100644 --- a/Control/CxxUtils/CxxUtils/vec.h +++ b/Control/CxxUtils/CxxUtils/vec.h @@ -557,7 +557,7 @@ vblend(VEC& dst, const VEC& src1, const VEC& src2) "blend indices outside allowed range"); #if !HAVE_VECTOR_SIZE_ATTRIBUTE || WANT_VECTOR_FALLBACK - size_t pos{ 0 };; + size_t pos{ 0 }; for (size_t i : { Indices... }) { if (i < N) { dst[pos] = src1[i]; diff --git a/Control/xAODRootAccess/xAODRootAccess/tools/TReturnCode.h b/Control/xAODRootAccess/xAODRootAccess/tools/TReturnCode.h index dab7eaac86b2b2d2f88da8c7eba48649fab0c88a..eda9d6a535dcdd5141698bb59fbd88ede294ba50 100644 --- a/Control/xAODRootAccess/xAODRootAccess/tools/TReturnCode.h +++ b/Control/xAODRootAccess/xAODRootAccess/tools/TReturnCode.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // $Id: TReturnCode.h 598368 2014-05-22 10:23:54Z krasznaa $ @@ -27,7 +27,17 @@ namespace xAOD { /// $Revision: 598368 $ /// $Date: 2014-05-22 12:23:54 +0200 (Thu, 22 May 2014) $ /// - class [[nodiscard]] TReturnCode { + class +#ifndef __CLING__ + // cppyy will generate wrappers both for functions returning a value + // and the value being discarded. If we have [[nodiscard]] on, + // then we'll get warnings when cling compiles these wrappers. + // Since these wrappers are automatically generated by cppyy, + // we can't really avoid these other than by disabling them + // for the cling case. + [[nodiscard]] +#endif + TReturnCode { public: /// Enumeration listing the possible return codes diff --git a/DataQuality/DQUtils/python/grl.py b/DataQuality/DQUtils/python/grl.py index 18047708fc723b59bb31c4b94ae1526419e29b22..8dde6b95afd6c0c04d6336c42818febd488908ac 100644 --- a/DataQuality/DQUtils/python/grl.py +++ b/DataQuality/DQUtils/python/grl.py @@ -70,7 +70,7 @@ def make_grl(iovset, name="unknown", version="unknown"): name=name, version=version, time=datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"))).strip()] - for run, iovs in sorted(iovset.by_run.iteritems()): + for run, iovs in sorted(iovset.by_run.items()): result.append(" <LumiBlockCollection>") result.append(" <Run>%i</Run>" % run) for iov in iovs: diff --git a/DataQuality/ZLumiScripts/scripts/dqt_zlumi_alleff_HIST.py b/DataQuality/ZLumiScripts/scripts/dqt_zlumi_alleff_HIST.py index ecb4f90b5e0d2951ee40585e766dd2da7ca9b252..ad7884e559336222be25d94d2de2db1a2969c4a9 100755 --- a/DataQuality/ZLumiScripts/scripts/dqt_zlumi_alleff_HIST.py +++ b/DataQuality/ZLumiScripts/scripts/dqt_zlumi_alleff_HIST.py @@ -24,7 +24,7 @@ infilename = args.infile infile = ROOT.TFile.Open(infilename, 'READ') runmode = args.mode -print 'Running in', runmode, 'mode' +print('Running in', runmode, 'mode') runname = None @@ -33,17 +33,17 @@ for k in infile.GetListOfKeys(): runname = k.GetName() break if not runname: - print 'Cannot find run directory in input file' + print('Cannot find run directory in input file') sys.exit(1) else: - print 'Found runname', runname + print('Found runname', runname) lbdirs = [] for k in infile.Get(runname).GetListOfKeys(): if k.GetName().startswith('lb_'): lbdirs.append(k.GetName()) -print 'Now to dump' +print('Now to dump') lbnums = sorted([int(_[3:]) for _ in lbdirs]) effcyt = ROOT.TH1F('effcyt', 'Trigger efficiency', lbnums[-1]-lbnums[0]+1, lbnums[0]-0.5, @@ -88,7 +88,7 @@ tl.Branch('aestat', o_aestat, 'aestat/F') from DQUtils import fetch_iovs #rset=set(_[0] for _ in rlb) -#print rset +#print(rset) lblb = fetch_iovs("LBLB", runs=int(runname[4:])).by_run for lb in sorted(lbdirs): if runmode == "Zee": @@ -106,7 +106,7 @@ for lb in sorted(lbdirs): lbnum = int(lb[3:]) yld = (h[2], h[3]) ylderr = (h.GetBinError(2), h.GetBinError(3)) - #print yld, ylderr + #print(yld, ylderr) A, B = yld o_z_one[0], o_z_two[0] = yld if B == 0: continue @@ -118,7 +118,7 @@ for lb in sorted(lbdirs): try: iov = lblb[int(runname[4:])][lbnum-1] o_lbwhen[0], o_lbwhen[1] = iov.StartTime/1e9, iov.EndTime/1e9 - except Exception, e: + except Exception as e: o_lbwhen[0], o_lbwhen[1] = 0, 0 effcyt.SetBinContent(lbnum-lbnums[0]+1, eff) effcyt.SetBinError(lbnum-lbnums[0]+1, o_trigeffstat[0]) @@ -132,11 +132,11 @@ for lb in sorted(lbdirs): nomatchos, nomatchoserr = extract(hno) nomatchss, nomatchsserr = extract(hns) if args.debug: - print lb - print ' ->', matchos, matchoserr - print ' ->', matchss, matchsserr - print ' ->', nomatchos, nomatchoserr - print ' ->', nomatchss, nomatchsserr + print(lb) + print(' ->', matchos, matchoserr) + print(' ->', matchss, matchsserr) + print(' ->', nomatchos, nomatchoserr) + print(' ->', nomatchss, nomatchsserr) A = float(matchos-matchss) Aerr = (matchoserr**2+matchsserr**2)**.5 B = float(nomatchos-nomatchss) @@ -163,7 +163,7 @@ for lb in sorted(lbdirs): tl.Fill() tl.Write() -print 'Done' +print('Done') c1 = ROOT.TCanvas() effcya.SetMarkerStyle(21) @@ -198,7 +198,7 @@ if sumweights: for ibin in xrange(1,sumweights.GetNbinsX()+1): o_lb[0] = int(sumweights.GetBinCenter(ibin)) ctrbin = ctr.FindBin(o_lb[0]) - print ibin, o_lb[0], sumweights[ibin], ctr[ctrbin] + print(ibin, o_lb[0], sumweights[ibin], ctr[ctrbin]) if sumweights[ibin] == 0: continue p = ctr[ctrbin]/sumweights[ibin] o_alleff[0]=p diff --git a/DataQuality/ZLumiScripts/scripts/dqt_zlumi_combine_lumi.py b/DataQuality/ZLumiScripts/scripts/dqt_zlumi_combine_lumi.py index 9cefac39d98184e18c11aab1d3bb55dac8afad58..c1c2cfddbe952a18239ee0a93ae4b9547db701d3 100755 --- a/DataQuality/ZLumiScripts/scripts/dqt_zlumi_combine_lumi.py +++ b/DataQuality/ZLumiScripts/scripts/dqt_zlumi_combine_lumi.py @@ -45,8 +45,8 @@ for i in xrange(recoztree.GetEntries()): if recoztree.lblive < 10 : continue effztree.Draw('alleff:alleffstat', 'run==%s&&lb==%s' % (recoztree.run, recoztree.lb), 'goff') if effztree.GetSelectedRows() == 0: - print 'Broken for run, lb %s %s' % (recoztree.run, recoztree.lb) - print 'We THINK there are %d events here ...' % (recoztree.zraw) + print('Broken for run, lb %s %s' % (recoztree.run, recoztree.lb)) + print('We THINK there are %d events here ...' % (recoztree.zraw)) continue lbzero = (recoztree.lb // LUMIBLOCKS)*LUMIBLOCKS run = recoztree.run @@ -107,7 +107,7 @@ for entry, entryval in sorted(entrydict.items()): entryval['offlumi'] /= entryval['livetime'] eff = entryval['rolleff']/entryval['rollefferrsq'] efferr = 1/entryval['rollefferrsq']**.5 - #print 'LIVETIME2', entryval['livetime'] + #print('LIVETIME2', entryval['livetime']) entryval['zrate'] = entryval['zcount']/eff/entryval['livetime'] entryval['zratestat'] = (entryval['zcounterrsq']/eff/eff + (entryval['zcount']/eff**2*efferr)**2)**.5/entryval['livetime'] o_run[0], o_lb[0] = entry @@ -123,7 +123,7 @@ for entry, entryval in sorted(entrydict.items()): o_lblive[0] = entryval['livetime'] o_lhcfill[0] = entryval['lhcfill'] if o_zlumi[0] < 4 or o_zlumi[0] > 15: - print o_lb[0], o_zlumi[0], entryval['zcount'], eff, entryval['livetime'] + print(o_lb[0], o_zlumi[0], entryval['zcount'], eff, entryval['livetime']) t.Fill() #t.Write() newrzt = recoztree.CloneTree() diff --git a/DataQuality/ZLumiScripts/scripts/dqt_zlumi_compute_lumi.py b/DataQuality/ZLumiScripts/scripts/dqt_zlumi_compute_lumi.py index 44a2e9f770cd55b203052f4fd1ba02776233db5a..03db29ba112e6711167034ab0e2ffdfa371ed0d0 100755 --- a/DataQuality/ZLumiScripts/scripts/dqt_zlumi_compute_lumi.py +++ b/DataQuality/ZLumiScripts/scripts/dqt_zlumi_compute_lumi.py @@ -38,7 +38,7 @@ def mu_dep_eff(mu): elif 8 <= mu < 27: return 0.3191 - 0.000493*mu elif 27 <= mu: return 0.3443 - 0.00143*mu else: - print 'WTF??' + print('WTF??') return ZATIMESC ROOT.gStyle.SetOptStat(0) @@ -67,7 +67,7 @@ else: outfname = '%s_data.root' % runname[4:] runmode = args.mode -print 'Running in', runmode, 'mode' +print('Running in', runmode, 'mode') if runmode == 'Zee': z_m = fin.Get('%s/GLOBAL/DQTGlobalWZFinder/m_Z_Counter_el' % runname) if not z_m: @@ -151,11 +151,11 @@ from DQUtils import fetch_iovs from DQUtils.iov_arrangement import inverse_lblb lblb = fetch_iovs("LBLB", runs=int(runname[4:])) lbtime = inverse_lblb(lblb) -#print list(lbtime) +#print(list(lbtime)) iovs_acct = fetch_iovs('COOLOFL_TRIGGER::/TRIGGER/OFLLUMI/LumiAccounting', lbtime.first.since, lbtime.last.until, tag=args.tag) if args.useofficial: iovs_lum = fetch_iovs('COOLOFL_TRIGGER::%s' % args.lumifolder, lblb.first.since, lblb.last.until, tag=args.lumitag, channels=[0]) - #print list(iovs_lum) + #print(list(iovs_lum)) lb_start_end = {} lb_lhcfill = {} for iov in lblb: @@ -167,7 +167,7 @@ for iov in iovs_acct: lb_lhcfill[iov.LumiBlock] = iov.FillNumber if args.dblivetime: livetime.Fill(iov.LumiBlock, iov.LiveFraction) - #print iov.InstLumi, iovs_lum[iov.LumiBlock-1].LBAvInstLumi + #print(iov.InstLumi, iovs_lum[iov.LumiBlock-1].LBAvInstLumi) if not args.useofficial: official_lum_zero.Fill(iov.LumiBlock, iov.InstLumi/1e3) official_lum.Fill(iov.LumiBlock, iov.InstLumi*iov.LBTime*iov.LiveFraction/1e3) @@ -175,8 +175,8 @@ for iov in iovs_acct: else: offlumiov = [_ for _ in iovs_lum if _.since.lumi==iov.LumiBlock] if len(offlumiov) != 1: - print 'MAJOR PROBLEM, LUMI IOV MISMATCH' - print len(offlumiov) + print('MAJOR PROBLEM, LUMI IOV MISMATCH') + print(len(offlumiov)) continue offlumiov = offlumiov[0] official_lum_zero.Fill(iov.LumiBlock, offlumiov.LBAvInstLumi/1e3) @@ -219,7 +219,7 @@ for ibin in xrange(1, int(lbmax-lbmin)+1): profileflag=True try: z_m[ibin] - except IndexError, e: + except IndexError as e: logging.error('Something unfortunate has happened; LB %d missing from Z count' % (ibin + lbmin - 1)) profileflag=False if args.mudep: @@ -244,7 +244,7 @@ for ibin in xrange(1, int(lbmax-lbmin)+1): # fill tree if t: - #print ibin, lumiplot_raw_m.GetBinCenter(ibin) + #print(ibin, lumiplot_raw_m.GetBinCenter(ibin)) o_lb[0] = int(lumiplot_raw_m.GetBinCenter(ibin)) o_lbwhen[0] = lb_start_end[o_lb[0]][0] o_lbwhen[1] = lb_start_end[o_lb[0]][1] diff --git a/DataQuality/ZLumiScripts/scripts/dqt_zlumi_display_z_rate.py b/DataQuality/ZLumiScripts/scripts/dqt_zlumi_display_z_rate.py index ca5211c06ebd044fa9a31fc440533a053d4355ef..bc232b151f47d3155362e4e45d33e511bf3e6681 100755 --- a/DataQuality/ZLumiScripts/scripts/dqt_zlumi_display_z_rate.py +++ b/DataQuality/ZLumiScripts/scripts/dqt_zlumi_display_z_rate.py @@ -34,7 +34,7 @@ if min(runs) == max(runs): titlestr += ' Run %d' % min(runs) lumitree.Draw("zrate:lb+10:zratestat", "", "goff") -print 'Selected rows', lumitree.GetSelectedRows() +print('Selected rows', lumitree.GetSelectedRows()) if lumitree.GetSelectedRows() > 0: gr = ROOT.TGraphErrors(lumitree.GetSelectedRows(), lumitree.GetV2(), lumitree.GetV1(), ROOT.nullptr, lumitree.GetV3()) gr.Draw("ap") @@ -55,14 +55,15 @@ for i in xrange(lumitree.GetSelectedRows()): zrate = lumitree.GetV1()[i] instlumi = lumitree.GetVal(5)[i] livetime = lumitree.GetVal(4)[i] - print >>csvout, '%d, %s, %s, %6f, %6f, %4f, %6f' % (lumitree.GetV4()[i], - time.strftime(timeformat, time.gmtime(lumitree.GetV2()[i])), - time.strftime(timeformat, time.gmtime(lumitree.GetV3()[i])), - lumitree.GetV1()[i], - instlumi/1e3, - instlumi*livetime/1e3, - lumitree.GetV1()[i]*livetime - ) + print('%d, %s, %s, %6f, %6f, %4f, %6f' % (lumitree.GetV4()[i], + time.strftime(timeformat, time.gmtime(lumitree.GetV2()[i])), + time.strftime(timeformat, time.gmtime(lumitree.GetV3()[i])), + lumitree.GetV1()[i], + instlumi/1e3, + instlumi*livetime/1e3, + lumitree.GetV1()[i]*livetime + ), + file=csvout) csvout.close() lumitree.Draw("zlumi:lb+10:zlumistat", "", "goff") diff --git a/Database/APR/CollectionBase/CMakeLists.txt b/Database/APR/CollectionBase/CMakeLists.txt index fc861d1f9f4a5e34c6ea1864bae743a7a45c4a98..346d4cd3e1aaa3677608e0fc91c05a669c11c60d 100644 --- a/Database/APR/CollectionBase/CMakeLists.txt +++ b/Database/APR/CollectionBase/CMakeLists.txt @@ -12,7 +12,7 @@ atlas_add_library( CollectionBase src/*.cpp PUBLIC_HEADERS CollectionBase INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} FileCatalog + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} FileCatalog CxxUtils PRIVATE_LINK_LIBRARIES POOLCore PersistentDataModel ) atlas_add_dictionary( CollectionDict diff --git a/Database/APR/CollectionBase/CollectionBase/ATLAS_CHECK_THREAD_SAFETY b/Database/APR/CollectionBase/CollectionBase/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..51c5d7f4f8a73de80eb350f76d93e4f29d78681c --- /dev/null +++ b/Database/APR/CollectionBase/CollectionBase/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Database/APR/CollectionBase diff --git a/Database/APR/CollectionBase/CollectionBase/CollectionDescription.h b/Database/APR/CollectionBase/CollectionBase/CollectionDescription.h index 6ea5ed57953fbcfa17db518922ece96be2ad4324..47ad8118aa8266e4fd45d09eca0c74568aefbae8 100755 --- a/Database/APR/CollectionBase/CollectionBase/CollectionDescription.h +++ b/Database/APR/CollectionBase/CollectionBase/CollectionDescription.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef COLLECTIONBASE_COLLECTIONDESCRIPTION_H @@ -573,13 +573,16 @@ namespace pool { // check if the column contains tokens virtual bool isTokenColumn( const std::string& columnName, const std::string& method ) const; - // this version includes the 'mothod name' in the error message - virtual pool::CollectionColumn* column( const std::string& columnName, const std::string& methodName ) const; + // this version includes the 'method name' in the error message + virtual pool::CollectionColumn* column( const std::string& columnName, const std::string& methodName ); + virtual const pool::CollectionColumn* column( const std::string& columnName, const std::string& methodName ) const; // returns non-const fragment pointer - virtual pool::CollectionFragment* collectionFragment( int fragmentId, const std::string& method ) const; + virtual pool::CollectionFragment* collectionFragment( int fragmentId, const std::string& method ); + virtual const pool::CollectionFragment* collectionFragment( int fragmentId, const std::string& method ) const; // returns non-const fragment pointer - virtual pool::CollectionFragment* collectionFragment( const std::string& fragmentName, const std::string& method ) const; + virtual pool::CollectionFragment* collectionFragment( const std::string& fragmentName, const std::string& method ); + virtual const pool::CollectionFragment* collectionFragment( const std::string& fragmentName, const std::string& method ) const; public: /// print out the description (debugging) diff --git a/Database/APR/CollectionBase/CollectionBase/CollectionFactory.h b/Database/APR/CollectionBase/CollectionBase/CollectionFactory.h index 3c77051ffebe5ee65a4e65f6f38808cec70c49d3..3adbcc2f53d72a7c24fdc3a321413a04cb49da82 100755 --- a/Database/APR/CollectionBase/CollectionBase/CollectionFactory.h +++ b/Database/APR/CollectionBase/CollectionBase/CollectionFactory.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef COLLECTIONBASE_COLLECTIONFACTORY_H @@ -8,6 +8,7 @@ #include "CollectionBase/ICollection.h" #include "CollectionBase/CollectionDescription.h" #include "FileCatalog/IFileCatalog.h" +#include "CxxUtils/checker_macros.h" #include <string> #include <vector> @@ -27,7 +28,8 @@ namespace pool { * collection fragments, the latter of which contain a subset of the metadata of a * full collection. */ - class CollectionFactory + class ATLAS_NOT_THREAD_SAFE CollectionFactory + // not thread-safe due to constness violations wrt the catalog. { public: /// Retrieves the collection factory singleton. diff --git a/Database/APR/CollectionBase/CollectionBase/CollectionRowBuffer.h b/Database/APR/CollectionBase/CollectionBase/CollectionRowBuffer.h index 9dc1bf61ac5a611be15592c3527e388d364ff91e..38320ada3607d4cc0a7069fe302e767e9d87833b 100755 --- a/Database/APR/CollectionBase/CollectionBase/CollectionRowBuffer.h +++ b/Database/APR/CollectionBase/CollectionBase/CollectionRowBuffer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef COLLECTIONBASE_COLLECTIONROWBUFFER_H @@ -8,6 +8,7 @@ #include "CollectionBase/TokenList.h" #include "CoralBase/AttributeList.h" +#include "CxxUtils/checker_macros.h" #include <string> @@ -102,7 +103,12 @@ namespace pool { TokenList m_tokenList; /// List of Attributes. - coral::AttributeList m_attributeList; + // Changed to a pointed to be able to avoid thread-safety checker + // warnings about AttributeList. We can change back to holding + // this by value once those warnings are removed. + coral::AttributeList* m_attributeList; + + bool deleteAL ATLAS_NOT_THREAD_SAFE (); }; } diff --git a/Database/APR/CollectionBase/CollectionBase/CollectionService.h b/Database/APR/CollectionBase/CollectionBase/CollectionService.h index bee57353970a01c9c92db8873de8cae6d97f2f60..4800f1a4d1e7c93317ed0cbfd6d3ae1e78e4f622 100755 --- a/Database/APR/CollectionBase/CollectionBase/CollectionService.h +++ b/Database/APR/CollectionBase/CollectionBase/CollectionService.h @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef COLLECTIONBASE_COLLECTIONSERVICE_H #define COLLECTIONBASE_COLLECTIONSERVICE_H #include "CollectionBase/ICollectionService.h" +#include "CxxUtils/checker_macros.h" namespace pool { @@ -21,7 +22,7 @@ namespace pool { * of the metadata of an existing collection. Note that a class that inherits from this * interface must also inherit from the SEAL Service base class. */ - class CollectionService : virtual public ICollectionService + class ATLAS_NOT_THREAD_SAFE CollectionService : virtual public ICollectionService { // DECLARE_SEAL_COMPONENT; diff --git a/Database/APR/CollectionBase/CollectionBase/ICollectionMetadata.h b/Database/APR/CollectionBase/CollectionBase/ICollectionMetadata.h index d78254187815c0c2a0f50531fb9a50d865705b87..7f5b8667cdbd8d6f69c17196cb3f6506c1d97a65 100644 --- a/Database/APR/CollectionBase/CollectionBase/ICollectionMetadata.h +++ b/Database/APR/CollectionBase/CollectionBase/ICollectionMetadata.h @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ICollectionMetadata_h #define ICollectionMetadata_h #include <string> +#include <memory> namespace pool { @@ -35,25 +36,11 @@ namespace pool { const std::string& key() const { return m_iterator->key(); } const char * value() const { return m_iterator->value(); } - ~const_iterator() { delete m_iterator; } - - const_iterator( ICollectionMetadataIterator* iter ) - : m_iterator( iter ) {} - - const_iterator& operator=( const const_iterator& rhs ) { - m_iterator = rhs.releaseIter(); - return *this; - } - - protected: - ICollectionMetadataIterator* releaseIter() const { - ICollectionMetadataIterator *iter = m_iterator; - m_iterator = 0; - return iter; - } - + const_iterator( std::unique_ptr<ICollectionMetadataIterator> iter ) + : m_iterator( std::move(iter) ) {} - mutable ICollectionMetadataIterator* m_iterator; + private: + std::unique_ptr<ICollectionMetadataIterator> m_iterator; }; diff --git a/Database/APR/CollectionBase/CollectionBase/ICollectionService.h b/Database/APR/CollectionBase/CollectionBase/ICollectionService.h index 4d542886c352ddd39f27e40b3f6bd46f2cd8e3d6..025742afce303d581bb0d0f1cd94657a62841b73 100755 --- a/Database/APR/CollectionBase/CollectionBase/ICollectionService.h +++ b/Database/APR/CollectionBase/CollectionBase/ICollectionService.h @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef COLLECTIONBASE_ICOLLECTIONSERVICE_H #define COLLECTIONBASE_ICOLLECTIONSERVICE_H #include "CollectionBase/ICollection.h" +#include "CxxUtils/checker_macros.h" #include <string> #include <vector> @@ -29,7 +30,7 @@ namespace pool { * Note that a class that inherits from this interface must also inherit from the SEAL * Service base class. */ - class ICollectionService + class ATLAS_NOT_THREAD_SAFE ICollectionService { public: /** diff --git a/Database/APR/CollectionBase/src/CollectionDescription.cpp b/Database/APR/CollectionBase/src/CollectionDescription.cpp index fa90e718772851db3ad8738f9290f3be33a2a063..b9e9902a8cf0c74626c949ced96b54ebbd5f7559 100755 --- a/Database/APR/CollectionBase/src/CollectionDescription.cpp +++ b/Database/APR/CollectionBase/src/CollectionDescription.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CollectionBase/CollectionDescription.h" @@ -1450,7 +1450,7 @@ pool::CollectionDescription::numberOfColumns( std::string fragmentName ) const if( !fragmentName.size() ) { return m_attributeColumnForColumnName.size() + m_tokenColumnForColumnName.size(); } - CollectionFragment* fragment = collectionFragment( fragmentName, "numberOfColumns" ); + const CollectionFragment* fragment = collectionFragment( fragmentName, "numberOfColumns" ); return fragment->attributeColumns().size() + fragment->tokenColumns().size(); } @@ -1481,7 +1481,7 @@ pool::CollectionDescription::columnPtr( const std::string& name ) const // internal use protected method (when non-const column is needed). throws exceptions pool::CollectionColumn * -pool::CollectionDescription::column( const std::string& name, const std::string& method ) const +pool::CollectionDescription::column( const std::string& name, const std::string& method ) { std::map< std::string, pool::CollectionColumn* >::const_iterator iColumn; iColumn = m_attributeColumnForColumnName.find( name ); @@ -1497,6 +1497,22 @@ pool::CollectionDescription::column( const std::string& name, const std::string& +const pool::CollectionColumn * +pool::CollectionDescription::column( const std::string& name, const std::string& method ) const +{ + std::map< std::string, pool::CollectionColumn* >::const_iterator iColumn; + iColumn = m_attributeColumnForColumnName.find( name ); + if( iColumn == m_attributeColumnForColumnName.end() ) { + iColumn = m_tokenColumnForColumnName.find( name ); + if( iColumn == m_tokenColumnForColumnName.end() ) { + std::string errorMsg = "Column with name `" + name + "' does NOT exist."; + throw pool::Exception(errorMsg, "CollectionDescription::" + method, "CollectionBase"); + } + } + return iColumn->second; +} + + int pool::CollectionDescription::numberOfTokenColumns( std::string fragmentName ) const { @@ -1609,7 +1625,7 @@ pool::CollectionDescription::attributeColumn( const std::string& columnName ) co const pool::ICollectionColumn& pool::CollectionDescription::attributeColumn( int columnId, int fragmentId ) const { - CollectionFragment* fragment = collectionFragment( fragmentId, "attributeColumn" ); + const CollectionFragment* fragment = collectionFragment( fragmentId, "attributeColumn" ); std::vector< pool::CollectionColumn* > columns = fragment->attributeColumns(); if( columnId >= 0 && columnId < (int) columns.size() ) { @@ -1630,7 +1646,7 @@ pool::CollectionDescription::attributeColumn( int columnId, int fragmentId ) con const pool::ICollectionColumn& pool::CollectionDescription::attributeColumn( int columnId, const std::string& fragmentName ) const { - CollectionFragment* fragment = collectionFragment( fragmentName, "attributeColumn" ); + const CollectionFragment* fragment = collectionFragment( fragmentName, "attributeColumn" ); std::vector< pool::CollectionColumn* > columns = fragment->attributeColumns(); if( columnId >= 0 && columnId < (int)columns.size() ) { return *( columns[ columnId ] ); @@ -1777,6 +1793,22 @@ pool::CollectionDescription::collectionFragment( const std::string& fragmentName pool::CollectionFragment * +pool::CollectionDescription::collectionFragment( const std::string& fragmentName, const std::string& method ) +{ + std::map< std::string, pool::CollectionFragment* >::const_iterator iFragment = + m_fragmentForFragmentName.find( fragmentName ); + + if( iFragment == m_fragmentForFragmentName.end() ) { + std::string errorMsg = "Collection fragment `" + fragmentName + "' NOT found."; + throw pool::Exception( errorMsg, + "CollectionDescription::" + method, + "CollectionBase" ); + } + return iFragment->second; +} + + +const pool::CollectionFragment * pool::CollectionDescription::collectionFragment( const std::string& fragmentName, const std::string& method ) const { std::map< std::string, pool::CollectionFragment* >::const_iterator iFragment = @@ -1800,6 +1832,24 @@ pool::CollectionDescription::collectionFragment( int fragmentId ) const pool::CollectionFragment * +pool::CollectionDescription::collectionFragment( int fragmentId, const std::string& method ) +{ + std::map< int, pool::CollectionFragment* >::const_iterator iFragment = m_fragmentForFragmentId.find( fragmentId ); + + if ( iFragment == m_fragmentForFragmentId.end() ) + { + std::string errorMsg = "Not using a collection fragment with ID " + std::to_string(fragmentId); + throw pool::Exception( errorMsg, + "CollectionDescription::" + method, + "CollectionBase" ); + } + + return iFragment->second; +} + + + +const pool::CollectionFragment * pool::CollectionDescription::collectionFragment( int fragmentId, const std::string& method ) const { std::map< int, pool::CollectionFragment* >::const_iterator iFragment = m_fragmentForFragmentId.find( fragmentId ); diff --git a/Database/APR/CollectionBase/src/CollectionFactory.cpp b/Database/APR/CollectionBase/src/CollectionFactory.cpp index 803958d8deaaf111a5ff1f0a6d64fe92091e97d5..29de465160de9195c60d968731b9388e1aed5894 100755 --- a/Database/APR/CollectionBase/src/CollectionFactory.cpp +++ b/Database/APR/CollectionBase/src/CollectionFactory.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CollectionBase/CollectionFactory.h" @@ -24,7 +24,7 @@ using namespace std; using namespace pool; pool::CollectionFactory pool::CollectionFactory::s_instance; -static string thisModule( "POOLCollFactory" ); +static const string thisModule( "POOLCollFactory" ); const std::string pool::CollectionFactory::c_fileType = "PoolCollection"; diff --git a/Database/APR/CollectionBase/src/CollectionRowBuffer.cpp b/Database/APR/CollectionBase/src/CollectionRowBuffer.cpp index 459879a031aa60e49f8a00fe51dd1811bd5b6e4d..143b19bd7c9a280a24dccab0f86ecddcfba4658c 100755 --- a/Database/APR/CollectionBase/src/CollectionRowBuffer.cpp +++ b/Database/APR/CollectionBase/src/CollectionRowBuffer.cpp @@ -1,44 +1,53 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CollectionBase/CollectionRowBuffer.h" - pool::CollectionRowBuffer::CollectionRowBuffer() : m_tokenList(), - m_attributeList() + m_attributeList (new coral::AttributeList) {} pool::CollectionRowBuffer::CollectionRowBuffer( const pool::TokenList& tokenList, coral::AttributeList& attributeList ) - : m_tokenList( tokenList ) - //m_attributeList( attributeList ) + : m_tokenList( tokenList ), + m_attributeList( new coral::AttributeList ) { // share data - m_attributeList.merge( attributeList ); + m_attributeList->merge( attributeList ); } pool::CollectionRowBuffer::CollectionRowBuffer( const pool::CollectionRowBuffer& rhs ) - : m_tokenList( rhs.m_tokenList ) - // m_attributeList( rhs.m_attributeList ) + : m_tokenList( rhs.m_tokenList ), + m_attributeList( new coral::AttributeList ) { // share the data - m_attributeList.merge( rhs.m_attributeList ); + m_attributeList->merge( *rhs.m_attributeList ); +} + + +bool pool::CollectionRowBuffer::deleteAL ATLAS_NOT_THREAD_SAFE() +{ + delete m_attributeList; + m_attributeList = nullptr; + return true; } pool::CollectionRowBuffer::~CollectionRowBuffer() -{} +{ + [[maybe_unused]] bool flag ATLAS_THREAD_SAFE = deleteAL(); +} pool::CollectionRowBuffer& pool::CollectionRowBuffer::operator=( const pool::CollectionRowBuffer& rhs ) { m_tokenList = rhs.m_tokenList; - m_attributeList = rhs.m_attributeList; + *m_attributeList = *rhs.m_attributeList; return *this; } @@ -47,7 +56,7 @@ pool::CollectionRowBuffer::operator=( const pool::CollectionRowBuffer& rhs ) bool pool::CollectionRowBuffer::operator==( const pool::CollectionRowBuffer& rhs ) const { - if ( ( m_tokenList != rhs.m_tokenList ) || ( m_attributeList != rhs.m_attributeList ) ) + if ( ( m_tokenList != rhs.m_tokenList ) || ( *m_attributeList != *rhs.m_attributeList ) ) { return false; } @@ -73,7 +82,7 @@ pool::CollectionRowBuffer::setTokenList( const pool::TokenList& tokenList ) void pool::CollectionRowBuffer::setAttributeList( const coral::AttributeList& attributeList ) { - m_attributeList = attributeList; + *m_attributeList = attributeList; } @@ -87,7 +96,7 @@ pool::CollectionRowBuffer::tokenList() coral::AttributeList& pool::CollectionRowBuffer::attributeList() { - return m_attributeList; + return *m_attributeList; } @@ -101,6 +110,6 @@ pool::CollectionRowBuffer::tokenList() const const coral::AttributeList& pool::CollectionRowBuffer::attributeList() const { - return m_attributeList; + return *m_attributeList; } diff --git a/Database/APR/CollectionBase/src/TokenList.cpp b/Database/APR/CollectionBase/src/TokenList.cpp index 093858682129bee6888af15c9af646b8a0d15a70..17b8cf9a4727140cda03d54931ba3247d4c6065a 100755 --- a/Database/APR/CollectionBase/src/TokenList.cpp +++ b/Database/APR/CollectionBase/src/TokenList.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CollectionBase/TokenList.h" @@ -99,14 +99,29 @@ pool::TokenList::extend( const std::string& name ) Token& pool::TokenList::operator[]( const std::string& name ) { - return const_cast<Token&>( ((const TokenList&)*this)[name] ); + std::map< std::string, Token* >::iterator iData = m_tokenMap.find( name ); + + if( iData == m_tokenMap.end() ) { + std::string errorMsg = "Cannot find Token with name `" + name + "' in Token list."; + throw pool::Exception( errorMsg, + "TokenList::operator[](name)", + "CollectionBase" ); + } + return *( iData->second ); } Token& pool::TokenList::operator[]( unsigned int index ) { - return const_cast<Token&>( ((const TokenList&)*this)[index] ); + if( index >= m_tokenVector.size() ) { + std::ostringstream errorMsg; + errorMsg << "Cannot find Token with index `" << index << "' in Token list."; + throw pool::Exception( errorMsg.str(), + "TokenList::operator[](index)", + "CollectionBase" ); + } + return *m_tokenVector[index]; } diff --git a/Database/APR/CollectionBase/test/Factory_test.cxx b/Database/APR/CollectionBase/test/Factory_test.cxx index 6d389082da3af0880606002bc22cfffe6f1fb832..8bdaa1bbd61bf67f885a376b1a5b64c385af261b 100644 --- a/Database/APR/CollectionBase/test/Factory_test.cxx +++ b/Database/APR/CollectionBase/test/Factory_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include <cstdio> // For sprintf on gcc45 @@ -15,6 +15,10 @@ #include "CollectionBase/ICollection.h" #include "CollectionBase/CollectionDescription.h" #include "CollectionBase/CollectionFactory.h" +#include "CxxUtils/checker_macros.h" + + +ATLAS_NO_CHECK_FILE_THREAD_SAFETY; using namespace std; diff --git a/Database/APR/FileCatalog/FileCatalog/ATLAS_CHECK_THREAD_SAFETY b/Database/APR/FileCatalog/FileCatalog/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..a9f156d201be6188e8036b8693686988bb74faa6 --- /dev/null +++ b/Database/APR/FileCatalog/FileCatalog/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Database/APR/FileCatalog diff --git a/Database/APR/FileCatalog/test/URIParser_test.cxx b/Database/APR/FileCatalog/test/URIParser_test.cxx index 8de9abb457e30248d923a8e53053fb88de508ad7..cdca6bb025c6dc00ac6d11e16e7e17e0482b533d 100755 --- a/Database/APR/FileCatalog/test/URIParser_test.cxx +++ b/Database/APR/FileCatalog/test/URIParser_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //$Id: URIParser_test.cxx 457829 2011-09-08 13:13:25Z mnowak $ @@ -36,7 +36,7 @@ int main(){ p.parse();p.dump(); }catch(const pool::Exception& er){ std::cerr <<er.what()<< std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/FileCatalog/utilities/FCaddReplica.cpp b/Database/APR/FileCatalog/utilities/FCaddReplica.cpp index 4370ad9f0c8338d9b563e73c983ca7f8e44d4b34..a409808db3317b15a0b15cb50cddb9c7c96e19a7 100755 --- a/Database/APR/FileCatalog/utilities/FCaddReplica.cpp +++ b/Database/APR/FileCatalog/utilities/FCaddReplica.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /**FCaddReplica.cpp -- FileCatalog command line tool to add replica pfn @@ -20,8 +20,6 @@ void printUsage(){ std::cout<<"usage: FCaddReplica -r replica [-p pfname -g guid -u contactstring -h]" <<std::endl; } -static const char* opts[] = {"r","p","g","u","h",0}; - int main(int argc, char** argv) { @@ -33,6 +31,7 @@ int main(int argc, char** argv) FileCatalog::FileID myguid; try{ CommandLine commands(argc,argv); + const char* opts[] = {"r","p","g","u","h",0}; commands.CheckOptions(opts); if( commands.Exists("u") ){ @@ -51,22 +50,22 @@ int main(int argc, char** argv) } if( commands.Exists("h") ){ printUsage(); - exit(0); + return 0; } }catch(std::string& strError){ std::cerr << "Error: command parsing error "<<strError<<std::endl; - exit(-1); + return -1; } if( myrpf.empty() ){ printUsage(); std::cerr<<"Error: must specify replica name using -r"<<std::endl; - exit(0); + return 0; } if( mypfn.empty()&& myguid.empty() ){ printUsage(); std::cerr<<"Error: must specify PFN using -p or guid using -g"<<std::endl; - exit(0); + return 0; } try{ std::unique_ptr<IFileCatalog> mycatalog(new IFileCatalog); @@ -88,10 +87,10 @@ int main(int argc, char** argv) } }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; }catch (const std::exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/FileCatalog/utilities/FCdeleteEntry.cpp b/Database/APR/FileCatalog/utilities/FCdeleteEntry.cpp index 0cdd294897ec8b33ddc392e670443e8827203246..0752d444c863bc56a09bd1b0b1e3a3ba941bd196 100755 --- a/Database/APR/FileCatalog/utilities/FCdeleteEntry.cpp +++ b/Database/APR/FileCatalog/utilities/FCdeleteEntry.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /**FCdeleteEntry.cpp -- FileCatalog command line tool to delete all entries associated with given file. @@ -19,8 +19,6 @@ void printUsage(){ std::cout<<"usage: FCdeleteEntry [-q query -l lfname -p pfname -u contactstring -h]" <<std::endl; } -static const char* opts[] = {"q","l","p","u","h",0}; - int main(int argc, char** argv) { @@ -32,6 +30,7 @@ int main(int argc, char** argv) std::string myquery; try{ CommandLine commands(argc,argv); + const char* opts[] = {"q","l","p","u","h",0}; commands.CheckOptions(opts); if( commands.Exists("u") ){ @@ -51,23 +50,23 @@ int main(int argc, char** argv) if( commands.Exists("h") ){ printUsage(); - exit(0); + return 0; } }catch(std::string& strError){ std::cerr << "Error: command parsing error "<<strError<<std::endl; - exit(0); + return 0; } if( mylfn.empty() && mypfn.empty() && myquery.empty() ){ printUsage(); std::cerr<<"Error: must specify lfname using -l , pfname using -p, query using -q"<<std::endl; - exit(0); + return 0; } if( !mylfn.empty() && !mypfn.empty() ){ printUsage(); std::cerr<<"Error: can only delete either PFN or LFN"<<std::endl; - exit(0); + return 0; } try{ std::unique_ptr<IFileCatalog> mycatalog(new IFileCatalog); @@ -79,7 +78,7 @@ int main(int argc, char** argv) mycatalog->start(); if( !myquery.empty() ){ std::cerr << "Query option not supported" << std::endl; - exit(2); + return 2; }else if( !mylfn.empty() ){ mycatalog->deleteFID( mycatalog->lookupLFN( mylfn ) ); }else if( !mypfn.empty() ) { @@ -89,10 +88,10 @@ int main(int argc, char** argv) mycatalog->disconnect(); }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; }catch (const std::exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/FileCatalog/utilities/FCdeletePFN.cpp b/Database/APR/FileCatalog/utilities/FCdeletePFN.cpp index a3b500fe5d15ae3a927d3a8ab4a3b78fc9cd1a9a..ded3e4dde787b93ee760983aaa22d5bed12276b4 100755 --- a/Database/APR/FileCatalog/utilities/FCdeletePFN.cpp +++ b/Database/APR/FileCatalog/utilities/FCdeletePFN.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** FCdeletePFN.cpp -- FileCatalog command line tool to delete the selected PFN @@ -19,8 +19,6 @@ void printUsage(){ std::cout<<"usage: FCdeletePFN [-q query -p pfname -u contactstring -h]" <<std::endl; } -static const char* opts[] = {"p","q","u","h",0}; - int main(int argc, char** argv) { @@ -31,6 +29,7 @@ int main(int argc, char** argv) std::string myquery; try{ CommandLine commands(argc,argv); + const char* opts[] = {"p","q","u","h",0}; commands.CheckOptions(opts); if( commands.Exists("u") ){ @@ -46,17 +45,17 @@ int main(int argc, char** argv) } if( commands.Exists("h") ){ printUsage(); - exit(0); + return 0; } }catch(std::string& strError){ std::cerr<< "Error: command parsing error "<<strError<<std::endl; - exit(0); + return 0; } if( mypfn.empty() && myquery.empty() ){ printUsage(); std::cerr<<"Error: must specify pfname using -p, query using -q"<<std::endl; - exit(0); + return 0; } try{ std::unique_ptr<IFileCatalog> mycatalog(new IFileCatalog); @@ -67,7 +66,7 @@ int main(int argc, char** argv) mycatalog->start(); if( !myquery.empty() ){ std::cerr << "Query option not supported" << std::endl; - exit(2); + return 2; }else if( !mypfn.empty() ) { mycatalog->deletePFN(mypfn); } @@ -75,10 +74,10 @@ int main(int argc, char** argv) mycatalog->disconnect(); }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; }catch (const std::exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/FileCatalog/utilities/FClistGUID.cpp b/Database/APR/FileCatalog/utilities/FClistGUID.cpp index f1aa7fa971b4104c178329738bcb452101c7dadc..5e224bd8eacb241b5b3a6a6d10fadbf6988dd393 100644 --- a/Database/APR/FileCatalog/utilities/FClistGUID.cpp +++ b/Database/APR/FileCatalog/utilities/FClistGUID.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /**FClistGUID.cpp -- FileCatalog command line tool to list guid @@ -22,8 +22,6 @@ void printUsage(){ std::cout<<"usage: FClistGUID [-p pfname -l lfname -q query -u contactstring -h]" <<std::endl; } -static const char* opts[] = {"p","l","q","u","h",0}; - class contactParser{ public: contactParser(const std::string& contact):m_contact(contact){} @@ -62,6 +60,7 @@ int main(int argc, char** argv) std::string query; try{ CommandLine commands(argc,argv); + const char* opts[] = {"p","l","q","u","h",0}; commands.CheckOptions(opts); if( commands.Exists("u") ){ @@ -80,11 +79,11 @@ int main(int argc, char** argv) } if( commands.Exists("h") ){ printUsage(); - exit(0); + return 0; } }catch(std::string& strError){ std::cerr<< "Error: command parsing error "<<strError<<std::endl; - exit(1); + return 1; } if(!query.empty()&&!mypfn.empty()){ @@ -110,7 +109,7 @@ int main(int argc, char** argv) pool::IFileCatalog::Strings fids; if( !query.empty() ){ std::cerr << "Query option not supported" << std::endl; - exit(2); + return 2; } else if( !mypfn.empty() ){ fids.push_back( mycatalog->lookupPFN( mypfn ) ); } else if( !mylfn.empty() ){ @@ -125,10 +124,10 @@ int main(int argc, char** argv) mycatalog->disconnect(); }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; }catch (const std::exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/FileCatalog/utilities/FClistLFN.cpp b/Database/APR/FileCatalog/utilities/FClistLFN.cpp index b3f42119184b73b181b685844904684f2d0d8ded..cddad5128a24873c0de21c9dad69ad21e0b4b07a 100755 --- a/Database/APR/FileCatalog/utilities/FClistLFN.cpp +++ b/Database/APR/FileCatalog/utilities/FClistLFN.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /**FClistLFN.cpp -- FileCatalog command line tool to list all the LFN entries from the catalog. @@ -21,8 +21,6 @@ void printUsage(){ std::cout<<"usage: FClistLFN [-p pfname] [-u contactstring] [-h]" <<std::endl; } -static const char* opts[] = {"p","u","h",0}; - class contactParser{ public: @@ -58,6 +56,7 @@ int main(int argc, char** argv) std::string mypfn; try{ CommandLine commands(argc,argv); + const char* opts[] = {"p","u","h",0}; commands.CheckOptions(opts); if( commands.Exists("u") ){ @@ -70,11 +69,11 @@ int main(int argc, char** argv) } if( commands.Exists("h") ){ printUsage(); - exit(0); + return 0; } }catch(std::string& strError){ std::cerr<< "Error: command parsing error "<<strError<<std::endl; - exit(0); + return 0; } if( !mypfn.empty() ) { @@ -116,10 +115,10 @@ int main(int argc, char** argv) mycatalog->disconnect(); }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; }catch (const std::exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/FileCatalog/utilities/FClistPFN.cpp b/Database/APR/FileCatalog/utilities/FClistPFN.cpp index 25d1980aef50f2485dea3705720511ba18ebb0a0..8a2ef5d5a27b07640c9b828e67c3fc8e8ad74149 100755 --- a/Database/APR/FileCatalog/utilities/FClistPFN.cpp +++ b/Database/APR/FileCatalog/utilities/FClistPFN.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /**FClistPFN.cpp -- FileCatalog command line tool to list the PFN entries from the catalog @@ -23,8 +23,6 @@ void printUsage(){ std::cout<<"usage: FClistPFN [-l lfname] [-u contactstring] [-t -h]" <<std::endl; } -static const char* opts[] = {"t","l","u","f","h",0}; - class contactParser{ public: @@ -61,6 +59,7 @@ int main(int argc, char** argv) bool printall=false; try{ CommandLine commands(argc,argv); + const char* opts[] = {"t","l","u","f","h",0}; commands.CheckOptions(opts); if( commands.Exists("u") ){ @@ -79,11 +78,11 @@ int main(int argc, char** argv) } if( commands.Exists("h") ){ printUsage(); - exit(0); + return 0; } }catch(std::string& strError){ std::cerr << "Error: command parsing error "<<strError<<std::endl; - exit(0); + return 0; } try{ @@ -129,10 +128,10 @@ int main(int argc, char** argv) mycatalog->disconnect(); }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; }catch (const std::exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/FileCatalog/utilities/FCregisterLFN.cpp b/Database/APR/FileCatalog/utilities/FCregisterLFN.cpp index 2d1ad5a62d327b1ae228006ac65b342c2665331c..92692b48f8c05ce0eecc786b3101604f7dae7e6e 100755 --- a/Database/APR/FileCatalog/utilities/FCregisterLFN.cpp +++ b/Database/APR/FileCatalog/utilities/FCregisterLFN.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /**FCregisterLFN.cpp -- FileCatalog command line tool to register a LFN @@ -20,8 +20,6 @@ void printUsage(){ std::cout<<"usage: FCregisterLFN -l lfname -p pfname [-u contactstring -h]" <<std::endl; } -static const char* opts[] = {"p","l","u","h",0}; - int main(int argc, char** argv) { @@ -32,6 +30,7 @@ int main(int argc, char** argv) std::string mylfn; try{ CommandLine commands(argc,argv); + const char* opts[] = {"p","l","u","h",0}; commands.CheckOptions(opts); if( commands.Exists("u") ){ @@ -47,17 +46,17 @@ int main(int argc, char** argv) } if( commands.Exists("h") ){ printUsage(); - exit(0); + return 0; } }catch(std::string& strError){ std::cerr << "Error: command parsing error "<<strError<<std::endl; - exit(0); + return 0; } if( mypfn.empty() || mylfn.empty() ){ printUsage(); std::cerr<<"Error: must specify pfname using -p, lfname using -l"<<std::endl; - exit(0); + return 0; } try{ std::unique_ptr<IFileCatalog> mycatalog(new IFileCatalog); @@ -71,10 +70,10 @@ int main(int argc, char** argv) mycatalog->disconnect(); }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; }catch (const std::exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/FileCatalog/utilities/FCregisterPFN.cpp b/Database/APR/FileCatalog/utilities/FCregisterPFN.cpp index e42d0e404997888306ed3b612dd34f9af2c551a7..d0820dc49790919aa5af51e700b763a25e985733 100755 --- a/Database/APR/FileCatalog/utilities/FCregisterPFN.cpp +++ b/Database/APR/FileCatalog/utilities/FCregisterPFN.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @@ -20,8 +20,6 @@ void printUsage(){ std::cout<< "usage: registerPFN -p pfname [ -u contactstring -t filetype -g guid -h ]" <<std::endl; } -static const char* opts[] = {"p","t","g","u","h",0}; - int main(int argc, char** argv) { @@ -33,6 +31,7 @@ int main(int argc, char** argv) std::string myguid; try{ CommandLine commands(argc,argv); + const char* opts[] = {"p","t","g","u","h",0}; commands.CheckOptions(opts); if( commands.Exists("u") ){ @@ -51,17 +50,17 @@ int main(int argc, char** argv) } if( commands.Exists("h") ){ printUsage(); - exit(0); + return 0; } }catch(std::string& strError){ std::cerr<<"Error: command parsing error "<<strError<<std::endl; - exit(0); + return 0; } if( mypfn.empty() ){ printUsage(); std::cerr<<"Error: must specify pfname using -p"<<std::endl; - exit(0); + return 0; } try{ std::unique_ptr<IFileCatalog> mycatalog(new IFileCatalog); @@ -76,10 +75,10 @@ int main(int argc, char** argv) std::cout<<myguid<<std::endl; }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; }catch (const std::exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/FileCatalog/utilities/FCrenamePFN.cpp b/Database/APR/FileCatalog/utilities/FCrenamePFN.cpp index 61b6ce2c47fe2025906e2d8ab9061717512a917c..8d911bd514d74a7206adcd3007e10ddbeec06876 100755 --- a/Database/APR/FileCatalog/utilities/FCrenamePFN.cpp +++ b/Database/APR/FileCatalog/utilities/FCrenamePFN.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /**FCrenamePFN.cpp -- FileCatalog command line tool to rename PFN. Used in the case the file has been moved. @@ -18,8 +18,6 @@ void printUsage(){ std::cout<<"usage: FCrenamePFN -p pfname -n newpfname [-u contactstring -h]" <<std::endl; } -static const char* opts[] = {"p","n","u","h",0}; - int main(int argc, char** argv) { @@ -30,6 +28,7 @@ int main(int argc, char** argv) std::string mynewpfn; try{ CommandLine commands(argc,argv); + const char* opts[] = {"p","n","u","h",0}; commands.CheckOptions(opts); if( commands.Exists("u") ){ @@ -43,17 +42,17 @@ int main(int argc, char** argv) } if( commands.Exists("h") ){ printUsage(); - exit(0); + return 0; } }catch(std::string& strError){ std::cerr << "error "<<strError<<std::endl; - exit(1); + return 1; } if( mypfn.empty() || mynewpfn.empty() ){ printUsage(); std::cerr<<"must specify pfname using -p, newpfname using -n "<<std::endl; - exit(0); + return 0; } try{ std::unique_ptr<IFileCatalog> mycatalog(new IFileCatalog); @@ -67,10 +66,10 @@ int main(int argc, char** argv) mycatalog->disconnect(); }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; }catch (const std::exception& er){ std::cerr<<er.what()<<std::endl; - exit(1); + return 1; } } diff --git a/Database/APR/ImplicitCollection/src/ImplicitCollectionMetadata.h b/Database/APR/ImplicitCollection/src/ImplicitCollectionMetadata.h index d15bd4ac5d0d7f601cd56a997b64d3cfd21a05fd..ca69348a4e05b4cb7e188fbd04dca0e0bbef45f1 100644 --- a/Database/APR/ImplicitCollection/src/ImplicitCollectionMetadata.h +++ b/Database/APR/ImplicitCollection/src/ImplicitCollectionMetadata.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ImplicitCollectionMetadata_h @@ -51,6 +51,7 @@ namespace pool { class ImplicitCollectionMetadataIterator : public ICollectionMetadata::ICollectionMetadataIterator { + public: friend class ImplicitCollectionMetadata; ImplicitCollectionMetadataIterator() {} @@ -74,12 +75,12 @@ namespace pool { ICollectionMetadata::const_iterator begin() const { - return ICollectionMetadata::const_iterator( new ImplicitCollectionMetadataIterator() ); + return ICollectionMetadata::const_iterator( std::make_unique<ImplicitCollectionMetadataIterator>() ); } ICollectionMetadata::const_iterator end() const { - return ICollectionMetadata::const_iterator( new ImplicitCollectionMetadataIterator() ); + return ICollectionMetadata::const_iterator( std::make_unique<ImplicitCollectionMetadataIterator>() ); } }; // end ImplicitCollectionMetadata diff --git a/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.cpp b/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.cpp index b9a506a2930bcf9194a0955087d7408b948a28c6..488bdbd32a166b5477f76862a68b0a575e02facd 100644 --- a/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.cpp +++ b/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "RelationalCollectionMetadata.h" @@ -334,7 +334,7 @@ namespace pool { query->setCondition( RelationalCollectionBindVariables::whereClauseForMetadata(), m_whereDataForMetadata ); return ICollectionMetadata::const_iterator( - new RelationalCollectionMetadataIterator( this, query.release(), + std::make_unique<RelationalCollectionMetadataIterator>( this, query.release(), entries() < 10000? &m_keyInfo : 0 ) ); } @@ -343,7 +343,7 @@ namespace pool { RelationalCollectionMetadata::end() const { return ICollectionMetadata::const_iterator( - new RelationalCollectionMetadataIterator( 0, 0, 0 ) ); + std::make_unique<RelationalCollectionMetadataIterator>( nullptr, nullptr, nullptr ) ); } diff --git a/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.h b/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.h index 2194c1230ae1f59e1a56b455b9c4a94fccd6340f..6aa064fa6e8859dbb16d6e7dc40869b347e48572 100644 --- a/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.h +++ b/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef RelationalCollectionMetadata_h @@ -58,6 +58,7 @@ namespace pool { class RelationalCollectionMetadataIterator : public ICollectionMetadata::ICollectionMetadataIterator { + public: friend class RelationalCollectionMetadata; RelationalCollectionMetadataIterator( const RelationalCollectionMetadata* meta, diff --git a/Database/APR/RootCollection/src/RootCollectionMetadata.cpp b/Database/APR/RootCollection/src/RootCollectionMetadata.cpp index 016ec419de80cdc7197b1613c2dd2cb816a31777..1da914ab43b3e27dad3908d6dbc549761c88f9ed 100644 --- a/Database/APR/RootCollection/src/RootCollectionMetadata.cpp +++ b/Database/APR/RootCollection/src/RootCollectionMetadata.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "RootCollectionMetadata.h" @@ -232,7 +232,7 @@ namespace pool { if( !m_hasKeys ) readKeys(); return ICollectionMetadata::const_iterator( - new RootCollectionMetadataIterator( m_keyMap.begin(), this ) ); + std::make_unique<RootCollectionMetadataIterator>( m_keyMap.begin(), this ) ); } @@ -243,7 +243,7 @@ namespace pool { if( !m_hasKeys ) // check also here, in case End is evaluated before Begin readKeys(); return ICollectionMetadata::const_iterator( - new RootCollectionMetadataIterator( m_keyMap.end(), this ) ); + std::make_unique<RootCollectionMetadataIterator>( m_keyMap.end(), this ) ); } } // end namespace diff --git a/Database/APR/RootCollection/src/RootCollectionMetadata.h b/Database/APR/RootCollection/src/RootCollectionMetadata.h index 473524a4d3da1e178edc9ec20cf71fdb4732dad3..0a128659cdcd90c7ff695beccb78d1b131eff26e 100644 --- a/Database/APR/RootCollection/src/RootCollectionMetadata.h +++ b/Database/APR/RootCollection/src/RootCollectionMetadata.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef RootCollectionMetadata_h @@ -55,6 +55,7 @@ namespace pool { class RootCollectionMetadataIterator : public ICollectionMetadata::ICollectionMetadataIterator { + public: friend class RootCollectionMetadata; RootCollectionMetadataIterator( const MetadataKeyMap_t::const_iterator& iter, diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx index bca157b86f9d3c9ff9cc1fec71e906e56f01e405..afe868a98f581642614c47c7b6279578d2ae1abf 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx @@ -9,12 +9,12 @@ #include "AthenaPoolCnvSvc.h" +#include "GaudiKernel/AttribStringParser.h" #include "GaudiKernel/ClassID.h" #include "GaudiKernel/FileIncident.h" - -#include "GaudiKernel/IOpaqueAddress.h" #include "GaudiKernel/IIncidentSvc.h" -#include "GaudiKernel/AttribStringParser.h" +#include "GaudiKernel/IIoComponentMgr.h" +#include "GaudiKernel/IOpaqueAddress.h" #include "AthenaKernel/IAthenaSerializeSvc.h" #include "AthenaKernel/IAthenaOutputStreamTool.h" @@ -24,7 +24,6 @@ #include "PersistentDataModel/TokenAddress.h" #include "PersistentDataModel/DataHeader.h" - #include "StorageSvc/DbReflex.h" #include "AuxDiscoverySvc.h" @@ -62,6 +61,13 @@ StatusCode AthenaPoolCnvSvc::initialize() { ATH_CHECK(arswsvc.retrieve()); } } + // Register this service for 'I/O' events + ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name()); + ATH_CHECK(iomgr.retrieve()); + if (!iomgr->io_register(this).isSuccess()) { + ATH_MSG_FATAL("Could not register myself with the IoComponentMgr !"); + return(StatusCode::FAILURE); + } // Extracting MaxFileSizes for global default and map by Database name. for (std::vector<std::string>::const_iterator iter = m_maxFileSizes.value().begin(), last = m_maxFileSizes.value().end(); iter != last; ++iter) { @@ -101,6 +107,12 @@ StatusCode AthenaPoolCnvSvc::initialize() { return(StatusCode::SUCCESS); } //______________________________________________________________________________ +StatusCode AthenaPoolCnvSvc::io_reinit() { + ATH_MSG_DEBUG("I/O reinitialization..."); + m_contextAttr.clear(); + return(StatusCode::SUCCESS); +} +//______________________________________________________________________________ StatusCode AthenaPoolCnvSvc::finalize() { // Release AthenaSerializeSvc if (!m_serializeSvc.empty()) { @@ -137,6 +149,11 @@ StatusCode AthenaPoolCnvSvc::finalize() { m_cnvs.shrink_to_fit(); return(StatusCode::SUCCESS); } +//______________________________________________________________________________ +StatusCode AthenaPoolCnvSvc::io_finalize() { + ATH_MSG_DEBUG("I/O finalization..."); + return(StatusCode::SUCCESS); +} //_______________________________________________________________________ StatusCode AthenaPoolCnvSvc::queryInterface(const InterfaceID& riid, void** ppvInterface) { if (IAthenaPoolCnvSvc::interfaceID().versionMatch(riid)) { @@ -266,7 +283,10 @@ StatusCode AthenaPoolCnvSvc::connectOutput(const std::string& outputConnectionSp return(StatusCode::FAILURE); } if (m_makeStreamingToolClient.value() > 0 && !m_outputStreamingTool.empty() && !m_outputStreamingTool[0]->isServer() && !m_outputStreamingTool[0]->isClient()) { - m_outputStreamingTool[0]->makeClient(m_makeStreamingToolClient.value()).ignore(); + if (!makeClient(m_makeStreamingToolClient.value()).isSuccess()) { + ATH_MSG_ERROR("Could not make AthenaPoolCnvSvc a Share Client"); + return(StatusCode::FAILURE); + } } if (!m_outputStreamingTool.empty() && m_outputStreamingTool[0]->isClient() && (!m_streamMetaDataOnly || outputConnectionSpec.find("[PoolContainerPrefix=" + m_metadataContainerProp.value() + "]") != std::string::npos)) { @@ -320,8 +340,22 @@ StatusCode AthenaPoolCnvSvc::connectOutput(const std::string& outputConnectionSp const std::string& opt = (*iter)[0]; std::string data = (*iter)[1]; const std::string& file = (*iter)[2]; - if (opt == "TREE_AUTO_FLUSH" && data != "int" && data != "DbLonglong" && data != "double" && data != "string") { - m_fileFlushSetting[file] = atoi(data.c_str()); + const std::string& cont = (*iter)[3]; + std::size_t colon = m_containerPrefixProp.value().find(":"); + if (colon == std::string::npos) colon = 0; // Used to remove leading technology + else colon++; + std::size_t equal = cont.find("="); // Used to remove leading "TTree=" + if (equal == std::string::npos) equal = 0; + else equal++; + if (opt == "TREE_AUTO_FLUSH" && cont.substr(equal) == m_containerPrefixProp.value().substr(colon) && data != "int" && data != "DbLonglong" && data != "double" && data != "string") { + int flush = atoi(data.c_str()); + if (flush < m_numberEventsPerWrite.value()) { + flush = flush * (int((m_numberEventsPerWrite.value() - 1) / flush) + 1); + } + if (flush > 0) { + ATH_MSG_DEBUG("connectOutput setting auto write for: " << file << " to " << flush << " events"); + m_fileFlushSetting[file] = flush; + } } } } @@ -670,7 +704,10 @@ Token* AthenaPoolCnvSvc::registerForWrite(Placement* placement, const void* obj, m_chronoStatSvc->chronoStart("cRepR_ALL"); } if (m_makeStreamingToolClient.value() > 0 && !m_outputStreamingTool.empty() && !m_outputStreamingTool[0]->isServer() && !m_outputStreamingTool[0]->isClient()) { - m_outputStreamingTool[0]->makeClient(m_makeStreamingToolClient.value()).ignore(); + if (!makeClient(m_makeStreamingToolClient.value()).isSuccess()) { + ATH_MSG_ERROR("Could not make AthenaPoolCnvSvc a Share Client"); + return(nullptr); + } } Token* token = nullptr; if (!m_outputStreamingTool.empty() && m_outputStreamingTool[0]->isClient() diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.h b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.h index 8212f1a69e1e1b5d7ce48c002695cb3100b501e8..0f1420668e6e27af0d182b31ae22990cc9c5603f 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.h +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.h @@ -12,15 +12,17 @@ #include "AthenaPoolCnvSvc/IAthenaPoolCnvSvc.h" +#include "GaudiKernel/IChronoStatSvc.h" #include "GaudiKernel/IIncidentListener.h" +#include "GaudiKernel/IIoComponent.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" + #include "StorageSvc/DbType.h" #include "AthenaBaseComps/AthCnvSvc.h" #include "AthenaKernel/IAthenaIPCTool.h" -#include "GaudiKernel/IChronoStatSvc.h" -#include "PoolSvc/IPoolSvc.h" #include "AthenaKernel/IClassIDSvc.h" +#include "PoolSvc/IPoolSvc.h" #include <vector> #include <map> @@ -37,7 +39,8 @@ template <class TYPE> class SvcFactory; **/ class ATLAS_CHECK_THREAD_SAFETY AthenaPoolCnvSvc : public ::AthCnvSvc, public virtual IAthenaPoolCnvSvc, - public virtual IIncidentListener { + public virtual IIncidentListener, + public virtual IIoComponent { // Allow the factory class access to the constructor friend class SvcFactory<AthenaPoolCnvSvc>; @@ -45,8 +48,10 @@ public: /// Required of all Gaudi Services StatusCode initialize(); + StatusCode io_reinit(); /// Required of all Gaudi Services StatusCode finalize(); + StatusCode io_finalize(); /// Required of all Gaudi services: see Gaudi documentation for details StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface); @@ -187,8 +192,6 @@ private: // data ToolHandleArray<IAthenaIPCTool> m_outputStreamingTool; //The following doesn't work because of Gaudi issue #122 //ToolHandleArray<IAthenaIPCTool> m_outputStreamingTool{this,"OutputStreamingTool", {} }; - IntegerProperty m_makeStreamingToolClient{this,"MakeStreamingToolClient",0}; - BooleanProperty m_streamMetaDataOnly{this,"StreamMetaDataOnly",false}; std::size_t m_streamServer=0; int m_metadataClient=0; @@ -241,8 +244,15 @@ private: // properties /// bool to activate the chrono stats, depending on the m_skipFirstChronoCommit data member bool m_doChronoStat=true; - /// For SharedWriter to use MetadataSvc to merge data placed in a certain container + /// For SharedWriter: + /// To use MetadataSvc to merge data placed in a certain container StringProperty m_metadataContainerProp{this,"OutputMetadataContainer",""}; + /// Make this instance a Streaming Client during first connect/write automatically + IntegerProperty m_makeStreamingToolClient{this,"MakeStreamingToolClient",0}; + /// Use Athena Object sharing for metadata only, event data is collected and send via ROOT TMemFile + BooleanProperty m_streamMetaDataOnly{this,"StreamMetaDataOnly",false}; + /// When using TMemFile call Write on number of Events, respecting CollectionTree auto_flush + IntegerProperty m_numberEventsPerWrite{this,"NumberEventsPerWrite",10}; }; #endif diff --git a/Database/AthenaPOOL/PoolSvc/CMakeLists.txt b/Database/AthenaPOOL/PoolSvc/CMakeLists.txt index 140900a73ad9a93da028be034ad043af4d78b99c..3dd1d70b2a5b33f558f8ba72a42e44aefcbe84d5 100644 --- a/Database/AthenaPOOL/PoolSvc/CMakeLists.txt +++ b/Database/AthenaPOOL/PoolSvc/CMakeLists.txt @@ -10,7 +10,7 @@ find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) atlas_add_library( PoolSvcLib INTERFACE PUBLIC_HEADERS PoolSvc - LINK_LIBRARIES GaudiKernel CollectionBase PersistencySvc DataModelRoot ) + LINK_LIBRARIES GaudiKernel CollectionBase PersistencySvc DataModelRoot CxxUtils ) # Component(s) in the package: atlas_add_component( PoolSvc diff --git a/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h b/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h index ae024f6888657e6b569b974ab58a66181f1b9427..477f74db55115b4cf8e59c7842a99fde51fab068 100644 --- a/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h +++ b/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef POOLSVC_IPOOLSVC_H @@ -14,6 +14,7 @@ #include "CollectionBase/ICollection.h" #include "PersistencySvc/ITransaction.h" #include "DataModelRoot/RootType.h" +#include "CxxUtils/checker_macros.h" #include <string> @@ -92,7 +93,8 @@ public: // Non-static members /// @param collectionName [IN] string containing the persistent name of the collection. /// @param openMode [IN] ICollection open mode of the collection. /// @param contextId [IN] id for PoolSvc persistency service to use for input. - virtual pool::ICollection* createCollection(const std::string& collectionType, + virtual pool::ICollection* createCollection ATLAS_NOT_THREAD_SAFE + (const std::string& collectionType, const std::string& connection, const std::string& collectionName, const pool::ICollection::OpenMode& openMode = pool::ICollection::READ, @@ -102,7 +104,7 @@ public: // Non-static members /// @param c [IN] collection to be registered /// @param overwrite [IN] whether to overwrite /// @param sharedCat [IN] whether to use same catalog as data - virtual void registerExistingCollection(pool::ICollection* c, bool overwrite, bool sharedCat = true) = 0; + virtual void registerExistingCollection ATLAS_NOT_THREAD_SAFE (pool::ICollection* c, bool overwrite, bool sharedCat = true) = 0; /// @return a token for a container entry. /// @param connection [IN] string containing the connection/file name. diff --git a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx index 4ccd4b01123d3422a3c5220178af77b763c32ad6..e525cb142b89a68aebbef52ada8ee94c0ee7d661 100644 --- a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx +++ b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx @@ -426,7 +426,8 @@ void PoolSvc::renamePfn(const std::string& pf, const std::string& newpf) const { m_catalog->renamePFN(pf, newpf); } //__________________________________________________________________________ -pool::ICollection* PoolSvc::createCollection(const std::string& collectionType, +pool::ICollection* PoolSvc::createCollection ATLAS_NOT_THREAD_SAFE + (const std::string& collectionType, const std::string& connection, const std::string& collectionName, const pool::ICollection::OpenMode& openMode, @@ -531,7 +532,9 @@ pool::ICollection* PoolSvc::createCollection(const std::string& collectionType, return(collPtr); } //__________________________________________________________________________ -void PoolSvc::registerExistingCollection(pool::ICollection* coll, bool overwrite, bool sharedCat) { +void PoolSvc::registerExistingCollection ATLAS_NOT_THREAD_SAFE + (pool::ICollection* coll, bool overwrite, bool sharedCat) +{ std::lock_guard<CallMutex> lock(m_pool_mut); m_catalog->commit(); pool::CollectionFactory* collFac = pool::CollectionFactory::get(); diff --git a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h index ff7e581c9d1f4a550e4a1c155bc2cb15f16b814e..aad4e1a7e14c61c04af4023cd2430867ae071651 100644 --- a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h +++ b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h @@ -98,7 +98,8 @@ public: // Non-static members /// @param collectionName [IN] string containing the persistent name of the collection. /// @param openMode [IN] ICollection open mode of the collection. /// @param contextId [IN] id for PoolSvc persistency service to use for input. - pool::ICollection* createCollection(const std::string& collectionType, + pool::ICollection* createCollection ATLAS_NOT_THREAD_SAFE + (const std::string& collectionType, const std::string& connection, const std::string& collectionName, const pool::ICollection::OpenMode& openMode = pool::ICollection::READ, @@ -108,7 +109,7 @@ public: // Non-static members /// @param c [IN] collection to be registered /// @param overwrite [IN] whether to overwrite /// @param sharedCat [IN] whether to use same catalog as data - void registerExistingCollection(pool::ICollection* c, bool overwrite, bool sharedCat = true); + void registerExistingCollection ATLAS_NOT_THREAD_SAFE (pool::ICollection* c, bool overwrite, bool sharedCat = true); /// @return a token for a container entry. /// @param connection [IN] string containing the connection/file name. diff --git a/DetectorDescription/DetDescrCond/DetDescrCondTools/src/CoolStrFileSvc.h b/DetectorDescription/DetDescrCond/DetDescrCondTools/src/CoolStrFileSvc.h index 58c6b29333b58ead4f55e6999a803366d4a38afb..1e00121c625dfea93a5ea8e427530fea756f0057 100755 --- a/DetectorDescription/DetDescrCond/DetDescrCondTools/src/CoolStrFileSvc.h +++ b/DetectorDescription/DetDescrCond/DetDescrCondTools/src/CoolStrFileSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef DETDESCRCONDTOOLS_COOLSTRFILESVC_H @@ -10,7 +10,7 @@ #include "DetDescrCondTools/ICoolStrFileSvc.h" #include "AthenaBaseComps/AthService.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" class CoolStrFileSvc : public virtual ICoolStrFileSvc, public virtual AthService { template <class TYPE> class SvcFactory; diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx index 78c92b83a5f9fcc09de090a9eb824e3199968c31..83bd068fcfbbc1d7100dcb7937a9c3489c4c311e 100755 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx @@ -10,7 +10,6 @@ #include "GeoModelKernel/GeoElement.h" #include "GeoModelKernel/Units.h" -#include "StoreGate/StoreGate.h" #include "StoreGate/DataHandle.h" #include "RDBAccessSvc/IRDBAccessSvc.h" diff --git a/DetectorDescription/IdDictDetDescrCnv/src/AtlasIDDetDescrCnv.cxx b/DetectorDescription/IdDictDetDescrCnv/src/AtlasIDDetDescrCnv.cxx index 3478bbe27512ab7030bb2d36f8305ae213e6b52b..b2b6cedbe943300fce0078a86aea070d28842a93 100755 --- a/DetectorDescription/IdDictDetDescrCnv/src/AtlasIDDetDescrCnv.cxx +++ b/DetectorDescription/IdDictDetDescrCnv/src/AtlasIDDetDescrCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -17,8 +17,8 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" #include "AthenaKernel/StorableConversions.h" +#include "StoreGate/StoreGateSvc.h" #include "IdDictDetDescr/IdDictManager.h" #include "AtlasDetDescr/AtlasDetectorID.h" @@ -122,7 +122,7 @@ AtlasIDDetDescrCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) } else {} // Get the dictionary manager from the detector store - const DataHandle<IdDictManager> idDictMgr; + const IdDictManager* idDictMgr; status = detStore->retrieve(idDictMgr, "IdDict"); if (status.isFailure()) { log << MSG::FATAL << "Could not get IdDictManager !" << endmsg; diff --git a/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx b/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx index 74a87ea9b43620fb67c00a2dedc423b48b4a3381..2ad3d0bb4a21bcda303604487574cfda81167d4b 100755 --- a/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx +++ b/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -26,7 +26,6 @@ #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" #include "AthenaKernel/StorableConversions.h" diff --git a/DetectorDescription/RegionSelector/python/RegSelToolConfig.py b/DetectorDescription/RegionSelector/python/RegSelToolConfig.py index 8ed2f0a3b34d4f9c8acb85aa96c528dbac3dbf3f..738b154e955711e3c795788acc9bdecda235798d 100644 --- a/DetectorDescription/RegionSelector/python/RegSelToolConfig.py +++ b/DetectorDescription/RegionSelector/python/RegSelToolConfig.py @@ -26,8 +26,10 @@ def _createRegSelCondAlg( detector, CondAlgConstructor ): if detector == "Pixel": condAlg.DetEleCollKey = "PixelDetectorElementCollection" + condAlg.PixelCablingCondData = "PixelCablingCondData" elif detector == "SCT": condAlg.DetEleCollKey = "SCT_DetectorElementCollection" + condAlg.SCT_CablingData = "SCT_CablingData" return condAlg def _createRegSelTool( detector, enable ): diff --git a/DetectorDescription/RegionSelector/src/RegSelTool.cxx b/DetectorDescription/RegionSelector/src/RegSelTool.cxx index 2c5ab3d331046966f6c9b954bb98520ba40c7353..0189fd718bb25143feb57b34dd8c2c79d219d103 100644 --- a/DetectorDescription/RegionSelector/src/RegSelTool.cxx +++ b/DetectorDescription/RegionSelector/src/RegSelTool.cxx @@ -43,11 +43,11 @@ const IRegSelLUT* RegSelTool::lookup() const { StatusCode RegSelTool::initialize() { - ATH_CHECK( m_tableKey.initialize() ); ATH_MSG_DEBUG( "Initialising RegSelTool " << name() << "\ttable: " << m_tableKey ); if ( !m_initialised ) { ATH_MSG_WARNING( "Lookup table will not be initialised " << name() << "\tkey " << m_tableKey ); } + ATH_CHECK( m_tableKey.initialize(m_initialised) ); if ( name().find( "RPC") != std::string::npos ) m_rpcflag = true; return StatusCode::SUCCESS; } diff --git a/Event/ByteStreamCnvSvc/src/ByteStreamCnvSvc.cxx b/Event/ByteStreamCnvSvc/src/ByteStreamCnvSvc.cxx index c3182d8eeb70865350c39ef83b78ef3d0a169ddc..fc5836a7b3904dcc2ab60a12bc27b57cb2650a7b 100644 --- a/Event/ByteStreamCnvSvc/src/ByteStreamCnvSvc.cxx +++ b/Event/ByteStreamCnvSvc/src/ByteStreamCnvSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ByteStreamCnvSvc/ByteStreamCnvSvc.h" @@ -7,7 +7,6 @@ #include "ByteStreamCnvSvcBase/FullEventAssembler.h" #include "ByteStreamCnvSvcBase/ByteStreamAddress.h" -#include "StoreGate/StoreGate.h" #include "xAODEventInfo/EventInfo.h" #include "xAODTrigger/TrigDecision.h" diff --git a/Event/ByteStreamCnvSvc/src/ByteStreamMergeOutputSvc.cxx b/Event/ByteStreamCnvSvc/src/ByteStreamMergeOutputSvc.cxx index 8148846ca32e7789aee19c833bebc5f2b59aa756..506706b4da22bbc88cf972f3e324b2fb9fd77e15 100644 --- a/Event/ByteStreamCnvSvc/src/ByteStreamMergeOutputSvc.cxx +++ b/Event/ByteStreamCnvSvc/src/ByteStreamMergeOutputSvc.cxx @@ -5,8 +5,6 @@ #include "ByteStreamMergeOutputSvc.h" #include "ByteStreamData/ByteStream.h" -#include "StoreGate/StoreGate.h" - #include "GaudiKernel/GenericAddress.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ISvcLocator.h" diff --git a/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.cxx b/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.cxx index 413376e18750ecd976ea1f266709ee57a3047a43..8ecff3c9a53f9860fa21a8c9c69b9ef96dc0339c 100644 --- a/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.cxx +++ b/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.cxx @@ -16,7 +16,6 @@ #include "AthenaKernel/IAthenaIPCTool.h" #include "EventInfo/EventInfo.h" -#include "StoreGate/StoreGate.h" // EventInfoAttributeList includes #include "AthenaPoolUtilities/AthenaAttributeList.h" diff --git a/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/ATLAS_CHECK_THREAD_SAFETY b/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..dbac30c32c93e16d5307b1ad170ea52496ea75d9 --- /dev/null +++ b/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Event/ByteStreamCnvSvcLegacy diff --git a/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_EventStorage/v5_DataWriter.h b/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_EventStorage/v5_DataWriter.h index 705d5240f931832a34eb9734062a2d9aa7bde89a..0d11bd1199cbfb093892309431a9f5ddabd875f7 100644 --- a/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_EventStorage/v5_DataWriter.h +++ b/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_EventStorage/v5_DataWriter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @@ -44,7 +44,8 @@ namespace offline_EventStorage_v5 { class DataWriter : boost::noncopyable { public: - + using iovec_const = offline_EventStorage_v5::iovec_const; + /** constructor with metadata strings \param writingPath directory where to write data @@ -111,7 +112,7 @@ private: EventStorage::DWError putData_implementation(const unsigned int& entries, - const struct iovec * my_iovec, + const iovec_const * my_iovec, uint32_t& sizeToDisk, bool precompressed = false); @@ -191,7 +192,7 @@ public: \param locations of the data chunks */ EventStorage::DWError putPrecompressedData(const unsigned int& entries, - const struct iovec* my_iovec); + const iovec_const* my_iovec); /** @@ -224,7 +225,7 @@ public: \param my_iovec locations of the data chunks \param &sizeToDisk will be update with the actual chunck size on disk */ - EventStorage::DWError putData(const unsigned int& entries, const struct iovec* my_iovec, + EventStorage::DWError putData(const unsigned int& entries, const iovec_const* my_iovec, uint32_t& sizeToDisk); diff --git a/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_EventStorage/v5_EventStorageRecords.h b/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_EventStorage/v5_EventStorageRecords.h index fcb50b7ee9eccc6d7a93e80ac181b1eb850b5972..98b13ba81dacfdb9df4ebe834284f7e3877154a7 100644 --- a/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_EventStorage/v5_EventStorageRecords.h +++ b/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_EventStorage/v5_EventStorageRecords.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @@ -32,6 +32,12 @@ namespace offline_EventStorage_v5 { + struct iovec_const + { + const void* iov_base; + size_t iov_len; + }; + enum CompressionType { NONE, RESERVED, UNKNOWN, ZLIB}; struct file_start_record diff --git a/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_eformat/old/util.h b/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_eformat/old/util.h index 439acee834e739f14b24ade740f9d3e4ebc915dc..721f501b3f99fa1d2ade59c3f6ca71ef41c96e1c 100644 --- a/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_eformat/old/util.h +++ b/Event/ByteStreamCnvSvcLegacy/ByteStreamCnvSvcLegacy/offline_eformat/old/util.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef BYTESTREAMCNVSVC_OFFLINE_EFORMAT_OLD_UTIL_H @@ -39,7 +39,6 @@ namespace old { uint32_t convert_to_40(const uint32_t* src, uint32_t* dest, uint32_t max, eformat::CheckSum event_checksum = eformat::NO_CHECKSUM, eformat::CheckSum rob_checksum = eformat::NO_CHECKSUM); - }} // namespace offline_eformat::old #endif // BYTESTREAMCNVSVC_OFFLINE_EFORMAT_OLD_UTIL_H diff --git a/Event/ByteStreamCnvSvcLegacy/CMakeLists.txt b/Event/ByteStreamCnvSvcLegacy/CMakeLists.txt index 775000f22bbc8684cd26e7e4c3efdf39aeb1cc04..3c7f6ba094eedf0ed7ffca554aeb454c8799046e 100644 --- a/Event/ByteStreamCnvSvcLegacy/CMakeLists.txt +++ b/Event/ByteStreamCnvSvcLegacy/CMakeLists.txt @@ -19,5 +19,5 @@ atlas_add_library( ByteStreamCnvSvcLegacy INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${UUID_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/src/offline_EventStorage - LINK_LIBRARIES ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} + LINK_LIBRARIES CxxUtils ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} PRIVATE_LINK_LIBRARIES ${UUID_LIBRARIES} ${ZLIB_LIBRARIES} ) diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_DataWriter.cxx b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_DataWriter.cxx index a0c4d613be0d4d4ef8cb1cf336353010cf41d721..7fbbf10362e668adc55fc4f74700a6da4f8368d1 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_DataWriter.cxx +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_DataWriter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include <time.h> @@ -214,16 +214,16 @@ void DataWriter::date_timeAsInt(uint32_t &getDate, uint32_t &getTime) const long a_time; time(&a_time); - struct tm* t; - t = localtime( &a_time); + struct tm t; + localtime_r( &a_time, &t); - getDate= 1000000*t->tm_mday+ - 10000*(1+t->tm_mon)+ - 1900+t->tm_year; + getDate= 1000000*t.tm_mday+ + 10000*(1+t.tm_mon)+ + 1900+t.tm_year; - getTime= 10000*t->tm_hour+ - 100*t->tm_min+ - t->tm_sec ; + getTime= 10000*t.tm_hour+ + 100*t.tm_min+ + t.tm_sec ; } @@ -278,8 +278,8 @@ DWError DataWriter::putData(const unsigned int& dataSize, const void *event) { uint32_t todisk; - struct iovec iov; - iov.iov_base = const_cast<void *>(event); + iovec_const iov; + iov.iov_base = event; iov.iov_len = dataSize; return this->putData(1, &iov, todisk); } @@ -293,13 +293,13 @@ DWError DataWriter::putData(const unsigned int& entries, const struct iovec * my DWError DataWriter::putData(const unsigned int& dataSize, const void *event, uint32_t& sizeToDisk){ - struct iovec iov; - iov.iov_base = const_cast<void *>(event); + iovec_const iov; + iov.iov_base = event; iov.iov_len = dataSize; return this->putData(1, &iov, sizeToDisk); } -DWError DataWriter::putData(const unsigned int& entries, const struct iovec * my_iovec, uint32_t& sizeToDisk){ +DWError DataWriter::putData(const unsigned int& entries, const iovec_const * my_iovec, uint32_t& sizeToDisk){ return this->putData_implementation(entries, my_iovec, sizeToDisk); } @@ -307,22 +307,22 @@ DWError DataWriter::putData(const unsigned int& entries, const struct iovec * my DWError DataWriter::putPrecompressedData(const unsigned int& dataSize, const void *event){ - struct iovec iov; - iov.iov_base = const_cast<void *>(event); + iovec_const iov; + iov.iov_base = event; iov.iov_len = dataSize; return this->putPrecompressedData(1, &iov); } DWError DataWriter::putPrecompressedData(const unsigned int& entries, - const struct iovec* my_iovec){ + const iovec_const* my_iovec){ uint32_t todisk; return this->putData_implementation(entries, my_iovec, todisk, true); } -DWError DataWriter::putData_implementation(const unsigned int& entries, const struct iovec * my_iovec, uint32_t& sizeToDisk, bool precompressed){ +DWError DataWriter::putData_implementation(const unsigned int& entries, const iovec_const * my_iovec, uint32_t& sizeToDisk, bool precompressed){ ERS_DEBUG(3,"DataWriter::putData called for an iovec."); if(!m_cFileOpen) openNextFile(); @@ -644,8 +644,8 @@ bool DataWriter::inTransition() const { void DataWriter::file_record(void *ri, const void *pi) { - uint32_t *record = (uint32_t *)ri; - uint32_t *pattern = (uint32_t *)pi; + uint32_t *record = reinterpret_cast<uint32_t *>(ri); + const uint32_t *pattern = reinterpret_cast<const uint32_t *>(pi); int size=pattern[1]; for(int i=0; i<size; i++) { diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_ESCompression.cxx b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_ESCompression.cxx index 0f7e42007c46a6253628eb4f13015ed1c750433c..244d1e61470642d4914213504ff36900d722b403 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_ESCompression.cxx +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_ESCompression.cxx @@ -1,8 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ +#define ZLIB_CONST #include "v5_ESCompression.h" #include "zlib.h" #include <string.h> @@ -62,7 +63,7 @@ namespace offline_EventStorage_v5{ void offline_EventStorage_v5::zlibcompress(offline_EventStorage_v5::CompressionBuffer& compressed, uint32_t& compressedsize, const uint32_t& entries, - const struct iovec* iov, + const struct iovec_const* iov, const uint32_t& totalsize, const uint32_t& level){ @@ -89,7 +90,7 @@ void offline_EventStorage_v5::zlibcompress(offline_EventStorage_v5::CompressionB for (unsigned int i=0; i < entries; ++i) { - strm.next_in = static_cast<Bytef*>(iov[i].iov_base); + strm.next_in = static_cast<const Bytef*>(iov[i].iov_base); strm.avail_in = iov[i].iov_len; int flush = ((i+1)==entries) ? Z_FINISH : Z_NO_FLUSH; diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_ESCompression.h b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_ESCompression.h index b544cc48b6cd9b44526d55d7c3e028ab27040c0d..36d8eb17e7108a2b7e9628b8621258a0620d45af 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_ESCompression.h +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_ESCompression.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -43,6 +43,8 @@ namespace offline_EventStorage_v5 { class CompressionBuffer{ public: + using iovec_const = offline_EventStorage_v5::iovec_const; + virtual ~CompressionBuffer() {}; /** @@ -103,7 +105,7 @@ namespace offline_EventStorage_v5 { void zlibcompress(CompressionBuffer& compressed, uint32_t& compressedsize, const uint32_t& entries, - const struct iovec* iov, + const struct iovec_const* iov, const uint32_t& totalsize, const uint32_t& level); diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_EventStorageRecords.cxx b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_EventStorageRecords.cxx index dcda26234279d54e08000813f8cc14cbd2124c68..da491b0215d1680f785ded77e51cca844562012e 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_EventStorageRecords.cxx +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_EventStorageRecords.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // @@ -14,8 +14,8 @@ std::string offline_EventStorage_v5::string_record(void *ri, const void *pi) { std::ostringstream s; - uint32_t *record = (uint32_t *)ri; - uint32_t *pattern = (uint32_t *)pi; + uint32_t *record = reinterpret_cast<uint32_t *>(ri); + const uint32_t *pattern = reinterpret_cast<const uint32_t *>(pi); int size=pattern[1]; for(int i=0; i<size; i++) { @@ -55,8 +55,8 @@ std::string offline_EventStorage_v5::string_record(offline_EventStorage_v5::file void offline_EventStorage_v5::reset_record(void *ri, const void *pi) { - uint32_t *record = (uint32_t *)ri; - uint32_t *pattern = (uint32_t *)pi; + uint32_t *record = reinterpret_cast<uint32_t *>(ri); + const uint32_t *pattern = reinterpret_cast<const uint32_t *>(pi); int size=pattern[1]; for(int i=0; i<size; i++) record[i] = pattern[i]; diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_Guid.cxx b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_Guid.cxx index 57a29e3d6090f3a2b2a77b8cb13c770aa84cb7d7..8b4e4c8077521c93ce3014b6bb566742bf0eb685 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_Guid.cxx +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_EventStorage/v5_Guid.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // ==================================================================== @@ -21,7 +21,7 @@ #include "uuid/uuid.h" -static const char* fmt_Guid = +static const char* const fmt_Guid = "%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX"; //{ 0x0,0x0,0x0,{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; @@ -50,7 +50,8 @@ void offline_poolCopy_v5::Guid::create(Guid& guid) { const std::string offline_poolCopy_v5::Guid::toString() const { char text[128]; ::snprintf(text, 128, fmt_Guid, - Data1, Data2, Data3, + static_cast<long unsigned int>(Data1), + Data2, Data3, Data4[0], Data4[1], Data4[2], Data4[3], Data4[4], Data4[5], Data4[6], Data4[7]); return text; @@ -62,8 +63,10 @@ const offline_poolCopy_v5::Guid& offline_poolCopy_v5::Guid::fromString(const std // integer or short. Hence one has to reserve a bit more space // otherwise the stack gets corrupted. unsigned char d[8]; - ::sscanf( source.c_str(), fmt_Guid, &Data1, &Data2, &Data3, + long unsigned int xData1; + ::sscanf( source.c_str(), fmt_Guid, &xData1, &Data2, &Data3, &Data4[0], &Data4[1], &Data4[2], &Data4[3], &d[0], &d[1], &d[2], &d[3]); + Data1 = xData1; //*(int*)&Data4[4] = *(int*)d; ::memcpy(Data4+4, d, 4); return *this; diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/util.cxx b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/util.cxx index d6a8bc68474127d9c5191fa25c24af6ab2c545a9..2240c1fe95217379321008491ae8062749c34c90 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/util.cxx +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/util.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ByteStreamCnvSvcLegacy/offline_eformat/old/util.h" diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_FullEventFragment.cxx b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_FullEventFragment.cxx index cbdbac2115a011e2b28650df2dd14e1b4cc9a925..d1de0cdb539c6e98f23a3dcc3064a4b69429e2e5 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_FullEventFragment.cxx +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_FullEventFragment.cxx @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -111,45 +111,10 @@ offline_eformat::v40_write::FullEventFragment::FullEventFragment () initialize(); } -offline_eformat::v40_write::FullEventFragment::FullEventFragment - (const offline_eformat::v40_write::FullEventFragment& other) -{ - *this = other; -} - offline_eformat::v40_write::FullEventFragment::~FullEventFragment() { } -offline_eformat::v40_write::FullEventFragment& - offline_eformat::v40_write::FullEventFragment::operator= -(const offline_eformat::v40_write::FullEventFragment& other) -{ - if (this != &other) { - initialize(); - copy_header(other); - //copy extra payload attached - if (other.m_node[10].size_word) { - m_node[9].next = &m_node[10]; - set(m_node[10], other.m_node[10].base, other.m_node[10].size_word, 0); - } - //copy the ROBFragments attached - for (const v40_write::ROBFragment* - it = other.m_child; it; it = it->next()) - append(const_cast<v40_write::ROBFragment*>(it)); - //get the unchecked ROB fragments attached - if (m_n_unchecked) { - m_n_unchecked = other.m_n_unchecked; - for (uint32_t i=0; i < m_n_unchecked; ++i) { - set(m_unchecked[i], other.m_unchecked[i].base, - other.m_unchecked[i].size_word, &m_unchecked[i+1]); - } - m_unchecked[m_n_unchecked-1].next = 0; - } - } - return *this; -} - void offline_eformat::v40_write::FullEventFragment::copy_header(const uint32_t* other) { v40::FullEventFragment read(other); @@ -210,7 +175,10 @@ void offline_eformat::v40_write::FullEventFragment::status m_node[1].size_word = m_node[0].base[5] = n; //set new values m_node[0].base[1] += n; m_node[0].base[2] += n; - m_node[1].base = const_cast<uint32_t*>(status); + // FIXME: I'm assuming that these are ok. + // Probably can't avoid this as long as we're using node_t from eformat. + uint32_t* status_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(status); + m_node[1].base = status_nc; } void offline_eformat::v40_write::FullEventFragment::lvl1_trigger_info @@ -221,7 +189,10 @@ void offline_eformat::v40_write::FullEventFragment::lvl1_trigger_info m_node[3].size_word = m_node[2].base[10] = n; //set new values m_node[0].base[1] += n; //fragment size m_node[0].base[2] += n; //header size - m_node[3].base = const_cast<uint32_t*>(data); + // FIXME: I'm assuming that these are ok. + // Probably can't avoid this as long as we're using node_t from eformat. + uint32_t* data_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(data); + m_node[3].base = data_nc; } void offline_eformat::v40_write::FullEventFragment::lvl2_trigger_info @@ -232,7 +203,10 @@ void offline_eformat::v40_write::FullEventFragment::lvl1_trigger_info m_node[5].size_word = m_node[4].base[0] = n; //set new values m_node[0].base[1] += n; //fragment size m_node[0].base[2] += n; //header size - m_node[5].base = const_cast<uint32_t*>(data); + // FIXME: I'm assuming that these are ok. + // Probably can't avoid this as long as we're using node_t from eformat. + uint32_t* data_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(data); + m_node[5].base = data_nc; } void offline_eformat::v40_write::FullEventFragment::event_filter_info @@ -243,7 +217,10 @@ void offline_eformat::v40_write::FullEventFragment::event_filter_info m_node[7].size_word = m_node[6].base[0] = n; //set new values m_node[0].base[1] += n; //fragment size m_node[0].base[2] += n; //header size - m_node[7].base = const_cast<uint32_t*>(data); + // FIXME: I'm assuming that these are ok. + // Probably can't avoid this as long as we're using node_t from eformat. + uint32_t* data_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(data); + m_node[7].base = data_nc; } void offline_eformat::v40_write::FullEventFragment::stream_tag @@ -254,7 +231,10 @@ void offline_eformat::v40_write::FullEventFragment::stream_tag m_node[9].size_word = m_node[8].base[0] = n; //set new values m_node[0].base[1] += n; //fragment size m_node[0].base[2] += n; //header size - m_node[9].base = const_cast<uint32_t*>(data); + // FIXME: I'm assuming that these are ok. + // Probably can't avoid this as long as we're using node_t from eformat. + uint32_t* data_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(data); + m_node[9].base = data_nc; } void offline_eformat::v40_write::FullEventFragment::append @@ -299,9 +279,8 @@ offline_eformat::v40_write::FullEventFragment::bind (void) last->next = 0; //potentially remove old checksum //iterate over the attached children - for (v40_write::ROBFragment* curr = m_child; curr; - curr = const_cast<v40_write::ROBFragment*>(curr->next())) { - last->next = const_cast<eformat::write::node_t*>(curr->bind()); + for (v40_write::ROBFragment* curr = m_child; curr; curr = curr->next()) { + last->next = curr->bind(); while (last->next) last = last->next; //advance until end } diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_FullEventFragment.h b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_FullEventFragment.h index 000dc21952061601d5e83192c93cda395360c3b4..f7ffa3d0595cb3534b3dce16d478dc9f4b392bca 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_FullEventFragment.h +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_FullEventFragment.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -19,6 +19,7 @@ #define OFFLINE_EFORMAT_V40_WRITE_FULLEVENTFRAGMENT_H #include "v40_write_ROBFragment.h" +#include "CxxUtils/checker_macros.h" #include <cstring> namespace offline_eformat { @@ -34,8 +35,8 @@ namespace offline_eformat { /** * Defines a helper class to aid the creation of FullEvent fragments. */ - class FullEventFragment { - + class FullEventFragment + { public: /** @@ -74,37 +75,14 @@ namespace offline_eformat { */ FullEventFragment (); - /** - * Copy constructor. This will only copy the meta data, not the fragment - * relationships and block-data (children and status block) contained in - * the to-be-copied fragment. If you wish this fragment to have the same - * children of the copied fragment, you have to do this operation - * manually, after copying. If you wish to make a copy of the status as - * well, do it manually and then assign it to this fragment using the - * status() method. - * - * @param other The other fragment to take the meta data from. - */ - FullEventFragment (const FullEventFragment& other); + FullEventFragment (const FullEventFragment& other) = delete; + FullEventFragment& operator= (const FullEventFragment& other) = delete; /** * Base destructor */ virtual ~FullEventFragment (); - /** - * Assigment operator. This will only copy the meta data, not the - * fragment relationships and block-data (children and parent and status - * block) contained in the to-be-copied fragment. If you wish this - * fragment has the same parents, and children of the copied fragment, - * you have to do this operation manually, after copying. If you wish to - * make a copy of the status as well, do it manually and then assign it - * to this fragment using the status() method. - * - * @param other The other fragment to take the meta data from. - */ - FullEventFragment& operator= (const FullEventFragment& other); - /** * Copies the header (meta data information) from another existing * FullEvent Fragment. Please note that this will not copy any specificy diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_ROBFragment.cxx b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_ROBFragment.cxx index b6b9fc783593d6966eff2110be3e4e328fb93c70..e0c7ddca6fa1c738f3c49da02f0f161b96faf95d 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_ROBFragment.cxx +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_ROBFragment.cxx @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -22,6 +22,7 @@ #include "eformat/Status.h" #include "eformat/Issue.h" #include "eformat/checksum.h" +#include "CxxUtils/checker_macros.h" #include <cstring> static const unsigned int ROB_HEADER = 0; @@ -279,7 +280,10 @@ void offline_eformat::v40_write::ROBFragment::status (uint32_t n, const uint32_t m_node[ROB_STATUS].size_word = m_node[ROB_HEADER].base[5] = n; //set new values m_node[ROB_HEADER].base[1] += n; m_node[ROB_HEADER].base[2] += n; - m_node[ROB_STATUS].base = const_cast<uint32_t*>(status); + // FIXME: I'm assuming that these are ok. + // Probably can't avoid this as long as we're using node_t from eformat. + uint32_t* status_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(status); + m_node[ROB_STATUS].base = status_nc; } void offline_eformat::v40_write::ROBFragment::rod_status (uint32_t n, @@ -290,7 +294,10 @@ void offline_eformat::v40_write::ROBFragment::rod_status (uint32_t n, m_node[ROB_HEADER].base[1] -= m_node[ROD_TRAILER].base[0]; //remove count from previous status m_node[ROD_STATUS].size_word = m_node[ROD_TRAILER].base[0] = n; //set new values m_node[ROB_HEADER].base[1] += n; //set ROB header's total fragment size - m_node[ROD_STATUS].base = const_cast<uint32_t*>(status); + // FIXME: I'm assuming that these are ok. + // Probably can't avoid this as long as we're using node_t from eformat. + uint32_t* status_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(status); + m_node[ROD_STATUS].base = status_nc; } void offline_eformat::v40_write::ROBFragment::status_position (uint32_t v) @@ -318,7 +325,10 @@ void offline_eformat::v40_write::ROBFragment::rod_data (uint32_t n, const uint32 m_node[ROB_HEADER].base[1] -= m_node[ROD_TRAILER].base[1]; m_node[ROD_DATA].size_word = m_node[ROD_TRAILER].base[1] = n; //set new values m_node[ROB_HEADER].base[1] += n; //set ROB header's total fragment size back - m_node[ROD_DATA].base = const_cast<uint32_t*>(data); + // FIXME: I'm assuming that these are ok. + // Probably can't avoid this as long as we're using node_t from eformat. + uint32_t* data_nc ATLAS_THREAD_SAFE = const_cast<uint32_t*>(data); + m_node[ROD_DATA].base = data_nc; } void offline_eformat::v40_write::ROBFragment::checksum_type(uint32_t s) @@ -345,7 +355,7 @@ const eformat::write::node_t* offline_eformat::v40_write::ROBFragment::rod_bind( return &m_node[ROD_HEADER]; } -const eformat::write::node_t* offline_eformat::v40_write::ROBFragment::bind(void) +eformat::write::node_t* offline_eformat::v40_write::ROBFragment::bind(void) { m_node[ROD_TRAILER].next = 0; //cuts off the checksum word m_node[ROB_CHECKSUM].next = 0; //cuts off relation ships with other fragments diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_ROBFragment.h b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_ROBFragment.h index e23d51443ec231b85621587bf78493a94f753cfb..5cf633233123fc1cfe36617d73f3dd229df53fde 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_ROBFragment.h +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v40_write_ROBFragment.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -20,6 +20,7 @@ #include "eformat/write/node.h" #include "eformat/Version.h" +#include "CxxUtils/checker_macros.h" namespace offline_eformat { @@ -30,8 +31,8 @@ namespace offline_eformat { /** * Defines a helper class to aid the creation of ROB fragments. */ - class ROBFragment { - + class ROBFragment + { public: /** @@ -477,7 +478,7 @@ namespace offline_eformat { * Outputs a concatenation of eformat::write::node making up a list with * the contents of this ROB fragment. */ - const eformat::write::node_t* bind (void); + eformat::write::node_t* bind (void); /** * Outputs a concatenation of eformat::write::node making up a list with @@ -503,12 +504,13 @@ namespace offline_eformat { * * @param n The sibling following this fragment */ - inline void next (const ROBFragment* n) { m_next = n; } + inline void next (ROBFragment* n) { m_next = n; } /** * Returns the next sibling */ inline const ROBFragment* next (void) const { return m_next; } + inline ROBFragment* next (void) { return m_next; } private: //to make the code simpler @@ -526,7 +528,7 @@ namespace offline_eformat { uint32_t m_checksum; ///< The ROB trailer eformat::write::node_t m_node[8]; ///< Node representation v40_write::FullEventFragment* m_parent; ///< My parent - const v40_write::ROBFragment* m_next; ///< Next sibling + v40_write::ROBFragment* m_next; ///< Next sibling }; diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v50_util.cxx b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v50_util.cxx index 3c6ae7953469c04d156e5ddc002389371c278d69..11415ac1352f61971f66c8e8fa14564f5b1e7559 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v50_util.cxx +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v50_util.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include <algorithm> @@ -42,6 +42,7 @@ namespace v50 { uint32_t convert_to_40(const uint32_t* src, uint32_t* dest, uint32_t max, eformat::CheckSum event_checksum, eformat::CheckSum rob_checksum) + { // this has to do the opposite of what eformat::v40::convert // is doing (for current = v50). diff --git a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v50_util.h b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v50_util.h index 7ee6868f802f3e83953255d30596d17c982ea129..8520b5c050c68f8374a95f90601921f911413cf0 100644 --- a/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v50_util.h +++ b/Event/ByteStreamCnvSvcLegacy/src/offline_eformat/old/v50_util.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef BYTESTREAMCNVSVC_OFFLINE_EFORMAT_OLD_V50_UTIL_H @@ -22,7 +22,6 @@ namespace v50 { uint32_t convert_to_40(const uint32_t* src, uint32_t* dest, uint32_t max, eformat::CheckSum event_checksum=eformat::NO_CHECKSUM, eformat::CheckSum rob_checksum=eformat::NO_CHECKSUM); - }} // namespace offline_eformat::V50 #endif // BYTESTREAMCNVSVC_EFORMAT_OLD_V50_UTIL_H diff --git a/Event/EventBookkeeperTools/src/FillEBCFromFlat.h b/Event/EventBookkeeperTools/src/FillEBCFromFlat.h index b8c5a275e5084498d6f3e497c2ba5866c4f8b354..468a67c6379823bb6b0251df898eff43bc75c357 100644 --- a/Event/EventBookkeeperTools/src/FillEBCFromFlat.h +++ b/Event/EventBookkeeperTools/src/FillEBCFromFlat.h @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef FILL_EBC_FROM_FLAT_H #define FILL_EBC_FROM_FLAT_H #include "GaudiKernel/ServiceHandle.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "SGTools/StlVectorClids.h" #include "SGTools/BuiltinsClids.h" diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/InnerDetectorOverlay_jobOptions.py b/Event/EventOverlay/EventOverlayJobTransforms/share/InnerDetectorOverlay_jobOptions.py index a080d7b9f4e808c1df6dbac9ab07f3e10eb5ad8e..b3ecdd3c5a42ea61a1756278f32fa651fce138a4 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/InnerDetectorOverlay_jobOptions.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/InnerDetectorOverlay_jobOptions.py @@ -96,6 +96,9 @@ if DetFlags.overlay.pixel_on() or DetFlags.overlay.SCT_on() or DetFlags.overlay. job.InDetTRTRawDataProvider.RDOKey = overlayFlags.dataStore()+"+TRT_RDOs" #ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "TRT_RDO_Container/TRT_RDOs" ] + from RegionSelector.RegSelToolConfig import makeRegSelTool_TRT + InDetTRTRawDataProvider.RegSelTool = makeRegSelTool_TRT() + #from IOVDbSvc.CondDB import conddb #conddb.addFolder("TRT","/TRT/Calib/T0","<tag>TrtCalibt0-UPD2-FDR2-01</tag>") #conddb.addFolder("TRT","/TRT/Calib/RT","<tag>TrtCalibRt-UPD2-FDR2-01</tag>") diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/OverlayOutputItemList_jobOptions.py b/Event/EventOverlay/EventOverlayJobTransforms/share/OverlayOutputItemList_jobOptions.py index 7f9aedb6c5e2521a5d10ad68eccb8cf05a2a7167..69d059da43246f8a4409fa1a3f792b3dc171a829 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/OverlayOutputItemList_jobOptions.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/OverlayOutputItemList_jobOptions.py @@ -52,9 +52,10 @@ if DetFlags.overlay.Truth_on(): if DetFlags.overlay.pixel_on(): outStream.ItemList += ["PixelRDO_Container#*"] - outStream.ItemList += ["IDCInDetBSErrContainer#*"] + outStream.ItemList += ["IDCInDetBSErrContainer#PixelByteStreamErrs"] if DetFlags.overlay.SCT_on(): outStream.ItemList += ["SCT_RDO_Container#*"] + outStream.ItemList += ["IDCInDetBSErrContainer#SCT_ByteStreamErrs"] if DetFlags.overlay.TRT_on(): outStream.ItemList += ["TRT_RDO_Container#*"] outStream.ItemList += ["TRT_BSIdErrContainer#*"] diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/OverlayOutput_jobOptions.py b/Event/EventOverlay/EventOverlayJobTransforms/share/OverlayOutput_jobOptions.py index c237b24552db5497f96accd6c481d1137cc7d376..e6115496c7f8de3e8de772eea7763ee2fba7a46b 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/OverlayOutput_jobOptions.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/OverlayOutput_jobOptions.py @@ -42,6 +42,8 @@ if DetFlags.overlay.Truth_on(): if DetFlags.overlay.SCT_on(): outStream.ItemList += ['InDetSimDataCollection#SCT_SDO_Map'] + if overlayFlags.isDataOverlay(): + outStream.ItemList += [ 'IDCInDetBSErrContainer#SCT_ByteStreamErrs' ] if DetFlags.overlay.TRT_on(): outStream.ItemList += [ 'InDetSimDataCollection#TRT_SDO_Map' ] diff --git a/Event/PyDumper/python/Dumpers.py b/Event/PyDumper/python/Dumpers.py index 53450f2afc932f7cbc52e8ef1495090b209bd7a1..3d2a63c20c3b4503e2407a81da1db11c57c39212 100644 --- a/Event/PyDumper/python/Dumpers.py +++ b/Event/PyDumper/python/Dumpers.py @@ -4668,7 +4668,10 @@ def format_float_vector(v): return ''.join ([format_float(x) for x in v]) def format_el(x): if x.isDefaultIndex(): return '(null)' - return '%s[%d]' % (x.dataID(), x.index()) + key = x.dataID() + if not key: + key = '(%d)' % x.key() + return '%s[%d]' % (key, x.index()) char_accessor_ = getattr (ROOT, 'SG::AuxElement::ConstAccessor<char>') class char_accessor: def __init__ (self, name): diff --git a/Event/xAOD/xAODAssociationsAthenaPool/CMakeLists.txt b/Event/xAOD/xAODAssociationsAthenaPool/CMakeLists.txt index d8e535d0bca7f20b79e5a95923020b2754f7b98a..5c66be090653edf996705ed849f42c431355bb39 100644 --- a/Event/xAOD/xAODAssociationsAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODAssociationsAthenaPool/CMakeLists.txt @@ -1,29 +1,12 @@ -################################################################################ -# Package: xAODAssociationsAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODAssociationsAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Control/AthContainers - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODAssociations - Event/xAOD/xAODCaloEvent - Event/xAOD/xAODTracking ) - -# External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODAssociationsAthenaPoolPoolCnv src/*.cxx FILES xAODAssociations/TrackParticleClusterAssociationContainer.h xAODAssociations/TrackParticleClusterAssociationAuxContainer.h TYPES_WITH_NAMESPACE xAOD::TrackParticleClusterAssociationContainer xAOD::TrackParticleClusterAssociationAuxContainer CNV_PFX xAOD - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthenaKernel AthenaPoolCnvSvcLib AthenaPoolUtilities xAODAssociations xAODCaloEvent xAODTracking ) - + LINK_LIBRARIES AthenaPoolCnvSvcLib xAODAssociations ) diff --git a/Event/xAOD/xAODBPhys/CMakeLists.txt b/Event/xAOD/xAODBPhys/CMakeLists.txt index 22379b569ea3ec3408a0c4086f2e09e796832010..127e26aa78a503f002a02d850d2f125b03e546ca 100644 --- a/Event/xAOD/xAODBPhys/CMakeLists.txt +++ b/Event/xAOD/xAODBPhys/CMakeLists.txt @@ -1,37 +1,15 @@ -# -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# $Id: CMakeLists.txt 805745 2017-05-31 17:23:48Z wwalko $ -# -# Build configuration for the package. -# -#******************************************** -# The name of the package: +# Declare the package name: atlas_subdir( xAODBPhys ) -# Package dependencies: -atlas_depends_on_subdirs( - PUBLIC - Event/xAOD/xAODTracking - Event/xAOD/xAODMuon - Event/xAOD/xAODMetaData - Event/xAOD/xAODEgamma - PRIVATE - ) - # Used external(s): find_package( ROOT COMPONENTS Core Physics Matrix ) # Build the main library of the package: atlas_add_library( xAODBPhysLib - xAODBPhys/*.h Root/*.cxx src/*.cxx - PUBLIC_HEADERS xAODBPhys - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} - xAODTracking - xAODMuon - xAODEgamma - xAODMetaData - ) - + xAODBPhys/*.h Root/*.cxx src/*.cxx + PUBLIC_HEADERS xAODBPhys + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} xAODEgamma xAODMetaData xAODMuon xAODTracking + PRIVATE_LINK_LIBRARIES AthContainers ) diff --git a/Event/xAOD/xAODBTaggingAthenaPool/CMakeLists.txt b/Event/xAOD/xAODBTaggingAthenaPool/CMakeLists.txt index e01129fb9662193fbc6ef6a7c3d8300408fa97c1..e853c21f147b804848f99732212d4ea5c2e4681b 100644 --- a/Event/xAOD/xAODBTaggingAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODBTaggingAthenaPool/CMakeLists.txt @@ -30,7 +30,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( XAODBTAGGINGATHENAPOOL_REFERENCE_TAG - xAODBTaggingAthenaPoolReference-01-00-00 ) + xAODBTaggingAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODBTaggingAthenaPool_21.0.79 AOD-21.0.79-full REQUIRED_LIBRARIES xAODBTaggingAthenaPoolPoolCnv REFERENCE_TAG ${XAODBTAGGINGATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODBTaggingCnv/CMakeLists.txt b/Event/xAOD/xAODBTaggingCnv/CMakeLists.txt index 0b0a965c15201f0723f6ab56ffa17fcd8a784c68..25eb186e01d8adeee6b4d3514b8b996cabc8b971 100644 --- a/Event/xAOD/xAODBTaggingCnv/CMakeLists.txt +++ b/Event/xAOD/xAODBTaggingCnv/CMakeLists.txt @@ -1,29 +1,16 @@ -################################################################################ -# Package: xAODBTaggingCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODBTaggingCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Event/xAOD/xAODBTagging - PRIVATE - Control/AthenaBaseComps - Control/AthenaKernel - GaudiKernel - Trigger/TrigEvent/TrigParticle ) - atlas_add_library( xAODBTaggingCnvLib xAODBTaggingCnv/*.h INTERFACE PUBLIC_HEADERS xAODBTaggingCnv LINK_LIBRARIES GaudiKernel xAODBTagging ) - # Component(s) in the package: atlas_add_component( xAODBTaggingCnv src/*.cxx src/components/*.cxx LINK_LIBRARIES xAODBTaggingCnvLib xAODBTagging AthenaBaseComps AthenaKernel GaudiKernel TrigParticle ) - diff --git a/Event/xAOD/xAODCaloEventAthenaPool/CMakeLists.txt b/Event/xAOD/xAODCaloEventAthenaPool/CMakeLists.txt index c3c36b50ad8d91a09e57325a18d7565016337f6a..701b8380bb57f227f3cc1187a56665b589e1e7a1 100644 --- a/Event/xAOD/xAODCaloEventAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODCaloEventAthenaPool/CMakeLists.txt @@ -25,7 +25,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( XAODCALOEVENTATHENAPOOL_REFERENCE_TAG - xAODCaloEventAthenaPoolReference-01-00-00 ) + xAODCaloEventAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODCaloEventAthenaPool_20.1.7.2 AOD-20.1.7.2-full REQUIRED_LIBRARIES xAODCaloEventAthenaPoolPoolCnv REFERENCE_TAG ${XAODCALOEVENTATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt b/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt index f9e353c36dac77d64b04beccbb68244212029089..11d631f92f478b3b6d93489673de2e094f2d486b 100644 --- a/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt +++ b/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt @@ -1,25 +1,8 @@ -################################################################################ -# Package: xAODCaloEventCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODCaloEventCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Event/xAOD/xAODCaloEvent - PRIVATE - AtlasTest/TestTools - Calorimeter/CaloEvent - Control/AthenaBaseComps - Control/AthenaKernel - Event/EventKernel - GaudiKernel ) - -# External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - - # Component(s) in the package: atlas_add_library( xAODCaloEventCnvLib xAODCaloEventCnv/*.h @@ -31,8 +14,7 @@ atlas_add_library( xAODCaloEventCnvLib atlas_add_component( xAODCaloEventCnv src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} xAODCaloEventCnvLib xAODCaloEvent CaloEvent AthenaBaseComps AthenaKernel EventKernel GaudiKernel ) + LINK_LIBRARIES xAODCaloEventCnvLib xAODCaloEvent CaloEvent AthenaBaseComps AthenaKernel GaudiKernel ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/Event/xAOD/xAODCnvInterfaces/CMakeLists.txt b/Event/xAOD/xAODCnvInterfaces/CMakeLists.txt index 8564104a202655bbec4de021c829b20730fa9b80..72863cae61b802301ef777aba3b6cf1035be1bf0 100644 --- a/Event/xAOD/xAODCnvInterfaces/CMakeLists.txt +++ b/Event/xAOD/xAODCnvInterfaces/CMakeLists.txt @@ -1,14 +1,8 @@ -################################################################################ -# Package: xAODCnvInterfaces -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODCnvInterfaces ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - GaudiKernel ) - # Component(s) in the package: atlas_add_library( xAODCnvInterfaces PUBLIC_HEADERS xAODCnvInterfaces diff --git a/Event/xAOD/xAODCoreAthenaPool/CMakeLists.txt b/Event/xAOD/xAODCoreAthenaPool/CMakeLists.txt index 3b84a08b33f6313d4ae72c233bf73b40b3d59ff4..400a9823e47b37012c1c82eb6b63891b0f11d30c 100644 --- a/Event/xAOD/xAODCoreAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODCoreAthenaPool/CMakeLists.txt @@ -1,20 +1,8 @@ -# $Id: CMakeLists.txt 769660 2016-08-23 15:51:19Z krasznaa $ -################################################################################ -# Package: xAODCoreAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODCoreAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PRIVATE - Control/AthContainers - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODCore ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODCoreAthenaPoolPoolCnv src/*.cxx @@ -23,5 +11,4 @@ atlas_add_poolcnv_library( xAODCoreAthenaPoolPoolCnv TYPES_WITH_NAMESPACE xAOD::AuxInfoBase xAOD::AuxContainerBase xAOD::ShallowAuxContainer xAOD::ShallowAuxInfo CNV_PFX xAOD - LINK_LIBRARIES AthContainers AthenaKernel AthenaPoolCnvSvcLib - AthenaPoolUtilities xAODCore ) + LINK_LIBRARIES AthContainers AthenaKernel AthenaPoolCnvSvcLib xAODCore ) diff --git a/Event/xAOD/xAODCutFlowAthenaPool/CMakeLists.txt b/Event/xAOD/xAODCutFlowAthenaPool/CMakeLists.txt index db6958fcbcf42493b6b47924d092e817b1312398..d9c7076aca6d2a18c5b2e5e68cc34434b9af9e09 100644 --- a/Event/xAOD/xAODCutFlowAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODCutFlowAthenaPool/CMakeLists.txt @@ -1,18 +1,8 @@ -################################################################################ -# Package: xAODCutFlowAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODCutFlowAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Control/AthContainers - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODCutFlow ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODCutFlowAthenaPoolPoolCnv src/*.cxx diff --git a/Event/xAOD/xAODEgammaCnv/CMakeLists.txt b/Event/xAOD/xAODEgammaCnv/CMakeLists.txt index b49dc176ad89883a7f8e018a5aed3d986cffb3d5..4f240116163a5f96c6001e8f7fb386db744e1360 100644 --- a/Event/xAOD/xAODEgammaCnv/CMakeLists.txt +++ b/Event/xAOD/xAODEgammaCnv/CMakeLists.txt @@ -1,25 +1,8 @@ -################################################################################ -# Package: xAODEgammaCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODEgammaCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthContainers - Event/xAOD/xAODEgamma - GaudiKernel - PRIVATE - Control/AthenaBaseComps - Control/AthenaKernel - Event/FourMom - Event/xAOD/xAODTracking - Event/xAOD/xAODTruth - PhysicsAnalysis/AnalysisCommon/ParticleEvent - Reconstruction/Particle - Reconstruction/egamma/egammaEvent ) - # Component(s) in the package: atlas_add_library( xAODEgammaCnvLib xAODEgammaCnv/*.h diff --git a/Event/xAOD/xAODEventFormatAthenaPool/CMakeLists.txt b/Event/xAOD/xAODEventFormatAthenaPool/CMakeLists.txt index 6f4931291178213799c2f7c53108edaef9fbf3c5..37216a7264b70234f26de547cc4f8e98c27c5161 100644 --- a/Event/xAOD/xAODEventFormatAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODEventFormatAthenaPool/CMakeLists.txt @@ -1,16 +1,8 @@ -################################################################################ -# Package: xAODEventFormatAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODEventFormatAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODEventFormat ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODEventFormatAthenaPoolPoolCnv src/*.cxx diff --git a/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt b/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt index b488fbda41a57d2a3b031d51d638142078b91e9f..c24bb3a933b705edf077e0657323800a86ba8f61 100644 --- a/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt +++ b/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt @@ -34,7 +34,6 @@ atlas_add_library( xAODEventFormatCnvTestLib xAODEventFormat PRIVATE_LINK_LIBRARIES AthenaBaseComps StoreGateLib ) - atlas_add_poolcnv_library( xAODEventFormatCnvTestAthenaPoolCnv src/test/cnv/*.h src/test/cnv/*.cxx FILES @@ -65,14 +64,9 @@ atlas_add_xaod_smart_pointer_dicts( OUTPUT _selectionFile CONTAINERS "xAODMakerTest::AVec_v1" ) - # Install files from the package. atlas_install_joboptions( share/*.py ) -atlas_depends_on_subdirs( - PUBLIC - PRIVATE AtlasTest/TestTools ) - # Test(s) in the package. atlas_add_test( Write SCRIPT athena.py --threads=8 xAODEventFormatCnv/EventFormatWriteTestJobOptions.py ) diff --git a/Event/xAOD/xAODForwardAthenaPool/CMakeLists.txt b/Event/xAOD/xAODForwardAthenaPool/CMakeLists.txt index 911634a1081a57d632bd5f33fbc4be5681114231..8f4bb12e817738d734c8e5dec45e5100472fb528 100644 --- a/Event/xAOD/xAODForwardAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODForwardAthenaPool/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: xAODForwardAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODForwardAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PRIVATE - Control/AthContainers - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODForward ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODForwardAthenaPoolPoolCnv src/*.h src/*.cxx diff --git a/Event/xAOD/xAODForwardCnv/CMakeLists.txt b/Event/xAOD/xAODForwardCnv/CMakeLists.txt index 15e2400edb81b5c24489f9ba1c17a4365cd4f28a..1fe8dff71a3adb85f4ce985fd778546cbf0aad78 100644 --- a/Event/xAOD/xAODForwardCnv/CMakeLists.txt +++ b/Event/xAOD/xAODForwardCnv/CMakeLists.txt @@ -1,28 +1,21 @@ -################################################################################ -# Package: xAODForwardCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODForwardCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Event/xAOD/xAODForward - GaudiKernel - TileCalorimeter/TileEvent - TileCalorimeter/TileIdentifier - PRIVATE - Control/AthenaBaseComps - Control/AthenaKernel ) - # Component(s) in the package: +atlas_add_library( xAODForwardCnvLib + xAODForwardCnv/*.h + INTERFACE + PUBLIC_HEADERS xAODForwardCnv + LINK_LIBRARIES GaudiKernel TileEvent xAODForward ) + atlas_add_component( xAODForwardCnv src/*.cxx src/components/*.cxx - LINK_LIBRARIES xAODForward GaudiKernel TileEvent TileIdentifier AthenaBaseComps AthenaKernel ) + LINK_LIBRARIES xAODForward GaudiKernel TileEvent TileIdentifier AthenaBaseComps AthenaKernel xAODForwardCnvLib ) # Install files from the package: -atlas_install_headers( xAODForwardCnv ) atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) diff --git a/Event/xAOD/xAODHIEventAthenaPool/CMakeLists.txt b/Event/xAOD/xAODHIEventAthenaPool/CMakeLists.txt index 0da0001ff3c47366ac49f2e95d03919bb7d07c1c..d1b086f02d6393db7156990688ce8fc06b0a97fb 100644 --- a/Event/xAOD/xAODHIEventAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODHIEventAthenaPool/CMakeLists.txt @@ -1,18 +1,8 @@ -################################################################################ -# Package: xAODHIEventAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODHIEventAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Control/AthContainers - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODHIEvent ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODHIEventAthenaPoolPoolCnv src/*.cxx diff --git a/Event/xAOD/xAODJetAthenaPool/CMakeLists.txt b/Event/xAOD/xAODJetAthenaPool/CMakeLists.txt index 7a5dfccdf97f61daa45891af5ed3709d8bec0d87..858f93903e82c94cb7dd265ef41d340bb6765845 100644 --- a/Event/xAOD/xAODJetAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODJetAthenaPool/CMakeLists.txt @@ -33,7 +33,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND AND NOT SIMULATIONBASE AND NOT GENERATIONBASE ) set( XAODJETATHENAPOOL_REFERENCE_TAG - xAODJetAthenaPoolReference-01-00-00 ) + xAODJetAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODJetAthenaPool_20.7.2.2 AOD-20.7.2.2-full REQUIRED_LIBRARIES xAODJetAthenaPoolPoolCnv REFERENCE_TAG ${XAODJETATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODJetCnv/CMakeLists.txt b/Event/xAOD/xAODJetCnv/CMakeLists.txt index ebe42202f99268948a68dd4a93b6caea76a25e7c..f03c03e7cb032bc17be34cf68f77f1ea264a74a5 100644 --- a/Event/xAOD/xAODJetCnv/CMakeLists.txt +++ b/Event/xAOD/xAODJetCnv/CMakeLists.txt @@ -1,29 +1,14 @@ -################################################################################ -# Package: xAODJetCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODJetCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthLinks - Event/xAOD/xAODBase - Event/xAOD/xAODJet - GaudiKernel - PRIVATE - Control/AthenaBaseComps - Control/AthenaKernel - Control/StoreGate - Reconstruction/Jet/JetEvent ) - atlas_add_library( xAODJetCnvLib xAODJetCnv/*.h INTERFACE PUBLIC_HEADERS xAODJetCnv LINK_LIBRARIES GaudiKernel xAODJet xAODBase AthLinks ) - # Component(s) in the package: atlas_add_component( xAODJetCnv src/*.cxx diff --git a/Event/xAOD/xAODLuminosityAthenaPool/CMakeLists.txt b/Event/xAOD/xAODLuminosityAthenaPool/CMakeLists.txt index 87319204976a6f9bc502dd76446a7026db6a4528..5e5ddd8633cb03fc4a079846326fe736e2ba3c32 100644 --- a/Event/xAOD/xAODLuminosityAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODLuminosityAthenaPool/CMakeLists.txt @@ -1,16 +1,8 @@ -################################################################################ -# Package: xAODLuminosityAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODLuminosityAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODLuminosity ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODLuminosityAthenaPoolPoolCnv src/*.cxx diff --git a/Event/xAOD/xAODMetaDataAthenaPool/CMakeLists.txt b/Event/xAOD/xAODMetaDataAthenaPool/CMakeLists.txt index 909a743fe509f141905057029675371be200f20a..399ee39794c1ec5422576883a8c2972b11847a28 100644 --- a/Event/xAOD/xAODMetaDataAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODMetaDataAthenaPool/CMakeLists.txt @@ -1,16 +1,8 @@ -################################################################################ -# Package: xAODMetaDataAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODMetaDataAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODMetaData ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODMetaDataAthenaPoolPoolCnv src/*.cxx diff --git a/Event/xAOD/xAODMetaDataCnv/CMakeLists.txt b/Event/xAOD/xAODMetaDataCnv/CMakeLists.txt index 480b16fc6a00810e009fc78a6b7453b530c16dc3..101270ff9e4d0529a4e38a003a1cb2f1257a9251 100644 --- a/Event/xAOD/xAODMetaDataCnv/CMakeLists.txt +++ b/Event/xAOD/xAODMetaDataCnv/CMakeLists.txt @@ -1,31 +1,8 @@ -# $Id: CMakeLists.txt 744578 2016-05-03 16:26:20Z krasznaa $ -################################################################################ -# Package: xAODMetaDataCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODMetaDataCnv ) -# Extra dependencies, based on the environment that we're in: -if( NOT XAOD_STANDALONE ) - set( - extra_deps - GaudiKernel - PRIVATE - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolUtilities - Event/EventInfo - ) -endif() - -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthToolSupport/AsgTools - Event/xAOD/xAODMetaData - ${extra_deps} -) - # Build the package differently in standalone and Athena modes: if( XAOD_STANDALONE ) diff --git a/Event/xAOD/xAODMissingETAthenaPool/CMakeLists.txt b/Event/xAOD/xAODMissingETAthenaPool/CMakeLists.txt index fe3fdf7cc08a89595ab5a6804ac87d9a5dc1fd95..013441b1eaa9dadf4e82fbcbd6b349cdb96fc67a 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODMissingETAthenaPool/CMakeLists.txt @@ -3,15 +3,6 @@ # Declare the package name: atlas_subdir( xAODMissingETAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Control/AthContainers - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODMissingET - GaudiKernel ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODMissingETAthenaPoolPoolCnv src/*.h src/*.cxx @@ -38,7 +29,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( XAODMISSINGETATHENAPOOL_REFERENCE_TAG - xAODMissingETAthenaPoolReference-01-00-00 ) + xAODMissingETAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODMissingETAthenaPool_20.1.7.2 AOD-20.1.7.2-full REQUIRED_LIBRARIES xAODMissingETAthenaPoolPoolCnv REFERENCE_TAG ${XAODMISSINGETATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODMissingETCnv/CMakeLists.txt b/Event/xAOD/xAODMissingETCnv/CMakeLists.txt index 25061b5122e926d913e32bc3cbb1ccfaa45fc857..11aa6b3fefc831b24f8e9b988677cc565af945b2 100644 --- a/Event/xAOD/xAODMissingETCnv/CMakeLists.txt +++ b/Event/xAOD/xAODMissingETCnv/CMakeLists.txt @@ -1,18 +1,8 @@ -################################################################################ -# Package: xAODMissingETCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODMissingETCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Event/xAOD/xAODMissingET - GaudiKernel - PRIVATE - Control/AthenaBaseComps - Reconstruction/MissingETEvent ) - # Component(s) in the package: atlas_add_component( xAODMissingETCnv src/*.cxx diff --git a/Event/xAOD/xAODMuonAthenaPool/CMakeLists.txt b/Event/xAOD/xAODMuonAthenaPool/CMakeLists.txt index 9f8c6efb5d9ed05c23271172224351ea8da8609f..87ed5a797fe303d79e2c30cc6099cf2acf24012f 100644 --- a/Event/xAOD/xAODMuonAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODMuonAthenaPool/CMakeLists.txt @@ -29,7 +29,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( XAODMUONATHENAPOOL_REFERENCE_TAG - xAODMuonAthenaPoolReference-01-00-00 ) + xAODMuonAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODMuonAthenaPool_master-20190911 AOD-master-20190911-full REQUIRED_LIBRARIES xAODMuonAthenaPoolPoolCnv REFERENCE_TAG ${XAODMUONATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODPFlowAthenaPool/CMakeLists.txt b/Event/xAOD/xAODPFlowAthenaPool/CMakeLists.txt index 85541f56d980c41bed69da42e261c155991cdf7f..06f62fa46bd293422a2c8f5bf0fdc398dba46d1e 100644 --- a/Event/xAOD/xAODPFlowAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODPFlowAthenaPool/CMakeLists.txt @@ -28,7 +28,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( XAODPFLOWATHENAPOOL_REFERENCE_TAG - xAODPFlowAthenaPoolReference-01-00-00 ) + xAODPFlowAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODPFlowAthenaPool_21.0.79 AOD-21.0.79-full REQUIRED_LIBRARIES xAODPFlowAthenaPoolPoolCnv REFERENCE_TAG ${XAODPFLOWATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODTauAthenaPool/CMakeLists.txt b/Event/xAOD/xAODTauAthenaPool/CMakeLists.txt index 1bcfccae9acaada1b84a8f406d50d6e50f5cab18..3b1b0bb386cd2c8369b5ee7c8447e54be3737cf2 100644 --- a/Event/xAOD/xAODTauAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODTauAthenaPool/CMakeLists.txt @@ -24,7 +24,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( XAODTAUATHENAPOOL_REFERENCE_TAG - xAODTauAthenaPoolReference-01-00-00 ) + xAODTauAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODTauAthenaPool_20.1.7.2 AOD-20.1.7.2-full REQUIRED_LIBRARIES xAODTauAthenaPoolPoolCnv REFERENCE_TAG ${XAODTAUATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODTauCnv/CMakeLists.txt b/Event/xAOD/xAODTauCnv/CMakeLists.txt index bd43c731e295bcda4f8035a8d0f6f5dd7ae4505c..370af6d8d802f48af3e99b5a539dc6ec8ff00c9e 100644 --- a/Event/xAOD/xAODTauCnv/CMakeLists.txt +++ b/Event/xAOD/xAODTauCnv/CMakeLists.txt @@ -1,28 +1,14 @@ -################################################################################ -# Package: xAODTauCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODTauCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthContainers - Event/xAOD/xAODTau - Reconstruction/tauEvent - PRIVATE - Control/AthenaBaseComps - Control/AthenaKernel - GaudiKernel - ) - atlas_add_library( xAODTauCnvLib xAODTauCnv/*.h INTERFACE PUBLIC_HEADERS xAODTauCnv LINK_LIBRARIES GaudiKernel AthContainers xAODTau tauEvent ) - # Component(s) in the package: atlas_add_component( xAODTauCnv src/*.cxx diff --git a/Event/xAOD/xAODTrackingAthenaPool/CMakeLists.txt b/Event/xAOD/xAODTrackingAthenaPool/CMakeLists.txt index 9065fdacc9dff32bf18285387bc9fd6c49aae3ff..37a2b654c08a557261b2e0691c6877294808222f 100644 --- a/Event/xAOD/xAODTrackingAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODTrackingAthenaPool/CMakeLists.txt @@ -41,7 +41,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( XAODTRACKINGATHENAPOOL_REFERENCE_TAG - xAODTrackingAthenaPoolReference-02-00-00 ) + xAODTrackingAthenaPoolReference-02-01-00 ) run_tpcnv_legacy_test( xAODTrackingAthenaPool_20.1.7.2 AOD-20.1.7.2-full REQUIRED_LIBRARIES xAODTrackingAthenaPoolPoolCnv REFERENCE_TAG ${XAODTRACKINGATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODTrackingCnv/CMakeLists.txt b/Event/xAOD/xAODTrackingCnv/CMakeLists.txt index df9daef57bca7a4d9fc79189be3360217dcffd59..d48e57d6c758d15465cab18ea560221a7686d01b 100644 --- a/Event/xAOD/xAODTrackingCnv/CMakeLists.txt +++ b/Event/xAOD/xAODTrackingCnv/CMakeLists.txt @@ -1,33 +1,8 @@ -# $Id: CMakeLists.txt 789457 2016-12-13 12:00:43Z krasznaa $ -################################################################################ -# Package: xAODTrackingCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODTrackingCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - GaudiKernel - Event/xAOD/xAODTracking - Tracking/TrkEvent/TrkTrack - PRIVATE - Control/AthenaBaseComps - Control/AthenaKernel - Event/EventPrimitives - Event/xAOD/xAODCore - Generators/GeneratorObjects - PhysicsAnalysis/MCTruthClassifier - Reconstruction/Particle - Reconstruction/ParticleTruth - Tracking/TrkEvent/TrkLinks - Tracking/TrkEvent/TrkParticleBase - Tracking/TrkEvent/TrkTrackLink - Tracking/TrkEvent/TrkTruthData - Tracking/TrkEvent/VxVertex - Tracking/TrkTools/TrkToolInterfaces ) - # Component(s) in the package: atlas_add_library( xAODTrackingCnvLib xAODTrackingCnv/*.h diff --git a/Event/xAOD/xAODTrigEgammaAthenaPool/CMakeLists.txt b/Event/xAOD/xAODTrigEgammaAthenaPool/CMakeLists.txt index 10343f69b37e0c3f69d8b3d3ad3edad5350d0802..a3dc5ff8be66bd15f54ac5fe3db8159eb616a2f3 100644 --- a/Event/xAOD/xAODTrigEgammaAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODTrigEgammaAthenaPool/CMakeLists.txt @@ -29,7 +29,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( XAODTRIGEGAMMAATHENAPOOL_REFERENCE_TAG - xAODTrigEgammaAthenaPoolReference-01-00-00 ) + xAODTrigEgammaAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODTrigEgammaAthenaPool_21.0.79 AOD-21.0.79-full REQUIRED_LIBRARIES xAODTrigEgammaAthenaPoolPoolCnv REFERENCE_TAG ${XAODTRIGEGAMMAATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODTrigMuonAthenaPool/CMakeLists.txt b/Event/xAOD/xAODTrigMuonAthenaPool/CMakeLists.txt index 1b50fc8e47e3916f231074628c05f61fd850ff20..3042eb2ebab8815ee675445fbe6598405299335a 100644 --- a/Event/xAOD/xAODTrigMuonAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODTrigMuonAthenaPool/CMakeLists.txt @@ -30,7 +30,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( XAODTRIGMONATHENAPOOL_REFERENCE_TAG - xAODTrigMuonAthenaPoolReference-01-00-01 ) + xAODTrigMuonAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODTrigMuonAthenaPool_20.1.7.2 AOD-20.1.7.2-full REQUIRED_LIBRARIES xAODTrigMuonAthenaPoolPoolCnv REFERENCE_TAG ${XAODTRIGMONATHENAPOOL_REFERENCE_TAG} ) diff --git a/Event/xAOD/xAODTruthAthenaPool/CMakeLists.txt b/Event/xAOD/xAODTruthAthenaPool/CMakeLists.txt index 4a44804a30360aadf8a65ff44497cc41d576775d..3455fb87b36d2f8278444b71af58c471294e940b 100644 --- a/Event/xAOD/xAODTruthAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODTruthAthenaPool/CMakeLists.txt @@ -35,7 +35,7 @@ find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND AND NOT SIMULATIONBASE AND NOT GENERATIONBASE ) set( XAODTRUTHATHENAPOOL_REFERENCE_TAG - xAODTruthAthenaPoolReference-01-00-00 ) + xAODTruthAthenaPoolReference-01-01-00 ) run_tpcnv_legacy_test( xAODTruthAthenaPool_21.0.79 AOD-21.0.79-full REQUIRED_LIBRARIES xAODTruthAthenaPoolPoolCnv REFERENCE_TAG ${XAODTRUTHATHENAPOOL_REFERENCE_TAG} ) diff --git a/ForwardDetectors/ForwardIdCnv/src/ZdcIDDetDescrCnv.cxx b/ForwardDetectors/ForwardIdCnv/src/ZdcIDDetDescrCnv.cxx index 090c74254638dd4af42279dafca4eca2a93682c3..721e66a00593c49063eb91ef4e29e7fa04fc73d0 100644 --- a/ForwardDetectors/ForwardIdCnv/src/ZdcIDDetDescrCnv.cxx +++ b/ForwardDetectors/ForwardIdCnv/src/ZdcIDDetDescrCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -16,8 +16,8 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" +#include "StoreGate/StoreGateSvc.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" #include "IdDictDetDescr/IdDictManager.h" #include "ZdcIdentifier/ZdcID.h" @@ -120,7 +120,7 @@ ZdcIDDetDescrCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) } else {} // Get the dictionary manager from the detector store - const DataHandle<IdDictManager> idDictMgr; + const IdDictManager* idDictMgr = nullptr; status = detStore->retrieve(idDictMgr, "IdDict"); if (status.isFailure()) { log << MSG::FATAL << "Could not get IdDictManager !" << endmsg; diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_RawDataByteStreamCnv/LUCID_RawDataByteStreamCnv/LUCID_DigitByteStreamCnv.h b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_RawDataByteStreamCnv/LUCID_RawDataByteStreamCnv/LUCID_DigitByteStreamCnv.h index a5c0e56a9ec316482ba8bcace6b8514c23c325a8..dddd207648154522562a4f9688b4b53a2557567c 100644 --- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_RawDataByteStreamCnv/LUCID_RawDataByteStreamCnv/LUCID_DigitByteStreamCnv.h +++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_RawDataByteStreamCnv/LUCID_RawDataByteStreamCnv/LUCID_DigitByteStreamCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // ************************************************************************* @@ -31,7 +31,7 @@ #include "GaudiKernel/IRegistry.h" #include "GaudiKernel/IToolSvc.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "AthenaKernel/MsgStreamMember.h" diff --git a/Generators/BeamHaloGenerator/CMakeLists.txt b/Generators/BeamHaloGenerator/CMakeLists.txt index cb681358ce726d5789a9776bd0c5934c57ccf5a8..64fc8046e17ef14fe385053ab8da098d029c6bf0 100644 --- a/Generators/BeamHaloGenerator/CMakeLists.txt +++ b/Generators/BeamHaloGenerator/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: BeamHaloGenerator -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( BeamHaloGenerator ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - GaudiKernel - Generators/AtlasHepMC - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - Control/AthenaKernel ) - # External dependencies: find_package( CLHEP ) find_package( HepPDT ) @@ -31,8 +20,7 @@ atlas_add_library( BeamHaloGeneratorLib atlas_add_component( BeamHaloGenerator src/components/*.cxx - INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib GaudiKernel GeneratorModulesLib AthenaKernel BeamHaloGeneratorLib ) + LINK_LIBRARIES BeamHaloGeneratorLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/Generators/BoostAfterburner/CMakeLists.txt b/Generators/BoostAfterburner/CMakeLists.txt index 7a75e5c1477305980d2cea2dc7744a69ae619000..d16355432a07e04d1e6b9cef5392d451dfc123db 100644 --- a/Generators/BoostAfterburner/CMakeLists.txt +++ b/Generators/BoostAfterburner/CMakeLists.txt @@ -1,17 +1,8 @@ -################################################################################ -# Package: BoostAfterburner -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( BoostAfterburner ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - PRIVATE - GaudiKernel - Generators/GeneratorObjects ) - # External dependencies: find_package( CLHEP ) @@ -22,12 +13,11 @@ atlas_add_library( BoostAfterburnerLib PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES AthenaBaseComps - PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} GaudiKernel GeneratorObjects ) + PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} GeneratorObjects ) atlas_add_component( BoostAfterburner src/components/*.cxx - INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel GeneratorObjects BoostAfterburnerLib ) + LINK_LIBRARIES BoostAfterburnerLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/Generators/CavernBkgGenerator/CMakeLists.txt b/Generators/CavernBkgGenerator/CMakeLists.txt index 9e03eb960fa5d1c98f7437617e8e614821f7ecc6..045aea85dbb30d45fc764032c6657a5d64ade2f6 100644 --- a/Generators/CavernBkgGenerator/CMakeLists.txt +++ b/Generators/CavernBkgGenerator/CMakeLists.txt @@ -1,17 +1,8 @@ -################################################################################ -# Package: CavernBkgGenerator -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( CavernBkgGenerator ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaKernel - GaudiKernel - Generators/AtlasHepMC - Generators/GeneratorModules ) - # External dependencies: find_package( CLHEP ) find_package( HepPDT ) @@ -35,8 +26,7 @@ atlas_add_library( CavernBkgGeneratorLib atlas_add_component( CavernBkgGenerator src/components/*.cxx - INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaKernel GaudiKernel GeneratorModulesLib CavernBkgGeneratorLib ) + LINK_LIBRARIES CavernBkgGeneratorLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/Generators/Charybdis_i/CMakeLists.txt b/Generators/Charybdis_i/CMakeLists.txt index fc93de5edb0ffd0e0a7cb3ab3183e98c9c8a08fb..37ff118e17c963bca50a3d466ed989ab2c5fec7a 100644 --- a/Generators/Charybdis_i/CMakeLists.txt +++ b/Generators/Charybdis_i/CMakeLists.txt @@ -1,15 +1,8 @@ -################################################################################ -# Package: Charybdis_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Charybdis_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PRIVATE - Generators/GeneratorFortranCommon ) - # External dependencies: find_package( Herwig ) find_package( Lhapdf ) diff --git a/Generators/CosmicGenerator/CMakeLists.txt b/Generators/CosmicGenerator/CMakeLists.txt index c3a3ed4d42fef0f6eba4c1f6ee134ee8a13af152..498f329297b88c03152abe8c61abaace439fc489 100644 --- a/Generators/CosmicGenerator/CMakeLists.txt +++ b/Generators/CosmicGenerator/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: CosmicGenerator -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( CosmicGenerator ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaKernel - Generators/AtlasHepMC - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - GaudiKernel ) - # External dependencies: find_package( CLHEP ) @@ -30,8 +19,7 @@ atlas_add_library( CosmicGeneratorLib atlas_add_component( CosmicGenerator src/components/*.cxx - INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaKernel GeneratorModulesLib GaudiKernel CosmicGeneratorLib ) + LINK_LIBRARIES CosmicGeneratorLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Generators/Epos_i/CMakeLists.txt b/Generators/Epos_i/CMakeLists.txt index 922105d3edaae19fe12c71721d31c12b0c4f325f..46318ba51bb38e1b3756422c7b376d108d7dc33e 100644 --- a/Generators/Epos_i/CMakeLists.txt +++ b/Generators/Epos_i/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: Epos_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Epos_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - Control/AthenaKernel - GaudiKernel - Generators/TruthUtils ) - # External dependencies: find_package( CLHEP ) find_package( Crmc COMPONENTS Epos ) @@ -36,8 +25,7 @@ atlas_add_library( Epos_iLib atlas_add_component( Epos_i src/components/*.cxx - INCLUDE_DIRS ${CRMC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CRMC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AtlasHepMCfioLib GeneratorModulesLib AthenaKernel GaudiKernel TruthUtils Epos_iLib ) + LINK_LIBRARIES Epos_iLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/Generators/EvgenJobTransforms/CMakeLists.txt b/Generators/EvgenJobTransforms/CMakeLists.txt index 53e08f83fde6f8d63fc90562545376edee54f13f..c449d97a4d61268e96dcb0c98cbcda2425353c6d 100644 --- a/Generators/EvgenJobTransforms/CMakeLists.txt +++ b/Generators/EvgenJobTransforms/CMakeLists.txt @@ -1,15 +1,8 @@ - -################################################################################ -# Package: EvgenJobTransforms -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( EvgenJobTransforms ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Tools/PyJobTransforms ) - # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) diff --git a/Generators/EvgenProdTools/CMakeLists.txt b/Generators/EvgenProdTools/CMakeLists.txt index 9fc1f78f57cb2e8a1ab7f3fd54fe05f609f6e2f0..c2a3600b0573e8b6fc5a2b5916e2866cd4f06c78 100644 --- a/Generators/EvgenProdTools/CMakeLists.txt +++ b/Generators/EvgenProdTools/CMakeLists.txt @@ -1,23 +1,8 @@ -################################################################################ -# Package: EvgenProdTools -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( EvgenProdTools ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Generators/GenAnalysisTools/TruthHelper - Generators/GenInterfaces - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - Control/AthenaKernel - Event/EventInfo - GaudiKernel - Generators/TruthUtils ) - # External dependencies: find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) @@ -31,8 +16,7 @@ atlas_add_library( EvgenProdToolsLib atlas_add_component( EvgenProdTools src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib AthenaBaseComps TruthHelper GeneratorModulesLib AthenaKernel EventInfo GaudiKernel TruthUtils EvgenProdToolsLib ) + LINK_LIBRARIES EvgenProdToolsLib ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Generators/EvtGen_i/CMakeLists.txt b/Generators/EvtGen_i/CMakeLists.txt index 5b34b7b6f48cf79cdad6000922b592da48bdde7a..d4ef9a781c24c61afacaac4e07e94cb3cc4d8b06 100644 --- a/Generators/EvtGen_i/CMakeLists.txt +++ b/Generators/EvtGen_i/CMakeLists.txt @@ -1,26 +1,12 @@ -################################################################################ -# Package: EvtGen_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( EvtGen_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/StoreGate - GaudiKernel - Generators/GeneratorModules - Generators/GeneratorObjects - Generators/AtlasHepMC - PRIVATE - Control/AthenaKernel ) - #set( PHOTOSPP_VERSION 3.61 ) #set( PHOTOSPP_ROOT # /cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/photos++/${PHOTOSPP_VERSION}/${LCG_PLATFORM} ) - - # External dependencies: find_package( Boost COMPONENTS filesystem thread system ) find_package( CLHEP ) @@ -58,8 +44,7 @@ atlas_add_library( EvtGen_iLib atlas_add_component( EvtGen_i src/components/*.cxx - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${PYTHIA8_INCLUDE_DIRS} ${PHOTOSPP_INCLUDE_DIRS} ${TAUOLAPP_INCLUDE_DIRS} ${EVTGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${PYTHIA8_LIBRARIES} ${PHOTOSPP_LIBRARIES} ${TAUOLAPP_LIBRARIES} AtlasHepMCLib ${EVTGEN_LIBRARIES} StoreGateLib SGtests GaudiKernel GeneratorModulesLib GeneratorObjects AthenaKernel EvtGen_iLib ) + LINK_LIBRARIES EvtGen_iLib ) # Install files from the package: atlas_install_joboptions( share/common/*.py ) diff --git a/Generators/FlowAfterburner/CMakeLists.txt b/Generators/FlowAfterburner/CMakeLists.txt index 0185f2a587c7d75ff6707c639024cf300a289bf5..bbeab93b32a051f8b7cd388b4b5ceb7c784a1774 100644 --- a/Generators/FlowAfterburner/CMakeLists.txt +++ b/Generators/FlowAfterburner/CMakeLists.txt @@ -1,22 +1,8 @@ -################################################################################ -# Package: FlowAfterburner -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( FlowAfterburner ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Control/AthenaKernel - GaudiKernel - Generators/GenAnalysisTools/TruthHelper - Generators/GeneratorObjects - Generators/AtlasHepMC - PRIVATE - Control/StoreGate - Generators/TruthUtils ) - # External dependencies: find_package( CLHEP ) find_package( GSL ) @@ -29,13 +15,12 @@ atlas_add_library( FlowAfterburnerLib INCLUDE_DIRS ${GSL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${GSL_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel TruthHelper GeneratorObjects StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES AtlasHepMCLib AtlasHepMCsearchLib TruthUtils ) + LINK_LIBRARIES ${GSL_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AtlasHepMCLib GaudiKernel TruthHelper GeneratorObjects + PRIVATE_LINK_LIBRARIES StoreGateLib TruthUtils ) atlas_add_component( FlowAfterburner src/components/*.cxx - INCLUDE_DIRS ${GSL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${GSL_LIBRARIES} ${ROOT_LIBRARIES} AtlasHepMCLib AtlasHepMCsearchLib ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel TruthHelper GeneratorObjects StoreGateLib SGtests TruthUtils FlowAfterburnerLib ) + LINK_LIBRARIES FlowAfterburnerLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/Generators/GenAnalysisTools/EventBoost/CMakeLists.txt b/Generators/GenAnalysisTools/EventBoost/CMakeLists.txt index 414cee5c5cf79d2a95903926f391ffa1f3f04c18..631db80656d43c2cfde84d8e3e40ad172bf8ad5f 100644 --- a/Generators/GenAnalysisTools/EventBoost/CMakeLists.txt +++ b/Generators/GenAnalysisTools/EventBoost/CMakeLists.txt @@ -1,20 +1,8 @@ -################################################################################ -# Package: EventBoost -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( EventBoost ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - GaudiKernel - PRIVATE - Control/StoreGate - Generators/AtlasHepMC - Generators/GeneratorObjects - ) - # External dependencies: find_package( CLHEP ) diff --git a/Generators/GenAnalysisTools/ReweightTools/CMakeLists.txt b/Generators/GenAnalysisTools/ReweightTools/CMakeLists.txt index 82ba5b5dab6bfcfd9d29514f90bfb2718c8a185b..03cccdc76371c10aea959b58fada1b29f4770550 100644 --- a/Generators/GenAnalysisTools/ReweightTools/CMakeLists.txt +++ b/Generators/GenAnalysisTools/ReweightTools/CMakeLists.txt @@ -1,22 +1,8 @@ -################################################################################ -# Package: ReweightTools -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( ReweightTools ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - GaudiKernel - Generators/AtlasHepMC - Generators/GenInterfaces - PRIVATE - Control/AthContainers - Control/StoreGate - Generators/AtlasHepMC - Generators/GeneratorObjects ) - # External dependencies: find_package( Lhapdf ) @@ -25,13 +11,12 @@ atlas_add_library( ReweightToolsLib src/*.cxx PUBLIC_HEADERS ReweightTools INCLUDE_DIRS ${LHAPDF_INCLUDE_DIRS} - LINK_LIBRARIES ${LHAPDF_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel StoreGateLib SGtests + LINK_LIBRARIES ${LHAPDF_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel GenInterfacesLib PRIVATE_LINK_LIBRARIES AthContainers GeneratorObjects ) atlas_add_component( ReweightTools src/components/*.cxx - INCLUDE_DIRS ${LHAPDF_INCLUDE_DIRS} - LINK_LIBRARIES ${LHAPDF_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel AthContainers StoreGateLib SGtests GeneratorObjects ReweightToolsLib ) + LINK_LIBRARIES ReweightToolsLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/Generators/GenAnalysisTools/TruthHelper/CMakeLists.txt b/Generators/GenAnalysisTools/TruthHelper/CMakeLists.txt index 572d21a40444c209d20d27d6d7fbb115ce79567a..caa3ad086d79b5f057b8d344c2ff1a23c78eb5e3 100644 --- a/Generators/GenAnalysisTools/TruthHelper/CMakeLists.txt +++ b/Generators/GenAnalysisTools/TruthHelper/CMakeLists.txt @@ -1,20 +1,8 @@ -################################################################################ -# Package: TruthHelper -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TruthHelper ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/StoreGate - GaudiKernel - Generators/AtlasHepMC - Generators/GeneratorObjects - PRIVATE - Control/AthenaKernel - Generators/TruthUtils ) - # External dependencies: find_package( HepPDT ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) diff --git a/Generators/GenAnalysisTools/TruthTools/CMakeLists.txt b/Generators/GenAnalysisTools/TruthTools/CMakeLists.txt index 155e8c5703ffa920d8f3e8b9355a4755e5c1be84..d057f73b57ed1c890ddd37c4700b9648cb209dab 100644 --- a/Generators/GenAnalysisTools/TruthTools/CMakeLists.txt +++ b/Generators/GenAnalysisTools/TruthTools/CMakeLists.txt @@ -1,20 +1,8 @@ -################################################################################ -# Package: TruthTools -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TruthTools ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - GaudiKernel - PRIVATE - Generators/GenInterfaces - Generators/AtlasHepMC - Generators/GeneratorObjects - Generators/TruthUtils ) - # External dependencies: find_package( HepPDT ) diff --git a/Generators/GenInterfaces/CMakeLists.txt b/Generators/GenInterfaces/CMakeLists.txt index 01a1961f64cd36466aed0aadb52180326fff2a89..a1d2be08a0a1a3c711cfb891f7b53b4a890d4889 100644 --- a/Generators/GenInterfaces/CMakeLists.txt +++ b/Generators/GenInterfaces/CMakeLists.txt @@ -1,14 +1,8 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + # The name of the package: atlas_subdir( GenInterfaces ) -# The dependencies of the package: -atlas_depends_on_subdirs( - PUBLIC - Generators/AtlasHepMC - GaudiKernel ) - -# External dependencies: - # Component(s) in the package: atlas_add_library( GenInterfacesLib GenInterfaces/*.h @@ -19,5 +13,4 @@ atlas_add_library( GenInterfacesLib atlas_add_dictionary( GenInterfacesDict GenInterfaces/GenInterfacesDict.h GenInterfaces/selection.xml - LINK_LIBRARIES AtlasHepMCLib GenInterfacesLib ) - + LINK_LIBRARIES GenInterfacesLib ) diff --git a/Generators/GenInterfaces/GenInterfaces/IHiggsTruthCategoryTool.h b/Generators/GenInterfaces/GenInterfaces/IHiggsTruthCategoryTool.h new file mode 100644 index 0000000000000000000000000000000000000000..0c9b95d9c77bc5d35b52dc38f03699d4ec6342ca --- /dev/null +++ b/Generators/GenInterfaces/GenInterfaces/IHiggsTruthCategoryTool.h @@ -0,0 +1,31 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/* + * Dual-use tool interface for Rivet routine for classifying MC events according to the Higgs template cross section categories + * Authors: Jim Lacey (Carleton University) + * <james.lacey@cern.ch,jlacey@physics.carleton.ca> + */ + +#ifndef GENINTERFACES_IHIGGSTRUTHCATEGORYTOOL_H +#define GENINTERFACES_IHIGGSTRUTHCATEGORYTOOL_H 1 + +#include "AsgTools/IAsgTool.h" +#include "HepMC/GenEvent.h" + +namespace HTXS { + class HiggsClassification; +} + +class IHiggsTruthCategoryTool : public virtual asg::IAsgTool { + public: + ASG_TOOL_INTERFACE( IHiggsTruthCategoryTool ) //declares the interface to athena + virtual ~IHiggsTruthCategoryTool() {}; + public: + virtual StatusCode initialize() = 0; + virtual StatusCode finalize () = 0; + virtual HTXS::HiggsClassification* getHiggsTruthCategoryObject(const HepMC::GenEvent& HepMCEvent, const HTXS::HiggsProdMode prodMode)=0; +}; + +#endif //> !GENINTERFACES_IHIGGSTRUTHCATEGORYTOOL_H diff --git a/Generators/GeneratorFilters/CMakeLists.txt b/Generators/GeneratorFilters/CMakeLists.txt index 533134312a582b689dd58a3d5fe54b5ff2b9a4c9..cf026c88f2a8d57fc2e3c638ec881808b5b9a1f2 100644 --- a/Generators/GeneratorFilters/CMakeLists.txt +++ b/Generators/GeneratorFilters/CMakeLists.txt @@ -1,26 +1,8 @@ -################################################################################ -# Package: GeneratorFilters -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeneratorFilters ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/StoreGate - GaudiKernel - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - Control/AthenaKernel - Control/CxxUtils - Event/EventInfo - Event/xAOD/xAODJet - Event/xAOD/xAODTruth - Generators/TruthUtils - PhysicsAnalysis/AnalysisCommon/ParticleEvent - PhysicsAnalysis/TruthParticleID/McParticleEvent ) - # External dependencies: find_package( CLHEP ) find_package( HepPDT ) @@ -33,15 +15,13 @@ atlas_add_library( GeneratorFiltersLib INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib GaudiKernel StoreGateLib SGtests GeneratorModulesLib - PRIVATE_LINK_LIBRARIES ${HEPPDT_LIBRARIES} AthenaKernel CxxUtils EventInfo xAODJet xAODTruth TruthUtils ParticleEvent McParticleEvent ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib GaudiKernel StoreGateLib GeneratorModulesLib xAODJet + PRIVATE_LINK_LIBRARIES ${HEPPDT_LIBRARIES} AthenaKernel CxxUtils EventInfo xAODTruth TruthUtils ParticleEvent McParticleEvent ) atlas_add_component( GeneratorFilters src/components/*.cxx - INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib StoreGateLib SGtests GaudiKernel GeneratorModulesLib AthenaKernel CxxUtils EventInfo xAODJet xAODTruth TruthUtils ParticleEvent McParticleEvent GeneratorFiltersLib ) + LINK_LIBRARIES GeneratorFiltersLib ) # Install job option fragments from the package: atlas_install_joboptions( share/common/*.py ) - diff --git a/Generators/GeneratorFortranCommon/CMakeLists.txt b/Generators/GeneratorFortranCommon/CMakeLists.txt index 2f1a30a601defdb421085ab9eacb315ab969653d..b1dd5d9fc9da2df645832bd95472eeb4113ff91a 100644 --- a/Generators/GeneratorFortranCommon/CMakeLists.txt +++ b/Generators/GeneratorFortranCommon/CMakeLists.txt @@ -1,16 +1,8 @@ -################################################################################ -# Package: GeneratorFortranCommon -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeneratorFortranCommon ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthenaKernel - GaudiKernel ) - # Component(s) in the package: atlas_add_library( GeneratorFortranCommonLib src/inituser.F src/useuser.F src/getaddr.cxx diff --git a/Generators/GeneratorModules/CMakeLists.txt b/Generators/GeneratorModules/CMakeLists.txt index c5a14a50ebecfc969773805e2de19af3918974c0..1239ed294e3a612ad2b4fdb62fc8e543544ddc29 100644 --- a/Generators/GeneratorModules/CMakeLists.txt +++ b/Generators/GeneratorModules/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: GeneratorModules -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeneratorModules ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Control/AthenaKernel - Control/StoreGate - GaudiKernel - Generators/AtlasHepMC - Generators/GeneratorObjects ) - # External dependencies: find_package( CLHEP ) find_package( HepPDT ) @@ -25,12 +14,11 @@ atlas_add_library( GeneratorModulesLib PUBLIC_HEADERS GeneratorModules INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel GaudiKernel GeneratorObjects StoreGateLib SGtests ) + LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel GaudiKernel GeneratorObjects StoreGateLib ) atlas_add_component( GeneratorModules src/components/*.cxx - INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel StoreGateLib SGtests GaudiKernel GeneratorObjects GeneratorModulesLib ) + LINK_LIBRARIES GeneratorModulesLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Generators/GeneratorObjects/CMakeLists.txt b/Generators/GeneratorObjects/CMakeLists.txt index af7edc9db03691a1c7450e2b1b89ad85c0eb9b08..3c5a77aadb10889f9c58ea0071db0b0659c86983 100644 --- a/Generators/GeneratorObjects/CMakeLists.txt +++ b/Generators/GeneratorObjects/CMakeLists.txt @@ -1,28 +1,10 @@ -################################################################################ -# Package: GeneratorObjects -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeneratorObjects ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthContainers - Control/AthLinks - Control/SGTools - Control/AthenaKernel - Event/xAOD/xAODTruth - GaudiKernel - Generators/AtlasHepMC - PRIVATE - AtlasTest/TestTools - Control/CxxUtils - Control/RootUtils - Control/StoreGate ) - # External dependencies: find_package( CLHEP ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) find_package( GTest ) # Component(s) in the package: @@ -31,16 +13,14 @@ atlas_add_library( GeneratorObjects src/McEventCollection.cxx src/HijingEventParams.cxx PUBLIC_HEADERS GeneratorObjects - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES AtlasHepMCLib AthContainers AthLinks SGTools xAODTruth GaudiKernel RootUtilsPyROOT StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} TestTools AthenaKernel RootUtils ) + LINK_LIBRARIES AthenaKernel AtlasHepMCLib AthContainers AthLinks SGTools xAODTruth GaudiKernel RootUtils StoreGateLib ) atlas_add_dictionary( GeneratorObjectsDict GeneratorObjects/McEventDict.h GeneratorObjects/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthContainers AthLinks SGTools xAODTruth GaudiKernel TestTools AthenaKernel RootUtils RootUtilsPyROOT StoreGateLib SGtests GeneratorObjects ) + LINK_LIBRARIES GeneratorObjects RootUtils ) # Install a dummy rootmap file to suppress loading the rootmap from hepmc3, # which defines dictionary entries for HepMC types that clash with @@ -52,11 +32,9 @@ atlas_install_generic ( share/libHepMC3rootIO.rootmap atlas_add_test( HepMcParticleLink_test SOURCES test/HepMcParticleLink_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthContainers CxxUtils AthLinks SGTools xAODTruth GaudiKernel TestTools AthenaKernel RootUtils RootUtilsPyROOT StoreGateLib SGtests GeneratorObjects ${GTEST_LIBRARIES} ) - + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} ${GTEST_LIBRARIES} CxxUtils GeneratorObjects TestTools ) atlas_add_test( CachedParticlePtr_test SOURCES test/CachedParticlePtr_test.cxx - LINK_LIBRARIES GeneratorObjects AtlasHepMCLib) - + LINK_LIBRARIES GeneratorObjects ) diff --git a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx index 8a92a7829e84fa799de9f0152f07bb2333fbd91e..be4e96ac8016353de23aff647852556661c29620 100644 --- a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx +++ b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx @@ -9,7 +9,6 @@ #include "GeneratorObjects/HepMcParticleLink.h" #include "GeneratorObjects/McEventCollection.h" -#include "StoreGate/StoreGate.h" #include "AtlasHepMC/GenParticle.h" #include "AtlasHepMC/GenEvent.h" #include "AthenaKernel/getMessageSvc.h" diff --git a/Generators/GeneratorObjectsAthenaPool/CMakeLists.txt b/Generators/GeneratorObjectsAthenaPool/CMakeLists.txt index 2e2c7eb39ecedea766a343873ce40d405bd4db16..5ed59bbaf5002fb031caac35b90f6d35c4e4033d 100644 --- a/Generators/GeneratorObjectsAthenaPool/CMakeLists.txt +++ b/Generators/GeneratorObjectsAthenaPool/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: GeneratorObjectsAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeneratorObjectsAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Database/AthenaPOOL/AthenaPoolUtilities - Database/AtlasSealCLHEP - PRIVATE - Database/AthenaPOOL/AthenaPoolCnvSvc - Generators/GeneratorObjects - Generators/GeneratorObjectsTPCnv ) - # Component(s) in the package: atlas_add_poolcnv_library( GeneratorObjectsAthenaPoolPoolCnv src/*.cxx diff --git a/Generators/GeneratorObjectsTPCnv/CMakeLists.txt b/Generators/GeneratorObjectsTPCnv/CMakeLists.txt index aa5d5b632f0b2fd84e293b226572c7a7974210a7..5dc8a3771c5d5a600b809aae7b352a9c12774d37 100644 --- a/Generators/GeneratorObjectsTPCnv/CMakeLists.txt +++ b/Generators/GeneratorObjectsTPCnv/CMakeLists.txt @@ -1,65 +1,49 @@ -################################################################################ -# Package: GeneratorObjectsTPCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeneratorObjectsTPCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Database/AthenaPOOL/AthenaPoolCnvSvc - GaudiKernel - Generators/GeneratorObjects - PRIVATE - AtlasTest/TestTools - Control/AthAllocators - Control/AthenaKernel - Generators/AtlasHepMC - Generators/GenInterfaces ) - # External dependencies: find_package( CLHEP ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_tpcnv_library( GeneratorObjectsTPCnv src/*.cxx PUBLIC_HEADERS GeneratorObjectsTPCnv - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaPoolCnvSvcLib GaudiKernel GeneratorObjects AthAllocators AthenaKernel GenInterfacesLib TestTools ) + PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES AthenaPoolCnvSvcLib AtlasHepMCLib GaudiKernel GeneratorObjects + PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AthAllocators AthenaKernel GenInterfacesLib StoreGateLib TestTools) atlas_add_dictionary( GeneratorObjectsTPCnvDict GeneratorObjectsTPCnv/GeneratorObjectsTPCnvDict.h GeneratorObjectsTPCnv/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib AthenaPoolCnvSvcLib GaudiKernel GeneratorObjects AthAllocators AthenaKernel GeneratorObjectsTPCnv TestTools ) + LINK_LIBRARIES GeneratorObjectsTPCnv ) atlas_add_dictionary( OLD_GeneratorObjectsTPCnvDict GeneratorObjectsTPCnv/GeneratorObjectsTPCnvDict.h GeneratorObjectsTPCnv/OLD_selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib AthenaPoolCnvSvcLib GaudiKernel GeneratorObjects AthAllocators AthenaKernel GeneratorObjectsTPCnv TestTools ) + LINK_LIBRARIES GeneratorObjectsTPCnv ) atlas_add_test( McEventCollectionCnv_p4_test SOURCES test/McEventCollectionCnv_p4_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaPoolCnvSvcLib GaudiKernel GeneratorObjects TestTools StoreGateLib SGtests GeneratorObjectsTPCnv ) + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} GeneratorObjectsTPCnv ) atlas_add_test( McEventCollectionCnv_p5_test SOURCES test/McEventCollectionCnv_p5_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaPoolCnvSvcLib GaudiKernel GeneratorObjects TestTools StoreGateLib SGtests GeneratorObjectsTPCnv ) + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} GeneratorObjectsTPCnv ) atlas_add_test( HepMcParticleLinkCnv_p1_test SOURCES test/HepMcParticleLinkCnv_p1_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaPoolCnvSvcLib GaudiKernel GeneratorObjects TestTools StoreGateLib SGtests GeneratorObjectsTPCnv ) + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} GeneratorObjectsTPCnv StoreGateLib TestTools ) atlas_add_test( HepMcParticleLinkCnv_p2_test SOURCES test/HepMcParticleLinkCnv_p2_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaPoolCnvSvcLib GaudiKernel GeneratorObjects TestTools StoreGateLib SGtests GeneratorObjectsTPCnv ) + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} GeneratorObjectsTPCnv StoreGateLib TestTools ) diff --git a/Generators/GeneratorUtils/CMakeLists.txt b/Generators/GeneratorUtils/CMakeLists.txt index d4c81c159f56196a69b565a6f6c3193b418bdd90..6719593cc8fc839710677300647a6f3c49b59661 100644 --- a/Generators/GeneratorUtils/CMakeLists.txt +++ b/Generators/GeneratorUtils/CMakeLists.txt @@ -1,25 +1,21 @@ -################################################################################ -# Package: GeneratorUtils -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeneratorUtils ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - AtlasTest/TestTools ) - -# External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) - # Component(s) in the package: +atlas_add_library( GeneratorUtilsLib + GeneratorUtils/*.h + INTERFACE + PUBLIC_HEADERS GeneratorUtils + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} ) + +# Test(s) in the package: atlas_add_test( StringParse_test SOURCES test/StringParse_test.cxx - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} TestTools ) + LINK_LIBRARIES GeneratorUtilsLib ) # Install files from the package: -atlas_install_headers( GeneratorUtils ) atlas_install_joboptions( share/*.py ) - diff --git a/Generators/GenzModuleEvent/CMakeLists.txt b/Generators/GenzModuleEvent/CMakeLists.txt index c8063a30fdccd63cbe4687201a66d499aaf66e65..04169fddffd559436123bf0b223d087bc2dc75a8 100644 --- a/Generators/GenzModuleEvent/CMakeLists.txt +++ b/Generators/GenzModuleEvent/CMakeLists.txt @@ -1,14 +1,9 @@ -################################################################################ -# Package: GenzModuleEvent -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GenzModuleEvent ) # The dependencies of the package: -atlas_depends_on_subdirs( - PUBLIC - Generators/AtlasHepMC) # Component(s) in the package: atlas_add_library( GenzModuleEvent diff --git a/Generators/HepMCAnalysis_i/CMakeLists.txt b/Generators/HepMCAnalysis_i/CMakeLists.txt index b970fb62fa61f15ca3f7071dcca54d926576f9cd..832b31e70c13b677845b594d48b4ef67bb1e2c22 100644 --- a/Generators/HepMCAnalysis_i/CMakeLists.txt +++ b/Generators/HepMCAnalysis_i/CMakeLists.txt @@ -1,22 +1,8 @@ -################################################################################ -# Package: HepMCAnalysis_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( HepMCAnalysis_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthenaBaseComps - GaudiKernel - Generators/AtlasHepMC - PRIVATE - Control/StoreGate - Event/EventInfo - Generators/GeneratorObjects - Generators/TruthUtils ) - # External dependencies: find_package( CLHEP ) find_package( HEPUtils ) @@ -30,8 +16,6 @@ else() set( HEPMC_HepMCAnalysis_INTERFACE_DIR ) endif() - - # Component(s) in the package: atlas_add_component( HepMCAnalysis_i HepMCAnalysis_i/*.h src/*.cxx src/components/*.cxx diff --git a/Generators/HepMCWeightSvc/CMakeLists.txt b/Generators/HepMCWeightSvc/CMakeLists.txt index 67bf86e764affdff4c46502be35babd4383d25b0..c8fe7876d0c97104262a29ca47fead2bbeee74d9 100644 --- a/Generators/HepMCWeightSvc/CMakeLists.txt +++ b/Generators/HepMCWeightSvc/CMakeLists.txt @@ -1,29 +1,15 @@ -################################################################################ -# Package: HepMCWeightSvc -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( HepMCWeightSvc ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - GaudiKernel - PRIVATE - Control/AthenaBaseComps - Database/AthenaPOOL/AthenaPoolUtilities - Database/IOVDbDataModel - Database/IOVDbMetaDataTools - Event/EventInfo - Generators/GenInterfaces ) - +# External dependencies: find_package( Boost ) find_package( CORAL COMPONENTS CoralBase ) # Component(s) in the package: atlas_add_component( HepMCWeightSvc src/*.cxx src/components/*.cxx - NO_PUBLIC_HEADERS INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} LINK_LIBRARIES ${CORAL_LIBRARIES} GaudiKernel AthenaBaseComps AthenaPoolUtilities IOVDbDataModel EventInfo GenInterfacesLib IOVDbMetaDataToolsLib ) diff --git a/Generators/Herwig7_i/CMakeLists.txt b/Generators/Herwig7_i/CMakeLists.txt index c58fcf1986d03c02b38d55affeecdfbf77ee0df9..0c4b498f6801e290ebba0c7556ed9e8dcae15e7c 100644 --- a/Generators/Herwig7_i/CMakeLists.txt +++ b/Generators/Herwig7_i/CMakeLists.txt @@ -1,20 +1,8 @@ -################################################################################ -# Package: Herwig7_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Herwig7_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - Event/EventInfo - GaudiKernel - Tools/PathResolver ) - # External dependencies: find_package( Boost ) find_package( Herwig3 COMPONENTS HerwigAPI ) diff --git a/Generators/HforTool/CMakeLists.txt b/Generators/HforTool/CMakeLists.txt index 79cd889ad38f14debc31c94b19f11b4673730936..56ff1587cb23572fa3f3567b55feff74afccafa0 100644 --- a/Generators/HforTool/CMakeLists.txt +++ b/Generators/HforTool/CMakeLists.txt @@ -1,33 +1,10 @@ -################################################################################ -# Package: HforTool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( HforTool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Event/EventInfo - GaudiKernel - Reconstruction/Jet/JetEvent - PRIVATE - Control/StoreGate - Generators/TruthUtils - Generators/GeneratorObjects - Generators/AtlasHepMC - Generators/GenInterfaces ) - -# External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - # Component(s) in the package: atlas_add_component( HforTool src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib AthenaBaseComps EventInfo GaudiKernel JetEvent StoreGateLib SGtests GeneratorObjects TruthUtils GenInterfacesLib ) - -# Install files from the package: -atlas_install_headers( HforTool ) - + LINK_LIBRARIES AtlasHepMCLib AthenaBaseComps EventInfo JetEvent GeneratorObjects TruthUtils GenInterfacesLib ) diff --git a/Generators/Hijing_i/CMakeLists.txt b/Generators/Hijing_i/CMakeLists.txt index 9eb1adf6f6d33e26d310734f48378abeb66dc98b..ff26151c56c5234402a15dfd30ae14d7d4c8ef2e 100644 --- a/Generators/Hijing_i/CMakeLists.txt +++ b/Generators/Hijing_i/CMakeLists.txt @@ -1,25 +1,8 @@ -################################################################################ -# Package: Hijing_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Hijing_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Generators/GeneratorFortranCommon - Generators/GeneratorModules - Generators/AtlasHepMC - Control/CxxUtils - PRIVATE - Control/AthenaKernel - Control/StoreGate - GaudiKernel - Generators/GeneratorObjects - Generators/GeneratorUtils - Generators/TruthUtils ) - # External dependencies: find_package( CLHEP ) find_package( Hijing ) @@ -38,7 +21,7 @@ atlas_add_library( Hijing_iLib LINK_LIBRARIES ${HIJING_LIBRARIES} ${CLHEP_LIBRARIES} GeneratorFortranCommonLib GeneratorModulesLib StoreGateLib PRIVATE_LINK_LIBRARIES AtlasHepMCLib AthenaKernel GaudiKernel - GeneratorObjects TruthUtils ) + GeneratorObjects GeneratorUtilsLib TruthUtils ) atlas_add_component( Hijing_i src/components/*.cxx diff --git a/Generators/Hydjet_i/CMakeLists.txt b/Generators/Hydjet_i/CMakeLists.txt index 8fa501fba7b1e96eeab5e137fb749ca109ab1409..98b4cfd896956e5da80355712083a3961de16cbf 100644 --- a/Generators/Hydjet_i/CMakeLists.txt +++ b/Generators/Hydjet_i/CMakeLists.txt @@ -1,25 +1,8 @@ -################################################################################ -# Package: Hydjet_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Hydjet_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Generators/GeneratorFortranCommon - Generators/GeneratorModules - Generators/AtlasHepMC - Control/CxxUtils - PRIVATE - Control/AthenaKernel - Control/StoreGate - GaudiKernel - Generators/GeneratorObjects - Generators/GeneratorUtils - Generators/TruthUtils ) - # External dependencies: find_package( CLHEP ) find_package( Hijing ) @@ -39,10 +22,10 @@ atlas_add_library( Hydjet_iLib PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${PYQUEN_LIBRARIES} ${PYTHIA6_LIBRARIES} - ${HYDJET_LIBRARIES} ${HIJING_LIBRARIES} GeneratorFortranCommonLib - GeneratorModulesLib StoreGateLib + ${HYDJET_LIBRARIES} ${HIJING_LIBRARIES} CxxUtils GeneratorFortranCommonLib + GeneratorModulesLib PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib - AthenaKernel GaudiKernel GeneratorObjects TruthUtils ) + AthenaKernel GaudiKernel GeneratorObjects GeneratorUtilsLib StoreGateLib TruthUtils ) atlas_add_component( Hydjet_i src/components/*.cxx diff --git a/Generators/Lhef_i/CMakeLists.txt b/Generators/Lhef_i/CMakeLists.txt index 2657351f8f3698c0317d7941bc896b8968ca0982..11a14dfc1e9a0cf041714f4df821786173841609 100644 --- a/Generators/Lhef_i/CMakeLists.txt +++ b/Generators/Lhef_i/CMakeLists.txt @@ -1,14 +1,8 @@ -################################################################################ -# Package: Lhef_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Lhef_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Generators/GeneratorFortranCommon ) - # External dependencies: find_package( Pythia6 ) diff --git a/Generators/MCTester_i/CMakeLists.txt b/Generators/MCTester_i/CMakeLists.txt index 4df0bcb72e4b37ef208a3c96a7f0ca60f7e30303..d649ac1fe69c12f597af6a3d7ec57257e8249bf7 100644 --- a/Generators/MCTester_i/CMakeLists.txt +++ b/Generators/MCTester_i/CMakeLists.txt @@ -1,20 +1,8 @@ -################################################################################ -# Package: MCTester_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( MCTester_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - GaudiKernel - PRIVATE - Control/StoreGate - Event/EventInfo - Generators/AtlasHepMC - Generators/GeneratorObjects ) - # External dependencies: find_package( MCTester ) 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 ) diff --git a/Generators/McAsciiEventSelector/CMakeLists.txt b/Generators/McAsciiEventSelector/CMakeLists.txt index cf73dca20a3fd7b118a7f66cb85d40dc174a987e..c5786b5f21da5481418708e087e1a6429c2272a7 100644 --- a/Generators/McAsciiEventSelector/CMakeLists.txt +++ b/Generators/McAsciiEventSelector/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: McAsciiEventSelector -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( McAsciiEventSelector ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - GaudiKernel - PRIVATE - Control/AthenaBaseComps - Control/AthenaKernel - Event/EventInfo - PhysicsAnalysis/TruthParticleID/McParticleKernel ) - # Component(s) in the package: atlas_add_component( McAsciiEventSelector src/*.cxx @@ -21,6 +10,6 @@ atlas_add_component( McAsciiEventSelector LINK_LIBRARIES GaudiKernel AthenaBaseComps AthenaKernel EventInfo McParticleKernel ) # Install files from the package: -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) diff --git a/Generators/McAsciiEventSelector/python/ReadMcAscii.py b/Generators/McAsciiEventSelector/python/ReadMcAscii.py index a0bcb8fc0ec2c9ea2135de720e576399e96ce2be..ee38f1505cef8ef3113e6ccf99f3953d115705bf 100644 --- a/Generators/McAsciiEventSelector/python/ReadMcAscii.py +++ b/Generators/McAsciiEventSelector/python/ReadMcAscii.py @@ -1,10 +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 ## @file McAsciiEventSelector/python/ReadMcAscii.py ## @brief: install the McAsciiEventSelector def _loadReadMcAscii(): - import AthenaCommon.AtlasUnixStandardJob + import AthenaCommon.AtlasUnixStandardJob # noqa: F401 from AthenaCommon.AppMgr import theApp from AthenaCommon.AppMgr import ServiceMgr as svcMgr diff --git a/Generators/McEventSelector/CMakeLists.txt b/Generators/McEventSelector/CMakeLists.txt index b4209f351eed980d9186fb7da7bbfe0a1679a1fd..582e4fd5356e4bb4a80c5253170de83ba9885729 100644 --- a/Generators/McEventSelector/CMakeLists.txt +++ b/Generators/McEventSelector/CMakeLists.txt @@ -1,18 +1,8 @@ -################################################################################ -# Package: McEventSelector -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( McEventSelector ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Control/AthenaKernel - GaudiKernel - PRIVATE - Event/EventInfo ) - # Component(s) in the package: atlas_add_component( McEventSelector src/McAddress.cxx @@ -23,5 +13,4 @@ atlas_add_component( McEventSelector LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel EventInfo ) # Install files from the package: -atlas_install_headers( McEventSelector ) -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Generators/ParticleDecayer/CMakeLists.txt b/Generators/ParticleDecayer/CMakeLists.txt index 9eced30bb549be2eb499c5efe153ae51c8160049..df2c6b6c9460e3672763cc80b79dcc605d627766 100644 --- a/Generators/ParticleDecayer/CMakeLists.txt +++ b/Generators/ParticleDecayer/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: ParticleDecayer -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( ParticleDecayer ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaKernel - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - GaudiKernel - Generators/GeneratorObjects ) - # External dependencies: find_package( CLHEP ) find_package( HepPDT ) @@ -26,9 +15,8 @@ atlas_add_component( ParticleDecayer src/*.cxx src/components/*.cxx INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaKernel GeneratorModulesLib GaudiKernel GeneratorObjects ) + LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaKernel GeneratorModulesLib GeneratorObjects ) # Install files from the package: -atlas_install_headers( ParticleDecayer ) atlas_install_joboptions( share/*.py ) diff --git a/Generators/Photospp_i/CMakeLists.txt b/Generators/Photospp_i/CMakeLists.txt index cca200250bddeac1eff9a370e63d1e1c544df9b4..4cb57036fb67febc654d38996498fdac77b69f31 100644 --- a/Generators/Photospp_i/CMakeLists.txt +++ b/Generators/Photospp_i/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: Photospp_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Photospp_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthenaBaseComps - PRIVATE - Control/AthenaKernel - GaudiKernel - Generators/GeneratorObjects ) - # External dependencies: find_package( CLHEP ) if (HEPMC3_USE) diff --git a/Generators/ProtosLHEF_i/CMakeLists.txt b/Generators/ProtosLHEF_i/CMakeLists.txt index dfb3990ddc468b8eb027af5eab34a07fae461027..b24a7613d6c76667d11583ee37437b7305823a37 100644 --- a/Generators/ProtosLHEF_i/CMakeLists.txt +++ b/Generators/ProtosLHEF_i/CMakeLists.txt @@ -1,17 +1,8 @@ -################################################################################ -# Package: ProtosLHEF_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( ProtosLHEF_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - PRIVATE - GaudiKernel - Generators/GeneratorFortranCommon ) - # Component(s) in the package: atlas_add_component( ProtosLHEF_i src/*.cxx diff --git a/Generators/Pythia8B_i/CMakeLists.txt b/Generators/Pythia8B_i/CMakeLists.txt index fa41256e694b457f022ef713e085140d503adcf1..d55fb351f1f758f360cc2c241b0aa48fb2e26475 100644 --- a/Generators/Pythia8B_i/CMakeLists.txt +++ b/Generators/Pythia8B_i/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: Pythia8B_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Pythia8B_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - GaudiKernel - Generators/Pythia8_i - Generators/AtlasHepMC - PRIVATE - Generators/GeneratorObjects ) - # External dependencies: find_package( Boost COMPONENTS filesystem thread system ) find_package( CLHEP ) diff --git a/Generators/Pythia8_i/CMakeLists.txt b/Generators/Pythia8_i/CMakeLists.txt index 2edc52abdaaf9401e419f822df7cf7631ef2f44e..ebcd213390fd32ad2578a793795f972a79d80144 100644 --- a/Generators/Pythia8_i/CMakeLists.txt +++ b/Generators/Pythia8_i/CMakeLists.txt @@ -1,20 +1,8 @@ -################################################################################ -# Package: Pythia8_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Pythia8_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaKernel - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - GaudiKernel - Generators/GeneratorObjects - Tools/PathResolver ) - # External dependencies: find_package( Boost COMPONENTS filesystem thread system ) find_package( CLHEP ) diff --git a/Generators/QGSJet_i/CMakeLists.txt b/Generators/QGSJet_i/CMakeLists.txt index 2a134271151517da9bd1c6ac73944ea3c7db3a92..0f71dd037f340d1e4c28f96cebd3dcf4cd8b8773 100644 --- a/Generators/QGSJet_i/CMakeLists.txt +++ b/Generators/QGSJet_i/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: QGSJet_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( QGSJet_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - Control/AthenaKernel - GaudiKernel - Generators/TruthUtils ) - # External dependencies: find_package( CLHEP ) find_package( Crmc COMPONENTS QgsjetII04 ) diff --git a/Generators/Sherpa_i/CMakeLists.txt b/Generators/Sherpa_i/CMakeLists.txt index fde33ef972995b1ea38df45c8ea95a9d3cca5c99..375632d6381da1ea97782a53fe2a44e5403c1206 100644 --- a/Generators/Sherpa_i/CMakeLists.txt +++ b/Generators/Sherpa_i/CMakeLists.txt @@ -1,20 +1,8 @@ -################################################################################ -# Package: Sherpa_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Sherpa_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - GaudiKernel - Generators/GeneratorModules - Generators/AtlasHepMC - Generators/TruthUtils - PRIVATE - Control/AthenaBaseComps - Control/AthenaKernel ) - # Set the version of Sherpa to use: #set( SHERPA_VERSION 2.2.2 ) #set( SHERPA_ROOT diff --git a/Generators/Starlight_i/CMakeLists.txt b/Generators/Starlight_i/CMakeLists.txt index 04abb290de4e318dd4868074f7fc4328c86ef936..8dfb8fbf4e65aecb9dd092a6cf2c7f108640d4ab 100644 --- a/Generators/Starlight_i/CMakeLists.txt +++ b/Generators/Starlight_i/CMakeLists.txt @@ -1,23 +1,9 @@ -# $Id: CMakeLists.txt 762209 2016-07-15 14:15:34Z krasznaa $ -################################################################################ -# Package: Starlight_i -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + # Declare the package name: atlas_subdir( Starlight_i ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - Control/AthenaKernel - Control/StoreGate - GaudiKernel - Generators/GeneratorUtils - Generators/TruthUtils ) - # External dependencies: find_package( CLHEP ) find_package( Starlight ) @@ -32,9 +18,9 @@ atlas_add_library( Starlight_iLib INCLUDE_DIRS ${STARLIGHT_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${STARLIGHT_LIBRARIES} GeneratorModulesLib StoreGateLib + LINK_LIBRARIES ${STARLIGHT_LIBRARIES} GeneratorModulesLib PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaKernel - GaudiKernel TruthUtils ) + GaudiKernel GeneratorUtilsLib TruthUtils StoreGateLib ) atlas_add_component( Starlight_i src/components/*.cxx diff --git a/Generators/TrackRecordGenerator/CMakeLists.txt b/Generators/TrackRecordGenerator/CMakeLists.txt index b6721397072653eb184d4d947fe64149f30fcbae..6eb7d4c93b3ea78ab08c56586ded1918a9b14ee3 100644 --- a/Generators/TrackRecordGenerator/CMakeLists.txt +++ b/Generators/TrackRecordGenerator/CMakeLists.txt @@ -1,35 +1,18 @@ -################################################################################ -# Package: TrackRecordGenerator -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrackRecordGenerator ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - GaudiKernel - Simulation/G4Sim/TrackRecord ) - # External dependencies: find_package( CLHEP ) # Component(s) in the package: -atlas_add_library( TrackRecordGeneratorLib - src/TrackRecordGenerator.cxx - PUBLIC_HEADERS TrackRecordGenerator - INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GeneratorModulesLib - PRIVATE_LINK_LIBRARIES GaudiKernel TrackRecordLib ) - atlas_add_component( TrackRecordGenerator + src/TrackRecordGenerator.cxx src/components/*.cxx - INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GeneratorModulesLib GaudiKernel TrackRecordGeneratorLib ) + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} + DEFINITIONS ${CLHEP_DEFINITIONS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GeneratorModulesLib TrackRecordLib ) # 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/Generators/TrackRecordGenerator/python/TrackRecordGeneratorConfig.py b/Generators/TrackRecordGenerator/python/TrackRecordGeneratorConfig.py index b1e222ea17c28e8d31936b0c2be44d6b7c7de5d2..f456db67df2cbb1acd3e528c22a989a6c3dc36af 100644 --- a/Generators/TrackRecordGenerator/python/TrackRecordGeneratorConfig.py +++ b/Generators/TrackRecordGenerator/python/TrackRecordGeneratorConfig.py @@ -1,9 +1,9 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ############## Input: Reading Particles from TrackRecord Input File ############### def getInput_TrackRecordGenerator(name="TrackRecordGenerator", **kwargs): ## Configuring the Athena application for a 'track record' job - import G4AtlasApps.AtlasCosmicTrackRecordJob + import G4AtlasApps.AtlasCosmicTrackRecordJob # noqa: F401 kwargs.setdefault('TRCollection','CosmicRecord') # Collection name kwargs.setdefault('TRSmearing', -1) #in millimeters, e.g. 10 kwargs.setdefault('TRPSmearing', -1) #in radians, e.g. 0.01 diff --git a/Generators/TruthIO/CMakeLists.txt b/Generators/TruthIO/CMakeLists.txt index bd91ec10b475e6d27a587cd53c87d17ba905e0cc..86a910ee1af5590e8c9e1ef59853bc7fc20b048e 100644 --- a/Generators/TruthIO/CMakeLists.txt +++ b/Generators/TruthIO/CMakeLists.txt @@ -1,21 +1,8 @@ -################################################################################ -# Package: TruthIO -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TruthIO ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - GaudiKernel - Generators/GeneratorModules - Generators/AtlasHepMC - PRIVATE - Control/StoreGate - Event/EventInfo - Generators/GeneratorObjects ) - # External dependencies: find_package( HepPDT ) @@ -24,9 +11,7 @@ atlas_add_component( TruthIO src/*.cxx src/components/*.cxx INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} AtlasHepMCLib AtlasHepMCfioLib AthenaBaseComps GaudiKernel GeneratorModulesLib StoreGateLib SGtests EventInfo GeneratorObjects ) + LINK_LIBRARIES ${HEPPDT_LIBRARIES} AtlasHepMCLib AtlasHepMCfioLib AthenaBaseComps GaudiKernel GeneratorModulesLib StoreGateLib EventInfo GeneratorObjects ) # Install files from the package: -atlas_install_headers( TruthIO ) atlas_install_joboptions( share/*.py ) - diff --git a/Generators/TruthRivetTools/CMakeLists.txt b/Generators/TruthRivetTools/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..989f3d621882f05c090492dfa4e15312b837df9e --- /dev/null +++ b/Generators/TruthRivetTools/CMakeLists.txt @@ -0,0 +1,36 @@ +################################################################################ +# Package: TruthRivetTools +################################################################################ + +# Declare the name of the package: +atlas_subdir( TruthRivetTools ) + +# External dependencies: +find_package( HepMC ) +find_package( Rivet ) +find_package( YODA ) +find_package( FastJet ) +find_package( ROOT COMPONENTS Core Physics ) +find_package( GSL ) + +# Remove the --as-needed linker flags: +atlas_disable_as_needed() + +# Component(s) in the package: +atlas_add_library( TruthRivetToolsLib + Root/*.cxx TruthRivetTools/*.h + SHARED + PUBLIC_HEADERS TruthRivetTools + INCLUDE_DIRS ${HEPMC_INCLUDE_DIRS} ${RIVET_INCLUDE_DIRS} ${YODA_INCLUDE_DIRS} + ${FASTJET_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} + LINK_LIBRARIES ${HEPMC_LIBRARIES} ${RIVET_LIBRARIES} ${YODA_LIBRARIES} + ${FASTJET_LIBRARIES} ${ROOT_LIBRARIES} ${GSL_LIBRARIES} AsgTools AtlasHepMCLib + GenInterfacesLib ) + +atlas_add_component( TruthRivetTools + src/components/*.cxx + LINK_LIBRARIES TruthRivetToolsLib GaudiKernel ) + +atlas_add_dictionary( TruthRivetToolsDict + TruthRivetTools/TruthRivetToolsDict.h TruthRivetTools/selection.xml + LINK_LIBRARIES TruthRivetToolsLib ) diff --git a/Generators/TruthRivetTools/Root/HiggsTruthCategoryTool.cxx b/Generators/TruthRivetTools/Root/HiggsTruthCategoryTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d2790e23680f848bedb4f5cf6571992a64df0fd4 --- /dev/null +++ b/Generators/TruthRivetTools/Root/HiggsTruthCategoryTool.cxx @@ -0,0 +1,59 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthRivetTools includes +#include "TruthRivetTools/HiggsTruthCategoryTool.h" + +HiggsTruthCategoryTool::HiggsTruthCategoryTool( const std::string& name) +: asg::AsgTool( name ), + rivetAnaHandler(nullptr), + higgsTemplateCrossSections(nullptr) +{ + // cannot be set to true until the issue with the beam protons in the truth event record is fixed.. + // see JIRA ticket: https://its.cern.ch/jira/browse/ATLASRECTS-3072?filter=-2 + m_outHistos = false; + m_isInitialized = false; +} + + +StatusCode HiggsTruthCategoryTool::initialize() { + ATH_MSG_INFO ("Initializing " << name() << "..."); + // Rivet analysis :: Higgs truth event classifier class + higgsTemplateCrossSections = new Rivet::HiggsTemplateCrossSections(); + // crreate an instance of the Rivet analysis handler + rivetAnaHandler = new Rivet::AnalysisHandler(); + // Add the Higgs truth classifier class to the handler + rivetAnaHandler->addAnalysis(&(*higgsTemplateCrossSections)); + return StatusCode::SUCCESS; +} + +StatusCode HiggsTruthCategoryTool :: finalize () { + ATH_MSG_INFO (" ====================================================== "); + ATH_MSG_INFO (" ---- Finalizing" << name() << "..."); + ATH_MSG_INFO (" ====================================================== "); + if ( !m_outHistos ) + higgsTemplateCrossSections->printClassificationSummary( ); + else{ + // TODO:: update the tool properly deal with output files/paths + rivetAnaHandler->finalize(); + rivetAnaHandler->writeData("HiggsTruthCategoryTool.yoda"); + } + ATH_MSG_INFO (" ====================================================== "); + return StatusCode::SUCCESS; +} + +HTXS::HiggsClassification* HiggsTruthCategoryTool :: getHiggsTruthCategoryObject (const HepMC::GenEvent& HepMCEvent, const HTXS::HiggsProdMode prodMode){ + if ( !m_isInitialized ) { + higgsTemplateCrossSections->setHiggsProdMode(prodMode); + rivetAnaHandler->init(HepMCEvent); + m_isInitialized=true; + } + // fill histos if flag is specified + if ( m_outHistos ) rivetAnaHandler->analyze(HepMCEvent); + // get the category output object containing the template cross section category, + // and Higgs, V-boson, jets 4-vectors + const Rivet::HiggsClassification htxs_cat_rivet = higgsTemplateCrossSections->classifyEvent(HepMCEvent,prodMode); + return HTXS::Rivet2Root(htxs_cat_rivet); +} + diff --git a/Generators/TruthRivetTools/Root/LinkDef.h b/Generators/TruthRivetTools/Root/LinkDef.h new file mode 100644 index 0000000000000000000000000000000000000000..ad9ccce30447c1913f786b106404a46740f8ff2b --- /dev/null +++ b/Generators/TruthRivetTools/Root/LinkDef.h @@ -0,0 +1,16 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include <TruthRivetTools/HiggsTruthCategoryTool.h> + +#ifdef __CINT__ +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; +#pragma link C++ nestedclass; +#endif + +#ifdef __CINT__ +#pragma link C++ class HiggsTruthCategoryTool+; +#endif diff --git a/Generators/TruthRivetTools/TruthRivetTools/HiggsTemplateCrossSections.h b/Generators/TruthRivetTools/TruthRivetTools/HiggsTemplateCrossSections.h new file mode 100644 index 0000000000000000000000000000000000000000..b875bcdf982fefb9adcd358d649faec2fe7db676 --- /dev/null +++ b/Generators/TruthRivetTools/TruthRivetTools/HiggsTemplateCrossSections.h @@ -0,0 +1,791 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRUTHRIVETTOOLS_HIGGSTEMPLATECROSSSECTIONS_H +#define TRUTHRIVETTOOLS_HIGGSTEMPLATECROSSSECTIONS_H + +// -*- C++ -*- +#include "Rivet/Analysis.hh" +#include "Rivet/Particle.hh" +#include "Rivet/Projections/FastJets.hh" + +// Definition of the StatusCode and Category enums +// Note: the Template XSec Defs *depends* on having included +// the TLorentzVector header *before* it is included -- it +// uses the include guard from TLorentzVector to decide +// what is available +#include "TLorentzVector.h" +#include "TruthRivetTools/HiggsTemplateCrossSectionsDefs.h" +#include "AtlasHepMC/Relatives.h" +#include "AtlasHepMC/GenVertex.h" +#include "AtlasHepMC/GenParticle.h" +#include "AtlasHepMC/GenRanges.h" + +namespace Rivet { + + /// @class HiggsTemplateCrossSections + /// @brief Rivet routine for classifying MC events according to the Higgs template cross section categories + /// @author Jim Lacey (DESY) <james.lacey@cern.ch,jlacey@desy.de> + /// @author Dag Gillberg (Carleton University) <dag.gillberg@cern.ch> + class HiggsTemplateCrossSections : public Analysis { + public: + // Constructor + HiggsTemplateCrossSections() + : Analysis("HiggsTemplateCrossSections"), + m_HiggsProdMode(HTXS::UNKNOWN) {} + + public: + + /// @name Utility methods + /// Methods to identify the Higgs boson and + /// associated vector boson and to build jets + /// @{ + + /// follow a "propagating" particle and return its last instance + Particle getLastInstance(Particle ptcl) { + if ( ptcl.genParticle()->end_vertex() ) { + if ( !hasChild(ptcl.genParticle(),ptcl.pid()) ) return ptcl; + else return getLastInstance(ptcl.children()[0]); + } + return ptcl; + } + + /// @brief Whether particle p originate from any of the ptcls + bool originateFrom(const Particle& p, const Particles& ptcls ) { + const HepMC::GenVertex* prodVtx = p.genParticle()->production_vertex(); + if (prodVtx == nullptr) return false; + // for each ancestor, check if it matches any of the input particles + for (auto ancestor:Rivet::HepMCUtils::particles(prodVtx,HepMC::ancestors)){ + for ( auto part:ptcls ) + if ( ancestor==part.genParticle() ) return true; + } + // if we get here, no ancetor matched any input particle + return false; + } + + /// @brief Whether particle p originates from p2 + bool originateFrom(const Particle& p, const Particle& p2 ) { + Particles ptcls = {p2}; return originateFrom(p,ptcls); + } + + /// @brief Checks whether the input particle has a child with a given PDGID + bool hasChild(const HepMC::GenParticle *ptcl, int pdgID) { + for (const Particle& child:Particle(*ptcl).children()) + if (child.pid()==pdgID) return true; + return false; + } + + /// @brief Checks whether the input particle has a parent with a given PDGID + bool hasParent(const HepMC::GenParticle *ptcl, int pdgID) { + for (auto parent:Rivet::HepMCUtils::particles(ptcl->production_vertex(),HepMC::parents)) + if (parent->pdg_id()==pdgID) return true; + return false; + } + + /// @brief Return true is particle decays to quarks + bool quarkDecay(const Particle &p) { + for (const Particle& child:p.children()) + if (PID::isQuark(child.pid())) return true; + return false; + } + + /// @brief Return true if particle decays to charged leptons. + bool ChLeptonDecay(const Particle &p) { + for (const Particle& child:p.children()) + if (PID::isChLepton(child.pid())) return true; + return false; + } + + /// @brief Returns the classification object with the error code set. + /// Prints an warning message, and keeps track of number of errors + HiggsClassification error(HiggsClassification &cat, HTXS::ErrorCode err, + std::string msg="", int NmaxWarnings=20) { + // Set the error, and keep statistics + cat.errorCode = err; + ++m_errorCount[err]; + + // Print warning message to the screen/log + static int Nwarnings = 0; + if ( msg!="" && ++Nwarnings < NmaxWarnings ) + MSG_WARNING(msg); + + return cat; + } + /// @} + + /// @brief Main classificaion method. + HiggsClassification classifyEvent(const Event& event, const HTXS::HiggsProdMode prodMode ) { + + if (m_HiggsProdMode==HTXS::UNKNOWN) m_HiggsProdMode = prodMode; + + // the classification object + HiggsClassification cat; + cat.prodMode = prodMode; + cat.errorCode = HTXS::UNDEFINED; + cat.stage0_cat = HTXS::Stage0::UNKNOWN; + cat.stage1_cat_pTjet25GeV = HTXS::Stage1::UNKNOWN; + cat.stage1_cat_pTjet30GeV = HTXS::Stage1::UNKNOWN; + cat.stage1_2_cat_pTjet25GeV = HTXS::Stage1_2::UNKNOWN; + cat.stage1_2_cat_pTjet30GeV = HTXS::Stage1_2::UNKNOWN; + cat.stage1_2_fine_cat_pTjet25GeV = HTXS::Stage1_2_Fine::UNKNOWN; + cat.stage1_2_fine_cat_pTjet30GeV = HTXS::Stage1_2_Fine::UNKNOWN; + + if (prodMode == HTXS::UNKNOWN) + return error(cat,HTXS::PRODMODE_DEFINED, + "Unkown Higgs production mechanism. Cannot classify event." + " Classification for all events will most likely fail."); + + /***** + * Step 1. + * Idenfify the Higgs boson and the hard scatter vertex + * There should be only one of each. + */ + + HepMC::GenVertex *HSvtx = event.genEvent()->signal_process_vertex(); + int Nhiggs=0; + for ( const HepMC::GenParticle *ptcl : Rivet::HepMCUtils::particles(event.genEvent()) ) { + + // a) Reject all non-Higgs particles + if ( !PID::isHiggs(ptcl->pdg_id()) ) continue; + // b) select only the final Higgs boson copy, prior to decay + if ( ptcl->end_vertex() && !hasChild(ptcl,PID::HIGGS) ) { + cat.higgs = Particle(ptcl); ++Nhiggs; + } + // c) if HepMC::signal_proces_vertex is missing + // set hard-scatter vertex based on first Higgs boson + if ( HSvtx==nullptr && ptcl->production_vertex() && !hasParent(ptcl,PID::HIGGS) ) + HSvtx = ptcl->production_vertex(); + } + + // Make sure things are in order so far + if (Nhiggs!=1) + return error(cat,HTXS::HIGGS_IDENTIFICATION, + "Current event has "+std::to_string(Nhiggs)+" Higgs bosons. There must be only one."); + if (cat.higgs.children().size()<2) + return error(cat,HTXS::HIGGS_DECAY_IDENTIFICATION, + "Could not identify Higgs boson decay products."); + + if (HSvtx == nullptr) + return error(cat,HTXS::HS_VTX_IDENTIFICATION,"Cannot find hard-scatter vertex of current event."); + + /***** + * Step 2. + * Identify associated vector bosons + */ + + // Find associated vector bosons + bool is_uncatdV = false; + Particles uncatV_decays; + FourMomentum uncatV_p4(0,0,0,0); + FourVector uncatV_v4(0,0,0,0); + int nWs=0, nZs=0, nTop=0; + if ( isVH(prodMode) ) { + for (auto ptcl:Rivet::HepMCUtils::particles(HSvtx,HepMC::children)) { + if (PID::isW(ptcl->pdg_id())) { ++nWs; cat.V=Particle(ptcl); } + if (PID::isZ(ptcl->pdg_id())) { ++nZs; cat.V=Particle(ptcl); } + } + if(nWs+nZs>0) cat.V = getLastInstance(cat.V); + else { + for (auto ptcl:Rivet::HepMCUtils::particles(HSvtx,HepMC::children)) { + if (!PID::isHiggs(ptcl->pdg_id())) { + uncatV_decays += Particle(ptcl); + uncatV_p4 += Particle(ptcl).momentum(); + uncatV_v4 += Particle(ptcl).origin(); + } + } + is_uncatdV = true; cat.V = Particle(24,uncatV_p4,uncatV_v4); + } + } + + if ( !is_uncatdV ){ + + if ( isVH(prodMode) && !cat.V.genParticle()->end_vertex() ) + return error(cat,HTXS::VH_DECAY_IDENTIFICATION,"Vector boson does not decay!"); + + if ( isVH(prodMode) && cat.V.children().size()<2 ) + return error(cat,HTXS::VH_DECAY_IDENTIFICATION,"Vector boson does not decay!"); + + if ( ( prodMode==HTXS::WH && (nZs>0||nWs!=1) ) || + ( (prodMode==HTXS::QQ2ZH||prodMode==HTXS::GG2ZH) && (nZs!=1||nWs>0) ) ) + return error(cat,HTXS::VH_IDENTIFICATION,"Found "+std::to_string(nWs)+" W-bosons and "+ + std::to_string(nZs)+" Z-bosons. Inconsitent with VH expectation."); + } + + // Find and store the W-bosons from ttH->WbWbH + Particles Ws; + if ( prodMode==HTXS::TTH || prodMode==HTXS::TH ){ + // loop over particles produced in hard-scatter vertex + for ( auto ptcl : Rivet::HepMCUtils::particles(HSvtx,HepMC::children) ) { + if ( !PID::isTop(ptcl->pdg_id()) ) continue; + ++nTop; + Particle top = getLastInstance(Particle(ptcl)); + if ( top.genParticle()->end_vertex() ) + for (auto child:top.children()) + if ( PID::isW(child.pid()) ) Ws += getLastInstance(child); + } + } + + // Make sure result make sense + if ( (prodMode==HTXS::TTH && Ws.size()<2) || (prodMode==HTXS::TH && Ws.size()<1 ) ) + return error(cat,HTXS::TOP_W_IDENTIFICATION,"Failed to identify W-boson(s) from t-decay!"); + + /***** + * Step 3. + * Build jets + * Make sure all stable particles are present + */ + + // Create a list of the vector bosons that decay leptonically + // Either the vector boson produced in association with the Higgs boson, + // or the ones produced from decays of top quarks produced with the Higgs + Particles leptonicVs; + if ( !is_uncatdV ){ + if ( isVH(prodMode) && !quarkDecay(cat.V) ) leptonicVs += cat.V; + }else leptonicVs = uncatV_decays; + for ( auto W:Ws ) if ( W.genParticle()->end_vertex() && !quarkDecay(W) ) leptonicVs += W; + + // Obtain all stable, final-state particles + const Particles FS = apply<FinalState>(event, "FS").particles(); + Particles hadrons; + FourMomentum sum(0,0,0,0), vSum(0,0,0,0), hSum(0,0,0,0); + for ( const Particle &p : FS ) { + // Add up the four momenta of all stable particles as a cross check + sum += p.momentum(); + // ignore particles from the Higgs boson + if ( originateFrom(p,cat.higgs) ) { hSum += p.momentum(); continue; } + // Cross-check the V decay products for VH + if ( isVH(prodMode) && !is_uncatdV && originateFrom(p,Ws) ) vSum += p.momentum(); + // ignore final state particles from leptonic V decays + if ( leptonicVs.size() && originateFrom(p,leptonicVs) ) continue; + // All particles reaching here are considered hadrons and will be used to build jets + hadrons += p; + } + + cat.p4decay_higgs = hSum; + cat.p4decay_V = vSum; + + FinalState fps_temp; + FastJets jets(fps_temp, FastJets::ANTIKT, 0.4 ); + jets.calc(hadrons); + + cat.jets25 = jets.jetsByPt( Cuts::pT > 25.0 ); + cat.jets30 = jets.jetsByPt( Cuts::pT > 30.0 ); + + // check that four mometum sum of all stable particles satisfies momentum consevation + if ( sum.pt()>0.1 ) + return error(cat,HTXS::MOMENTUM_CONSERVATION,"Four vector sum does not amount to pT=0, m=E=sqrt(s), but pT="+ + std::to_string(sum.pt())+" GeV and m = "+std::to_string(sum.mass())+" GeV"); + + // check if V-boson was not included in the event record but decay particles were + // EFT contact interaction: return UNKNOWN for category but set all event/particle kinematics + if(is_uncatdV) + return error(cat,HTXS::VH_IDENTIFICATION,"Failed to identify associated V-boson!"); + + /***** + * Step 4. + * Classify and save output + */ + + // Apply the categorization categorization + cat.isZ2vvDecay = false; + if( (prodMode==HTXS::GG2ZH || prodMode==HTXS::QQ2ZH) && !quarkDecay(cat.V) && !ChLeptonDecay(cat.V) ) cat.isZ2vvDecay = true; + cat.stage0_cat = getStage0Category(prodMode,cat.higgs,cat.V); + cat.stage1_cat_pTjet25GeV = getStage1Category(prodMode,cat.higgs,cat.jets25,cat.V); + cat.stage1_cat_pTjet30GeV = getStage1Category(prodMode,cat.higgs,cat.jets30,cat.V); + cat.stage1_2_cat_pTjet25GeV = getStage1_2_Category(prodMode,cat.higgs,cat.jets25,cat.V); + cat.stage1_2_cat_pTjet30GeV = getStage1_2_Category(prodMode,cat.higgs,cat.jets30,cat.V); + cat.stage1_2_fine_cat_pTjet25GeV = getStage1_2_Fine_Category(prodMode,cat.higgs,cat.jets25,cat.V); + cat.stage1_2_fine_cat_pTjet30GeV = getStage1_2_Fine_Category(prodMode,cat.higgs,cat.jets30,cat.V); + cat.errorCode = HTXS::SUCCESS; ++m_errorCount[HTXS::SUCCESS]; + + return cat; + } + + /// @name Categorization methods + /// Methods to assign the truth category based + /// on the identified Higgs boson and associated + /// vector bosons and/or reconstructed jets + /// @{ + + /// @brief Return bin index of x given the provided bin edges. 0=first bin, -1=underflow bin. + int getBin(double x, std::vector<double> bins) { + if (bins.size()==0||x<bins[0]) return -1; // should not happen! + for (size_t i=1;i<bins.size();++i) + if (x<bins[i]) return i-1; + return bins.size()-1; + } + + /// @brief VBF topolog selection + /// 0 = fail loose selction: m_jj > 400 GeV and Dy_jj > 2.8 + /// 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass tight selection + int vbfTopology(const Jets &jets, const Particle &higgs) { + if (jets.size()<2) return 0; + const FourMomentum &j1=jets[0].momentum(), &j2=jets[1].momentum(); + bool VBFtopo = (j1+j2).mass() > 400.0 && std::abs(j1.rapidity()-j2.rapidity()) > 2.8; + return VBFtopo ? (j1+j2+higgs.momentum()).pt()<25 ? 2 : 1 : 0; + } + /// @brief VBF topology selection + /// 0 = fail loose selection: m_jj > 350 GeV + /// 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass pT(Hjj)>25 selection + /// 3 pass tight (m_jj>700 GeV), but fail additional cut pT(Hjj)<25. 4 pass pT(Hjj)>25 selection + int vbfTopology_Stage1_2(const Jets &jets, const Particle &higgs) { + if (jets.size()<2) return 0; + const FourMomentum &j1=jets[0].momentum(), &j2=jets[1].momentum(); + double mjj = (j1+j2).mass(); + if(mjj>350 && mjj<=700) return (j1+j2+higgs.momentum()).pt()<25 ? 1 : 2; + else if(mjj>700) return (j1+j2+higgs.momentum()).pt()<25 ? 3 : 4; + else return 0; + } + /// @brief VBF topology selection for Stage1_2 + /// 0 = fail loose selection: m_jj > 350 GeV + /// 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass pT(Hjj)>25 selection + /// 3 pass 700<m_jj<1000 GeV, but fail additional cut pT(Hjj)<25. 4 pass pT(Hjj)>25 selection + /// 5 pass 1000<m_jj<1500 GeV, but fail additional cut pT(Hjj)<25. 6 pass pT(Hjj)>25 selection + /// 7 pass m_jj>1500 GeV, but fail additional cut pT(Hjj)<25. 8 pass pT(Hjj)>25 selection + int vbfTopology_Stage1_2_Fine(const Jets &jets, const Particle &higgs) { + if (jets.size()<2) return 0; + const FourMomentum &j1=jets[0].momentum(), &j2=jets[1].momentum(); + double mjj = (j1+j2).mass(); + if(mjj>350 && mjj<=700) return (j1+j2+higgs.momentum()).pt()<25 ? 1 : 2; + else if(mjj>700 && mjj<=1000) return (j1+j2+higgs.momentum()).pt()<25 ? 3 : 4; + else if(mjj>1000 && mjj<=1500) return (j1+j2+higgs.momentum()).pt()<25 ? 5 : 6; + else if(mjj>1500) return (j1+j2+higgs.momentum()).pt()<25 ? 7 : 8; + else return 0; + } + + /// @brief Whether the Higgs is produced in association with a vector boson (VH) + bool isVH(HTXS::HiggsProdMode p) { return p==HTXS::WH || p==HTXS::QQ2ZH || p==HTXS::GG2ZH; } + + /// @brief Stage-0 HTXS categorization + HTXS::Stage0::Category getStage0Category(const HTXS::HiggsProdMode prodMode, + const Particle &higgs, + const Particle &V) { + using namespace HTXS::Stage0; + int ctrlHiggs = std::abs(higgs.rapidity())<2.5; + // Special cases first, qq→Hqq + if ( (prodMode==HTXS::WH||prodMode==HTXS::QQ2ZH) && quarkDecay(V) ) { + return ctrlHiggs ? VH2HQQ : VH2HQQ_FWDH; + } else if ( prodMode==HTXS::GG2ZH && quarkDecay(V) ) { + return Category(HTXS::GGF*10 + ctrlHiggs); + } + // General case after + return Category(prodMode*10 + ctrlHiggs); + } + + /// @brief Stage-1 categorization + HTXS::Stage1::Category getStage1Category(const HTXS::HiggsProdMode prodMode, + const Particle &higgs, + const Jets &jets, + const Particle &V) { + using namespace HTXS::Stage1; + int Njets=jets.size(), ctrlHiggs = std::abs(higgs.rapidity())<2.5, fwdHiggs = !ctrlHiggs; + double pTj1 = jets.size() ? jets[0].momentum().pt() : 0; + int vbfTopo = vbfTopology(jets,higgs); + + // 1. GGF Stage 1 categories + // Following YR4 write-up: XXXXX + if (prodMode==HTXS::GGF || (prodMode==HTXS::GG2ZH && quarkDecay(V)) ) { + if (fwdHiggs) return GG2H_FWDH; + if (Njets==0) return GG2H_0J; + else if (Njets==1) return Category(GG2H_1J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200})); + else if (Njets>=2) { + // events with pT_H>200 get priority over VBF cuts + if(higgs.pt()<=200){ + if (vbfTopo==2) return GG2H_VBFTOPO_JET3VETO; + else if (vbfTopo==1) return GG2H_VBFTOPO_JET3; + } + // Njets >= 2jets without VBF topology + return Category(GG2H_GE2J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200})); + } + } + // 2. Electroweak qq->Hqq Stage 1 categories + else if (prodMode==HTXS::VBF || ( isVH(prodMode) && quarkDecay(V)) ) { + if (std::abs(higgs.rapidity())>2.5) return QQ2HQQ_FWDH; + if (pTj1>200) return QQ2HQQ_PTJET1_GT200; + if (vbfTopo==2) return QQ2HQQ_VBFTOPO_JET3VETO; + if (vbfTopo==1) return QQ2HQQ_VBFTOPO_JET3; + double mjj = jets.size()>1 ? (jets[0].mom()+jets[1].mom()).mass():0; + if ( 60 < mjj && mjj < 120 ) return QQ2HQQ_VH2JET; + return QQ2HQQ_REST; + } + // 3. WH->Hlv categories + else if (prodMode==HTXS::WH) { + if (fwdHiggs) return QQ2HLNU_FWDH; + else if (V.pt()<150) return QQ2HLNU_PTV_0_150; + else if (V.pt()>250) return QQ2HLNU_PTV_GT250; + // 150 < pTV/GeV < 250 + return jets.size()==0 ? QQ2HLNU_PTV_150_250_0J : QQ2HLNU_PTV_150_250_GE1J; + } + // 4. qq->ZH->llH categories + else if (prodMode==HTXS::QQ2ZH) { + if (fwdHiggs) return QQ2HLL_FWDH; + else if (V.pt()<150) return QQ2HLL_PTV_0_150; + else if (V.pt()>250) return QQ2HLL_PTV_GT250; + // 150 < pTV/GeV < 250 + return jets.size()==0 ? QQ2HLL_PTV_150_250_0J : QQ2HLL_PTV_150_250_GE1J; + } + // 5. gg->ZH->llH categories + else if (prodMode==HTXS::GG2ZH ) { + if (fwdHiggs) return GG2HLL_FWDH; + if (V.pt()<150) return GG2HLL_PTV_0_150; + else if (jets.size()==0) return GG2HLL_PTV_GT150_0J; + return GG2HLL_PTV_GT150_GE1J; + } + // 6.ttH,bbH,tH categories + else if (prodMode==HTXS::TTH) return Category(TTH_FWDH+ctrlHiggs); + else if (prodMode==HTXS::BBH) return Category(BBH_FWDH+ctrlHiggs); + else if (prodMode==HTXS::TH ) return Category(TH_FWDH+ctrlHiggs); + return UNKNOWN; + } + + /// @brief Stage-1.2 categorization + HTXS::Stage1_2::Category getStage1_2_Category(const HTXS::HiggsProdMode prodMode, + const Particle &higgs, + const Jets &jets, + const Particle &V) { + using namespace HTXS::Stage1_2; + int Njets=jets.size(), ctrlHiggs = std::abs(higgs.rapidity())<2.5, fwdHiggs = !ctrlHiggs; + int vbfTopo = vbfTopology_Stage1_2(jets,higgs); + + // 1. GGF Stage 1 categories + // Following YR4 write-up: XXXXX + if (prodMode==HTXS::GGF || (prodMode==HTXS::GG2ZH && quarkDecay(V)) ) { + if (fwdHiggs) return GG2H_FWDH; + if ( higgs.pt()>200 ) return Category(GG2H_PTH_200_300+getBin(higgs.pt(),{200,300,450,650})); + if (Njets==0) return higgs.pt()<10 ? GG2H_0J_PTH_0_10 : GG2H_0J_PTH_GT10; + if (Njets==1) return Category(GG2H_1J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200})); + if (Njets>1){ + //VBF topology + if(vbfTopo) return Category(GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25+vbfTopo-1); + //Njets >= 2jets without VBF topology (mjj<350) + return Category(GG2H_GE2J_MJJ_0_350_PTH_0_60+getBin(higgs.pt(),{0,60,120,200})); + } + } + + // 2. Electroweak qq->Hqq Stage 1.2 categories + else if (prodMode==HTXS::VBF || ( isVH(prodMode) && quarkDecay(V)) ) { + if (std::abs(higgs.rapidity())>2.5) return QQ2HQQ_FWDH; + int Njets=jets.size(); + if (Njets==0) return QQ2HQQ_0J; + else if (Njets==1) return QQ2HQQ_1J; + else if (Njets>=2) { + double mjj = (jets[0].mom()+jets[1].mom()).mass(); + if ( mjj < 60 ) return QQ2HQQ_GE2J_MJJ_0_60; + else if ( 60 < mjj && mjj < 120 ) return QQ2HQQ_GE2J_MJJ_60_120; + else if ( 120 < mjj && mjj < 350 ) return QQ2HQQ_GE2J_MJJ_120_350; + else if ( mjj > 350 ) { + if (higgs.pt()>200) return QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200; + if(vbfTopo) return Category(QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200+vbfTopo); + } + } + } + // 3. WH->Hlv categories + else if (prodMode==HTXS::WH) { + if (fwdHiggs) return QQ2HLNU_FWDH; + else if (V.pt()<75) return QQ2HLNU_PTV_0_75; + else if (V.pt()<150) return QQ2HLNU_PTV_75_150; + else if (V.pt()>250) return QQ2HLNU_PTV_GT250; + // 150 < pTV/GeV < 250 + return jets.size()==0 ? QQ2HLNU_PTV_150_250_0J : QQ2HLNU_PTV_150_250_GE1J; + } + // 4. qq->ZH->llH categories + else if (prodMode==HTXS::QQ2ZH) { + if (fwdHiggs) return QQ2HLL_FWDH; + else if (V.pt()<75) return QQ2HLL_PTV_0_75; + else if (V.pt()<150) return QQ2HLL_PTV_75_150; + else if (V.pt()>250) return QQ2HLL_PTV_GT250; + // 150 < pTV/GeV < 250 + return jets.size()==0 ? QQ2HLL_PTV_150_250_0J : QQ2HLL_PTV_150_250_GE1J; + } + // 5. gg->ZH->llH categories + else if (prodMode==HTXS::GG2ZH ) { + if (fwdHiggs) return GG2HLL_FWDH; + else if (V.pt()<75) return GG2HLL_PTV_0_75; + else if (V.pt()<150) return GG2HLL_PTV_75_150; + else if (V.pt()>250) return GG2HLL_PTV_GT250; + return jets.size()==0 ? GG2HLL_PTV_150_250_0J : GG2HLL_PTV_150_250_GE1J; + } + // 6.ttH,bbH,tH categories + else if (prodMode==HTXS::TTH) { + if (fwdHiggs) return TTH_FWDH; + else return Category(TTH_PTH_0_60+getBin(higgs.pt(),{0,60,120,200,300})); + } + else if (prodMode==HTXS::BBH) return Category(BBH_FWDH+ctrlHiggs); + else if (prodMode==HTXS::TH ) return Category(TH_FWDH+ctrlHiggs); + return UNKNOWN; + } + + /// @brief Stage-1.2_Fine categorization + HTXS::Stage1_2_Fine::Category getStage1_2_Fine_Category(const HTXS::HiggsProdMode prodMode, + const Particle &higgs, + const Jets &jets, + const Particle &V) { + using namespace HTXS::Stage1_2_Fine; + int Njets=jets.size(), ctrlHiggs = std::abs(higgs.rapidity())<2.5, fwdHiggs = !ctrlHiggs; + int vbfTopo = vbfTopology_Stage1_2_Fine(jets,higgs); + + // 1. GGF Stage 1.2 categories + // Following YR4 write-up: XXXXX + if (prodMode==HTXS::GGF || (prodMode==HTXS::GG2ZH && quarkDecay(V)) ) { + if (fwdHiggs) return GG2H_FWDH; + if ( higgs.pt()>200 ){ + if (Njets>0){ + double pTHj = (jets[0].momentum()+higgs.momentum()).pt(); + if( pTHj/higgs.pt()>0.15 ) return Category(GG2H_PTH_200_300_PTHJoverPTH_GT15+getBin(higgs.pt(),{200,300,450,650})); + else return Category(GG2H_PTH_200_300_PTHJoverPTH_0_15+getBin(higgs.pt(),{200,300,450,650})); + } + else return Category(GG2H_PTH_200_300_PTHJoverPTH_0_15+getBin(higgs.pt(),{200,300,450,650})); + } + if (Njets==0) return higgs.pt()<10 ? GG2H_0J_PTH_0_10 : GG2H_0J_PTH_GT10; + if (Njets==1) return Category(GG2H_1J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200})); + if (Njets>1){ + //double mjj = (jets[0].mom()+jets[1].mom()).mass(); + double pTHjj = (jets[0].momentum()+jets[1].momentum()+higgs.momentum()).pt(); + //VBF topology + if(vbfTopo) return Category(GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25+vbfTopo-1); + //Njets >= 2jets without VBF topology (mjj<350) + if (pTHjj<25) return Category(GG2H_GE2J_MJJ_0_350_PTH_0_60_PTHJJ_0_25+getBin(higgs.pt(),{0,60,120,200})); + else return Category(GG2H_GE2J_MJJ_0_350_PTH_0_60_PTHJJ_GT25+getBin(higgs.pt(),{0,60,120,200})); + } + } + + // 2. Electroweak qq->Hqq Stage 1.2 categories + else if (prodMode==HTXS::VBF || ( isVH(prodMode) && quarkDecay(V)) ) { + if (std::abs(higgs.rapidity())>2.5) return QQ2HQQ_FWDH; + int Njets=jets.size(); + if (Njets==0) return QQ2HQQ_0J; + else if (Njets==1) return QQ2HQQ_1J; + else if (Njets>=2) { + double mjj = (jets[0].mom()+jets[1].mom()).mass(); + double pTHjj = (jets[0].momentum()+jets[1].momentum()+higgs.momentum()).pt(); + if (mjj<350){ + if (pTHjj<25) return Category(QQ2HQQ_GE2J_MJJ_0_60_PTHJJ_0_25+getBin(mjj,{0,60,120,350})); + else return Category(QQ2HQQ_GE2J_MJJ_0_60_PTHJJ_GT25+getBin(mjj,{0,60,120,350})); + } else { //mjj>350 GeV + if (higgs.pt()<200){ + return Category(QQ2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25+vbfTopo-1); + } else { + return Category(QQ2HQQ_GE2J_MJJ_350_700_PTH_GT200_PTHJJ_0_25+vbfTopo-1); + } + } + } + } + // 3. WH->Hlv categories + else if (prodMode==HTXS::WH) { + if (fwdHiggs) return QQ2HLNU_FWDH; + int Njets=jets.size(); + if (Njets==0) return Category(QQ2HLNU_PTV_0_75_0J+getBin(V.pt(),{0,75,150,250,400})); + if (Njets==1) return Category(QQ2HLNU_PTV_0_75_1J+getBin(V.pt(),{0,75,150,250,400})); + return Category(QQ2HLNU_PTV_0_75_GE2J+getBin(V.pt(),{0,75,150,250,400})); + } + // 4. qq->ZH->llH categories + else if (prodMode==HTXS::QQ2ZH) { + if (fwdHiggs) return QQ2HLL_FWDH; + int Njets=jets.size(); + if (Njets==0) return Category(QQ2HLL_PTV_0_75_0J+getBin(V.pt(),{0,75,150,250,400})); + if (Njets==1) return Category(QQ2HLL_PTV_0_75_1J+getBin(V.pt(),{0,75,150,250,400})); + return Category(QQ2HLL_PTV_0_75_GE2J+getBin(V.pt(),{0,75,150,250,400})); + } + // 5. gg->ZH->llH categories + else if (prodMode==HTXS::GG2ZH ) { + if (fwdHiggs) return GG2HLL_FWDH; + int Njets=jets.size(); + if (Njets==0) return Category(GG2HLL_PTV_0_75_0J+getBin(V.pt(),{0,75,150,250,400})); + if (Njets==1) return Category(GG2HLL_PTV_0_75_1J+getBin(V.pt(),{0,75,150,250,400})); + return Category(GG2HLL_PTV_0_75_GE2J+getBin(V.pt(),{0,75,150,250,400})); + } + // 6.ttH,bbH,tH categories + else if (prodMode==HTXS::TTH) { + if (fwdHiggs) return TTH_FWDH; + else return Category(TTH_PTH_0_60+getBin(higgs.pt(),{0,60,120,200,300,450})); + } + else if (prodMode==HTXS::BBH) return Category(BBH_FWDH+ctrlHiggs); + else if (prodMode==HTXS::TH ) return Category(TH_FWDH+ctrlHiggs); + return UNKNOWN; + } + + /// @} + + + /// @name Default Rivet analysis methods and steering methods + /// @{ + + /// @brief Sets the Higgs production mode + void setHiggsProdMode( HTXS::HiggsProdMode prodMode ){ m_HiggsProdMode = prodMode; } + + /// @brief default Rivet Analysis::init method + /// Booking of histograms, initializing Rivet projection + /// Extracts Higgs production mode from shell variable if not set manually using setHiggsProdMode + void init() { + printf("==============================================================\n"); + printf("======== HiggsTemplateCrossSections Initialization =========\n"); + printf("==============================================================\n"); + // check that the production mode has been set + // if running in standalone Rivet the production mode is set through an env variable + if (m_HiggsProdMode==HTXS::UNKNOWN) { + char *pm_env = getenv("HIGGSPRODMODE"); + string pm(pm_env==nullptr?"":pm_env); + if ( pm == "GGF" ) m_HiggsProdMode = HTXS::GGF; + else if ( pm == "VBF" ) m_HiggsProdMode = HTXS::VBF; + else if ( pm == "WH" ) m_HiggsProdMode = HTXS::WH; + else if ( pm == "ZH" ) m_HiggsProdMode = HTXS::QQ2ZH; + else if ( pm == "QQ2ZH" ) m_HiggsProdMode = HTXS::QQ2ZH; + else if ( pm == "GG2ZH" ) m_HiggsProdMode = HTXS::GG2ZH; + else if ( pm == "TTH" ) m_HiggsProdMode = HTXS::TTH; + else if ( pm == "BBH" ) m_HiggsProdMode = HTXS::BBH; + else if ( pm == "TH" ) m_HiggsProdMode = HTXS::TH; + else { + MSG_WARNING("No HIGGSPRODMODE shell variable found. Needed when running Rivet stand-alone."); + } + } + + // Projections for final state particles + const FinalState FS; + declare(FS,"FS"); + + // initialize the histograms with for each of the stages + initializeHistos(); + m_sumw = 0.0; + printf("==============================================================\n"); + printf("======== Higgs prod mode %d =========\n",m_HiggsProdMode); + printf("======== Sucessful Initialization =========\n"); + printf("==============================================================\n"); + } + + // Perform the per-event analysis + void analyze(const Event& event) { + + // get the classification + HiggsClassification cat = classifyEvent(event,m_HiggsProdMode); + + // Fill histograms: categorization --> linerize the categories + const double weight = 1.; // Event weights are now all 1 in Rivet + m_sumw += weight; + + int F=cat.stage0_cat%10, P=cat.stage1_cat_pTjet30GeV/100; + m_hist_stage0->fill( cat.stage0_cat/10*2+F, weight ); + + // Stage 1 enum offsets for each production mode: GGF=12, VBF=6, WH= 5, QQ2ZH=5, GG2ZH=4, TTH=2, BBH=2, TH=2 + static vector<int> offset({0,1,13,19,24,29,33,35,37,39}); + int off = offset[P]; + // Stage 1.2 enum offsets for each production mode: GGF=17, VBF=11, WH= 6, QQ2ZH=6, GG2ZH=6, TTH=6, BBH=2, TH=2 + static vector<int> offset1_2({0,1,18,29,35,41,47,53,55,57}); + int off1_2 = offset1_2[P]; + // Stage 1.2-Fine enum offsets for each production mode: GGF=28, VBF=25, WH= 16, QQ2ZH=16, GG2ZH=16, TTH=7, BBH=2, TH=2 + static vector<int> offset1_2_Fine({0,1,29,54,70,86,102,109,111,113}); + int off1_2_Fine = offset1_2_Fine[P]; + + m_hist_stage1_pTjet25->fill(cat.stage1_cat_pTjet25GeV%100 + off, weight); + m_hist_stage1_pTjet30->fill(cat.stage1_cat_pTjet30GeV%100 + off, weight); + m_hist_stage1_2_pTjet25->fill(cat.stage1_2_cat_pTjet25GeV%100 + off1_2, weight); + m_hist_stage1_2_pTjet30->fill(cat.stage1_2_cat_pTjet30GeV%100 + off1_2, weight); + m_hist_stage1_2_fine_pTjet25->fill(cat.stage1_2_fine_cat_pTjet25GeV%100 + off1_2_Fine, weight); + m_hist_stage1_2_fine_pTjet30->fill(cat.stage1_2_fine_cat_pTjet30GeV%100 + off1_2_Fine, weight); + + // Fill histograms: variables used in the categorization + m_hist_pT_Higgs->fill(cat.higgs.pT(),weight); + m_hist_y_Higgs->fill(cat.higgs.rapidity(),weight); + m_hist_pT_V->fill(cat.V.pT(),weight); + + m_hist_Njets25->fill(cat.jets25.size(),weight); + m_hist_Njets30->fill(cat.jets30.size(),weight); + + m_hist_isZ2vv->fill(cat.isZ2vvDecay, weight); + + // Jet variables. Use jet collection with pT threshold at 30 GeV + if (cat.jets30.size()) m_hist_pT_jet1->fill(cat.jets30[0].pt(),weight); + if (cat.jets30.size()>=2) { + const FourMomentum &j1 = cat.jets30[0].momentum(), &j2 = cat.jets30[1].momentum(); + m_hist_deltay_jj->fill(std::abs(j1.rapidity()-j2.rapidity()),weight); + m_hist_dijet_mass->fill((j1+j2).mass(),weight); + m_hist_pT_Hjj->fill((j1+j2+cat.higgs.momentum()).pt(),weight); + } + } + + void printClassificationSummary(){ + MSG_INFO (" ====================================================== "); + MSG_INFO (" Higgs Template X-Sec Categorization Tool "); + MSG_INFO (" Status Code Summary "); + MSG_INFO (" ====================================================== "); + bool allSuccess = (numEvents()==m_errorCount[HTXS::SUCCESS]); + if ( allSuccess ) MSG_INFO (" >>>> All "<< m_errorCount[HTXS::SUCCESS] <<" events successfully categorized!"); + else{ + MSG_INFO (" >>>> "<< m_errorCount[HTXS::SUCCESS] <<" events successfully categorized"); + MSG_INFO (" >>>> --> the following errors occured:"); + MSG_INFO (" >>>> "<< m_errorCount[HTXS::PRODMODE_DEFINED] <<" had an undefined Higgs production mode."); + MSG_INFO (" >>>> "<< m_errorCount[HTXS::MOMENTUM_CONSERVATION] <<" failed momentum conservation."); + MSG_INFO (" >>>> "<< m_errorCount[HTXS::HIGGS_IDENTIFICATION] <<" failed to identify a valid Higgs boson."); + MSG_INFO (" >>>> "<< m_errorCount[HTXS::HS_VTX_IDENTIFICATION] <<" failed to identify the hard scatter vertex."); + MSG_INFO (" >>>> "<< m_errorCount[HTXS::VH_IDENTIFICATION] <<" VH: to identify a valid V-boson."); + MSG_INFO (" >>>> "<< m_errorCount[HTXS::TOP_W_IDENTIFICATION] <<" failed to identify valid Ws from top decay."); + } + MSG_INFO (" ====================================================== "); + MSG_INFO (" ====================================================== "); + } + + + void finalize() { + printClassificationSummary(); + double sf = m_sumw>0?1.0/m_sumw:1.0; + for (auto hist:{m_hist_stage0,m_hist_stage1_pTjet25,m_hist_stage1_pTjet30,m_hist_stage1_2_pTjet25,m_hist_stage1_2_pTjet30,m_hist_stage1_2_fine_pTjet25,m_hist_stage1_2_fine_pTjet30, + m_hist_Njets25,m_hist_Njets30,m_hist_pT_Higgs,m_hist_y_Higgs,m_hist_pT_V,m_hist_pT_jet1,m_hist_deltay_jj,m_hist_dijet_mass,m_hist_pT_Hjj,m_hist_isZ2vv}) + scale(hist, sf); + } + + /* + * initialize histograms + */ + + void initializeHistos(){ + book(m_hist_stage0,"HTXS_stage0",20,0,20); + book(m_hist_stage1_pTjet25,"HTXS_stage1_pTjet25",40,0,40); + book(m_hist_stage1_pTjet30,"HTXS_stage1_pTjet30",40,0,40); + book(m_hist_stage1_2_pTjet25,"HTXS_stage1_2_pTjet25",57,0,57); + book(m_hist_stage1_2_pTjet30,"HTXS_stage1_2_pTjet30",57,0,57); + book(m_hist_stage1_2_fine_pTjet25,"HTXS_stage1_2_fine_pTjet25",113,0,113); + book(m_hist_stage1_2_fine_pTjet30,"HTXS_stage1_2_fine_pTjet30",113,0,113); + book(m_hist_pT_Higgs,"pT_Higgs",80,0,400); + book(m_hist_y_Higgs,"y_Higgs",80,-4,4); + book(m_hist_pT_V,"pT_V",80,0,400); + book(m_hist_pT_jet1,"pT_jet1",80,0,400); + book(m_hist_deltay_jj ,"deltay_jj",50,0,10); + book(m_hist_dijet_mass,"m_jj",50,0,2000); + book(m_hist_pT_Hjj,"pT_Hjj",50,0,250); + book(m_hist_Njets25,"Njets25",10,0,10); + book(m_hist_Njets30,"Njets30",10,0,10); + book(m_hist_isZ2vv,"isZ2vv",2,0,2); + } + /// @} + + /* + * initialize private members used in the classification procedure + */ + + private: + double m_sumw; + HTXS::HiggsProdMode m_HiggsProdMode; + std::map<HTXS::ErrorCode,size_t> m_errorCount; + Histo1DPtr m_hist_stage0; + Histo1DPtr m_hist_stage1_pTjet25, m_hist_stage1_pTjet30; + Histo1DPtr m_hist_stage1_2_pTjet25, m_hist_stage1_2_pTjet30; + Histo1DPtr m_hist_stage1_2_fine_pTjet25, m_hist_stage1_2_fine_pTjet30; + Histo1DPtr m_hist_pT_Higgs, m_hist_y_Higgs; + Histo1DPtr m_hist_pT_V, m_hist_pT_jet1; + Histo1DPtr m_hist_deltay_jj, m_hist_dijet_mass, m_hist_pT_Hjj; + Histo1DPtr m_hist_Njets25, m_hist_Njets30; + Histo1DPtr m_hist_isZ2vv; + }; + + // the PLUGIN only needs to be decleared when running standalone Rivet + // and causes compilation / linking issues if included in Athena / RootCore + //check for Rivet environment variable RIVET_ANALYSIS_PATH +#ifdef RIVET_ANALYSIS_PATH + // The hook for the plugin system + DECLARE_RIVET_PLUGIN(HiggsTemplateCrossSections); +#endif + +} + +#endif + diff --git a/Generators/TruthRivetTools/TruthRivetTools/HiggsTemplateCrossSectionsDefs.h b/Generators/TruthRivetTools/TruthRivetTools/HiggsTemplateCrossSectionsDefs.h new file mode 100644 index 0000000000000000000000000000000000000000..10492c7aab971b9887d91e8a2f74a4982efec655 --- /dev/null +++ b/Generators/TruthRivetTools/TruthRivetTools/HiggsTemplateCrossSectionsDefs.h @@ -0,0 +1,549 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRUTHRIVETTOOLS_HIGGSTEMPLATECROSSSECTIONSDEFS_H +#define TRUTHRIVETTOOLS_HIGGSTEMPLATECROSSSECTIONSDEFS_H 1 + +/// Higgs Template Cross Section namespace +namespace HTXS { + + /// Error code: whether the classification was successful or failed + enum ErrorCode { + UNDEFINED=-99, + SUCCESS = 0, ///< successful classification + PRODMODE_DEFINED = 1, ///< production mode not defined + MOMENTUM_CONSERVATION = 2, ///< failed momentum conservation + HIGGS_IDENTIFICATION = 3, ///< failed to identify Higgs boson + HIGGS_DECAY_IDENTIFICATION = 4, ///< failed to identify Higgs boson decay products + HS_VTX_IDENTIFICATION = 5, ///< failed to identify hard scatter vertex + VH_IDENTIFICATION = 6, ///< failed to identify associated vector boson + VH_DECAY_IDENTIFICATION = 7, ///< failed to identify associated vector boson decay products + TOP_W_IDENTIFICATION = 8 ///< failed to identify top decay + }; + + /// Higgs production modes, corresponding to input sample + enum HiggsProdMode { + UNKNOWN = 0, + GGF = 1, VBF = 2, WH = 3, QQ2ZH = 4, GG2ZH = 5, + TTH = 6, BBH = 7, TH = 8 + }; + + /// Additional identifier flag for TH production modes + enum tH_type { noTH=0, THQB=1, TWH=2 }; + + /// Two digit number of format PF + /// P is digit for the physics process + /// and F is 0 for |yH|>2.5 and 11 for |yH|<2.5 ("in fiducial") + + /// Namespace for Stage0 categorization + namespace Stage0 { + /// @enum Stage-0 ategorization: Two-digit number of format PF, with P for process and F being 0 for |yH|>2.5 and 1 for |yH|<2.5 + enum Category { + UNKNOWN = 0, GG2H_FWDH = 10, GG2H = 11, VBF_FWDH = 20, VBF = 21, VH2HQQ_FWDH = 22, VH2HQQ = 23, + QQ2HLNU_FWDH = 30, QQ2HLNU = 31, QQ2HLL_FWDH = 40, QQ2HLL = 41, GG2HLL_FWDH = 50, GG2HLL = 51, + TTH_FWDH = 60, TTH = 61, BBH_FWDH = 70, BBH = 71, TH_FWDH = 80, TH = 81 }; + } + + /// Categorization Stage 1: + /// Three digit integer of format PF + /// Where P is a digit representing the process + /// F is a unique integer ( F < 99 ) corresponding to each Stage1 phase-space region (bin) + namespace Stage1 { + enum Category { + UNKNOWN = 0, + // Gluon fusion + GG2H_FWDH = 100, + GG2H_VBFTOPO_JET3VETO = 101, GG2H_VBFTOPO_JET3 = 102, + GG2H_0J = 103, + GG2H_1J_PTH_0_60 = 104, GG2H_1J_PTH_60_120 = 105, + GG2H_1J_PTH_120_200 = 106, GG2H_1J_PTH_GT200 = 107, + GG2H_GE2J_PTH_0_60 = 108, GG2H_GE2J_PTH_60_120 = 109, + GG2H_GE2J_PTH_120_200 = 110, GG2H_GE2J_PTH_GT200 = 111, + // "VBF" + QQ2HQQ_FWDH = 200, + QQ2HQQ_VBFTOPO_JET3VETO = 201, QQ2HQQ_VBFTOPO_JET3 = 202, + QQ2HQQ_VH2JET = 203, QQ2HQQ_REST = 204, QQ2HQQ_PTJET1_GT200 = 205, + // qq -> WH + QQ2HLNU_FWDH = 300, + QQ2HLNU_PTV_0_150 = 301, + QQ2HLNU_PTV_150_250_0J = 302, + QQ2HLNU_PTV_150_250_GE1J = 303, + QQ2HLNU_PTV_GT250 = 304, + // qq -> ZH + QQ2HLL_FWDH = 400, + QQ2HLL_PTV_0_150 = 401, + QQ2HLL_PTV_150_250_0J = 402, + QQ2HLL_PTV_150_250_GE1J = 403, + QQ2HLL_PTV_GT250 = 404, + // gg -> ZH + GG2HLL_FWDH = 500, + GG2HLL_PTV_0_150 = 501, + GG2HLL_PTV_GT150_0J = 502, + GG2HLL_PTV_GT150_GE1J = 503, + // ttH + TTH_FWDH = 600, TTH = 601, + // bbH + BBH_FWDH = 700, BBH = 701, + // tH + TH_FWDH = 800, TH = 801 + }; + } // namespace Stage1 + + /// Categorization Stage 1.2: + /// Three digit integer of format PF + /// Where P is a digit representing the process + /// F is a unique integer ( F < 99 ) corresponding to each Stage1_2 phase-space region (bin) + namespace Stage1_2 { + enum Category { + UNKNOWN = 0, + // Gluon fusion + GG2H_FWDH = 100, + GG2H_PTH_200_300 = 101, + GG2H_PTH_300_450 = 102, + GG2H_PTH_450_650 = 103, + GG2H_PTH_GT650 = 104, + GG2H_0J_PTH_0_10 = 105, + GG2H_0J_PTH_GT10 = 106, + GG2H_1J_PTH_0_60 = 107, + GG2H_1J_PTH_60_120 = 108, + GG2H_1J_PTH_120_200 = 109, + GG2H_GE2J_MJJ_0_350_PTH_0_60 = 110, + GG2H_GE2J_MJJ_0_350_PTH_60_120 = 111, + GG2H_GE2J_MJJ_0_350_PTH_120_200 = 112, + GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25 = 113, + GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25 = 114, + GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25 = 115, + GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25 = 116, + // "VBF" + QQ2HQQ_FWDH = 200, + QQ2HQQ_0J = 201, + QQ2HQQ_1J = 202, + QQ2HQQ_GE2J_MJJ_0_60 = 203, + QQ2HQQ_GE2J_MJJ_60_120 = 204, + QQ2HQQ_GE2J_MJJ_120_350 = 205, + QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200 = 206, + QQ2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25 = 207, + QQ2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25 = 208, + QQ2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25 = 209, + QQ2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25 = 210, + // qq -> WH + QQ2HLNU_FWDH = 300, + QQ2HLNU_PTV_0_75 = 301, + QQ2HLNU_PTV_75_150 = 302, + QQ2HLNU_PTV_150_250_0J = 303, + QQ2HLNU_PTV_150_250_GE1J = 304, + QQ2HLNU_PTV_GT250 = 305, + // qq -> ZH + QQ2HLL_FWDH = 400, + QQ2HLL_PTV_0_75 = 401, + QQ2HLL_PTV_75_150 = 402, + QQ2HLL_PTV_150_250_0J = 403, + QQ2HLL_PTV_150_250_GE1J = 404, + QQ2HLL_PTV_GT250 = 405, + // gg -> ZH + GG2HLL_FWDH = 500, + GG2HLL_PTV_0_75 = 501, + GG2HLL_PTV_75_150 = 502, + GG2HLL_PTV_150_250_0J = 503, + GG2HLL_PTV_150_250_GE1J = 504, + GG2HLL_PTV_GT250 = 505, + // ttH + TTH_FWDH = 600, + TTH_PTH_0_60 = 601, + TTH_PTH_60_120 = 602, + TTH_PTH_120_200 = 603, + TTH_PTH_200_300 = 604, + TTH_PTH_GT300 = 605, + // bbH + BBH_FWDH = 700, BBH = 701, + // tH + TH_FWDH = 800, TH = 801 + }; + } // namespace Stage1_2 + + namespace Stage1_2_Fine { + enum Category { + UNKNOWN = 0, + // Gluon fusion + GG2H_FWDH = 100, + GG2H_PTH_200_300_PTHJoverPTH_0_15 = 101, + GG2H_PTH_300_450_PTHJoverPTH_0_15 = 102, + GG2H_PTH_450_650_PTHJoverPTH_0_15 = 103, + GG2H_PTH_GT650_PTHJoverPTH_0_15 = 104, + GG2H_PTH_200_300_PTHJoverPTH_GT15 = 105, + GG2H_PTH_300_450_PTHJoverPTH_GT15 = 106, + GG2H_PTH_450_650_PTHJoverPTH_GT15 = 107, + GG2H_PTH_GT650_PTHJoverPTH_GT15 = 108, + GG2H_0J_PTH_0_10 = 109, + GG2H_0J_PTH_GT10 = 110, + GG2H_1J_PTH_0_60 = 111, + GG2H_1J_PTH_60_120 = 112, + GG2H_1J_PTH_120_200 = 113, + GG2H_GE2J_MJJ_0_350_PTH_0_60_PTHJJ_0_25 = 114, + GG2H_GE2J_MJJ_0_350_PTH_60_120_PTHJJ_0_25 = 115, + GG2H_GE2J_MJJ_0_350_PTH_120_200_PTHJJ_0_25 = 116, + GG2H_GE2J_MJJ_0_350_PTH_0_60_PTHJJ_GT25 = 117, + GG2H_GE2J_MJJ_0_350_PTH_60_120_PTHJJ_GT25 = 118, + GG2H_GE2J_MJJ_0_350_PTH_120_200_PTHJJ_GT25 = 119, + GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25 = 120, + GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25 = 121, + GG2H_GE2J_MJJ_700_1000_PTH_0_200_PTHJJ_0_25 = 122, + GG2H_GE2J_MJJ_700_1000_PTH_0_200_PTHJJ_GT25 = 123, + GG2H_GE2J_MJJ_1000_1500_PTH_0_200_PTHJJ_0_25 = 124, + GG2H_GE2J_MJJ_1000_1500_PTH_0_200_PTHJJ_GT25 = 125, + GG2H_GE2J_MJJ_GT1500_PTH_0_200_PTHJJ_0_25 = 126, + GG2H_GE2J_MJJ_GT1500_PTH_0_200_PTHJJ_GT25 = 127, + // "VBF" + QQ2HQQ_FWDH = 200, + QQ2HQQ_0J = 201, + QQ2HQQ_1J = 202, + QQ2HQQ_GE2J_MJJ_0_60_PTHJJ_0_25 = 203, + QQ2HQQ_GE2J_MJJ_60_120_PTHJJ_0_25 = 204, + QQ2HQQ_GE2J_MJJ_120_350_PTHJJ_0_25 = 205, + QQ2HQQ_GE2J_MJJ_0_60_PTHJJ_GT25 = 206, + QQ2HQQ_GE2J_MJJ_60_120_PTHJJ_GT25 = 207, + QQ2HQQ_GE2J_MJJ_120_350_PTHJJ_GT25 = 208, + QQ2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25 = 209, + QQ2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25 = 210, + QQ2HQQ_GE2J_MJJ_700_1000_PTH_0_200_PTHJJ_0_25 = 211, + QQ2HQQ_GE2J_MJJ_700_1000_PTH_0_200_PTHJJ_GT25 = 212, + QQ2HQQ_GE2J_MJJ_1000_1500_PTH_0_200_PTHJJ_0_25 = 213, + QQ2HQQ_GE2J_MJJ_1000_1500_PTH_0_200_PTHJJ_GT25 = 214, + QQ2HQQ_GE2J_MJJ_GT1500_PTH_0_200_PTHJJ_0_25 = 215, + QQ2HQQ_GE2J_MJJ_GT1500_PTH_0_200_PTHJJ_GT25 = 216, + QQ2HQQ_GE2J_MJJ_350_700_PTH_GT200_PTHJJ_0_25 = 217, + QQ2HQQ_GE2J_MJJ_350_700_PTH_GT200_PTHJJ_GT25 = 218, + QQ2HQQ_GE2J_MJJ_700_1000_PTH_GT200_PTHJJ_0_25 = 219, + QQ2HQQ_GE2J_MJJ_700_1000_PTH_GT200_PTHJJ_GT25 = 220, + QQ2HQQ_GE2J_MJJ_1000_1500_PTH_GT200_PTHJJ_0_25 = 221, + QQ2HQQ_GE2J_MJJ_1000_1500_PTH_GT200_PTHJJ_GT25 = 222, + QQ2HQQ_GE2J_MJJ_GT1500_PTH_GT200_PTHJJ_0_25 = 223, + QQ2HQQ_GE2J_MJJ_GT1500_PTH_GT200_PTHJJ_GT25 = 224, + // qq -> WH + QQ2HLNU_FWDH = 300, + QQ2HLNU_PTV_0_75_0J = 301, + QQ2HLNU_PTV_75_150_0J = 302, + QQ2HLNU_PTV_150_250_0J = 303, + QQ2HLNU_PTV_250_400_0J = 304, + QQ2HLNU_PTV_GT400_0J = 305, + QQ2HLNU_PTV_0_75_1J = 306, + QQ2HLNU_PTV_75_150_1J = 307, + QQ2HLNU_PTV_150_250_1J = 308, + QQ2HLNU_PTV_250_400_1J = 309, + QQ2HLNU_PTV_GT400_1J = 310, + QQ2HLNU_PTV_0_75_GE2J = 311, + QQ2HLNU_PTV_75_150_GE2J = 312, + QQ2HLNU_PTV_150_250_GE2J = 313, + QQ2HLNU_PTV_250_400_GE2J = 314, + QQ2HLNU_PTV_GT400_GE2J = 315, + // qq -> ZH + QQ2HLL_FWDH = 400, + QQ2HLL_PTV_0_75_0J = 401, + QQ2HLL_PTV_75_150_0J = 402, + QQ2HLL_PTV_150_250_0J = 403, + QQ2HLL_PTV_250_400_0J = 404, + QQ2HLL_PTV_GT400_0J = 405, + QQ2HLL_PTV_0_75_1J = 406, + QQ2HLL_PTV_75_150_1J = 407, + QQ2HLL_PTV_150_250_1J = 408, + QQ2HLL_PTV_250_400_1J = 409, + QQ2HLL_PTV_GT400_1J = 410, + QQ2HLL_PTV_0_75_GE2J = 411, + QQ2HLL_PTV_75_150_GE2J = 412, + QQ2HLL_PTV_150_250_GE2J = 413, + QQ2HLL_PTV_250_400_GE2J = 414, + QQ2HLL_PTV_GT400_GE2J = 415, + // gg -> ZH + GG2HLL_FWDH = 500, + GG2HLL_PTV_0_75_0J = 501, + GG2HLL_PTV_75_150_0J = 502, + GG2HLL_PTV_150_250_0J = 503, + GG2HLL_PTV_250_400_0J = 504, + GG2HLL_PTV_GT400_0J = 505, + GG2HLL_PTV_0_75_1J = 506, + GG2HLL_PTV_75_150_1J = 507, + GG2HLL_PTV_150_250_1J = 508, + GG2HLL_PTV_250_400_1J = 509, + GG2HLL_PTV_GT400_1J = 510, + GG2HLL_PTV_0_75_GE2J = 511, + GG2HLL_PTV_75_150_GE2J = 512, + GG2HLL_PTV_150_250_GE2J = 513, + GG2HLL_PTV_250_400_GE2J = 514, + GG2HLL_PTV_GT400_GE2J = 515, + // ttH + TTH_FWDH = 600, + TTH_PTH_0_60 = 601, + TTH_PTH_60_120 = 602, + TTH_PTH_120_200 = 603, + TTH_PTH_200_300 = 604, + TTH_PTH_300_450 = 605, + TTH_PTH_GT450 = 606, + // bbH + BBH_FWDH = 700, BBH = 701, + // tH + TH_FWDH = 800, TH = 801 + }; + } // namespace Stage1_2_Fine + + +#ifdef ROOT_TLorentzVector + + typedef TLorentzVector TLV; + typedef std::vector<TLV> TLVs; + + template <class vec4> + TLV MakeTLV(vec4 const p) { return TLV(p.px(),p.py(),p.pz(),p.E()); } + + template <class Vvec4> + inline TLVs MakeTLVs(Vvec4 const &rivet_jets){ + TLVs jets; for ( auto jet:rivet_jets ) jets.push_back(MakeTLV(jet)); + return jets; + } + + // Structure holding information about the current event: + // Four-momenta and event classification according to the + // Higgs Template Cross Section + struct HiggsClassification { + // Higgs production mode + HTXS::HiggsProdMode prodMode; + // The Higgs boson + TLV higgs; + // The Higgs boson decay products + TLV p4decay_higgs; + // Associated vector bosons + TLV V; + // The V-boson decay products + TLV p4decay_V; + // Jets are built ignoring Higgs decay products and leptons from V decays + // jets with pT > 25 GeV and 30 GeV + TLVs jets25, jets30; + // Event categorization according to YR4 wrtietup + // https://cds.cern.ch/record/2138079 + HTXS::Stage0::Category stage0_cat; + HTXS::Stage1::Category stage1_cat_pTjet25GeV; + HTXS::Stage1::Category stage1_cat_pTjet30GeV; + HTXS::Stage1_2::Category stage1_2_cat_pTjet25GeV; + HTXS::Stage1_2::Category stage1_2_cat_pTjet30GeV; + HTXS::Stage1_2_Fine::Category stage1_2_fine_cat_pTjet25GeV; + HTXS::Stage1_2_Fine::Category stage1_2_fine_cat_pTjet30GeV; + // Flag for Z->vv decay mode (needed to split QQ2ZH and GG2ZH) + bool isZ2vvDecay; + // Error code :: classification was succesful or some error occured + HTXS::ErrorCode errorCode; + }; + + template <class category> + inline HiggsClassification* Rivet2Root(category const &htxs_cat_rivet){ + HTXS::HiggsClassification* cat = new HTXS::HiggsClassification; + cat->prodMode = htxs_cat_rivet.prodMode; + cat->errorCode = htxs_cat_rivet.errorCode; + cat->higgs = MakeTLV(htxs_cat_rivet.higgs); + cat->V = MakeTLV(htxs_cat_rivet.V); + cat->p4decay_higgs = MakeTLV(htxs_cat_rivet.p4decay_higgs); + cat->p4decay_V = MakeTLV(htxs_cat_rivet.p4decay_V); + cat->jets25 = MakeTLVs(htxs_cat_rivet.jets25); + cat->jets30 = MakeTLVs(htxs_cat_rivet.jets30); + cat->stage0_cat = htxs_cat_rivet.stage0_cat; + cat->stage1_cat_pTjet25GeV = htxs_cat_rivet.stage1_cat_pTjet25GeV; + cat->stage1_cat_pTjet30GeV = htxs_cat_rivet.stage1_cat_pTjet30GeV; + cat->stage1_2_cat_pTjet25GeV = htxs_cat_rivet.stage1_2_cat_pTjet25GeV; + cat->stage1_2_cat_pTjet30GeV = htxs_cat_rivet.stage1_2_cat_pTjet30GeV; + cat->stage1_2_fine_cat_pTjet25GeV = htxs_cat_rivet.stage1_2_fine_cat_pTjet25GeV; + cat->stage1_2_fine_cat_pTjet30GeV = htxs_cat_rivet.stage1_2_fine_cat_pTjet30GeV; + cat->isZ2vvDecay = htxs_cat_rivet.isZ2vvDecay; + return cat; + } + + + + inline int HTXSstage1_to_HTXSstage1FineIndex(HTXS::Stage1::Category stage1, + HiggsProdMode prodMode, tH_type tH) { + + if(stage1==HTXS::Stage1::Category::UNKNOWN) return 0; + int P = (int)(stage1 / 100); + int F = (int)(stage1 % 100); + // 1.a spit tH categories + if (prodMode==HiggsProdMode::TH) { + // check that tH splitting is valid for Stage-1 FineIndex + // else return unknown category + if(tH==tH_type::noTH) return 0; + // check if forward tH + int fwdH = F==0?0:1; + return (49 + 2*(tH-1) +fwdH); + } + // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ + // offset vector 1: input is the Higgs prodMode + // first two indicies are dummies, given that this is only called for prodMode=2,3,4 + std::vector<int> pMode_offset = {0,0,13,19,25}; + if (P==2) return (F + pMode_offset[prodMode]); + // 1.c remaining categories + // offset vector 2: input is the Stage-1 category P + // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7 + std::vector<int> catP_offset = {0,1,0,31,36,41,45,47}; + return (F + catP_offset[P]); + } + + inline int HTXSstage1_to_HTXSstage1FineIndex(const HiggsClassification &stxs, + tH_type tH=noTH, bool jets_pT25 = false) { + HTXS::Stage1::Category stage1 = + jets_pT25==false?stxs.stage1_cat_pTjet30GeV: + stxs.stage1_cat_pTjet25GeV; + return HTXSstage1_to_HTXSstage1FineIndex(stage1,stxs.prodMode,tH); + } + + inline int HTXSstage1_to_index(HTXS::Stage1::Category stage1) { + // the Stage-1 categories + int P = (int)(stage1 / 100); + int F = (int)(stage1 % 100); + std::vector<int> offset{0,1,13,19,24,29,33,35,37,39}; + // convert to linear values + return ( F + offset[P] ); + } + + //Same for Stage1_2 categories + inline int HTXSstage1_2_to_HTXSstage1_2_FineIndex(HTXS::Stage1_2::Category stage1_2, + HiggsProdMode prodMode, tH_type tH) { + + if(stage1_2==HTXS::Stage1_2::Category::UNKNOWN) return 0; + int P = (int)(stage1_2 / 100); + int F = (int)(stage1_2 % 100); + // 1.a spit tH categories + if (prodMode==HiggsProdMode::TH) { + // check that tH splitting is valid for Stage-1 FineIndex + // else return unknown category + if(tH==tH_type::noTH) return 0; + // check if forward tH + int fwdH = F==0?0:1; + return (94 + 2*(tH-1) +fwdH); + } + // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ + // offset vector 1: input is the Higgs prodMode + // first two indicies are dummies, given that this is only called for prodMode=2,3,4 + std::vector<int> pMode_offset = {0,0,35,46,57}; + if (P==2) return (F + pMode_offset[prodMode]); + // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep + if (prodMode==HiggsProdMode::GG2ZH && P==1) return F + 18; + // 1.d remaining categories + // offset vector 2: input is the Stage-1 category P + // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7 + std::vector<int> catP_offset = {0,1,0,68,74,80,86,92}; + return (F + catP_offset[P]); + } + + inline int HTXSstage1_2_to_HTXSstage1_2_FineIndex(const HiggsClassification &stxs, + tH_type tH=noTH, bool jets_pT25 = false) { + HTXS::Stage1_2::Category stage1_2 = + jets_pT25==false?stxs.stage1_2_cat_pTjet30GeV: + stxs.stage1_2_cat_pTjet25GeV; + return HTXSstage1_2_to_HTXSstage1_2_FineIndex(stage1_2,stxs.prodMode,tH); + } + + inline int HTXSstage1_2_to_index(HTXS::Stage1_2::Category stage1_2) { + // the Stage-1 categories + int P = (int)(stage1_2 / 100); + int F = (int)(stage1_2 % 100); + std::vector<int> offset{0,1,18,29,35,41,47,53,55,57}; + // convert to linear values + return ( F + offset[P] ); + } + + //Same for Stage1_2_Fine categories + inline int HTXSstage1_2_Fine_to_HTXSstage1_2_Fine_FineIndex(HTXS::Stage1_2_Fine::Category Stage1_2_Fine, + HiggsProdMode prodMode, tH_type tH) { + + if(Stage1_2_Fine==HTXS::Stage1_2_Fine::Category::UNKNOWN) return 0; + int P = (int)(Stage1_2_Fine / 100); + int F = (int)(Stage1_2_Fine % 100); + // 1.a spit tH categories + if (prodMode==HiggsProdMode::TH) { + // check that tH splitting is valid for Stage-1 FineIndex + // else return unknown category + if(tH==tH_type::noTH) return 0; + // check if forward tH + int fwdH = F==0?0:1; + return (189 + 2*(tH-1) +fwdH); + } + // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ + // offset vector 1: input is the Higgs prodMode + // first two indicies are dummies, given that this is only called for prodMode=2,3,4 + std::vector<int> pMode_offset = {0,0,57,82,107}; + if (P==2) return (F + pMode_offset[prodMode]); + // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep + if (prodMode==HiggsProdMode::GG2ZH && P==1) return F + 29; + // 1.d remaining categories + // offset vector 2: input is the Stage-1 category P + // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7 + std::vector<int> catP_offset = {0,1,0,132,148,164,180,187}; + return (F + catP_offset[P]); + } + + inline int HTXSstage1_2_Fine_to_HTXSstage1_2_Fine_FineIndex(const HiggsClassification &stxs, + tH_type tH=noTH, bool jets_pT25 = false) { + HTXS::Stage1_2_Fine::Category Stage1_2_Fine = + jets_pT25==false?stxs.stage1_2_fine_cat_pTjet30GeV: + stxs.stage1_2_fine_cat_pTjet25GeV; + return HTXSstage1_2_Fine_to_HTXSstage1_2_Fine_FineIndex(Stage1_2_Fine,stxs.prodMode,tH); + } + + inline int HTXSstage1_2_Fine_to_index(HTXS::Stage1_2_Fine::Category Stage1_2_Fine) { + // the Stage-1_2_Fine categories + int P = (int)(Stage1_2_Fine / 100); + int F = (int)(Stage1_2_Fine % 100); + std::vector<int> offset{0,1,29,54,70,86,102,109,111,113}; + // convert to linear values + return ( F + offset[P] ); + } + + +#endif // ROOT_TLorentzVector + +} // namespace HTXS + + +#ifdef RIVET_Particle_HH + +namespace Rivet { + + /// @struct HiggsClassification + /// @brief Structure holding information about the current event: + /// Four-momenta and event classification according to the + /// Higgs Template Cross Section + struct HiggsClassification { + /// Higgs production mode + HTXS::HiggsProdMode prodMode; + /// The Higgs boson + Rivet::Particle higgs; + /// Vector boson produced in asscoiation with the Higgs + Rivet::Particle V; + /// The four momentum sum of all stable decay products orignating from the Higgs boson + Rivet::FourMomentum p4decay_higgs; + /// The four momentum sum of all stable decay products orignating from the vector boson in associated production + Rivet::FourMomentum p4decay_V; + /// Jets built ignoring Higgs decay products and leptons from V decays, pT thresholds at 25 GeV and 30 GeV + Rivet::Jets jets25, jets30; + /// Stage-0 HTXS event classifcation, see: https://cds.cern.ch/record/2138079 + HTXS::Stage0::Category stage0_cat; + /// Stage-1 HTXS event classifcation, see: https://cds.cern.ch/record/2138079 + HTXS::Stage1::Category stage1_cat_pTjet25GeV; + /// Stage-1 HTXS event classifcation, see: https://cds.cern.ch/record/2138079 + HTXS::Stage1::Category stage1_cat_pTjet30GeV; + /// Stage-1_2 STXS event classifcation, see: https://twiki.cern.ch/twiki/bin/view/LHCPhysics/LHCHXSWGFiducialAndSTXS#Stage_1_2 + HTXS::Stage1_2::Category stage1_2_cat_pTjet25GeV; + /// Stage-1_2 STXS event classifcation, see: https://twiki.cern.ch/twiki/bin/view/LHCPhysics/LHCHXSWGFiducialAndSTXS#Stage_1_2 + HTXS::Stage1_2::Category stage1_2_cat_pTjet30GeV; + /// Stage-1_2 STXS event classifcation, see: https://twiki.cern.ch/twiki/bin/view/LHCPhysics/LHCHXSWGFiducialAndSTXS#Stage_1_2 + HTXS::Stage1_2_Fine::Category stage1_2_fine_cat_pTjet25GeV; + /// Stage-1_2 STXS event classifcation, see: https://twiki.cern.ch/twiki/bin/view/LHCPhysics/LHCHXSWGFiducialAndSTXS#Stage_1_2 + HTXS::Stage1_2_Fine::Category stage1_2_fine_cat_pTjet30GeV; + /// Flag to distiguish the Z->vv and Z->l+l- decay modes + bool isZ2vvDecay; + /// Error code: Whether classification was succesful or some error occured + HTXS::ErrorCode errorCode; + }; +} // namespace Rivet +#endif // RIVET_Particle_HH + + + +#endif // TRUTHRIVETTOOLS_HIGGSTEMPLATECROSSSECTIONSDEFS_H diff --git a/Generators/TruthRivetTools/TruthRivetTools/HiggsTruthCategoryTool.h b/Generators/TruthRivetTools/TruthRivetTools/HiggsTruthCategoryTool.h new file mode 100644 index 0000000000000000000000000000000000000000..77e63f24a7493f9fc27c2ed40069befb41530871 --- /dev/null +++ b/Generators/TruthRivetTools/TruthRivetTools/HiggsTruthCategoryTool.h @@ -0,0 +1,56 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/* + * Dual-use tool interface for Rivet routine for classifying MC events according to the Higgs template cross section categories + * Authors: Jim Lacey (Carleton University) + * <james.lacey@cern.ch,jlacey@physics.carleton.ca> + */ + +#ifndef TRUTHRIVETTOOLS_HIGGSTRUTHCATEGORYTOOL_H +#define TRUTHRIVETTOOLS_HIGGSTRUTHCATEGORYTOOL_H 1 + +#include "Rivet/AnalysisHandler.hh" +#include "TruthRivetTools/HiggsTemplateCrossSections.h" + +// To avoid coflict of UNUSED macro of +// Control/CxxUtils/CxxUtils/unused.h and Rivet/Tools/Utils.hh +#ifdef UNUSED +#undef UNUSED +#endif // UNUSED + +// Base classes +#include "AsgTools/AsgTool.h" +#include "GenInterfaces/IHiggsTruthCategoryTool.h" + +// Return type (non-pointer) +// Note: the Template XSec Defs *depends* on having included +// the TLorentzVector header *before* it is included -- it +// uses the include guard from TLorentzVector to decide +// what is available +#include "TLorentzVector.h" +#include "TruthRivetTools/HiggsTemplateCrossSectionsDefs.h" + +#include "AtlasHepMC/GenEvent.h" + +class HiggsTruthCategoryTool +: public asg::AsgTool, + public virtual IHiggsTruthCategoryTool +{ + public: + ASG_TOOL_CLASS( HiggsTruthCategoryTool , IHiggsTruthCategoryTool ) + HiggsTruthCategoryTool( const std::string& name ); + ~HiggsTruthCategoryTool() { }; + public: + Rivet::AnalysisHandler *rivetAnaHandler; //! + Rivet::HiggsTemplateCrossSections *higgsTemplateCrossSections; //! + virtual StatusCode initialize() override; + StatusCode finalize () override; + HTXS::HiggsClassification* getHiggsTruthCategoryObject(const HepMC::GenEvent& HepMCEvent, const HTXS::HiggsProdMode prodMode) override; + private: + bool m_isInitialized; + bool m_outHistos; +}; + +#endif //> !HIGGSTRUTHCLASSIFIER_HIGGSTRUTHCATEGORYTOOL_H diff --git a/Generators/TruthRivetTools/TruthRivetTools/TruthRivetToolsDict.h b/Generators/TruthRivetTools/TruthRivetTools/TruthRivetToolsDict.h new file mode 100644 index 0000000000000000000000000000000000000000..d1c737a66c7ee26abe4f2f90b27918ac0b23bb47 --- /dev/null +++ b/Generators/TruthRivetTools/TruthRivetTools/TruthRivetToolsDict.h @@ -0,0 +1,11 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id: TruthRivetToolsDict.h 769074 2016-08-22 10:04:26Z krasznaa $ +#ifndef TRUTHRIVETTOOLS_TRUTHRIVETTOOLSDICT_H +#define TRUTHRIVETTOOLS_TRUTHRIVETTOOLSDICT_H + +#include "TruthRivetTools/HiggsTruthCategoryTool.h" + +#endif // TRUTHRIVETTOOLS_TRUTHRIVETTOOLSDICT_H diff --git a/Generators/TruthRivetTools/TruthRivetTools/selection.xml b/Generators/TruthRivetTools/TruthRivetTools/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..1068f79214da02683378b29eb62fa74ae58795d3 --- /dev/null +++ b/Generators/TruthRivetTools/TruthRivetTools/selection.xml @@ -0,0 +1,4 @@ +<lcgdict> + <class name="HiggsTruthCategoryTool" /> + <class name="IHiggsTruthCategoryTool" /> +</lcgdict> diff --git a/Generators/TruthRivetTools/src/components/TruthRivetTools_entries.cxx b/Generators/TruthRivetTools/src/components/TruthRivetTools_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..669dd2a7bb8aba977cac94a4b9ad86c627bf771e --- /dev/null +++ b/Generators/TruthRivetTools/src/components/TruthRivetTools_entries.cxx @@ -0,0 +1,3 @@ +#include "TruthRivetTools/HiggsTruthCategoryTool.h" + +DECLARE_COMPONENT( HiggsTruthCategoryTool ) \ No newline at end of file diff --git a/Generators/TruthUtils/CMakeLists.txt b/Generators/TruthUtils/CMakeLists.txt index e82e414ea1dceb95010dfd7a869c7671806feb17..c13fbe6a159e845b9fbf7e0c2ee1dc27393a431b 100644 --- a/Generators/TruthUtils/CMakeLists.txt +++ b/Generators/TruthUtils/CMakeLists.txt @@ -1,18 +1,9 @@ -# $Id: CMakeLists.txt 744476 2016-05-03 13:24:11Z krasznaa $ -################################################################################ -# Package: TruthUtils -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TruthUtils ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Generators/AtlasHepMC ) - # External dependencies: -find_package( Boost ) find_package( HEPUtils ) find_package( MCUtils ) find_package( HepMC ) @@ -37,5 +28,5 @@ endif() atlas_add_library( TruthUtils TruthUtils/*.h Root/*.cxx PUBLIC_HEADERS TruthUtils - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${extra_includes} - LINK_LIBRARIES ${Boost_LIBRARIES} ${extra_libs} ) + INCLUDE_DIRS ${extra_includes} + LINK_LIBRARIES ${extra_libs} ) diff --git a/HLT/Trigger/TrigControl/TrigPSC/share/TrigPSCPythonDbSetup.py b/HLT/Trigger/TrigControl/TrigPSC/share/TrigPSCPythonDbSetup.py index 1ba9ef0567df46eeb4bd7c5e2b781edae4ca87dc..120f219b32c7797e2dbb42e1e3dedb36d80af155 100644 --- a/HLT/Trigger/TrigControl/TrigPSC/share/TrigPSCPythonDbSetup.py +++ b/HLT/Trigger/TrigControl/TrigPSC/share/TrigPSCPythonDbSetup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ############################################################### ## @file TrigPSCPythonDbSetup.py @@ -6,8 +6,8 @@ ## @author Frank Winklmeier ############################################################### -## This is a very minimal Python setup. It is only included when -## the POSTCOMMAND is non-empty while running from the DB. +## This is a very minimal Python setup. It is only used when running +## with athenaHLT from the DB. It is not used in a partition! ## Besides providing basic python bindings it also takes care of ## switching the OutputLevel in case the "-l" option was used. @@ -39,6 +39,10 @@ from GaudiPython import * from GaudiPython.Bindings import iProperty from TrigCommon.TrigPyHelper import trigApp +## If HLT PSK is set on command line read it from DB (and not COOL) +if 'hltkey' in PscConfig.optmap['JOBOPTIONSPATH']: + trigApp.changeJobProperties('HLTPrescaleCondAlg', 'Source', 'DB') + ## Set OutputLevel in JobOptionsSvc if "-l" option was used in athenaHLT if logLevel!="INFO": outputLevel = int(locals()[logLevel]) diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OccupancyMapMaker.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OccupancyMapMaker.h new file mode 100755 index 0000000000000000000000000000000000000000..6880b883bdb3d747465b881aa836c57576f9a143 --- /dev/null +++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OccupancyMapMaker.h @@ -0,0 +1,107 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef PIXELCONDITIONSALGS_OCCUPANCYMAPMAKER_H +#define PIXELCONDITIONSALGS_OCCUPANCYMAPMAKER_H + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "GaudiKernel/ServiceHandle.h" + +#include "InDetConditionsSummaryService/IInDetConditionsTool.h" + +#include <string> +#include <sstream> +#include <vector> +#include <fstream> +#include <utility> // pair + +class ITHistSvc; +class PixelID; +class TH2D; +class TH2C; +class TH1D; + +class OccupancyMapMaker: public AthAlgorithm{ + public: + OccupancyMapMaker (const std::string& name, ISvcLocator* pSvcLocator); + ~OccupancyMapMaker(); + + StatusCode initialize(); + StatusCode execute(); + StatusCode finalize(); + + private: + std::string getDCSIDFromPosition(int bec, int layer, int modPhi, int modEta); + + std::vector<std::string> &splitter(const std::string &str, char delim, std::vector<std::string> &elems); + + std::vector<std::string> splitter(const std::string &str, char delim); + StatusCode registerHistograms(); + + const std::string histoSuffix(const int bec, const int layer); + + private: + ServiceHandle <ITHistSvc> m_tHistSvc; + + ToolHandle<IInDetConditionsTool> m_pixelConditionsTool + {this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; + + const PixelID *m_pixelID; + + // vector of modulename and vector(barrel/endcap, layer, phi, eta) + std::vector< std::pair< std::string, std::vector<int> > > m_pixelMapping; + + std::string m_pixelRDOKey; + std::vector<int> m_moduleHashList; + + double m_nEvents; + // double m_occupancyCut; + + TH1D* m_nEventsHist; + TH1D* m_nEventsLBHist; + std::vector<TH2D*> m_hitMaps; + std::vector<TH2C*> m_noiseMaps; + std::vector<TH1D*> m_LBdependence; + std::vector<TH1D*> m_BCIDdependence; + std::vector<TH1D*> m_TOTdistributions; + + TH1D *m_disabledModules; + TH2D *m_overlayedPixelNoiseMap; + TH2D *m_overlayedIBLDCNoiseMap; // Planar Double Chip + TH2D *m_overlayedIBLSCNoiseMap; // 3D Single Chip + //TH2D* m_overlayedDBMNoiseMap; // DBM + + // cuts .... + double m_disk1ACut; // disk-1, A-side + double m_disk2ACut; // disk-2, A-side + double m_disk3ACut; // disk-3, A-side + double m_disk1CCut; // disk-1, C-side + double m_disk2CCut; // disk-2, C-side + double m_disk3CCut; // disk-3, C-side + double m_iblCut; // IBL + double m_bLayerCut; // B-Layer + double m_layer1Cut; // Layer 1 + double m_layer2Cut; // Layer 2 + double m_dbmCut; // DBM + + int m_hist_lbMax; // max number of LB + + double m_longPixelMultiplier; + double m_gangedPixelMultiplier; + + // int m_maxLVL1A; + + bool m_occupancyPerBC; + + unsigned int m_nBCReadout; + + unsigned int m_evt_lbMin; // lower limit for LB to be taken into account + unsigned int m_evt_lbMax; // upper limit for LB to be taken into account + + bool m_calculateNoiseMaps; + + std::string m_mapFile; +}; + +#endif // PIXELCONDITIONSALGS_OCCUPANCYMAPMAKERH_ diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelConvert.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/PixelCalibAlgs/PixelConvert.h rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelConvert.h diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/OccupancyMapMaker.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/OccupancyMapMaker.cxx new file mode 100755 index 0000000000000000000000000000000000000000..b235a2e19927aa2a39994e1e8daa5aaa7618a0ac --- /dev/null +++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/OccupancyMapMaker.cxx @@ -0,0 +1,733 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +// PixelCalibAlgs +#include "PixelCalibAlgs/OccupancyMapMaker.h" +#include "PixelCalibAlgs/PixelConvert.h" + +// Gaudi +#include "GaudiKernel/ITHistSvc.h" + +// EDM +#include "InDetRawData/PixelRDO_Container.h" +#include "EventInfo/EventInfo.h" +#include "EventInfo/EventID.h" + +// geometry +#include "InDetIdentifier/PixelID.h" + +// Thread safety check +#include "CxxUtils/checker_macros.h" + +// ROOT +#include "TH2.h" +#include "TString.h" + +// standard library +#include <string> +#include <sstream> +#include <algorithm> +#include <map> +#include <fstream> +#include <cstdlib> + +OccupancyMapMaker::OccupancyMapMaker(const std::string& name, ISvcLocator* pSvcLocator) : + AthAlgorithm(name, pSvcLocator), + m_tHistSvc("THistSvc", name), + m_pixelID(0), + m_pixelRDOKey("PixelRDOs"), + m_nEvents(0.), + m_nEventsHist(nullptr), + m_nEventsLBHist(nullptr), + m_disabledModules(nullptr), + m_overlayedPixelNoiseMap(nullptr), + m_overlayedIBLDCNoiseMap(nullptr), + m_overlayedIBLSCNoiseMap(nullptr), + m_disk1ACut(1.e-3), + m_disk2ACut(1.e-3), + m_disk3ACut(1.e-3), + m_disk1CCut(1.e-3), + m_disk2CCut(1.e-3), + m_disk3CCut(1.e-3), + m_iblCut(1.e-3), + m_bLayerCut(1.e-3), + m_layer1Cut(1.e-3), + m_layer2Cut(1.e-3), + m_dbmCut(1.e-3), + m_hist_lbMax(3001), + m_longPixelMultiplier(1.5), + m_gangedPixelMultiplier(2.), + m_occupancyPerBC(true), + m_nBCReadout(2), + m_evt_lbMin(0), + m_evt_lbMax(-1), + m_calculateNoiseMaps(false), + m_mapFile("PixelMapping_Run2.dat") +{ + declareProperty("PixelRDOKey", m_pixelRDOKey, "StoreGate key of pixel RDOs"); + declareProperty("Disk1ACut", m_disk1ACut, "Occupancy cut for Disk1A pixels"); + declareProperty("Disk2ACut", m_disk2ACut, "Occupancy cut for Disk2A pixels"); + declareProperty("Disk3ACut", m_disk3ACut, "Occupancy cut for Disk3A pixels"); + declareProperty("Disk1CCut", m_disk1CCut, "Occupancy cut for Disk1C pixels"); + declareProperty("Disk2CCut", m_disk2CCut, "Occupancy cut for Disk2C pixels"); + declareProperty("Disk3CCut", m_disk3CCut, "Occupancy cut for Disk3C pixels"); + declareProperty("BLayerCut", m_bLayerCut, "Occupancy cut for BLayer pixels"); + declareProperty("Layer1Cut", m_layer1Cut, "Occupancy cut for Layer1 pixels"); + declareProperty("Layer2Cut", m_layer2Cut, "Occupancy cut for Layer2 pixels"); + declareProperty("IBLCut", m_dbmCut, "Occupancy cut for DBM pixels"); + declareProperty("nLBmax", m_hist_lbMax, "Maximum number of LB (for histograms binning)"); + declareProperty("NBCReadout", m_nBCReadout, "Number of bunch crossings read out"); + declareProperty("LBMin", m_evt_lbMin, "First lumi block to consider"); + declareProperty("LBMax", m_evt_lbMax, "Last lumi block to consider"); + declareProperty("LongPixelMultiplier", m_longPixelMultiplier, "Multiplier for long pixels"); + declareProperty("GangedPixelMultiplier", m_gangedPixelMultiplier, "Multiplier for ganged pixels"); + declareProperty("OccupancyPerBC", m_occupancyPerBC, "Calculate occupancy per BC or per event"); + declareProperty("CalculateNoiseMaps", m_calculateNoiseMaps, "If false only build hit maps"); + declareProperty("InputPixelMap", m_mapFile); + declareProperty("THistSvc", m_tHistSvc, "THistSvc"); +} + +OccupancyMapMaker::~OccupancyMapMaker(){} + +StatusCode OccupancyMapMaker::initialize(){ + ATH_MSG_INFO("Initializing OccupancyMapMaker"); + + ATH_CHECK(m_tHistSvc.retrieve()); + ATH_CHECK(m_pixelConditionsTool.retrieve()); + ATH_CHECK(detStore()->retrieve(m_pixelID, "PixelID")); + + // resize vectors of histograms + const Identifier::size_type maxHash = m_pixelID->wafer_hash_max(); + ATH_MSG_INFO("PixelID maxHash = " << maxHash); + m_hitMaps.resize(maxHash); + m_LBdependence.resize(maxHash); + m_BCIDdependence.resize(maxHash); + m_TOTdistributions.resize(maxHash); + if(m_calculateNoiseMaps) { + m_noiseMaps.resize(maxHash); + } + return registerHistograms(); +} + +std::string OccupancyMapMaker::getDCSIDFromPosition (int barrel_ec, int layer, int modPhi, int module_eta){ + for(unsigned int ii = 0; ii < m_pixelMapping.size(); ii++) { + if (m_pixelMapping[ii].second.size() != 4) { + ATH_MSG_WARNING( "getDCSIDFromPosition: Vector size is not 4!" ); + return std::string("Error!"); + } + if (m_pixelMapping[ii].second[0] != barrel_ec) continue; + if (m_pixelMapping[ii].second[1] != layer) continue; + if (m_pixelMapping[ii].second[2] != modPhi) continue; + if (m_pixelMapping[ii].second[3] != module_eta) continue; + return m_pixelMapping[ii].first; + } + ATH_MSG_WARNING( "Not found!" ); + return std::string("Error!"); +} + +const std::string OccupancyMapMaker::histoSuffix(const int bec, const int layer){ + std::ostringstream out; + + switch(bec) { + case 0: + out << "barrel/"; + if(layer==0) { out << "IBL"; } + else if(layer==1) { out << "B-layer"; } + else { out << "Layer" << layer-1; } + break; + case +2: out << "endcapA/Disk" << layer+1; break; + case -2: out << "endcapC/Disk" << layer+1; break; + case +4: out << "DBMA/Layer" << layer+1; break; + case -4: out << "DBMC/Layer" << layer+1; break; + default: break; + } + return out.str(); +} + +std::vector<std::string>& OccupancyMapMaker::splitter(const std::string &str, + char delim, + std::vector<std::string> &elems) { + std::stringstream ss(str); + std::string item; + while (std::getline(ss, item, delim)) { + elems.push_back(item); + } + return elems; +} + +std::vector<std::string> OccupancyMapMaker::splitter(const std::string &str, + char delim) { + std::vector<std::string> elems; + splitter(str, delim, elems); + return elems; +} + +StatusCode OccupancyMapMaker::registerHistograms(){ + + char* getenvPath = std::getenv("DATAPATH"); + const unsigned int maxPathStringLength{3000}; + if((not getenvPath) or (strlen(getenvPath) > maxPathStringLength) ){ + ATH_MSG_FATAL( "Unable to retrieve environmental DATAPATH" ); + return StatusCode::FAILURE; + } + std::stringstream tmpSstr{}; + tmpSstr<<getenvPath; + std::string tmppath(tmpSstr.str()); + + std::vector<std::string> paths = splitter(tmppath, ':'); + bool found(false); + for(const auto& x : paths){ + std::ifstream infile( (x+"/"+m_mapFile).c_str() ); + if( infile.is_open() ){ + ATH_MSG_INFO("Mapping file '" << m_mapFile << "' found in " << x); + + int tmp_barrel_ec; int tmp_layer; int tmp_modPhi; int tmp_module_eta; std::string tmp_module_name; + std::vector<int> tmp_position; + tmp_position.resize(4); + while(infile >> tmp_barrel_ec >> tmp_layer >> tmp_modPhi >> tmp_module_eta >> tmp_module_name) { + tmp_position[0] = tmp_barrel_ec; + tmp_position[1] = tmp_layer; + tmp_position[2] = tmp_modPhi; + tmp_position[3] = tmp_module_eta; + m_pixelMapping.push_back(std::make_pair(tmp_module_name, tmp_position)); + } + + found=true; + infile.close(); + break; + } + } + + if( !found ){ + ATH_MSG_FATAL("Mapping file '" << m_mapFile << "' not found in DATAPATH !!!"); + return StatusCode::FAILURE; + } + + m_nEventsHist = new TH1D("NEvents", "NEvents", 1, 0, 1); + m_tHistSvc->regHist("/histfile/NEvents", m_nEventsHist).setChecked(); + + m_nEventsLBHist = new TH1D("NEventsLB", "NEventsLB", m_hist_lbMax, -0.5, m_hist_lbMax+0.5); + m_tHistSvc->regHist("/histfile/NEventsLB", m_nEventsLBHist).setChecked(); + + for (PixelID::const_id_iterator wafer_it=m_pixelID->wafer_begin(); wafer_it!=m_pixelID->wafer_end(); ++wafer_it) { + Identifier ident = *wafer_it; + if(!m_pixelID->is_pixel(ident)) continue; + + //const InDetDD::PixelModuleDesign* design = dynamic_cast<const InDetDD::PixelModuleDesign*>(&element->design()); + //if(!design) continue; + //unsigned int mchips = design->numberOfCircuits(); + + int bec = m_pixelID->barrel_ec(ident); + int layer = m_pixelID->layer_disk(ident); + int modPhi = m_pixelID->phi_module(ident); + int module_eta = m_pixelID->eta_module(ident); + int modHash = m_pixelID->wafer_hash(ident); + + std::string onlineID = + getDCSIDFromPosition(bec,layer,modPhi,module_eta); + + std::ostringstream name; + + // hitmap + if( bec == 0 && layer == 0) // IBL + m_hitMaps[modHash] = new TH2D(onlineID.c_str(), onlineID.c_str(), 160, 0, 160, 336, 0, 336); + else if( abs(bec) == 4 ) // DBM + m_hitMaps[modHash] = new TH2D(onlineID.c_str(), onlineID.c_str(), 80, 0, 80, 336, 0, 336); + else + m_hitMaps[modHash] = new TH2D(onlineID.c_str(), onlineID.c_str(), 144, 0, 144, 328, 0, 328); + name << "/histfile/hitMaps_" << histoSuffix(bec,layer) << "/" << onlineID; + m_tHistSvc->regHist(name.str().c_str(), m_hitMaps[modHash]).setChecked(); + name.str(""); name.clear(); + + + // LB dependence + m_LBdependence[modHash] = new TH1D(onlineID.c_str(), onlineID.c_str(), m_hist_lbMax, -0.5, m_hist_lbMax + 0.5); + name << "/histfile/LBdep_" << histoSuffix(bec,layer) << "/" << onlineID; + m_tHistSvc->regHist(name.str().c_str(), m_LBdependence[modHash]).setChecked(); + name.str(""); name.clear(); + + // BCID dependence + m_BCIDdependence[modHash] = new TH1D(onlineID.c_str(), onlineID.c_str(), 301, -0.5, 300.5); + name << "/histfile/BCIDdep_" << histoSuffix(bec,layer) << "/" << onlineID; + m_tHistSvc->regHist(name.str().c_str(), m_BCIDdependence[modHash]).setChecked(); + name.str(""); name.clear(); + + // TOT + if( bec == 0 && layer == 0) // IBL + m_TOTdistributions[modHash] = new TH1D(onlineID.c_str(), onlineID.c_str(), 19, -0.5, 18.5); + else + m_TOTdistributions[modHash] = new TH1D(onlineID.c_str(), onlineID.c_str(), 256, -0.5, 255.5); + name << "/histfile/TOT_" << histoSuffix(bec,layer) << "/" << onlineID; + m_tHistSvc->regHist(name.str().c_str(), m_TOTdistributions[modHash]).setChecked(); + name.str(""); name.clear(); + + // noisemap + if( m_calculateNoiseMaps ){ + if( bec == 0 && layer == 0) // IBL + m_noiseMaps[modHash] = new TH2C(onlineID.c_str(), onlineID.c_str(), 160, 0, 160, 336, 0, 336); + else if( abs(bec) == 4 ) // DBM + m_noiseMaps[modHash] = new TH2C(onlineID.c_str(), onlineID.c_str(), 80, 0, 80, 336, 0, 336); + else + m_noiseMaps[modHash] = new TH2C(onlineID.c_str(), onlineID.c_str(), 144, 0, 144, 328, 0, 328); + name << "/histfile/noiseMaps_" << histoSuffix(bec,layer) << "/" << onlineID; + m_tHistSvc->regHist(name.str().c_str(), m_noiseMaps[modHash]).setChecked(); + name.str(""); name.clear(); + } + } // end loop in detector elements + + m_disabledModules = new TH1D("DisabledModules", "Number of events disabled vs. IdentifierHash", 2048, 0, 2048); + m_tHistSvc->regHist("/histfile/DisabledModules", m_disabledModules).setChecked(); + + if (m_calculateNoiseMaps) { + m_overlayedPixelNoiseMap = new TH2D("overlayedPixelNoiseMap", "Noisy pixel map overlayed all Pixel modules", 144, 0, 144, 328, 0, 328); + m_tHistSvc->regHist("/histfile/overlayedPixelNoiseMap", m_overlayedPixelNoiseMap).setChecked(); + + m_overlayedIBLDCNoiseMap = new TH2D("overlayedIBLDCNoiseMap", "Noisy pixel map overlayed all IBL Planar modules", 160, 0, 160, 336, 0, 336); + m_tHistSvc->regHist("/histfile/overlayedIBLDCNoiseMap", m_overlayedIBLDCNoiseMap).setChecked(); + + m_overlayedIBLSCNoiseMap = new TH2D("overlayedIBLSCNoiseMap", "Noisy pixel map overlayed all IBL 3D modules", 80, 0, 80, 336, 0, 336); + m_tHistSvc->regHist("/histfile/overlayedIBLSCNoiseMap", m_overlayedIBLSCNoiseMap).setChecked(); + } + + return StatusCode::SUCCESS; +} + +//========================================================= +// +// execute +// +//========================================================= +StatusCode OccupancyMapMaker::execute(){ + ATH_MSG_DEBUG( "Executing OccupancyMapMaker" ); + + // retrieve EventInfo + const EventInfo* eventInfo; + StatusCode sc = sgSvc()->retrieve(eventInfo); + if( !sc.isSuccess() ){ + ATH_MSG_FATAL("Unable to retrieve event info"); + return StatusCode::FAILURE; + } ATH_MSG_DEBUG("Event info retrieved"); + + // check LB is in allowed range + unsigned int LB = eventInfo->event_ID()->lumi_block(); + if( (LB < m_evt_lbMin) || (m_evt_lbMax >= m_evt_lbMin && LB > m_evt_lbMax) ){ + ATH_MSG_VERBOSE("Event in lumiblock " << eventInfo->event_ID()->lumi_block() << + " not in selected range [" << m_evt_lbMin << "," << m_evt_lbMax << "] => skipped"); + return StatusCode::SUCCESS; + } + + // retrieve PixelRDO container + const PixelRDO_Container* pixelRDOs = nullptr; + sc = sgSvc()->retrieve(pixelRDOs, m_pixelRDOKey); + if( !sc.isSuccess() ){ + ATH_MSG_FATAL( "Unable to retrieve pixel RDO container at " << m_pixelRDOKey ); + return StatusCode::FAILURE; + } ATH_MSG_DEBUG( "Pixel RDO container retrieved" ); + + // loop in RDO container + for(PixelRDO_Container::const_iterator coll=pixelRDOs->begin(); + coll!=pixelRDOs->end(); ++coll){ + + const InDetRawDataCollection<PixelRDORawData>* PixelRDOCollection(*coll); + if(PixelRDOCollection != 0){ + Identifier moduleID = PixelRDOCollection->identify(); + IdentifierHash modHash = m_pixelID->wafer_hash(moduleID); + ATH_MSG_VERBOSE("moduleID, modHash = " << moduleID << " , " << modHash); + + // exclude module if reported as not good by PixelConditionsSummaryTool + if( !(m_pixelConditionsTool->isGood(modHash)) ) { + ATH_MSG_VERBOSE("Module excluded as reported not good by PixelConditionsSummaryTool"); + continue; + } + + // exclude module if containg FE synch errors + if (m_pixelConditionsTool->hasBSError(modHash)) { + ATH_MSG_VERBOSE("Module excluded as containing FE synch errors"); + continue; + } + + for(DataVector<PixelRDORawData>::const_iterator rdo = PixelRDOCollection->begin(); + rdo!=PixelRDOCollection->end(); ++rdo){ + Identifier rdoID = (*rdo)->identify(); + unsigned int pixel_eta = m_pixelID->eta_index(rdoID); + unsigned int pixel_phi = m_pixelID->phi_index(rdoID); + + int TOT = (*rdo)->getToT(); // it returns a 8 bits "word" + int BCID = (*rdo)->getBCID(); + + m_hitMaps[modHash]->Fill(pixel_eta, pixel_phi); + m_LBdependence[modHash]->Fill(LB); + m_BCIDdependence[modHash]->Fill(BCID); + m_TOTdistributions[modHash]->Fill(TOT); + } + } + } + + + // [sgs] why is this done in every event ??? + for(unsigned int moduleHash = 0; moduleHash < m_pixelID->wafer_hash_max(); moduleHash++) { + if( !m_pixelConditionsTool->isActive( moduleHash ) ){ + m_disabledModules->Fill( moduleHash ); + } + } + + m_nEvents++; + m_nEventsHist->Fill(0.5); + m_nEventsLBHist->Fill(LB); + + return StatusCode::SUCCESS; +} + + +//========================================================= +// +// finalize +// +//========================================================= +StatusCode OccupancyMapMaker::finalize() { + ATH_MSG_INFO("Finalizing OccupancyMapMaker"); + + if(m_occupancyPerBC) + m_nEvents *= m_nBCReadout; + + const int minLogOccupancy = 8; + const double minOccupancy = pow(10.,-minLogOccupancy); + + TH1D* globalOccupancy= new TH1D("occupancy", "Pixel occupancy", minLogOccupancy*10, -minLogOccupancy, 0.); + m_tHistSvc->regHist("/histfile/occupancy",globalOccupancy).setChecked(); + + std::map<std::string, TH1D*> h_occupancy; + + // occupancy histograms for different components of the Pixel detector + std::vector<std::string> vcomponent; + vcomponent.push_back("Disk1A"); + vcomponent.push_back("Disk2A"); + vcomponent.push_back("Disk3A"); + vcomponent.push_back("Disk1C"); + vcomponent.push_back("Disk2C"); + vcomponent.push_back("Disk3C"); + vcomponent.push_back("IBL"); + vcomponent.push_back("B-layer"); + vcomponent.push_back("Layer1"); + vcomponent.push_back("Layer2"); + vcomponent.push_back("DBMA"); + vcomponent.push_back("DBMC"); + + for(std::vector<std::string>::const_iterator cit=vcomponent.begin(); cit!=vcomponent.end(); ++cit) { + const std::string comp = (*cit); + h_occupancy[comp] = new TH1D( ("occupancy"+comp).c_str(), ("Pixel occupancy "+comp).c_str(), + minLogOccupancy*10, -minLogOccupancy, 0); + m_tHistSvc->regHist(("/histfile/occupancy"+comp).c_str(), h_occupancy[comp]).setChecked(); + } + vcomponent.clear(); + + // occupancy histograms for different pixel types + std::vector<std::string> vtype; + vtype.push_back("Normal"); + vtype.push_back("Ganged"); + vtype.push_back("InterGanged"); + vtype.push_back("Long"); + vtype.push_back("Long-Ganged"); + vtype.push_back("Long-InterGanged"); + for(std::vector<std::string>::const_iterator cit=vtype.begin(); cit!=vtype.end(); ++cit){ + const std::string type = (*cit); + h_occupancy[type] = + new TH1D( ("occupancy"+type).c_str(), ("Pixel occupancy "+type).c_str(), + minLogOccupancy*10, -minLogOccupancy, 0); + m_tHistSvc->regHist(("/histfile/occupancy"+type).c_str(), h_occupancy[type]).setChecked(); + } + vtype.clear(); + + //------------------------ + // number of hits + //------------------------ + + // IBL + TH2F* nhitsPlotBI=new TH2F("nhitsPlotBI", "Number of hits BI;module_eta;module_phi", 20, -10, 10, 14, -0.5, 13.5); + m_tHistSvc->regHist("/histfile/nhitsPlotBI",nhitsPlotBI).setChecked(); + + // B-layer + TH2F* nhitsPlotB0=new TH2F("nhitsPlotB0", "Number of hits B0;module_eta;module_phi", 13, -6.5, 6.5, 22, -0.5, 21.5); + m_tHistSvc->regHist("/histfile/nhitsPlotB0",nhitsPlotB0).setChecked(); + + // barrel layer 1 + TH2F* nhitsPlotB1=new TH2F("nhitsPlotB1", "Number of hits B1;module_eta;module_phi", 13, -6.5, 6.5, 38, -0.5, 37.5); + m_tHistSvc->regHist("/histfile/nhitsPlotB1",nhitsPlotB1).setChecked(); + + // barrel layer 2 + TH2F* nhitsPlotB2=new TH2F("nhitsPlotB2", "Number of hits B2;module_eta;module_phi", 13,- 6.5, 6.5, 52, -0.5, 51.5); + m_tHistSvc->regHist("/histfile/nhitsPlotB2",nhitsPlotB2).setChecked(); + + // endcap + TH2F* nhitsPlotEC=new TH2F("nhitsPlotEC", "Number of hits Endcap;Disk;module_phi", 7, -3.5, 3.5, 48, -0.5, 47.5); + m_tHistSvc->regHist("/histfile/nhitsPlotEC",nhitsPlotEC).setChecked(); + + // DBM + TH2F* nhitsPlotDBM=new TH2F("nhitsPlotDBM", "Number of hits DBM;Layer;module_phi",7,-3.5,3.5,4,-0.5,3.5); + m_tHistSvc->regHist("/histfile/nhitsPlotDBM",nhitsPlotDBM).setChecked(); + + //------------------------ + // hits w/o noise + //------------------------ + + // IBL + TH2F* nhitsNoNoisePlotBI=new TH2F("nhitsNoNoisePlotBI","Number of hits without Noise BI;module_eta;module_phi", 20, -10, 10, 14, -0.5, 13.5); + m_tHistSvc->regHist("/histfile/nhitsNoNoisePlotBI",nhitsNoNoisePlotBI).setChecked(); + + // B-layer + TH2F* nhitsNoNoisePlotB0=new TH2F("nhitsNoNoisePlotB0","Number of hits without Noise B0;module_eta;module_phi", 13, -6.5, 6.5, 22, -0.5, 21.5); + m_tHistSvc->regHist("/histfile/nhitsNoNoisePlotB0",nhitsNoNoisePlotB0).setChecked(); + + // barrel layer 1 + TH2F* nhitsNoNoisePlotB1=new TH2F("nhitsNoNoisePlotB1","Number of hits without Noise B1;module_eta;module_phi", 13, -6.5, 6.5, 38, -0.5, 37.5); + m_tHistSvc->regHist("/histfile/nhitsNoNoisePlotB1",nhitsNoNoisePlotB1).setChecked(); + + // barrel layer 2 + TH2F* nhitsNoNoisePlotB2=new TH2F("nhitsNoNoisePlotB2","Number of hits without Noise B2;module_eta;module_phi", 13, -6.5, 6.5, 52, -0.5, 51.5); + m_tHistSvc->regHist("/histfile/nhitsNoNoisePlotB2",nhitsNoNoisePlotB2).setChecked(); + + //------------------------ + // disabled pixels + //------------------------ + + // IBL + TH2F* disablePlotBI=new TH2F("disablePlotBI", "Disabled pixels BI;module_eta;module_phi", 20, -10, 10, 14, -0.5, 13.5); + m_tHistSvc->regHist("/histfile/disablePlotBI",disablePlotBI).setChecked(); + + // B-layer + TH2F* disablePlotB0=new TH2F("disablePlotB0", "Disabled pixels B0;module_eta;module_phi", 13,- 6.5, 6.5, 22, -0.5, 21.5); + m_tHistSvc->regHist("/histfile/disablePlotB0",disablePlotB0).setChecked(); + + // barrel layer 1 + TH2F* disablePlotB1=new TH2F("disablePlotB1", "Disabled pixels B1;module_eta;module_phi", 13, -6.5, 6.5, 38, -0.5, 37.5); + m_tHistSvc->regHist("/histfile/disablePlotB1",disablePlotB1).setChecked(); + + // barrel layer 2 + TH2F* disablePlotB2=new TH2F("disablePlotB2", "Disabled pixels B2;module_eta;module_phi", 13, -6.5, 6.5, 52, -0.5, 51.5); + m_tHistSvc->regHist("/histfile/disablePlotB2",disablePlotB2).setChecked(); + + // endcap + TH2F* disablePlotEC=new TH2F("disablePlotEC", "Disabled pixels Endcap;Disk;module_phi", 7, -3.5, 3.5, 48, -0.5, 47.5); + m_tHistSvc->regHist("/histfile/disablePlotEC",disablePlotEC).setChecked(); + + // DBM + TH2F* disablePlotDBM=new TH2F("disablePlotDBM", "Disabled pixels DBM;Layer;module_phi", 7, -3.5, 3.5, 4, -0.5, 3.5); + m_tHistSvc->regHist("/histfile/disablePlotDBM",disablePlotDBM).setChecked(); + + TH1D* maskedPlot= new TH1D("maskedPlot","Disabled pixel per module",50,0.5,50.5); + m_tHistSvc->regHist("/histfile/maskedPlot",maskedPlot).setChecked(); + + int totalDisabledPixels=0; + int totalDisabledModules=0; + int modulesWithHits=0; + int modulesWithDisabledPixels=0; + + for (PixelID::const_id_iterator wafer_it=m_pixelID->wafer_begin(); wafer_it!=m_pixelID->wafer_end(); ++wafer_it) { + Identifier ident = *wafer_it; + if(!m_pixelID->is_pixel(ident)) continue; + + int bec = m_pixelID->barrel_ec (ident); + int layer = m_pixelID->layer_disk(ident); + int modPhi = m_pixelID->phi_module(ident); + int modEta = m_pixelID->eta_module(ident); + int modHash = m_pixelID->wafer_hash(ident); + int phi_max = m_pixelID->phi_index_max(ident); + int eta_max = m_pixelID->eta_index_max(ident); + + TH2F* nhitsNoNoisePlot=0; + std::string comp; + double cut = 0.; + + if(bec != 0) { // Disk or DBM + if(bec == 2) { + if(layer == 0) {cut=m_disk1ACut; comp="Disk1A"; } + else if(layer == 1) {cut=m_disk2ACut; comp="Disk2A"; } + else if(layer == 2) {cut=m_disk3ACut; comp="Disk3A"; } + } + else if(bec == -2) { + if(layer == 0) { cut=m_disk1CCut; comp="Disk1C"; } + else if(layer == 1) { cut=m_disk2CCut; comp="Disk2C"; } + else if(layer == 2) { cut=m_disk3CCut; comp="Disk3C"; } + } + else if(bec == 4) { cut=m_dbmCut; comp="DBMA"; } + else if(bec == -4) { cut=m_dbmCut; comp="DBMC"; } + } + else if(bec == 0) { // Barrel + if(layer == 0) { cut=m_iblCut; nhitsNoNoisePlot=nhitsNoNoisePlotBI; comp="IBL"; } + else if(layer == 1) { cut=m_bLayerCut; nhitsNoNoisePlot=nhitsNoNoisePlotB0; comp="B-layer"; } + else if(layer == 2) { cut=m_layer1Cut; nhitsNoNoisePlot=nhitsNoNoisePlotB1; comp="Layer1"; } + else if(layer == 3) { cut=m_layer2Cut; nhitsNoNoisePlot=nhitsNoNoisePlotB2; comp="Layer2"; } + } + + if (!m_pixelConditionsTool->hasBSError(modHash) && m_hitMaps[modHash]->GetEntries()==0) { + if(bec == 0) { + if(layer == 0) { disablePlotBI->Fill(modEta, modPhi, -1); } + else if(layer == 1) { disablePlotB0->Fill(modEta, modPhi, -1); } + else if(layer == 2) { disablePlotB1->Fill(modEta, modPhi, -1); } + else if(layer == 3) { disablePlotB2->Fill(modEta, modPhi, -1); } + } + else if(bec == 2) { disablePlotEC->Fill(layer+1, modPhi, -1); } + else if(bec == -2) { disablePlotEC->Fill(-(layer+1), modPhi, -1); } + else if(bec == 4) { disablePlotDBM->Fill(layer+1, modPhi, -1); } + else if(bec == -4) { disablePlotDBM->Fill(-(layer+1), modPhi, -1); } + + totalDisabledModules++; + continue; + } + else if( m_hitMaps[modHash]->GetEntries() != 0 ) { + if(bec == 0) { + if(layer == 0) { nhitsPlotBI->Fill(modEta, modPhi, m_hitMaps[modHash]->GetEntries()); } + else if(layer == 1) { nhitsPlotB0->Fill(modEta, modPhi, m_hitMaps[modHash]->GetEntries()); } + else if(layer == 2) { nhitsPlotB1->Fill(modEta, modPhi, m_hitMaps[modHash]->GetEntries()); } + else if(layer == 3) { nhitsPlotB2->Fill(modEta, modPhi, m_hitMaps[modHash]->GetEntries()); } + } + else if(bec == 2) { nhitsPlotEC->Fill(layer+1, modPhi, m_hitMaps[modHash]->GetEntries()); } + else if(bec == -2) { nhitsPlotEC->Fill(-(layer+1), modPhi, m_hitMaps[modHash]->GetEntries()); } + else if(bec == 4) { nhitsPlotDBM->Fill(layer+1, modPhi, m_hitMaps[modHash]->GetEntries()); } + else if(bec == -4) { nhitsPlotDBM->Fill(-(layer+1), modPhi, m_hitMaps[modHash]->GetEntries()); } + + modulesWithHits++; + } + + int thisModuleCut = 0; + bool isIBL3D = ( bec==0 && layer==0 && (modEta <= -7 || modEta >= 6) ) ? true : false; + + for(int pixel_eta=0; pixel_eta<=eta_max; pixel_eta++){ + for(int pixel_phi=0; pixel_phi<=phi_max; pixel_phi++){ + + // kazuki added from here + int pixel_eta_on_chip = (bec==0 && layer==0) ? pixel_eta % 80 : pixel_eta % 18; // column + int pixel_phi_on_chip = (pixel_phi <= 163) ? pixel_phi : 327 - pixel_phi; // eta + if (bec == 0 && layer == 0) pixel_phi_on_chip = pixel_phi; + int pixelType = 0; + + if (bec == 0 && layer == 0) { // ----- IBL ----- // + if( !isIBL3D && (pixel_eta_on_chip == 0 || pixel_eta_on_chip == 80 - 1) ){ + pixelType = 1; // long + } + else { // pixel size = 50x250 um2 + pixelType = 0; // normal + } + } else { // Pixel + if(pixel_eta_on_chip > 0 && pixel_eta_on_chip < 18 - 1){ // pixel size = 50x400 um2 + pixelType = 0; // normal + for(int kk = 0; kk < 3; kk++){ + // row 154,156,158 = inter-ganged + // row 153,155,157,159, 160,161,162,163 = ganged + if(pixel_phi_on_chip == (153 + 2 * kk + 1)){ + pixelType = 5; // inter-ganged (dealt as normal) + break; + } + if(pixel_phi_on_chip == (153 + 2 * kk) || pixel_phi_on_chip >= 159){ + pixelType = 2; // ganged + break; + } + } + } + else if(pixel_eta_on_chip == 0 || pixel_eta_on_chip == 18 - 1){ + pixelType = 1; //long + for(int kk = 0; kk < 3; kk++){ + if(pixel_phi_on_chip == (153 + 2 * kk + 1)){ + pixelType = 6; // long inter-ganged (dealt as long) + break; + } + if(pixel_phi_on_chip == (153 + 2 * kk) || pixel_phi_on_chip >= 159){ + pixelType = 3; // long ganged + break; + } + } + } + else + pixelType = 8; //invalid pixel_phi/pixel_eta pair + } + // to here + + std::string type; + + + switch(pixelType) { + case 0: + type = "Normal"; + break; + case 1: + type = "Long"; + break; + case 2: + type = "Ganged"; + break; + case 3: + type = "Long-Ganged"; + break; + case 5: + type = "Long-InterGanged"; + break; + case 6: + type = "InterGanged"; + break; + case 8: + default: + type = "Invalid"; + break; + } + + double thiscut = cut; + if( type == "Ganged" ) thiscut *= m_gangedPixelMultiplier; + else if( type == "Long" ) thiscut *= m_longPixelMultiplier; + else if( type == "Long-InterGanged" ) thiscut *= m_longPixelMultiplier; + else if( type == "Long-Ganged" ) thiscut *= m_longPixelMultiplier * m_gangedPixelMultiplier; + + if( type != "Invalid" ){ + double occupancy = 0; + if( m_nEvents != 0 ) + occupancy = static_cast<double>(m_hitMaps[modHash]->GetBinContent(pixel_eta+1, pixel_phi+1)) / + static_cast<double>(m_nEvents); + + if( occupancy < minOccupancy ) occupancy = minOccupancy; + globalOccupancy->Fill(log10(occupancy)); + h_occupancy[comp]->Fill(log10(occupancy)); + h_occupancy[type]->Fill(log10(occupancy)); + + if( occupancy > thiscut ) { + thisModuleCut++; + + if( m_calculateNoiseMaps ){ + m_noiseMaps[modHash]->Fill(pixel_eta, pixel_phi); + if (comp == "IBL") { + if(modEta >= -6 && modEta <= 5) m_overlayedIBLDCNoiseMap->Fill(pixel_eta, pixel_phi); // Planar + if(modEta <= -7 || modEta >= 6) m_overlayedIBLSCNoiseMap->Fill(pixel_eta, pixel_phi); // 3D + } + else m_overlayedPixelNoiseMap->Fill(pixel_eta, pixel_phi); + } + } else { + if(bec == 0) nhitsNoNoisePlot->Fill(modEta, modPhi, m_hitMaps[modHash]->GetBinContent(pixel_eta+1, pixel_phi+1)); + } + } // end if ( type != "Invalid" ) + } // end for loop on pixel_phi + } // end for loop on pixel_eta + + if ( thisModuleCut > 0 ) { + totalDisabledPixels+=thisModuleCut; + maskedPlot->Fill( static_cast<double>(thisModuleCut) ); + modulesWithDisabledPixels++; + + if(bec == 0) { + if(layer == 0) { disablePlotBI->Fill(modEta, modPhi, thisModuleCut); } + else if(layer == 1) { disablePlotB0->Fill(modEta, modPhi, thisModuleCut); } + else if(layer == 2) { disablePlotB1->Fill(modEta, modPhi, thisModuleCut); } + else if(layer == 3) { disablePlotB2->Fill(modEta, modPhi, thisModuleCut); } + } + else if(bec == 2) { disablePlotEC->Fill(layer+1, modPhi, thisModuleCut); } + else if(bec == -2) { disablePlotEC->Fill(-(layer+1), modPhi, thisModuleCut); } + } + } // end loop in detector elements + + ATH_MSG_INFO("Modules disabled = " << totalDisabledModules); + ATH_MSG_INFO("Modules with hits = " << modulesWithHits); + ATH_MSG_INFO("Modules with disabled pixels = " << modulesWithDisabledPixels); + ATH_MSG_INFO("Total disabled pixels = " << totalDisabledPixels); + + return StatusCode::SUCCESS; + +} // end finalize + diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelConvert.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx similarity index 100% rename from InnerDetector/InDetCalibAlgs/PixelCalibAlgs/run2/src/PixelConvert.cxx rename to InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/components/PixelCalibAlgs_entries.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/components/PixelCalibAlgs_entries.cxx index 0c751525b68a4349ebfa0a5ed8e06b18e74d17fa..7cfcbfda49c3c197c2d11833a1179e32e49c8712 100644 --- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/components/PixelCalibAlgs_entries.cxx +++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/components/PixelCalibAlgs_entries.cxx @@ -1,4 +1,6 @@ #include "PixelCalibAlgs/PixelChargeToTConversion.h" +#include "PixelCalibAlgs/OccupancyMapMaker.h" DECLARE_COMPONENT( PixelChargeToTConversion ) +DECLARE_COMPONENT( OccupancyMapMaker ) diff --git a/InnerDetector/InDetConditions/InDetBeamSpotService/src/BeamCondSvc.h b/InnerDetector/InDetConditions/InDetBeamSpotService/src/BeamCondSvc.h index e0db27dac96b10b3b609564b76415351881c2663..90f6c162b9ac8ba825a771d39448021d183224eb 100644 --- a/InnerDetector/InDetConditions/InDetBeamSpotService/src/BeamCondSvc.h +++ b/InnerDetector/InDetConditions/InDetBeamSpotService/src/BeamCondSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef InDetBeamSpotService_BEAMCOND_H @@ -11,7 +11,7 @@ #include "GeoPrimitives/GeoPrimitives.h" #include "AthenaBaseComps/AthService.h" #include "GaudiKernel/ServiceHandle.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #ifndef SIMULATIONBASE namespace Trk { diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelDCSTestReadWrite.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelDCSTestReadWrite.cxx index e2d50d752fe168263be5225edf20fababc31ebda..a711faefd2bf6f808f51877cb116dadc3d196d9b 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelDCSTestReadWrite.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelDCSTestReadWrite.cxx @@ -1,12 +1,11 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "PixelDCSTestReadWrite.h" // Athena includes -//#include "StoreGate/StoreGate.h" #include "AthenaKernel/IOVSvcDefs.h" // Gaudi includes diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelDCSTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelDCSTool.cxx index 0b0a582ef2f293cd5a9bfb04374db464a4b8420c..c74caca85d2e8b17f8baf2d0dbedd0c73f1e88aa 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelDCSTool.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelDCSTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //database access headers @@ -10,7 +10,6 @@ //Athena headers -//#include "StoreGate/StoreGate.h" #include "SGTools/TransientAddress.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/CMakeLists.txt b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/CMakeLists.txt index f81a2bc64d877330f1e7cf4b0b49997ba929056a..f5e44340b7955fdb13c5cf7e84de7ea06a442360 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/CMakeLists.txt +++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/CMakeLists.txt @@ -98,8 +98,14 @@ atlas_add_test( TestSummary ENVIRONMENT THREADS=5 ) atlas_add_test( TestTdaqEnabled SCRIPT athena.py --threads=5 SCT_ConditionsAlgorithms/testTdaqEnabled.py - PROPERTIES TIMEOUT 720 + PROPERTIES TIMEOUT 600 ENVIRONMENT THREADS=5 ) +atlas_add_test( TestDCSConditionsNewConf + SCRIPT python -m SCT_ConditionsAlgorithms.SCT_DCSConditionsTestAlgConfig + PROPERTIES TIMEOUT 600 ) +atlas_add_test( TestSummaryNewConf + SCRIPT python -m SCT_ConditionsAlgorithms.SCT_ConditionsSummaryTestAlgConfig + PROPERTIES TIMEOUT 600 ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/python/SCT_ConditionsSummaryTestAlgConfig.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/python/SCT_ConditionsSummaryTestAlgConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..26a559c668a85e7ecd2a943d2d89502d0128b972 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/python/SCT_ConditionsSummaryTestAlgConfig.py @@ -0,0 +1,46 @@ +"""Define method to configure and test SCT_ConditionsSummaryTestAlg + +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def SCT_ConditionsSummaryTestAlgCfg(flags, name="SCT_ConditionsSummaryTestAlg", **kwargs): + """Return a configured SCT_ConditionsSummaryTestAlg""" + acc = ComponentAccumulator() + from InDetConfig.InDetRecToolConfig import InDetSCT_ConditionsSummaryToolCfg + InDetSCT_ConditionsSummaryToolWithoutFlagged = acc.popToolsAndMerge(InDetSCT_ConditionsSummaryToolCfg(flags,withFlaggedCondTool=False)) + kwargs.setdefault("SCT_ConditionsSummaryTool", InDetSCT_ConditionsSummaryToolWithoutFlagged) + acc.addEventAlgo(CompFactory.SCT_ConditionsSummaryTestAlg(**kwargs)) + return acc + +if __name__=="__main__": + from AthenaCommon.Logging import log + from AthenaCommon.Constants import INFO + log.setLevel(INFO) + + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.Input.isMC = False + ConfigFlags.Input.ProjectName = "data17_13TeV" + ConfigFlags.Input.RunNumber = [310809] + ConfigFlags.addFlag("Input.InitialTimeStamp", 1476741326) # LB 18 of run 310809, 10/17/2016 @ 9:55pm (UTC) + ConfigFlags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2017-06" + ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2015-03-01-00" + ConfigFlags.Detector.GeometrySCT = True + ConfigFlags.lock() + + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + cfg = MainServicesCfg(ConfigFlags) + + from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg + cfg.merge(SCT_GeometryCfg(ConfigFlags)) + + from McEventSelector.McEventSelectorConfig import McEventSelectorCfg + cfg.merge(McEventSelectorCfg(ConfigFlags)) + + cfg.merge(SCT_ConditionsSummaryTestAlgCfg(ConfigFlags)) + + cfg.run(maxEvents=20) diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/python/SCT_DCSConditionsTestAlgConfig.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/python/SCT_DCSConditionsTestAlgConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..f10267f7376fbf011df76c4d836a7d1e1b554e82 --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/python/SCT_DCSConditionsTestAlgConfig.py @@ -0,0 +1,42 @@ +"""Define method to configure and test SCT_DCSConditionsTestAlg + +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def SCT_DCSConditionsTestAlgCfg(flags, name="SCT_DCSConditionsTestAlg", **kwargs): + """Return a configured SCT_DCSConditionsTestAlg""" + acc = ComponentAccumulator() + from SCT_ConditionsTools.SCT_DCSConditionsConfig import SCT_DCSConditionsCfg + kwargs.setdefault("SCT_DCSConditionsTool", acc.popToolsAndMerge(SCT_DCSConditionsCfg(flags))) + acc.addEventAlgo(CompFactory.SCT_DCSConditionsTestAlg(**kwargs)) + return acc + +if __name__=="__main__": + from AthenaCommon.Logging import log + from AthenaCommon.Constants import INFO + log.setLevel(INFO) + + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.Input.isMC = False + ConfigFlags.Input.ProjectName = "data17_13TeV" + ConfigFlags.Input.RunNumber = 310809 + ConfigFlags.addFlag("Input.InitialTimeStamp", 1476741326) # LB 18 of run 310809, 10/17/2016 @ 9:55pm (UTC) + ConfigFlags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2017-06" + ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2015-03-01-00" + ConfigFlags.Detector.GeometrySCT = True + ConfigFlags.lock() + + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + cfg = MainServicesCfg(ConfigFlags) + + from McEventSelector.McEventSelectorConfig import McEventSelectorCfg + cfg.merge(McEventSelectorCfg(ConfigFlags)) + + cfg.merge(SCT_DCSConditionsTestAlgCfg(ConfigFlags)) + + cfg.run(maxEvents=20) diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_DCSConditionsConfig.py b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_DCSConditionsConfig.py index 8fa64f67e930cab24631719a327729fb5b794865..02b7f4e2c45488546178cfc7588e4d8b57d2996d 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_DCSConditionsConfig.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_DCSConditionsConfig.py @@ -4,6 +4,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory +from AtlasGeoModel.GeoModelConfig import GeoModelCfg from IOVDbSvc.IOVDbSvcConfig import addFolders SCT_DCSConditionsTool=CompFactory.SCT_DCSConditionsTool SCT_DCSConditionsStatCondAlg=CompFactory.SCT_DCSConditionsStatCondAlg @@ -22,6 +23,7 @@ def SCT_DCSConditionsCfg(flags, name="InDetSCT_DCSConditions", **kwargs): DCSConditionsTool may be provided in kwargs """ acc = ComponentAccumulator() + acc.merge(GeoModelCfg(flags)) # For SCT_ID used in SCT_DCSConditionsTool tool = kwargs.get("DCSConditionsTool", SCT_DCSConditionsToolCfg(flags)) # folder arguments dbInstance = kwargs.get("dbInstance", "DCS_OFL") diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_SiliconConditionsConfig.py b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_SiliconConditionsConfig.py index ae125aaf76e196ae80e6b26e7b2498d6bac76d45..f021bdfebea585e2eb5674ad350d650069ea73e0 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_SiliconConditionsConfig.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_SiliconConditionsConfig.py @@ -1,9 +1,10 @@ """Define methods to configure SiPropertiesTool -Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory +from AtlasGeoModel.GeoModelConfig import GeoModelCfg SCT_SiliconHVCondAlg=CompFactory.SCT_SiliconHVCondAlg SCT_SiliconTempCondAlg=CompFactory.SCT_SiliconTempCondAlg SCT_SiliconConditionsTool=CompFactory.SCT_SiliconConditionsTool @@ -20,6 +21,7 @@ def SCT_SiliconConditionsCfg(flags, name="SCT_Silicon", **kwargs): DCSConditionsTool may be provided in kwargs """ acc = ComponentAccumulator() + acc.merge(GeoModelCfg(flags)) # For SCT_ID used in SCT_SiliconConditionsTool CondArgs = {} DCSConditionsTool = kwargs.get("DCSConditionsTool") if DCSConditionsTool: diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/CMakeLists.txt b/InnerDetector/InDetConditions/SiLorentzAngleTool/CMakeLists.txt index 7afdee9b19bec47e3939a306774edb1e1e907344..db384aa64ddcbb4ffb1330cefa31827cb5ef1a01 100644 --- a/InnerDetector/InDetConditions/SiLorentzAngleTool/CMakeLists.txt +++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/CMakeLists.txt @@ -44,6 +44,10 @@ atlas_add_test( TestSCTLorentzAngle PROPERTIES TIMEOUT 300 ENVIRONMENT THREADS=5 ) +atlas_add_test( TestSCTLorentzAngleNewConf + SCRIPT python -m SiLorentzAngleTool.SCTSiLorentzAngleTestAlgConfig + PROPERTIES TIMEOUT 300 ) + atlas_add_test( SiLorentzAngleConfig_test SCRIPT test/SiLorentzAngleConfig_test.py PROPERTIES TIMEOUT 30 ) diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCTSiLorentzAngleTestAlgConfig.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCTSiLorentzAngleTestAlgConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..3e9748a05777cb2a1e20bf3392c0867e214f0af5 --- /dev/null +++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCTSiLorentzAngleTestAlgConfig.py @@ -0,0 +1,43 @@ +"""Define method to configure and test SCTSiLorentzAngleTestAlg + +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def SCTSiLorentzAngleTestAlgCfg(flags, name="SCTSiLorentzAngleTestAlg", **kwargs): + """Return a configured SCTSiLorentzAngleTestAlg""" + acc = ComponentAccumulator() + from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg + kwargs.setdefault("SCTLorentzAngleTool", acc.popToolsAndMerge(SCT_LorentzAngleCfg(flags))) + acc.addEventAlgo(CompFactory.SCTSiLorentzAngleTestAlg(**kwargs)) + return acc + +if __name__=="__main__": + from AthenaCommon.Logging import log + from AthenaCommon.Constants import INFO + log.setLevel(INFO) + + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.Input.isMC = True + ConfigFlags.Input.ProjectName = "mc16_13TeV" + ConfigFlags.Input.RunNumber = 300000 # MC16c 2017 run number + ConfigFlags.addFlag("Input.InitialTimeStamp", 1500000000) # MC16c 2017 time stamp + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-18" + ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2015-03-01-00" + ConfigFlags.Detector.GeometrySCT = True + ConfigFlags.lock() + + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + cfg = MainServicesCfg(ConfigFlags) + + from McEventSelector.McEventSelectorConfig import McEventSelectorCfg + cfg.merge(McEventSelectorCfg(ConfigFlags)) + + cfg.merge(SCTSiLorentzAngleTestAlgCfg(ConfigFlags)) + + cfg.run(maxEvents=20) + diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCT_LorentzAngleConfig.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCT_LorentzAngleConfig.py index bded7ce2a91b4ebdb3f90b3c5c1b139cf0d75184..285669e10bfe18dc611cd0f5ad3bdb9807271caf 100644 --- a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCT_LorentzAngleConfig.py +++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCT_LorentzAngleConfig.py @@ -1,6 +1,6 @@ """Define methods to configure SCTLorentzAngleTool -Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ from AthenaCommon import Logging from AthenaConfiguration.ComponentFactory import CompFactory @@ -8,6 +8,7 @@ SiLorentzAngleTool=CompFactory.SiLorentzAngleTool SCTSiLorentzAngleCondAlg=CompFactory.SCTSiLorentzAngleCondAlg from SCT_ConditionsTools.SCT_DCSConditionsConfig import SCT_DCSConditionsCfg from SCT_ConditionsTools.SCT_SiliconConditionsConfig import SCT_SiliconConditionsCfg +from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg def SCT_LorentzAngleToolCfg(flags, name="SCT_LorentzAngleTool", **kwargs): @@ -29,6 +30,7 @@ def SCT_LorentzAngleCfg(flags, name="SCT_SiLorentzAngleCondAlg", msg.error("Setting is wrong: both forceUseDB and forceUseGeoModel cannot be True at the same time") # construct with field services acc = MagneticFieldSvcCfg(flags) + acc.merge(SCT_GeometryCfg(flags)) # For SCT_DetectorElementCollection used in SCTSiLorentzAngleCondAlg tool = kwargs.get("SiLorentzAngleTool", SCT_LorentzAngleToolCfg(flags)) if not forceUseGeoModel: DCSkwargs = {} diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/CMakeLists.txt b/InnerDetector/InDetConditions/SiPropertiesTool/CMakeLists.txt index 4c84b1ae0c4af9d088946df564e25a54e6255422..f516555cc72104d0dc563a7fafff10dce2d5557e 100644 --- a/InnerDetector/InDetConditions/SiPropertiesTool/CMakeLists.txt +++ b/InnerDetector/InDetConditions/SiPropertiesTool/CMakeLists.txt @@ -43,6 +43,10 @@ atlas_add_test( TestSCTProperties PROPERTIES TIMEOUT 300 ENVIRONMENT THREADS=5 ) +atlas_add_test( TestSCTPropertiesNewConf + SCRIPT python -m SiPropertiesTool.SCTSiPropertiesTestAlgConfig + PROPERTIES TIMEOUT 300 ) + atlas_add_test( SiPropertiesConfig_test SCRIPT test/SiPropertiesConfig_test.py PROPERTIES TIMEOUT 300 ) @@ -50,4 +54,3 @@ atlas_add_test( SiPropertiesConfig_test # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) - diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/python/SCTSiPropertiesTestAlgConfig.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCTSiPropertiesTestAlgConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..953b463570862090feb35f8bc040f7c51e21f2d0 --- /dev/null +++ b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCTSiPropertiesTestAlgConfig.py @@ -0,0 +1,42 @@ +"""Define method to configure and test SCTSiPropertiesTestAlg + +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def SCTSiPropertiesTestAlgCfg(flags, name="SCTSiPropertiesTestAlg", **kwargs): + """Return a configured SCTSiPropertiesTestAlg""" + acc = ComponentAccumulator() + from SiPropertiesTool.SCT_SiPropertiesConfig import SCT_SiPropertiesCfg + kwargs.setdefault("SCTPropertiesTool", acc.popToolsAndMerge(SCT_SiPropertiesCfg(flags))) + acc.addEventAlgo(CompFactory.SCTSiPropertiesTestAlg(**kwargs)) + return acc + +if __name__=="__main__": + from AthenaCommon.Logging import log + from AthenaCommon.Constants import INFO + log.setLevel(INFO) + + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.Input.isMC = True + ConfigFlags.Input.ProjectName = "mc16_13TeV" + ConfigFlags.Input.RunNumber = [300000] # MC16c 2017 run number + ConfigFlags.addFlag("Input.InitialTimeStamp", 1500000000) # MC16c 2017 time stamp + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-18" + ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2015-03-01-00" + ConfigFlags.Detector.GeometrySCT = True + ConfigFlags.lock() + + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + cfg = MainServicesCfg(ConfigFlags) + + from McEventSelector.McEventSelectorConfig import McEventSelectorCfg + cfg.merge(McEventSelectorCfg(ConfigFlags)) + + cfg.merge(SCTSiPropertiesTestAlgCfg(ConfigFlags)) + + cfg.run(maxEvents=20) diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py index e14c336828012779bbf618958163a9e7e3b55499..f8324a83f0e9f10441b098e771f0c3d9204124fd 100644 --- a/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py +++ b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py @@ -1,9 +1,12 @@ """Define methods to configure SCT SiProperties -Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory +from SCT_ConditionsTools.SCT_DCSConditionsConfig import SCT_DCSConditionsCfg +from SCT_ConditionsTools.SCT_SiliconConditionsConfig import SCT_SiliconConditionsCfg +from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg SiPropertiesTool=CompFactory.SiPropertiesTool SCTSiPropertiesCondAlg=CompFactory.SCTSiPropertiesCondAlg @@ -19,6 +22,22 @@ def SCT_SiPropertiesCfg(flags, name="SCTSiPropertiesCondAlg", **kwargs): SiConditionsTool and/or SiPropertiesTool may be provided in kwargs """ acc = ComponentAccumulator() + + acc.merge(SCT_GeometryCfg(flags)) # For SCT_DetectorElementCollection used in SCTSiPropertiesCondAlg + + DCSkwargs = {} + # For HLT + if flags.Common.isOnline and not flags.Input.isMC: + dcs_folder = "/SCT/HLT/DCS" + DCSkwargs["dbInstance"] = "SCT" + DCSkwargs["hvFolder"] = dcs_folder + "/HV" + DCSkwargs["tempFolder"] = dcs_folder + "/MODTEMP" + DCSkwargs["stateFolder"] = dcs_folder + "/CHANSTAT" + DCSAcc = SCT_DCSConditionsCfg(flags, **DCSkwargs) + SCAcc = SCT_SiliconConditionsCfg(flags, DCSConditionsTool=DCSAcc.popPrivateTools()) + acc.merge(DCSAcc) + acc.merge(SCAcc) + tool = kwargs.get("SiPropertiesTool", SCT_SiPropertiesToolCfg(flags)) alg = SCTSiPropertiesCondAlg(name, **kwargs) acc.addCondAlgo(alg) diff --git a/InnerDetector/InDetConfig/python/ClusterizationConfig.py b/InnerDetector/InDetConfig/python/ClusterizationConfig.py index bdc5672a1c0e12396aa7af1bbeb893b257654bed..80d683ef1860272bb46593b0573be13432e6979b 100644 --- a/InnerDetector/InDetConfig/python/ClusterizationConfig.py +++ b/InnerDetector/InDetConfig/python/ClusterizationConfig.py @@ -76,12 +76,10 @@ if __name__ == "__main__": acc = InDetClusterizationAlgorithmsCfg(ConfigFlags) top_acc.merge(acc) - # import pdb ; pdb.set_trace() + iovsvc = top_acc.getService('IOVDbSvc') iovsvc.OutputLevel=5 - ##acc.setAppProperty("EvtMax",25) - ##acc.store(open("test_SiClusterization.pkl", "w")) + + top_acc.printConfig() top_acc.run(25) - #with open('test4.pkl', mode="wb") as f: - # dill.dump(acc, f) - top_acc.store(open("test00.pkl", "wb")) + top_acc.store(open("test_Clusterization.pkl", "wb")) diff --git a/InnerDetector/InDetConfig/python/TRTPhaseConfig.py b/InnerDetector/InDetConfig/python/TRTPhaseConfig.py index 5ad1858931d1417d666c30667647e95a37716e57..b904fe576ca16b11d7aff60368b308258219a590 100644 --- a/InnerDetector/InDetConfig/python/TRTPhaseConfig.py +++ b/InnerDetector/InDetConfig/python/TRTPhaseConfig.py @@ -2,6 +2,18 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory +def TRTPhaseCondCfg(flags, name = "TRTPhaseCondAlg", **kwargs): + acc = ComponentAccumulator() + from InDetOverlay.TRT_ConditionsConfig import TRT_CalDbToolCfg + InDetTRTCalDbTool = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags)) + acc.addPublicTool(InDetTRTCalDbTool) + + kwargs.setdefault("TRTCalDbTool", InDetTRTCalDbTool) + # Average T0 CondAlg + TRTPhaseCondAlg = CompFactory.TRTPhaseCondAlg(name = name, **kwargs) + acc.addCondAlgo(TRTPhaseCondAlg) + return acc + def InDetTrackSummaryToolCfg(flags, name='InDetTrackSummaryTool',**kwargs) : acc = ComponentAccumulator() @@ -36,7 +48,10 @@ def InDetCosmicsEventPhaseToolCfg(flags, name='InDetCosmicsEventPhaseTool', **kw else: kwargs.setdefault("GlobalOffset", -3.125) # CalDb tool - InDetTRTCalDbTool = CompFactory.TRT_CalDbTool(name = "TRT_CalDbTool") + from InDetOverlay.TRT_ConditionsConfig import TRT_CalDbToolCfg + InDetTRTCalDbTool = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags)) + acc.addPublicTool(InDetTRTCalDbTool) + kwargs.setdefault("UseNewEP", True) kwargs.setdefault("TRTCalDbTool", InDetTRTCalDbTool) @@ -56,7 +71,10 @@ def InDetFixedWindowTrackTimeToolCfg(flags, name='InDetFixedWindowTrackTimeTool' else: kwargs.setdefault("GlobalOffset", -3.125) # CalDb tool - InDetTRTCalDbTool = CompFactory.TRT_CalDbTool(name = "TRT_CalDbTool") + from InDetOverlay.TRT_ConditionsConfig import TRT_CalDbToolCfg + InDetTRTCalDbTool = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags)) + acc.addPublicTool(InDetTRTCalDbTool) + cutWindowCenter = -8.5 cutWindowSize = 7 kwargs.setdefault("UseNewEP" , True) @@ -81,7 +99,10 @@ def InDetSlidingWindowTrackTimeToolCfg(flags, name='InDetSlidingWindowTrackTimeT else: kwargs.setdefault("GlobalOffset", -3.125) # CalDb tool - InDetTRTCalDbTool = CompFactory.TRT_CalDbTool(name = "TRT_CalDbTool") + from InDetOverlay.TRT_ConditionsConfig import TRT_CalDbToolCfg + InDetTRTCalDbTool = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags)) + acc.addPublicTool(InDetTRTCalDbTool) + numberIterations = 5 cutWindowSize = 7 kwargs.setdefault("UseNewEP" , True) @@ -111,7 +132,10 @@ def InDetCosmicsEventPhaseCfg(flags, InputTrackCollections, name = 'InDetCosmics acc.addPublicTool(InDetTrackSummaryTool) # CalDb tool - InDetTRTCalDbTool = CompFactory.TRT_CalDbTool(name = "TRT_CalDbTool") + from InDetOverlay.TRT_ConditionsConfig import TRT_CalDbToolCfg + InDetTRTCalDbTool = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags)) + acc.addPublicTool(InDetTRTCalDbTool) + kwargs.setdefault("InputTracksNames" , InputTrackCollections) kwargs.setdefault("TrackSummaryTool" , InDetTrackSummaryTool) kwargs.setdefault("TRTCalDbTool" , InDetTRTCalDbTool) @@ -123,7 +147,6 @@ def InDetCosmicsEventPhaseCfg(flags, InputTrackCollections, name = 'InDetCosmics acc.addEventAlgo(CompFactory.InDet.InDetCosmicsEventPhase(name = name, **kwargs)) return acc - # -------------------------------------------------------------------------------- # # --- TRT phase calculation @@ -132,6 +155,7 @@ def InDetCosmicsEventPhaseCfg(flags, InputTrackCollections, name = 'InDetCosmics def TRTPhaseCfg(flags, self, InputTrackCollections = [], **kwargs): acc = ComponentAccumulator() if flags.InDet.doPRDFormation and flags.Detector.RecoTRT: + acc.merge(TRTPhaseCondCfg(flags)) # # --- calculation of the event phase from all 3 input collections # diff --git a/InnerDetector/InDetConfig/python/TRTPreProcessing.py b/InnerDetector/InDetConfig/python/TRTPreProcessing.py index d5546a36f0849d3a5ad81de48a274586e96af51e..38f100e267d6991c2f7fdb2a847b5532ddbcc371 100644 --- a/InnerDetector/InDetConfig/python/TRTPreProcessing.py +++ b/InnerDetector/InDetConfig/python/TRTPreProcessing.py @@ -82,12 +82,11 @@ def InDetTRT_DriftFunctionToolCfg(flags, useTimeInfo, usePhase, name = "InDetTRT -0.328962, -0.403399, -0.663656, -1.029428, -1.46008, -1.919092, -2.151582, -2.285481, -2.036822, -2.15805]) # Second calibration DB Service in case pile-up and physics hits have different calibrations - if ConfigFlags.Detector.RecoTRT: - TRT_CalDbTool = CompFactory.TRT_CalDbTool - InDetTRTCalDbTool2 = TRT_CalDbTool( name="TRT_CalDbTool2", - RtFolderName="/TRT/Calib/MC/RT", - T0FolderName="/TRT/Calib/MC/T0") + if flags.Detector.RecoTRT: + from InDetOverlay.TRT_ConditionsConfig import TRT_CalDbToolCfg + InDetTRTCalDbTool2 = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags)) acc.addPublicTool(InDetTRTCalDbTool2) + kwargs.setdefault("TRTCalDbTool2", InDetTRTCalDbTool2) kwargs.setdefault("IsOverlay", True) kwargs.setdefault("IsMC", False) @@ -209,6 +208,10 @@ def InDetTRT_RIO_MakerCfg(flags, useTimeInfo, usePhase, prefix, collection, name # InDetTRT_DriftCircleTool = acc.popToolsAndMerge(TRT_DriftCircleToolCfg(flags, useTimeInfo, usePhase, prefix, name = "InDetTRT_DriftCircleTool")) acc.addPublicTool(InDetTRT_DriftCircleTool) + + # Region selector tools for TRT + from RegionSelector.RegSelToolConfig import regSelTool_TRT_Cfg + RegSelTool_TRT = acc.popToolsAndMerge(regSelTool_TRT_Cfg(flags)) # # --- TRT_RIO_Maker Algorithm # @@ -216,6 +219,7 @@ def InDetTRT_RIO_MakerCfg(flags, useTimeInfo, usePhase, prefix, collection, name kwargs.setdefault("TrtDescrManageLocation", 'TRT') kwargs.setdefault("TRTRDOLocation", 'TRT_RDOs') kwargs.setdefault("TRTRIOLocation", collection) + kwargs.setdefault("RegSelTool", RegSelTool_TRT) acc.addEventAlgo(CompFactory.InDet.TRT_RIO_Maker(name, **kwargs)) return acc @@ -227,6 +231,10 @@ def InDetTRT_RIO_MakerPUCfg(flags, useTimeInfo, usePhase, prefix, collectionPU, # InDetTRT_DriftCircleTool = acc.popToolsAndMerge(TRT_DriftCircleToolCfg(flags, useTimeInfo, usePhase, prefix, name = "InDetTRT_DriftCircleTool")) acc.addPublicTool(InDetTRT_DriftCircleTool) + + # Region selector tools for TRT + from RegionSelector.RegSelToolConfig import regSelTool_TRT_Cfg + RegSelTool_TRT = acc.popToolsAndMerge(regSelTool_TRT_Cfg(flags)) # # --- TRT_RIO_Maker Algorithm # @@ -234,6 +242,7 @@ def InDetTRT_RIO_MakerPUCfg(flags, useTimeInfo, usePhase, prefix, collectionPU, kwargs.setdefault("TrtDescrManageLocation", 'TRT') kwargs.setdefault("TRTRDOLocation", 'TRT_PU_RDOs') kwargs.setdefault("TRTRIOLocation", collectionPU) + kwargs.setdefault("RegSelTool", RegSelTool_TRT) acc.addEventAlgo(CompFactory.InDet.TRT_RIO_Maker(name, **kwargs)) return acc @@ -242,6 +251,13 @@ def InDetTRT_RIO_MakerPUCfg(flags, useTimeInfo, usePhase, prefix, collectionPU, def TRTPreProcessingCfg(flags, useTimeInfo = True, usePhase = False, **kwargs): acc = ComponentAccumulator() + from PixelConditionsAlgorithms.PixelConditionsConfig import (PixelChargeCalibCondAlgCfg, PixelConfigCondAlgCfg, PixelCablingCondAlgCfg, PixelReadoutSpeedAlgCfg) + + acc.merge(PixelChargeCalibCondAlgCfg(flags)) + acc.merge(PixelConfigCondAlgCfg(flags)) + acc.merge(PixelCablingCondAlgCfg(flags)) + acc.merge(PixelReadoutSpeedAlgCfg(flags)) + if flags.InDet.doPRDFormation and flags.InDet.doTRT_PRDFormation: # # --- setup naming of tools and algs @@ -306,6 +322,11 @@ if __name__ == "__main__": msgService = top_acc.getService('MessageSvc') msgService.Format = "S:%s E:%e % F%138W%S%7W%R%T %0W%M" + from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg + from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg + top_acc.merge( PixelGeometryCfg(ConfigFlags) ) + top_acc.merge( SCT_GeometryCfg(ConfigFlags) ) + if not ConfigFlags.InDet.doDBMstandalone: top_acc.merge(TRTPreProcessingCfg(ConfigFlags,(not ConfigFlags.InDet.doTRTPhaseCalculation or ConfigFlags.Beam.Type =="collisions"),False)) diff --git a/InnerDetector/InDetConfig/python/TRTSegmentFindingConfig.py b/InnerDetector/InDetConfig/python/TRTSegmentFindingConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..b48fcaad1bcff1700db811272f33f6fd080dfc25 --- /dev/null +++ b/InnerDetector/InDetConfig/python/TRTSegmentFindingConfig.py @@ -0,0 +1,277 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +import InDetConfig.TrackingCommonConfig as TC + +def TRT_TrackSegmentsMaker_BarrelCosmicsCfg(flags, name='InDetTRTSegmentsMaker', **kwargs) : + acc = ComponentAccumulator() + + kwargs.setdefault("TrtManagerLocation", 'TRT') # InDetKeys.TRT_Manager + kwargs.setdefault("TRT_ClustersContainer", 'TRT_DriftCirclesUncalibrated') # InDetKeys.TRT_DriftCirclesUncalibrated + kwargs.setdefault("IsMagneticFieldOn", flags.BField.solenoidOn) + + acc.setPrivateTools(CompFactory.InDet.TRT_TrackSegmentsMaker_BarrelCosmics(name = name, **kwargs)) + return acc + +def TRT_TrackSegmentsMaker_ATLxkCfg(flags, name = 'InDetTRT_SeedsMaker', extension = '', TrackingCuts = None, InputCollections = None, **kwargs): + acc = ComponentAccumulator() + # + # --- decide if use the association tool + # + usePrdAssociationTool = len(InputCollections) > 0 + + # + # --- get list of already associated hits (always do this, even if no other tracking ran before) + # + prefix = 'InDetSegment' + suffix = extension + # + # --- cut values + # + if extension == "_TRT": + # TRT Subdetector segment finding + MinNumberDCs = TrackingCuts.minTRTonly + pTmin = TrackingCuts.minPT + sharedFrac = TrackingCuts.maxTRTonlyShared + else: + # TRT-only/back-tracking segment finding + MinNumberDCs = TrackingCuts.minSecondaryTRTonTrk + pTmin = TrackingCuts.minSecondaryPt + sharedFrac = TrackingCuts.maxSecondaryTRTShared + # + # --- offline version of TRT segemnt making + # + InDetPatternPropagator = TC.InDetPatternPropagatorCfg() + acc.addPublicTool(InDetPatternPropagator) + + InDetTRTExtensionTool = acc.popToolsAndMerge(TC.InDetTRT_ExtensionToolCfg(flags, TrackingCuts = TrackingCuts)) + acc.addPublicTool(InDetTRTExtensionTool) + + kwargs.setdefault("TRT_ClustersContainer", 'TRT_DriftCircles') # InDetKeys.TRT_DriftCircles + kwargs.setdefault("PropagatorTool", InDetPatternPropagator) + kwargs.setdefault("TrackExtensionTool", InDetTRTExtensionTool) + kwargs.setdefault("PRDtoTrackMap", prefix+'PRDtoTrackMap'+suffix if usePrdAssociationTool else '') + kwargs.setdefault("RemoveNoiseDriftCircles", flags.InDet.removeTRTNoise) + kwargs.setdefault("MinNumberDriftCircles", MinNumberDCs) + kwargs.setdefault("NumberMomentumChannel", TrackingCuts.TRTSegFinderPtBins) + kwargs.setdefault("pTmin", pTmin) + kwargs.setdefault("sharedFrac", sharedFrac) + + InDetTRT_TrackSegmentsMaker = CompFactory.InDet.TRT_TrackSegmentsMaker_ATLxk(name = name, **kwargs) + acc.setPrivateTools(InDetTRT_TrackSegmentsMaker) + return acc + +def TRT_TrackSegmentsMakerCondAlg_ATLxkCfg(name = 'InDetTRT_SeedsMakerCondAlg', extension = '', TrackingCuts = None, **kwargs): + acc = ComponentAccumulator() + # + # --- cut values + # + if extension == "_TRT": + # TRT Subdetector segment finding + pTmin = TrackingCuts.minPT + else: + # TRT-only/back-tracking segment finding + pTmin = TrackingCuts.minSecondaryPt + + InDetPatternPropagator = TC.InDetPatternPropagatorCfg() + acc.addPublicTool(InDetPatternPropagator) + + kwargs.setdefault("PropagatorTool", InDetPatternPropagator) + kwargs.setdefault("NumberMomentumChannel", TrackingCuts.TRTSegFinderPtBins) + kwargs.setdefault("pTmin", pTmin) + + InDetTRT_TrackSegmentsMakerCondAlg = CompFactory.InDet.TRT_TrackSegmentsMakerCondAlg_ATLxk(name = name, **kwargs) + acc.addCondAlgo(InDetTRT_TrackSegmentsMakerCondAlg) + return acc + +def TRT_TrackSegmentsFinderCfg(flags, name = 'InDetTRT_TrackSegmentsFinderPhase', extension = '', TrackingCuts = None, BarrelSegments = None, InputCollections =None, doPhase = False, **kwargs): + acc = ComponentAccumulator() + + # --------------------------------------------------------------- + # + # --- now the main steering of the TRT segments finding + # + # --------------------------------------------------------------- + if flags.Beam.Type == "cosmics": + # + # --- cosmics barrel segments (use TRT track segements even for NewT) + # + if doPhase: + InDetTRT_TrackSegmentsMakerPhase = acc.popToolsAndMerge(TRT_TrackSegmentsMaker_BarrelCosmicsCfg(flags, name='InDetTRTSegmentsMakerPhase'+extension)) + acc.addPublicTool(InDetTRT_TrackSegmentsMakerPhase) + + kwargs.setdefault("SegmentsMakerTool", InDetTRT_TrackSegmentsMakerPhase) + kwargs.setdefault("SegmentsLocation", BarrelSegments) + else: + InDetTRT_TrackSegmentsMaker = acc.popToolsAndMerge(TRT_TrackSegmentsMaker_BarrelCosmicsCfg(flags, name='InDetTRTSegmentsMaker'+extension, + TRT_ClustersContainer = 'TRT_DriftCircles')) # InDetKeys.TRT_DriftCircles + acc.addPublicTool(InDetTRT_TrackSegmentsMaker) + + if flags.InDet.doCaloSeededTRTSegments or TrackingCuts.RoISeededBackTracking: + kwargs.setdefault("SegmentsMakerTool", InDetTRT_TrackSegmentsMaker) + kwargs.setdefault("SegmentsLocation", BarrelSegments) + kwargs.setdefault("useCaloSeeds", True) + kwargs.setdefault("InputClusterContainerName", 'InDetCaloClusterROIs') # InDetKeys.CaloClusterROIContainer + else: + kwargs.setdefault("SegmentsMakerTool", InDetTRT_TrackSegmentsMaker) + kwargs.setdefault("SegmentsLocation", BarrelSegments) + kwargs.setdefault("InputClusterContainerName", "") + else: + # + # --- offline version of TRT segemnt making + # + InDetTRT_TrackSegmentsMaker = acc.popToolsAndMerge(TRT_TrackSegmentsMaker_ATLxkCfg( flags, + name = 'InDetTRT_SeedsMaker'+extension, + extension = extension, + TrackingCuts = TrackingCuts, + InputCollections = InputCollections)) + acc.addPublicTool(InDetTRT_TrackSegmentsMaker) + kwargs.setdefault("SegmentsMakerTool", InDetTRT_TrackSegmentsMaker) + + acc.merge(TRT_TrackSegmentsMakerCondAlg_ATLxkCfg(name = 'InDetTRT_SeedsMakerCondAlg'+ extension, + extension = extension, + TrackingCuts=TrackingCuts)) + + acc.addEventAlgo(CompFactory.InDet.TRT_TrackSegmentsFinder( name = name, **kwargs)) + return acc + +def SegmentDriftCircleAssValidationCfg(flags, name="InDetSegmentDriftCircleAssValidation", extension='', TrackingCuts=None, BarrelSegments='', **kwargs): + acc = ComponentAccumulator() + # + # --- cut values + # + if extension == "_TRT": + # TRT Subdetector segment finding + MinNumberDCs = TrackingCuts.minTRTonly + pTmin = TrackingCuts.minPT + else: + # TRT-only/back-tracking segment finding + MinNumberDCs = TrackingCuts.minSecondaryTRTonTrk + pTmin = TrackingCuts.minSecondaryPt + + #kwargs.setdefault("OrigTracksLocation", BarrelSegments) + kwargs.setdefault("TRT_DriftCirclesName", 'TRT_DriftCircles') # InDetKeys.TRT_DriftCircles + kwargs.setdefault("pTmin", pTmin) + kwargs.setdefault("Pseudorapidity", 2.1) # end of TRT + kwargs.setdefault("RadiusMin", 0.) + kwargs.setdefault("RadiusMax", 600.) + kwargs.setdefault("MinNumberDCs", MinNumberDCs) + + InDetSegmentDriftCircleAssValidation = CompFactory.InDet.SegmentDriftCircleAssValidation(name = name, **kwargs) + acc.addEventAlgo(InDetSegmentDriftCircleAssValidation) + return acc + +def TRTActiveCondAlgCfg(flags, name="TRTActiveCondAlg", **kwargs): + acc = ComponentAccumulator() + + InDetTRTStrawStatusSummaryTool = acc.popToolsAndMerge(TC.InDetTRTStrawStatusSummaryToolCfg(flags)) + acc.addPublicTool(InDetTRTStrawStatusSummaryTool) + + kwargs.setdefault("TRTStrawStatusSummaryTool", InDetTRTStrawStatusSummaryTool) + + TRTActiveCondAlg = CompFactory.TRTActiveCondAlg(name = name, **kwargs) + acc.addCondAlgo(TRTActiveCondAlg) + return acc + +def TRTSegmentFindingCfg(flags, extension = "", InputCollections = None, NewTrackingCuts = None, BarrelSegments = None, doPhase = False): + acc = ComponentAccumulator() + # + # --- decide if use the association tool + # + usePrdAssociationTool = len(InputCollections) > 0 + + # + # --- get list of already associated hits (always do this, even if no other tracking ran before) + # + prefix = 'InDetSegment' + suffix = extension + if usePrdAssociationTool: + acc.merge(TC.InDetTrackPRD_AssociationCfg(flags, namePrefix = prefix, + nameSuffix = suffix, + TracksName = list(InputCollections))) + # + # --- TRT track reconstruction + # + acc.merge(TRT_TrackSegmentsFinderCfg( flags, + name = 'InDetTRT_TrackSegmentsFinderPhase'+extension, + extension =extension, + TrackingCuts = NewTrackingCuts, + BarrelSegments=BarrelSegments, + InputCollections = InputCollections, + doPhase = doPhase)) + # + # --- load TRT validation alg + # + + if flags.InDet.doTruth and not flags.Beam.Type == "cosmics": + acc.merge(SegmentDriftCircleAssValidationCfg(flags, + name="InDetSegmentDriftCircleAssValidation"+extension, + TrackingCuts = NewTrackingCuts, + BarrelSegments=BarrelSegments)) + + return acc + + +if __name__ == "__main__": + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + from AthenaConfiguration.TestDefaults import defaultTestFiles + ConfigFlags.Input.Files=defaultTestFiles.RDO + + ConfigFlags.Detector.RecoTRT = True + ConfigFlags.Detector.RecoIBL = True + + numThreads=1 + ConfigFlags.Concurrency.NumThreads=numThreads + ConfigFlags.Concurrency.NumConcurrentEvents=numThreads # Might change this later, but good enough for the moment. + + ConfigFlags.lock() + ConfigFlags.dump() + + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + top_acc = MainServicesCfg(ConfigFlags) + + msgService = top_acc.getService('MessageSvc') + msgService.Format = "S:%s E:%e % F%138W%S%7W%R%T %0W%M" + + from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg + top_acc.merge(PoolReadCfg(ConfigFlags)) + + from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg + top_acc.merge(MagneticFieldSvcCfg(ConfigFlags)) + + from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg + top_acc.merge(TRT_GeometryCfg( ConfigFlags )) + + from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg + from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg + top_acc.merge( PixelGeometryCfg(ConfigFlags) ) + top_acc.merge( SCT_GeometryCfg(ConfigFlags) ) + + # NewTracking collection keys + InputCombinedInDetTracks = [] + + InDetNewTrackingCuts = ConfigFlags.InDet.Tracking + ############################################################################# + top_acc.merge(TRTActiveCondAlgCfg(ConfigFlags)) + top_acc.merge(TC.TRT_DetElementsRoadCondAlgCfg()) + + from InDetConfig.TRTPreProcessing import TRTPreProcessingCfg + if not ConfigFlags.InDet.doDBMstandalone: + top_acc.merge(TRTPreProcessingCfg(ConfigFlags,(not ConfigFlags.InDet.doTRTPhaseCalculation or ConfigFlags.Beam.Type =="collisions"),False)) + + top_acc.merge(TRTSegmentFindingCfg( ConfigFlags, + "", + InputCombinedInDetTracks, + InDetNewTrackingCuts, + 'TRTSegments')) # InDetKeys.TRT_Segments + ############################################################################# + + iovsvc = top_acc.getService('IOVDbSvc') + iovsvc.OutputLevel=5 + top_acc.getService('StoreGateSvc').Dump = True + top_acc.printConfig(withDetails = True, summariseProps = True) + top_acc.run(25) + top_acc.store(open("test_TRTSegmentFinding.pkl", "wb")) \ No newline at end of file diff --git a/InnerDetector/InDetConfig/python/TrackRecoConfig.py b/InnerDetector/InDetConfig/python/TrackRecoConfig.py index 1d4e35f410c176531a2f8b4ee5c9344123512d5f..0291fe7b237205681bd8934e924e86384e9424a6 100644 --- a/InnerDetector/InDetConfig/python/TrackRecoConfig.py +++ b/InnerDetector/InDetConfig/python/TrackRecoConfig.py @@ -4,15 +4,15 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory ##------------------------------------------------------------------------------ -def BCM_ZeroSuppressionCfg(flags, **kwargs): +def BCM_ZeroSuppressionCfg(flags, name="InDetBCM_ZeroSuppression", **kwargs): acc = ComponentAccumulator() kwargs.setdefault("BcmContainerName", "BCM_RDOs") - algo = CompFactory.BCM_ZeroSuppression("InDetBCM_ZeroSuppression", **kwargs) + algo = CompFactory.BCM_ZeroSuppression(name=name, **kwargs) acc.addEventAlgo(algo, primary = True) return acc ##------------------------------------------------------------------------------ -def PixelClusterizationCfg(flags, **kwargs) : +def PixelClusterizationCfg(flags, name = "InDetPixelClusterization", **kwargs) : acc = ComponentAccumulator() sub_acc = MergedPixelsToolCfg(flags, **kwargs) merged_pixels_tool = sub_acc.getPrimary() @@ -21,24 +21,29 @@ def PixelClusterizationCfg(flags, **kwargs) : ambi_finder=sub_acc.getPrimary() acc.merge(sub_acc) - acc.addEventAlgo( CompFactory.InDet.PixelClusterization( name = "InDetPixelClusterization", - clusteringTool = merged_pixels_tool, - gangedAmbiguitiesFinder = ambi_finder, - DataObjectName = "PixelRDOs", - ClustersName = "PixelClusters" )) + # Region selector tools for Pixel + from RegionSelector.RegSelToolConfig import regSelTool_Pixel_Cfg + RegSelTool_Pixel = acc.popToolsAndMerge(regSelTool_Pixel_Cfg(flags)) + + kwargs.setdefault("clusteringTool", merged_pixels_tool) + kwargs.setdefault("gangedAmbiguitiesFinder", ambi_finder) + kwargs.setdefault("DataObjectName", "PixelRDOs") + kwargs.setdefault("ClustersName", "PixelClusters") + kwargs.setdefault("RegSelTool", RegSelTool_Pixel) + + acc.addEventAlgo(CompFactory.InDet.PixelClusterization(name=name, **kwargs)) return acc ##------------------------------------------------------------------------------ -def PixelClusterizationPUCfg(flags, **kwargs) : - kwargs.setdefault("name", "InDetPixelClusterizationPU") +def PixelClusterizationPUCfg(flags, name="InDetPixelClusterizationPU", **kwargs) : kwargs.setdefault("DataObjectName", "Pixel_PU_RDOs") kwargs.setdefault("ClustersName", "PixelPUClusters") kwargs.setdefault("AmbiguitiesMap", "PixelClusterAmbiguitiesMapPU") - return PixelClusterizationCfg(flags, **kwargs) + return PixelClusterizationCfg(flags, name=name, **kwargs) ##------------------------------------------------------------------------------ ##------------------------------------------------------------------------------ -def SCTClusterizationCfg(flags, **kwargs) : +def SCTClusterizationCfg(flags, name="InDetSCT_Clusterization", **kwargs) : acc = ComponentAccumulator() # Need to get SCT_ConditionsSummaryTool for e.g. SCT_ClusteringTool @@ -49,33 +54,32 @@ def SCTClusterizationCfg(flags, **kwargs) : accbuf = ClusterMakerToolCfg(flags) InDetClusterMakerTool = accbuf.getPrimary() acc.merge(accbuf) - InDetSCT_ClusteringTool = CompFactory.InDet.SCT_ClusteringTool( name = "InDetSCT_ClusteringTool", - globalPosAlg = InDetClusterMakerTool, - conditionsTool = InDetSCT_ConditionsSummaryToolWithoutFlagged) + InDetSCT_ClusteringTool = CompFactory.InDet.SCT_ClusteringTool( name = "InDetSCT_ClusteringTool", + globalPosAlg = InDetClusterMakerTool, + conditionsTool = InDetSCT_ConditionsSummaryToolWithoutFlagged) if flags.InDet.selectSCTIntimeHits : if flags.InDet.InDet25nsec : InDetSCT_ClusteringTool.timeBins = "01X" else: InDetSCT_ClusteringTool.timeBins = "X1X" - acc.addEventAlgo( CompFactory.InDet.SCT_Clusterization( name = "InDetSCT_Clusterization", - clusteringTool = InDetSCT_ClusteringTool, - DataObjectName = 'SCT_RDOs', ##InDetKeys.SCT_RDOs(), - ClustersName = 'SCT_Clusters', ##InDetKeys.SCT_Clusters(), - conditionsTool = InDetSCT_ConditionsSummaryToolWithoutFlagged ) ) + kwargs.setdefault("clusteringTool", InDetSCT_ClusteringTool) + kwargs.setdefault("DataObjectName", 'SCT_RDOs') ##InDetKeys.SCT_RDOs() + kwargs.setdefault("ClustersName", 'SCT_Clusters') ##InDetKeys.SCT_Clusters() + kwargs.setdefault("conditionsTool", InDetSCT_ConditionsSummaryToolWithoutFlagged) - return acc + acc.addEventAlgo( CompFactory.InDet.SCT_Clusterization(name=name, **kwargs)) + return acc ##------------------------------------------------------------------------------ ##------------------------------------------------------------------------------ ##------------------------------------------------------------------------------ -def SCTClusterizationPUCfg(flags, **kwargs) : - kwargs.setdefault("name", "InDetSCT_ClusterizationPU") +def SCTClusterizationPUCfg(flags, name="InDetSCT_ClusterizationPU", **kwargs) : kwargs.setdefault("DataObjectName", "SCT_PU_RDOs" ) #flags.InDetKeys.SCT_PU_RDOs - kwargs.setdefault("ClustersName", "SCT_PU_Clusters") #flags.InDetKeys.SCT_PU_Clusters - return SCTClusterizationCfg(flags, **kwargs) + kwargs.setdefault("ClustersName", "SCT_PU_Clusters") #flags.InDetKeys.SCT_PU_Clusters + return SCTClusterizationCfg(flags, name=name, **kwargs) ##------------------------------------------------------------------------------ def PixelGangedAmbiguitiesFinderCfg(flags) : @@ -84,7 +88,6 @@ def PixelGangedAmbiguitiesFinderCfg(flags) : acc.addPublicTool( InDetPixelGangedAmbiguitiesFinder, primary=True) return acc - ##------------------------------------------------------------------------------ def MergedPixelsToolCfg(flags, **kwargs) : acc = ComponentAccumulator() @@ -109,9 +112,11 @@ def MergedPixelsToolCfg(flags, **kwargs) : acc.addPublicTool(InDetMergedPixelsTool, primary=True) return acc + ##------------------------------------------------------------------------------ -def ClusterMakerToolCfg(flags, **kwargs) : - from PixelConditionsAlgorithms.PixelConditionsConfig import PixelChargeCalibCondAlgCfg, PixelConfigCondAlgCfg +def ClusterMakerToolCfg(flags, name="InDetClusterMakerTool", **kwargs) : + from PixelConditionsAlgorithms.PixelConditionsConfig import (PixelChargeCalibCondAlgCfg, PixelConfigCondAlgCfg, + PixelOfflineCalibCondAlgCfg, PixelCablingCondAlgCfg, PixelReadoutSpeedAlgCfg) acc = ComponentAccumulator() # This directly needs the following Conditions data: @@ -119,7 +124,11 @@ def ClusterMakerToolCfg(flags, **kwargs) : acc.merge( PixelChargeCalibCondAlgCfg(flags)) acc.merge( PixelConfigCondAlgCfg(flags)) - InDetClusterMakerTool = CompFactory.InDet.ClusterMakerTool(name = "InDetClusterMakerTool", **kwargs) + acc.merge(PixelOfflineCalibCondAlgCfg(flags)) + acc.merge(PixelCablingCondAlgCfg(flags)) + acc.merge(PixelReadoutSpeedAlgCfg(flags)) + + InDetClusterMakerTool = CompFactory.InDet.ClusterMakerTool(name = name, **kwargs) from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg SCTLorentzAngleTool = acc.popToolsAndMerge( SCT_LorentzAngleCfg(flags) ) diff --git a/InnerDetector/InDetConfig/python/TrackingCommonConfig.py b/InnerDetector/InDetConfig/python/TrackingCommonConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..62b03f5a367931676b05e6de731d59783148f2a1 --- /dev/null +++ b/InnerDetector/InDetConfig/python/TrackingCommonConfig.py @@ -0,0 +1,820 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline +from InDetConfig.InDetRecToolConfig import makeName +####################################################################### + +def copyArgs(kwargs, copy_list): + dict_copy={} + for elm in copy_list : + if elm in kwargs : + dict_copy[elm]=kwargs[elm] + return dict_copy + +def NeuralNetworkToHistoToolCfg(**kwargs): + acc = ComponentAccumulator() + name = kwargs.pop('name',"NeuralNetworkToHistoTool") + + NeuralNetworkToHistoTool=CompFactory.Trk.NeuralNetworkToHistoTool(name, **kwargs) + acc.setPrivateTools(NeuralNetworkToHistoTool) + return acc + +def PixelClusterNnCondAlgCfg(flags, **kwargs): + acc = ComponentAccumulator() + track_nn = kwargs.pop('TrackNetwork',False) + nn_names = [ + "NumberParticles_NoTrack/", + "ImpactPoints1P_NoTrack/", + "ImpactPoints2P_NoTrack/", + "ImpactPoints3P_NoTrack/", + "ImpactPointErrorsX1_NoTrack/", + "ImpactPointErrorsX2_NoTrack/", + "ImpactPointErrorsX3_NoTrack/", + "ImpactPointErrorsY1_NoTrack/", + "ImpactPointErrorsY2_NoTrack/", + "ImpactPointErrorsY3_NoTrack/" ] + + if track_nn : + nn_names = [ elm.replace('_NoTrack', '') for elm in nn_names ] + + acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/PixelClustering/PixelClusNNCalib", "/PIXEL/PixelClustering/PixelClusNNCalib", className='CondAttrListCollection')) + kwargs.setdefault("NetworkNames", nn_names) + kwargs.setdefault("WriteKey", 'PixelClusterNN' if not track_nn else 'PixelClusterNNWithTrack') + + if 'NetworkToHistoTool' not in kwargs : + NeuralNetworkToHistoTool = acc.popToolsAndMerge(NeuralNetworkToHistoToolCfg(name = "NeuralNetworkToHistoTool")) + kwargs.setdefault("NetworkToHistoTool", NeuralNetworkToHistoTool) + acc.addPublicTool(NeuralNetworkToHistoTool) + + acc.addCondAlgo(CompFactory.InDet.TTrainedNetworkCondAlg(kwargs.pop("name", 'PixelClusterNnCondAlg'), **kwargs)) + return acc + +def PixelClusterNnWithTrackCondAlgCfg(flags, **kwargs): + kwargs.setdefault("TrackNetwork", True) + kwargs.setdefault("name", 'PixelClusterNnWithTrackCondAlg') + + acc = PixelClusterNnCondAlgCfg(flags, **kwargs) + return acc + +def LWTNNCondAlgCfg(flags, **kwargs): + acc = ComponentAccumulator() + # Check for the folder + acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/PixelClustering/PixelNNCalibJSON", "/PIXEL/PixelClustering/PixelNNCalibJSON", className='CondAttrListCollection')) + # What we'll store it as + kwargs.setdefault("WriteKey", 'PixelClusterNNJSON') + + # Set up the algorithm + acc.addCondAlgo(CompFactory.InDet.LWTNNCondAlg(kwargs.pop("name", "LWTNNCondAlg"), **kwargs)) + return acc + +def NnClusterizationFactoryCfg(flags, name = 'NnClusterizationFactory', **kwargs): + acc = ComponentAccumulator() + the_name = makeName(name, kwargs) + + if 'PixelLorentzAngleTool' not in kwargs : + from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleTool + PixelLorentzAngleTool = PixelLorentzAngleTool(flags, name="PixelLorentzAngleTool", **kwargs) + acc.addPublicTool(PixelLorentzAngleTool) + kwargs.setdefault("PixelLorentzAngleTool", PixelLorentzAngleTool) + + useTTrainedNetworks = flags.InDet.useNNTTrainedNetworks + do_runI = flags.GeoModel.Run not in ["RUN2", "RUN3"] + + if useTTrainedNetworks : + acc.merge(PixelClusterNnCondAlgCfg(flags, name='PixelClusterNnCondAlg', GetInputsInfo = do_runI)) + acc.merge(PixelClusterNnWithTrackCondAlgCfg(flags, name = 'PixelClusterNnWithTrackCondAlg', GetInputsInfo = do_runI)) + else: + acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/PixelClustering/PixelClusNNCalib", "/PIXEL/PixelClustering/PixelClusNNCalib", className='CondAttrListCollection')) + acc.merge(LWTNNCondAlgCfg(flags, name='LWTNNCondAlg')) + + kwargs.setdefault("doRunI", True) + kwargs.setdefault("useToT", False if do_runI else flags.InDet.doNNToTCalibration) + kwargs.setdefault("useRecenteringNNWithoutTracks", True if do_runI else False) + kwargs.setdefault("useRecenteringNNWithTracks", False if do_runI else False) + kwargs.setdefault("correctLorShiftBarrelWithoutTracks", 0) + kwargs.setdefault("correctLorShiftBarrelWithTracks", 0.030 if do_runI else 0.000) + kwargs.setdefault("useTTrainedNetworks", useTTrainedNetworks) + kwargs.setdefault("NnCollectionReadKey", 'PixelClusterNN') + kwargs.setdefault("NnCollectionWithTrackReadKey", 'PixelClusterNNWithTrack') + kwargs.setdefault("NnCollectionJSONReadKey", '' if useTTrainedNetworks else 'PixelClusterNNJSON') + + NnClusterizationFactory = CompFactory.InDet.NnClusterizationFactory( name = the_name, **kwargs ) + + return NnClusterizationFactory + +def InDetPixelClusterOnTrackToolBaseCfg(flags, name, **kwargs): + the_name = makeName(name, kwargs) + split_cluster_map_extension = kwargs.pop('SplitClusterMapExtension','') + if (flags.Beam.Type == "cosmics") or flags.InDet.doDBMstandalone: + kwargs.setdefault("ErrorStrategy", 0) + kwargs.setdefault("PositionStrategy", 0) + + kwargs.setdefault("DisableDistortions", flags.InDet.doFatras or flags.InDet.doDBMstandalone ) + kwargs.setdefault("applyNNcorrection", flags.InDet.doPixelClusterSplitting and flags.InDet.pixelClusterSplittingType == 'NeuralNet' and not flags.InDet.doSLHC ) + kwargs.setdefault("NNIBLcorrection", flags.InDet.doPixelClusterSplitting and flags.InDet.pixelClusterSplittingType == 'NeuralNet' and not flags.InDet.doSLHC ) + kwargs.setdefault("SplitClusterAmbiguityMap", 'SplitClusterAmbiguityMap' + split_cluster_map_extension ) + kwargs.setdefault("RunningTIDE_Ambi", flags.InDet.doTIDE_Ambi ) + + return CompFactory.InDet.PixelClusterOnTrackTool(the_name, **kwargs) + +def InDetPixelClusterOnTrackToolDigitalCfg(flags, name='InDetPixelClusterOnTrackToolDigital', **kwargs): + if 'LorentzAngleTool' not in kwargs : + from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleTool + kwargs.setdefault("LorentzAngleTool", PixelLorentzAngleTool(flags, name="PixelLorentzAngleTool") ) + + if flags.InDet.doDigitalROTCreation: + kwargs.setdefault("applyNNcorrection", False ) + kwargs.setdefault("NNIBLcorrection", False ) + kwargs.setdefault("ErrorStrategy", 2 ) + kwargs.setdefault("PositionStrategy", 1 ) + kwargs.setdefault("SplitClusterAmbiguityMap", "" ) + else : + kwargs.setdefault("SplitClusterAmbiguityMap", "" ) + return InDetPixelClusterOnTrackToolBaseCfg(flags, name=name, **kwargs) + +def InDetPixelClusterOnTrackToolNNSplittingCfg(flags, name='InDetPixelClusterOnTrackToolNNSplitting', **kwargs): + if flags.InDet.doPixelClusterSplitting and flags.InDet.pixelClusterSplittingType == 'NeuralNet': + if 'NnClusterizationFactory' not in kwargs : + NnClusterizationFactory = NnClusterizationFactoryCfg(flags) + kwargs.setdefault("NnClusterizationFactory", NnClusterizationFactory) + + return InDetPixelClusterOnTrackToolBaseCfg(flags, name=name, **kwargs) + +def InDetPixelClusterOnTrackToolCfg(flags, name='InDetPixelClusterOnTrackTool', **kwargs): + if 'LorentzAngleTool' not in kwargs : + from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleTool + kwargs.setdefault("LorentzAngleTool", PixelLorentzAngleTool(flags, name="PixelLorentzAngleTool") ) + + if flags.InDet.doDigitalROTCreation: + return InDetPixelClusterOnTrackToolDigitalCfg(flags, name=name, **kwargs) + else: + return InDetPixelClusterOnTrackToolNNSplittingCfg(flags, name=name, **kwargs) + +def InDetSCT_ClusterOnTrackToolCfg(flags, name='InDetSCT_ClusterOnTrackTool', **kwargs): + the_name = makeName(name, kwargs) + + if 'LorentzAngleTool' not in kwargs : + from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleTool + kwargs.setdefault("LorentzAngleTool", PixelLorentzAngleTool(flags, name="PixelLorentzAngleTool") ) + + kwargs.setdefault("CorrectionStrategy", 0 ) # do correct position bias + kwargs.setdefault("ErrorStrategy", 2 ) # do use phi dependent errors + return CompFactory.InDet.SCT_ClusterOnTrackTool(the_name, **kwargs) + +def InDetBroadSCT_ClusterOnTrackToolCfg(flags, name='InDetBroadSCT_ClusterOnTrackTool', **kwargs): + kwargs.setdefault("ErrorStrategy", 0) + return InDetSCT_ClusterOnTrackToolCfg(flags, name=name, **kwargs) + +def InDetBroadPixelClusterOnTrackToolCfg(flags, name='InDetBroadPixelClusterOnTrackTool', **kwargs): + kwargs.setdefault("ErrorStrategy", 0) + return InDetPixelClusterOnTrackToolCfg(flags, name=name, **kwargs) + +def RIO_OnTrackErrorScalingCondAlgCfg(flags, **kwargs): + acc = ComponentAccumulator() + the_name=kwargs.pop("name", None) + + if flags.Detector.RecoIBL: + error_scaling_type = ["PixelRIO_OnTrackErrorScaling"] + error_scaling_outkey = ["/Indet/TrkErrorScalingPixel"] + else: + error_scaling_type = ["PixelRIO_OnTrackErrorScalingRun1"] + error_scaling_outkey = ["/Indet/TrkErrorScalingPixel"] + + error_scaling_type += ["SCTRIO_OnTrackErrorScaling"] + error_scaling_outkey += ["/Indet/TrkErrorScalingSCT"] + + error_scaling_type += ["TRTRIO_OnTrackErrorScaling"] + error_scaling_outkey += ["/Indet/TrkErrorScalingTRT"] + + acc.merge(addFoldersSplitOnline(flags, 'INDET','/Indet/Onl/TrkErrorScaling','/Indet/TrkErrorScaling', className="CondAttrListCollection")) + + kwargs.setdefault("ReadKey", "/Indet/TrkErrorScaling") + kwargs.setdefault("ErrorScalingType", error_scaling_type) + kwargs.setdefault("OutKeys", error_scaling_outkey) + + if the_name is not None: + kwargs.setdefault("name", the_name) + acc.addCondAlgo(CompFactory.RIO_OnTrackErrorScalingCondAlg(**kwargs)) + return acc + +def InDetTRT_DriftCircleOnTrackToolCfg(flags, name='TRT_DriftCircleOnTrackTool', **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + kwargs.pop('isHLT',None) + acc.merge(RIO_OnTrackErrorScalingCondAlgCfg(flags, name = 'RIO_OnTrackErrorScalingCondAlg')) + kwargs.setdefault("TRTErrorScalingKey", '/Indet/TrkErrorScalingTRT') + kwargs.setdefault("LumiDataKey", '') # need to check + acc.addPublicTool(CompFactory.InDet.TRT_DriftCircleOnTrackTool(name = the_name, **kwargs), primary = True) + return acc + +def InDetBroadTRT_DriftCircleOnTrackToolCfg(name='InDetBroadTRT_DriftCircleOnTrackTool', **kwargs): + the_name = makeName( name, kwargs) + return CompFactory.InDet.TRT_DriftCircleOnTrackNoDriftTimeTool(the_name, **kwargs) + +def InDetRotCreatorCfg(flags, name='InDetRotCreator', **kwargs): + acc = ComponentAccumulator() + strip_args=['SplitClusterMapExtension','ClusterSplitProbabilityName','RenounceInputHandles','nameSuffix'] + pix_cluster_on_track_args = copyArgs(kwargs,strip_args) + the_name = makeName(name, kwargs) + + for an_arg in strip_args: + kwargs.pop(an_arg, None) + + use_broad_cluster_pix = flags.InDet.useBroadPixClusterErrors and (not flags.InDet.doDBMstandalone) + use_broad_cluster_sct = flags.InDet.useBroadSCTClusterErrors and (not flags.InDet.doDBMstandalone) + + if 'ToolPixelCluster' not in kwargs : + if use_broad_cluster_pix : + ToolPixelCluster= InDetBroadPixelClusterOnTrackToolCfg(flags, **pix_cluster_on_track_args) + else: + ToolPixelCluster= InDetPixelClusterOnTrackToolCfg(flags, **pix_cluster_on_track_args) + acc.addPublicTool(ToolPixelCluster) + kwargs.setdefault("ToolPixelCluster", ToolPixelCluster) + + if 'ToolSCT_Cluster' not in kwargs : + if use_broad_cluster_sct : + ToolSCT_Cluster = InDetBroadSCT_ClusterOnTrackToolCfg(flags) + else : + ToolSCT_Cluster = InDetSCT_ClusterOnTrackToolCfg(flags) + kwargs.setdefault("ToolSCT_Cluster", ToolSCT_Cluster) + acc.addPublicTool(ToolSCT_Cluster) + + if 'ToolTRT_DriftCircle' not in kwargs : + acc_trt = InDetTRT_DriftCircleOnTrackToolCfg(flags) + TRT_DriftCircleOnTrackTool = acc_trt.getPrimary() + acc.merge(acc_trt) + kwargs.setdefault("ToolTRT_DriftCircle", TRT_DriftCircleOnTrackTool) + + kwargs.setdefault('Mode', 'indet') + acc.addPublicTool(CompFactory.Trk.RIO_OnTrackCreator(name=the_name, **kwargs), primary = True) + return acc + +def InDetTRT_DriftCircleOnTrackUniversalToolCfg(name='InDetTRT_RefitRotCreator', **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + default_ScaleHitUncertainty = 2.5 + + if 'RIOonTrackToolDrift' not in kwargs : + RIOonTrackToolDrift = InDetBroadTRT_DriftCircleOnTrackToolCfg() + kwargs.setdefault("RIOonTrackToolDrift", RIOonTrackToolDrift) + acc.addPublicTool(RIOonTrackToolDrift) + if 'RIOonTrackToolTube' not in kwargs : + RIOonTrackToolTube = InDetBroadTRT_DriftCircleOnTrackToolCfg() + kwargs.setdefault("RIOonTrackToolTube", RIOonTrackToolTube) + acc.addPublicTool(RIOonTrackToolTube) + kwargs.setdefault("ScaleHitUncertainty", default_ScaleHitUncertainty) + acc.setPrivateTools(CompFactory.InDet.TRT_DriftCircleOnTrackUniversalTool(name = the_name, **kwargs)) + return acc + +def InDetRefitRotCreatorCfg(flags, name='InDetRefitRotCreator', **kwargs): + acc = ComponentAccumulator() + default_ScaleHitUncertainty = 2.5 + ScaleHitUncertainty = kwargs.pop('ScaleHitUncertainty', default_ScaleHitUncertainty) + if flags.InDet.redoTRT_LR: + if flags.Detector.RecoTRT: + if 'ToolTRT_DriftCircle' not in kwargs : + ToolTRT_DriftCircle = acc.popToolsAndMerge(InDetTRT_DriftCircleOnTrackUniversalToolCfg(ScaleHitUncertainty = ScaleHitUncertainty)) + kwargs.setdefault("ToolTRT_DriftCircle", ToolTRT_DriftCircle) + acc.addPublicTool(ToolTRT_DriftCircle) + acc.merge(InDetRotCreatorCfg(flags, name = name, **kwargs)) + return acc + +def InDetPRDtoTrackMapToolGangedPixelsCfg(flags, name='PRDtoTrackMapToolGangedPixels', **kwargs): + the_name = makeName( name, kwargs) + kwargs.setdefault("PixelClusterAmbiguitiesMapName", 'PixelClusterAmbiguitiesMap') # InDetKeys.GangedPixelMap() + kwargs.setdefault("addTRToutliers", True) + return CompFactory.InDet.InDetPRDtoTrackMapToolGangedPixels( name=the_name, **kwargs) + +def InDetTrackPRD_AssociationCfg(flags, name='InDetTrackPRD_Association', **kwargs): + acc = ComponentAccumulator() + from InDetConfig.InDetRecToolConfig import makeNameGetPreAndSuffix + the_name,prefix,suffix=makeNameGetPreAndSuffix(name,kwargs) + + if kwargs.get('TracksName', None) is None : + raise Exception('Not TracksName argument provided') + kwargs.setdefault("AssociationTool", InDetPRDtoTrackMapToolGangedPixelsCfg(flags) \ + if 'AssociationTool' not in kwargs else None ) + kwargs.setdefault("AssociationMapName", prefix+'PRDtoTrackMap'+suffix ) + acc.addEventAlgo(CompFactory.InDet.InDetTrackPRD_Association(name = the_name, **kwargs)) + return acc + +def InDetTRTDriftCircleCutForPatternRecoCfg(flags, name='InDetTRTDriftCircleCutForPatternReco', TrackingCuts=None, **kwargs): + the_name = makeName( name, kwargs) + + kwargs.setdefault("MinOffsetDCs", 5) + kwargs.setdefault("UseNewParameterization", TrackingCuts.useNewParameterizationTRT) + kwargs.setdefault("UseActiveFractionSvc", flags.Detector.RecoTRT) + return CompFactory.InDet.InDetTrtDriftCircleCutTool(the_name, **kwargs) + +def InDetSummaryHelperNoHoleSearchCfg(flags, name='InDetSummaryHelperNoHoleSearch', **kwargs): + acc = ComponentAccumulator() + if 'HoleSearch' not in kwargs : + kwargs.setdefault("HoleSearch", None) + from InDetConfig.InDetRecToolConfig import InDetTrackSummaryHelperToolCfg + tmpAcc = InDetTrackSummaryHelperToolCfg(flags, name = name, **kwargs) + InDetSummaryHelper = tmpAcc.getPrimary() + acc.merge(tmpAcc) + acc.setPrivateTools(InDetSummaryHelper) + return acc + +def InDetTrackSummaryToolCfg(flags, name='InDetTrackSummaryTool', **kwargs): + acc = ComponentAccumulator() + # makeName will remove the namePrefix in suffix from kwargs, so copyArgs has to be first + hlt_args = copyArgs(kwargs,['isHLT','namePrefix']) + id_helper_args = copyArgs(kwargs,['ClusterSplitProbabilityName','RenounceInputHandles','namePrefix','nameSuffix']) if 'ClusterSplitProbabilityName' in kwargs else {} + kwargs.pop('ClusterSplitProbabilityName',None) + kwargs.pop('RenounceInputHandles',None) + kwargs.pop('isHLT',None) + the_name = makeName( name, kwargs) + do_holes=kwargs.get("doHolesInDet",True) + if do_holes : + id_helper_args.update(hlt_args) + if 'InDetSummaryHelperTool' not in kwargs : + from InDetConfig.InDetRecToolConfig import InDetTrackSummaryHelperToolCfg + tmpAcc = InDetTrackSummaryHelperToolCfg(flags, **id_helper_args) + InDetSummaryHelper = tmpAcc.getPrimary() + acc.merge(tmpAcc) + InDetSummaryHelperNoHoleSearch = acc.popToolsAndMerge(InDetSummaryHelperNoHoleSearchCfg(flags, **id_helper_args)) + acc.addPublicTool(InDetSummaryHelperNoHoleSearch) + kwargs.setdefault("InDetSummaryHelperTool", InDetSummaryHelper if do_holes else InDetSummaryHelperNoHoleSearch) + + # + # Configurable version of TrkTrackSummaryTool: no TRT_PID tool needed here (no shared hits) + # + kwargs.setdefault("doSharedHits", False) + kwargs.setdefault("doHolesInDet", do_holes) + kwargs.setdefault("TRT_ElectronPidTool", None) # we don't want to use those tools during pattern + kwargs.setdefault("TRT_ToT_dEdxTool", None) # dito + kwargs.setdefault("PixelToTPIDTool", None) # we don't want to use those tools during pattern + acc.setPrivateTools(CompFactory.Trk.TrackSummaryTool(name = the_name, **kwargs)) + return acc + +def InDetPixelToTPIDToolCfg(name = "InDetPixelToTPIDTool", **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + InDetPixelToTPIDTool = CompFactory.InDet.PixelToTPIDTool(name = the_name, **kwargs) + acc.setPrivateTools(InDetPixelToTPIDTool) + return acc + +def InDetRecTestBLayerToolCfg(flags, name='InDetRecTestBLayerTool', **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + + if not flags.Detector.RecoPixel: + return None + + if 'Extrapolator' not in kwargs : + from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg + tmpAcc = InDetExtrapolatorCfg(flags) + kwargs.setdefault("Extrapolator", tmpAcc.getPrimary()) + acc.merge(tmpAcc) + + if 'PixelSummaryTool' not in kwargs : + from InDetConfig.InDetRecToolConfig import PixelConditionsSummaryToolCfg + PixelConditionsSummaryTool = acc.popToolsAndMerge(PixelConditionsSummaryToolCfg(flags)) + kwargs.setdefault( "PixelSummaryTool", PixelConditionsSummaryTool) + acc.merge(tmpAcc) + + InDetTestBLayerTool = CompFactory.InDet.InDetTestBLayerTool(name=the_name, **kwargs) + acc.setPrivateTools(InDetTestBLayerTool) + return acc + +def InDetSummaryHelperSharedHitsCfg(flags, name='InDetSummaryHelperSharedHits', **kwargs): + acc = ComponentAccumulator() + if 'PixelToTPIDTool' not in kwargs : + InDetPixelToTPIDTool = acc.popToolsAndMerge(InDetPixelToTPIDToolCfg()) + acc.addPublicTool(InDetPixelToTPIDTool) + kwargs.setdefault("PixelToTPIDTool", InDetPixelToTPIDTool) + + if 'TestBLayerTool' not in kwargs : + if InDetRecTestBLayerToolCfg(flags) is not None: + InDetRecTestBLayerTool = acc.popToolsAndMerge(InDetRecTestBLayerToolCfg(flags)) + acc.addPublicTool(InDetRecTestBLayerTool) + kwargs.setdefault("TestBLayerTool", InDetRecTestBLayerTool) + else: + kwargs.setdefault("TestBLayerTool", None) + + kwargs.setdefault("DoSharedHits", flags.InDet.doSharedHits) + + if flags.Detector.RecoTRT: + kwargs.setdefault("DoSharedHitsTRT", flags.InDet.doSharedHits) + + from InDetConfig.InDetRecToolConfig import InDetTrackSummaryHelperToolCfg + tmpAcc = InDetTrackSummaryHelperToolCfg(flags, name = name, **kwargs) + InDetSummaryHelper = tmpAcc.getPrimary() + acc.merge(tmpAcc) + acc.setPrivateTools(InDetSummaryHelper) + return acc + +def InDetTRTStrawStatusSummaryToolCfg(flags, name = "InDetTRT_StrawStatusSummaryTool", **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + kwargs.setdefault("isGEANT4", flags.Input.isMC) + InDetTRTStrawStatusSummaryTool = CompFactory.TRT_StrawStatusSummaryTool(name = the_name, **kwargs ) + acc.setPrivateTools(InDetTRTStrawStatusSummaryTool) + return acc + +def InDetTRTCalDbToolCfg(name = "InDetTRT_CalDbTool", **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + InDetTRTCalDbTool = CompFactory.TRT_CalDbTool(name = the_name, **kwargs) + acc.setPrivateTools(InDetTRTCalDbTool) + return acc + +def InDetTRT_LocalOccupancyCfg(flags, name ="InDet_TRT_LocalOccupancy", **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + if 'TRTCalDbTool' not in kwargs : + InDetTRTCalDbTool = acc.popToolsAndMerge(InDetTRTCalDbToolCfg()) + acc.addPublicTool(InDetTRTCalDbTool) + kwargs.setdefault( "TRTCalDbTool", InDetTRTCalDbTool ) + + if 'TRTStrawStatusSummaryTool' not in kwargs : + InDetTRTStrawStatusSummaryTool = acc.popToolsAndMerge(InDetTRTStrawStatusSummaryToolCfg(flags)) + acc.addPublicTool(InDetTRTStrawStatusSummaryTool) + kwargs.setdefault( "TRTStrawStatusSummaryTool", InDetTRTStrawStatusSummaryTool ) + + kwargs.setdefault("isTrigger", False) + InDetTRT_LocalOccupancy = CompFactory.InDet.TRT_LocalOccupancy(name=the_name, **kwargs ) + acc.setPrivateTools(InDetTRT_LocalOccupancy) + return acc + +def InDetTRT_dEdxToolCfg(flags, name = "InDetTRT_dEdxTool", **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + + if not flags.Detector.RecoTRT or flags.InDet.doSLHC or flags.InDet.doHighPileup \ + or flags.InDet.useExistingTracksAsInput: # TRT_RDOs (used by the TRT_LocalOccupancy tool) are not present in ESD + return None + + kwargs.setdefault("TRT_dEdx_isData", not flags.Input.isMC) + + if 'TRT_LocalOccupancyTool' not in kwargs : + InDetTRT_LocalOccupancy = acc.popToolsAndMerge(InDetTRT_LocalOccupancyCfg(flags)) + kwargs.setdefault( "TRT_LocalOccupancyTool", InDetTRT_LocalOccupancy) + + InDetTRT_dEdxTool = CompFactory.TRT_ToT_dEdx(name = the_name, **kwargs) + return InDetTRT_dEdxTool + +def InDetTRT_ElectronPidToolCfg(flags, name = "InDetTRT_ElectronPidTool", **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + + if not flags.Detector.RecoTRT or flags.InDet.doSLHC or flags.InDet.doHighPileup \ + or flags.InDet.useExistingTracksAsInput: # TRT_RDOs (used by the TRT_LocalOccupancy tool) are not present in ESD + return None + + if 'TRTStrawSummaryTool' not in kwargs : + InDetTRTStrawStatusSummaryTool = acc.popToolsAndMerge(InDetTRTStrawStatusSummaryToolCfg(flags)) + acc.addPublicTool(InDetTRTStrawStatusSummaryTool) + kwargs.setdefault( "TRTStrawSummaryTool", InDetTRTStrawStatusSummaryTool) + + if 'TRT_LocalOccupancyTool' not in kwargs : + InDetTRT_LocalOccupancy = acc.popToolsAndMerge(InDetTRT_LocalOccupancyCfg(flags)) + acc.addPublicTool(InDetTRT_LocalOccupancy) + kwargs.setdefault( "TRT_LocalOccupancyTool", InDetTRT_LocalOccupancy) + + if 'TRT_ToT_dEdx_Tool' not in kwargs : + InDetTRT_dEdxTool = InDetTRT_dEdxToolCfg(flags) + acc.addPublicTool(InDetTRT_dEdxTool) + kwargs.setdefault( "TRT_ToT_dEdx_Tool", InDetTRT_dEdxTool) + + kwargs.setdefault( "isData", not flags.Input.isMC) + + InDetTRT_ElectronPidTool = CompFactory.InDet.TRT_ElectronPidToolRun2(name = the_name, **kwargs) + return InDetTRT_ElectronPidTool + +def InDetTrackSummaryToolSharedHitsCfg(flags, name='InDetTrackSummaryToolSharedHits',**kwargs): + acc = ComponentAccumulator() + if 'InDetSummaryHelperTool' not in kwargs : + copy_args=['ClusterSplitProbabilityName','RenounceInputHandles','namePrefix','nameSuffix'] + do_holes=kwargs.get("doHolesInDet",True) + if do_holes : + copy_args += ['isHLT'] + id_helper_args = copyArgs(kwargs,copy_args) if 'ClusterSplitProbabilityName' in kwargs else {} + kwargs.pop('ClusterSplitProbabilityName',None) + kwargs.pop('RenounceInputHandles',None) + + InDetSummaryHelperSharedHits = acc.popToolsAndMerge(InDetSummaryHelperSharedHitsCfg(flags, **id_helper_args)) + acc.addPublicTool(InDetSummaryHelperSharedHits) + kwargs.setdefault("InDetSummaryHelperTool", InDetSummaryHelperSharedHits) + + if 'TRT_ElectronPidTool' not in kwargs : + if InDetTRT_ElectronPidToolCfg(flags) is not None: + InDetTRT_ElectronPidTool = InDetTRT_ElectronPidToolCfg(flags) + acc.addPublicTool(InDetTRT_ElectronPidTool) + kwargs.setdefault("TRT_ElectronPidTool", InDetTRT_ElectronPidTool) + else: + kwargs.setdefault("TRT_ElectronPidTool", None) + + if 'TRT_ToT_dEdxTool' not in kwargs : + InDetTRT_dEdxTool = InDetTRT_dEdxToolCfg(flags) + acc.addPublicTool(InDetTRT_dEdxTool) + kwargs.setdefault("TRT_ToT_dEdxTool", InDetTRT_dEdxTool) + + if 'PixelToTPIDTool' not in kwargs : + InDetPixelToTPIDTool = acc.popToolsAndMerge(InDetPixelToTPIDToolCfg()) + acc.addPublicTool(InDetPixelToTPIDTool) + kwargs.setdefault( "PixelToTPIDTool", InDetPixelToTPIDTool) + + kwargs.setdefault( "doSharedHits", flags.InDet.doSharedHits) + kwargs.setdefault( "minTRThitsForTRTdEdx", 1) + + InDetTrackSummaryTool = acc.popToolsAndMerge(InDetTrackSummaryToolCfg(flags, name, **kwargs)) + acc.setPrivateTools(InDetTrackSummaryTool) + return acc + +def InDetUpdatorCfg(flags, name = 'InDetUpdator', **kwargs): + the_name = makeName( name, kwargs ) + if flags.InDet.kalmanUpdator == "fast" : + return CompFactory.Trk.KalmanUpdator_xk(name = the_name, **kwargs) + elif flags.InDet.kalmanUpdator == "weight" : + return CompFactory.Trk.KalmanWeightUpdator(name = the_name, **kwargs) + elif flags.InDet.kalmanUpdator == "smatrix" : + return CompFactory.Trk.KalmanUpdatorSMatrix(name = the_name, **kwargs) + elif flags.InDet.kalmanUpdator == "amg" : + return CompFactory.Trk.KalmanUpdatorAmg(name = the_name, **kwargs) + else : + return CompFactory.Trk.KalmanUpdator(name = the_name, **kwargs) + +def InDetMultipleScatteringUpdatorCfg(name = "InDetMultipleScatteringUpdator", **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + + kwargs.setdefault( "UseTrkUtils", False) + MultipleScatteringUpdator = CompFactory.Trk.MultipleScatteringUpdator(name = the_name, **kwargs) + + acc.setPrivateTools(MultipleScatteringUpdator) + return acc + +def GlobalChi2FitterCfg(flags, name ='InDetTrackFitterTRT', **kwargs): + from InDetConfig.InDetRecToolConfig import InDetNavigatorCfg, InDetPropagatorCfg, InDetExtrapolatorCfg + acc = ComponentAccumulator() + + tmpAcc = InDetExtrapolatorCfg(flags) + InDetExtrapolator = tmpAcc.getPrimary() + acc.merge(tmpAcc) + + InDetNavigator = acc.popToolsAndMerge(InDetNavigatorCfg(flags)) + acc.addPublicTool(InDetNavigator) + + InDetPropagator = acc.popToolsAndMerge(InDetPropagatorCfg(flags)) + acc.addPublicTool(InDetPropagator) + + acc.merge(InDetRefitRotCreatorCfg(flags)) + InDetRefitRotCreator = acc.getPublicTool("InDetRefitRotCreator") + + InDetUpdator = InDetUpdatorCfg(flags) + acc.addPublicTool(InDetUpdator) + + InDetMultipleScatteringUpdator = acc.popToolsAndMerge(InDetMultipleScatteringUpdatorCfg()) + acc.addPublicTool(InDetMultipleScatteringUpdator) + + if flags.InDet.doRobustReco or flags.Beam.Type == "cosmics": + kwargs.setdefault("MaxOutliers", 99) + + if flags.InDet.materialInteractions and not flags.BField.solenoidOn: + from AthenaCommon.SystemOfUnits import MeV + kwargs.setdefault("Momentum", 1000.*MeV) + + kwargs.setdefault("ExtrapolationTool", InDetExtrapolator) + kwargs.setdefault("NavigatorTool", InDetNavigator) + kwargs.setdefault("PropagatorTool", InDetPropagator) + kwargs.setdefault("RotCreatorTool", InDetRefitRotCreator) + kwargs.setdefault("MeasurementUpdateTool", InDetUpdator) + kwargs.setdefault("MultipleScatteringTool", InDetMultipleScatteringUpdator) + kwargs.setdefault("StraightLine", not flags.BField.solenoidOn) + kwargs.setdefault("ReintegrateOutliers", False) + kwargs.setdefault("MaxIterations", 10) + kwargs.setdefault("RecalculateDerivatives", False) + kwargs.setdefault("TrackChi2PerNDFCut", 999999) + + acc.setPrivateTools(CompFactory.Trk.GlobalChi2Fitter(name = name, **kwargs)) + return acc + +def InDetTrackSummaryToolTRTTracksCfg(flags, name='InDetTrackSummaryToolTRTTracks',**kwargs): + kwargs.setdefault("doSharedHits", True) + return InDetTrackSummaryToolSharedHitsCfg(flags, name = name, **kwargs) + +def PublicFKF(name = 'PublicFKF', **kwargs): + PublicFKF = CompFactory.Trk.ForwardKalmanFitter + return PublicFKF(name = name, **kwargs) + +def InDetFKF(name='InDetFKF', **kwargs): + kwargs.setdefault("StateChi2PerNDFPreCut", 30.0) + return PublicFKF(name=name, **kwargs) + +def InDetBKS(name='InDetBKS', **kwargs): + kwargs.setdefault("InitialCovarianceSeedFactor", 200.) + PublicBKS = CompFactory.Trk.KalmanSmoother + return PublicBKS(name = name, **kwargs) + +def InDetKOL(name = 'InDetKOL', **kwargs): + kwargs.setdefault("TrackChi2PerNDFCut", 17.0) + kwargs.setdefault("StateChi2PerNDFCut", 12.5) + PublicKOL = CompFactory.Trk.KalmanOutlierLogic + return PublicKOL(name = name, **kwargs) + +def InDetKalmanFitterCfg(flags, name ='InDetKalmanFitter', **kwargs): + acc = ComponentAccumulator() + from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg + + tmpAcc = InDetExtrapolatorCfg(flags) + InDetExtrapolator = tmpAcc.getPrimary() + acc.merge(tmpAcc) + + InDetUpdator = InDetUpdatorCfg(flags) + acc.addPublicTool(InDetUpdator) + + tmpAcc = InDetRotCreatorCfg(flags) + InDetRotCreator = tmpAcc.getPrimary() + acc.merge(tmpAcc) + + kwargs.setdefault("ExtrapolatorHandle", InDetExtrapolator) + kwargs.setdefault("RIO_OnTrackCreatorHandle", InDetRotCreator) + kwargs.setdefault("MeasurementUpdatorHandle", InDetUpdator) + kwargs.setdefault("ForwardKalmanFitterHandle", InDetFKF()) + kwargs.setdefault("KalmanSmootherHandle", InDetBKS()) + kwargs.setdefault("KalmanOutlierLogicHandle", InDetKOL()) + kwargs.setdefault("DynamicNoiseAdjustorHandle", None) + kwargs.setdefault("BrempointAnalyserHandle", None) + kwargs.setdefault("AlignableSurfaceProviderHandle", None) + kwargs.setdefault("RecalibratorHandle", None) + kwargs.setdefault("InternalDAFHandle", None) + + acc.setPrivateTools(CompFactory.Trk.KalmanFitter(name = name, **kwargs)) + return acc +############################################################################################# +#TRTSegmentFinder +############################################################################################# +def InDetPatternPropagatorCfg(name='InDetPatternPropagator', **kwargs): + the_name = makeName( name, kwargs) + return CompFactory.Trk.RungeKuttaPropagator(name = the_name, **kwargs) + +def InDetTRT_DriftCircleOnTrackUniversalToolCosmicsCfg(name='TRT_DriftCircleOnTrackUniversalTool', **kwargs): + kwargs.setdefault("ScaleHitUncertainty", 2.) + return InDetTRT_DriftCircleOnTrackUniversalToolCfg(name=name, **kwargs) + +def InDetTRT_DriftCircleOnTrackNoDriftTimeToolCfg(**kwargs): + return InDetBroadTRT_DriftCircleOnTrackToolCfg(**kwargs) + +def InDetTRT_ExtensionToolCosmicsCfg(flags, name='InDetTRT_ExtensionToolCosmics', **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + + if 'Propagator' not in kwargs : + from InDetConfig.InDetRecToolConfig import InDetPropagatorCfg + InDetPropagator = acc.popToolsAndMerge(InDetPropagatorCfg(flags)) + acc.addPublicTool(InDetPropagator) + kwargs.setdefault("Propagator", InDetPropagator) + + if 'Extrapolator' not in kwargs : + from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg + InDetExtrapolator = acc.popToolsAndMerge(InDetExtrapolatorCfg(flags)) + acc.addPublicTool(InDetExtrapolator) + kwargs.setdefault("Extrapolator", InDetExtrapolator) + + if 'RIOonTrackToolYesDr' not in kwargs : + InDetTRT_DriftCircleOnTrackUniversalToolCosmics = acc.popToolsAndMerge(InDetTRT_DriftCircleOnTrackUniversalToolCosmicsCfg()) + acc.addPublicTool(InDetTRT_DriftCircleOnTrackUniversalToolCosmics) + kwargs.setdefault("RIOonTrackToolYesDr", InDetTRT_DriftCircleOnTrackUniversalToolCosmics) + + if 'RIOonTrackToolNoDr' not in kwargs : + InDetBroadTRT_DriftCircleOnTrackTool = InDetTRT_DriftCircleOnTrackNoDriftTimeToolCfg() + acc.addPublicTool(InDetBroadTRT_DriftCircleOnTrackTool) + kwargs.setdefault("RIOonTrackToolNoDr", InDetBroadTRT_DriftCircleOnTrackTool) + + kwargs.setdefault("TRT_ClustersContainer", 'TRT_DriftCircles') # InDetKeys.TRT_DriftCircles() + kwargs.setdefault("SearchNeighbour", False) # needs debugging!!! + kwargs.setdefault("RoadWidth", 10.0) + acc.setPrivateTools(CompFactory.InDet.TRT_TrackExtensionToolCosmics(name = the_name, **kwargs)) + return acc + +def InDetPatternUpdatorCfg(name='InDetPatternUpdator', **kwargs): + the_name = makeName(name, kwargs) + return CompFactory.Trk.KalmanUpdator_xk(name = the_name, **kwargs) + +def InDetTRT_TrackExtensionTool_xkCfg(flags, name='InDetTRT_ExtensionTool', TrackingCuts=None, **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + + if 'PropagatorTool' not in kwargs : + InDetPatternPropagator = InDetPatternPropagatorCfg() + acc.addPublicTool(InDetPatternPropagator) + kwargs.setdefault("PropagatorTool", InDetPatternPropagator) + + if 'UpdatorTool' not in kwargs : + InDetPatternUpdator = InDetPatternUpdatorCfg() + acc.addPublicTool(InDetPatternUpdator) + kwargs.setdefault("UpdatorTool", InDetPatternUpdator) + + if 'DriftCircleCutTool' not in kwargs : + InDetTRTDriftCircleCutForPatternReco = InDetTRTDriftCircleCutForPatternRecoCfg(flags, TrackingCuts=TrackingCuts) + acc.addPublicTool(InDetTRTDriftCircleCutForPatternReco) + kwargs.setdefault("DriftCircleCutTool", InDetTRTDriftCircleCutForPatternReco) + + if 'RIOonTrackToolYesDr' not in kwargs : + acc_tmp = InDetTRT_DriftCircleOnTrackToolCfg(flags) + InDetTRT_DriftCircleOnTrackTool = acc_tmp.getPrimary() + acc.merge(acc_tmp) + kwargs.setdefault("RIOonTrackToolYesDr", InDetTRT_DriftCircleOnTrackTool) + + if 'RoadTool' not in kwargs : + InDetTRT_RoadMaker = acc.popToolsAndMerge(InDetTRT_RoadMakerCfg(flags)) + acc.addPublicTool(InDetTRT_RoadMaker) + kwargs.setdefault("RoadTool", InDetTRT_RoadMaker) + + kwargs.setdefault("TRT_ClustersContainer", 'TRT_DriftCircles') # InDetKeys.TRT_DriftCircles() + kwargs.setdefault("TrtManagerLocation", 'TRT') # InDetKeys.TRT_Manager() + kwargs.setdefault("UseDriftRadius", not flags.InDet.noTRTTiming) + kwargs.setdefault("MinNumberDriftCircles", TrackingCuts.minTRTonTrk) + kwargs.setdefault("ScaleHitUncertainty", 2) + kwargs.setdefault("RoadWidth", 20.) + kwargs.setdefault("UseParameterization", TrackingCuts.useParameterizedTRTCuts) + kwargs.setdefault("maxImpactParameter", 500 if flags.InDet.doBeamHalo or flags.InDet.doBeamGas else 50 ) # single beam running, open cuts + + if TrackingCuts.RoISeededBackTracking: + kwargs.setdefault("minTRTSegmentpT", TrackingCuts.minSecondaryPt) + + acc.setPrivateTools(CompFactory.InDet.TRT_TrackExtensionTool_xk(the_name, **kwargs)) + return acc + +def InDetWeightCalculatorCfg(name='InDetWeightCalculator', **kwargs): + the_name = makeName( name, kwargs) + return CompFactory.Trk.DAF_SimpleWeightCalculator(name = the_name, **kwargs) + +def InDetCompetingTRT_DC_ToolCfg(flags, name='InDetCompetingTRT_DC_Tool', **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + + if 'Extrapolator' not in kwargs : + from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg + InDetExtrapolator = acc.popToolsAndMerge(InDetExtrapolatorCfg(flags)) + acc.addPublicTool(InDetExtrapolator) + kwargs.setdefault("Extrapolator", InDetExtrapolator) + + if 'ToolForWeightCalculation' not in kwargs : + InDetWeightCalculator = InDetWeightCalculatorCfg() + acc.addPublicTool(InDetWeightCalculator) + kwargs.setdefault("ToolForWeightCalculation", InDetWeightCalculator) + + if 'ToolForTRT_DriftCircleOnTrackCreation' not in kwargs : + acc_tmp = InDetTRT_DriftCircleOnTrackToolCfg(flags) + InDetTRT_DriftCircleOnTrackTool = acc_tmp.getPrimary() + acc.merge(acc_tmp) + kwargs.setdefault("ToolForTRT_DriftCircleOnTrackCreation", InDetTRT_DriftCircleOnTrackTool) + + acc.setPrivateTools(CompFactory.InDet.CompetingTRT_DriftCirclesOnTrackTool( the_name, **kwargs)) + return acc + +def InDetTRT_RoadMakerCfg(flags, name='InDetTRT_RoadMaker', **kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + + InDetPatternPropagator = InDetPatternPropagatorCfg() + acc.addPublicTool(InDetPatternPropagator) + kwargs.setdefault("RoadWidth", 20.) + kwargs.setdefault("PropagatorTool", InDetPatternPropagator) + acc.setPrivateTools(CompFactory.InDet.TRT_DetElementsRoadMaker_xk(the_name, **kwargs)) + return acc + +def InDetTRT_TrackExtensionTool_DAFCfg(flags, name='TRT_TrackExtensionTool_DAF',**kwargs): + acc = ComponentAccumulator() + the_name = makeName( name, kwargs) + + if 'CompetingDriftCircleTool' not in kwargs : + InDetCompetingTRT_DC_Tool = acc.popToolsAndMerge(InDetCompetingTRT_DC_ToolCfg(flags)) + acc.addPublicTool(InDetCompetingTRT_DC_Tool) + kwargs.setdefault("CompetingDriftCircleTool", InDetCompetingTRT_DC_Tool) + + if 'PropagatorTool' not in kwargs : + InDetPatternPropagator = InDetPatternPropagatorCfg() + acc.addPublicTool(InDetPatternPropagator) + kwargs.setdefault("PropagatorTool", InDetPatternPropagator) + + if 'RoadTool' not in kwargs : + InDetTRT_RoadMaker = acc.popToolsAndMerge(InDetTRT_RoadMakerCfg(flags)) + acc.addPublicTool(InDetTRT_RoadMaker) + kwargs.setdefault("RoadTool", InDetTRT_RoadMaker) + + kwargs.setdefault("TRT_DriftCircleContainer", 'TRT_DriftCircles') # InDetKeys.TRT_DriftCircles() + + acc.setPrivateTools(CompFactory.InDet.TRT_TrackExtensionTool_DAF(the_name,**kwargs)) + return acc + +def InDetTRT_ExtensionToolCfg(flags, TrackingCuts=None, **kwargs): + # @TODO set all names to InDetTRT_ExtensionTool ? + if (flags.InDet.trtExtensionType == 'xk') or (not flags.InDet.doNewTracking) : + if (flags.Beam.Type == "cosmics"): + return InDetTRT_ExtensionToolCosmicsCfg(flags, **kwargs) + else: + return InDetTRT_TrackExtensionTool_xkCfg(flags, TrackingCuts=TrackingCuts, **kwargs) + elif flags.InDet.trtExtensionType == 'DAF' : + return InDetTRT_TrackExtensionTool_DAFCfg(flags, name = 'InDetTRT_ExtensionTool',**kwargs) + +def TRT_DetElementsRoadCondAlgCfg(**kwargs): + acc = ComponentAccumulator() + the_name=kwargs.pop("name","InDet__TRT_DetElementsRoadCondAlg_xk") + acc.addCondAlgo(CompFactory.InDet.TRT_DetElementsRoadCondAlg_xk(the_name, **kwargs)) + return acc \ No newline at end of file diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/DistortedMaterialManager.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/DistortedMaterialManager.cxx index 5341ad383c7b0a6d1ae930b0e3189b987e3db6fb..6db95bcdf313b8b5031dd52e3311b687df587282 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/DistortedMaterialManager.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/DistortedMaterialManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -7,7 +7,7 @@ #include "GeoModelInterfaces/StoredMaterialManager.h" #include "GeoModelUtilities/DecodeVersionKey.h" #include "AthenaKernel/MsgStreamMember.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "RDBAccessSvc/IRDBAccessSvc.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/Bootstrap.h" diff --git a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.cxx b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.cxx index cf62494149841bc157e071dd5d1f58defeeaceae..f719917d7baa0d1781cdcdeb84eb1ee288fafe10 100644 --- a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.cxx +++ b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.cxx @@ -44,8 +44,8 @@ SiRegSelCondAlg::SiRegSelCondAlg(const std::string& name, ISvcLocator* pSvcLocat StatusCode SiRegSelCondAlg::initialize() { ATH_MSG_DEBUG("SiRegSelCondAlg::initialize() "); - ATH_CHECK(m_pixCablingKey.initialize()); - ATH_CHECK(m_sctCablingKey.initialize()); + ATH_CHECK(m_pixCablingKey.initialize(!m_pixCablingKey.empty())); + ATH_CHECK(m_sctCablingKey.initialize(!m_sctCablingKey.empty())); ATH_CHECK(m_detEleCollKey.initialize()); ATH_CHECK(m_tableKey.initialize()); ATH_MSG_INFO("SiRegSelCondAlg::initialize() " << m_tableKey ); diff --git a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.h b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.h index 85082b55bc9c8bd31de63c216f043a5517fcb829..9dfdde02749b2b620d2135c9da0e8e9c351bcc0d 100755 --- a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.h +++ b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegSelCondAlg.h @@ -47,10 +47,10 @@ public: /// even if only one is to be used SG::ReadCondHandleKey<SCT_CablingData> m_sctCablingKey - {this, "SCT_CablingData", "SCT_CablingData", "SCT cabling key"}; + {this, "SCT_CablingData", "", "SCT cabling key"}; SG::ReadCondHandleKey<PixelCablingCondData> m_pixCablingKey - {this, "PixelCablingCondData", "PixelCablingCondData", "Pixel cabling key"}; + {this, "PixelCablingCondData", "", "Pixel cabling key"}; SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_detEleCollKey {this, "DetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel/SCT"}; diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx index c617f70712e7985bfb9757f024b6152e1f154312..a31b9faff3e8cdec2d75671c8e28a8e81e0981d0 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx @@ -32,7 +32,6 @@ #include "GeoModelInterfaces/IGeoModelSvc.h" #include "GeoModelInterfaces/StoredMaterialManager.h" #include "Identifier/Identifier.h" -#include "StoreGate/StoreGate.h" #include "StoreGate/StoreGateSvc.h" #include "AthenaKernel/getMessageSvc.h" #include "GaudiKernel/Bootstrap.h" diff --git a/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/PixelIDDetDescrCnv.cxx b/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/PixelIDDetDescrCnv.cxx index f3add41451da418bac8cf05f9b36c796960589a3..2b53f7869f1b11058e2f458c8b0730ee9600879c 100644 --- a/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/PixelIDDetDescrCnv.cxx +++ b/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/PixelIDDetDescrCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -17,7 +17,7 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "IdDictDetDescr/IdDictManager.h" //#include "Identifier/IdentifierHash.h" diff --git a/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/SCT_IDDetDescrCnv.cxx b/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/SCT_IDDetDescrCnv.cxx index 7f49d1839237992daf2cad76530e7f0c2eb73bda..61727d14307670fda4d4aa5c5ec555169dd68817 100644 --- a/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/SCT_IDDetDescrCnv.cxx +++ b/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/SCT_IDDetDescrCnv.cxx @@ -17,7 +17,7 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "IdDictDetDescr/IdDictManager.h" #include "InDetIdentifier/SCT_ID.h" diff --git a/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/SiliconIDDetDescrCnv.cxx b/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/SiliconIDDetDescrCnv.cxx index 8655441e63528e2adf558157d0f4c4fe801c4c6f..0e2ca54c944ce963eff9056ef4e12294727834ad 100644 --- a/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/SiliconIDDetDescrCnv.cxx +++ b/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/SiliconIDDetDescrCnv.cxx @@ -17,7 +17,7 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "IdDictDetDescr/IdDictManager.h" //#include "Identifier/IdentifierHash.h" diff --git a/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/TRT_IDDetDescrCnv.cxx b/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/TRT_IDDetDescrCnv.cxx index 6477047a37044944fea13963af3e5e73fcd15ba1..97fba7cbc22ed34672b88279d5ed57a62b4b58aa 100644 --- a/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/TRT_IDDetDescrCnv.cxx +++ b/InnerDetector/InDetDetDescrCnv/InDetIdCnv/src/TRT_IDDetDescrCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -17,7 +17,7 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "IdDictDetDescr/IdDictManager.h" #include "InDetIdentifier/TRT_ID.h" diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt index f06f8b6ca964b96137d159bdfc483d4751374bb6..026dc39d0d57729b484561e410663ea1edb50b8d 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt @@ -56,7 +56,8 @@ foreach( name InDetSimDataCollectionCnv_p2_test InDetSimDataCollectionCnv_p3_test TRT_LoLumRawDataContainerCnv_p1_test - TRT_LoLumRawDataContainerCnv_p2_test ) + TRT_LoLumRawDataContainerCnv_p2_test + TRT_LoLumRawDataContainerCnv_p3_test ) atlas_add_test( ${name} SOURCES test/${name}.cxx diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p1.cxx index b0f88bc7a8fe3b78a62e7034f4385d732da46bf0..ba8076c580aa34739b784a78a0c9be2dedf2c39c 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p1.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/TRT_LoLumRawDataContainerCnv_p1.cxx @@ -55,7 +55,7 @@ void TRT_LoLumRawDataContainerCnv_p1::transToPers(const TRT_RDO_Container* trans chanBegin = chanEnd; chanEnd += collection.size(); InDetRawDataCollection_p1& pcollection = persCont->m_collections[collIndex]; - pcollection.m_id = collection.identify().get_compact(); + pcollection.m_id = collection.identify().get_identifier32().get_compact(); pcollection.m_hashId = (unsigned int) collection.identifyHash(); pcollection.m_begin = chanBegin; pcollection.m_end = chanEnd; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_common_test.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_common_test.h index b96e2f681cd3be148d33a6ee89baf8b8a9597796..e6e30b547dd503e80dd98e568559db03e02d8635 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_common_test.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_common_test.h @@ -84,22 +84,28 @@ void test1() TRT_RDO_Container trans1(containerSize); // Creating collection for first example module const IdentifierHash elementHash1(10026); + const Identifier::value_type collIdValue1 = 0x1612280000000000; + const Identifier collID1 = Identifier(collIdValue1); + std::unique_ptr<TRT_RDO_Collection> collection1 = std::make_unique<TRT_RDO_Collection>(elementHash1); + collection1->setIdentifier(collID1); + //Add a TRT_LoLumRawData object const Identifier::value_type idValue1 = 0x1612282000000000; const Identifier strawID1 = Identifier(idValue1); const unsigned int strawWord1(2147483696); - std::unique_ptr<TRT_RDO_Collection> collection1 = std::make_unique<TRT_RDO_Collection>(elementHash1); - //Add a TRT_LoLumRawData object std::unique_ptr<TRT_LoLumRawData> rdo1 = std::make_unique<TRT_LoLumRawData>(strawID1,strawWord1); collection1->push_back(rdo1.release()); assert(trans1.addCollection(collection1.get(),elementHash1).isSuccess()); collection1.release(); // Now owned by trans1 // Creating collection for second example module const IdentifierHash elementHash2(10027); + const Identifier::value_type collIdValue2 = 0x16122c0000000000; + const Identifier collID2 = Identifier(collIdValue2); + std::unique_ptr<TRT_RDO_Collection> collection2 = std::make_unique<TRT_RDO_Collection>(elementHash2); + collection2->setIdentifier(collID2); + //Add a TRT_LoLumRawData object const Identifier::value_type idValue2 = 0x16122ce000000000; const Identifier strawID2 = Identifier(idValue2); const unsigned int strawWord2(2147499712); - std::unique_ptr<TRT_RDO_Collection> collection2 = std::make_unique<TRT_RDO_Collection>(elementHash2); - //Add a TRT_LoLumRawData object std::unique_ptr<TRT_LoLumRawData> rdo2 = std::make_unique<TRT_LoLumRawData>(strawID2,strawWord2); collection2->push_back(rdo2.release()); assert(trans1.addCollection(collection2.get(),elementHash2).isSuccess()); diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_p3_test.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_p3_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..68dfbae1a744bb6315f3cca9590bca3d65559a7e --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_p3_test.cxx @@ -0,0 +1,20 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/** + * @file InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_p3_test.cxx + * @brief Regression tests. + */ + +#undef NDEBUG + +#include "../src/TRT_LoLumRawDataContainerCnv_p3.h" + +#include "TRT_LoLumRawDataContainerCnv_common_test.h" + + +int main() +{ + return commonMain<TRT_LoLumRawDataContainerCnv_p3, InDetRawDataContainer_p3>(); +} diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt index 70feff1e74eec85a69f1cf1b88377c280797596a..6a610c94d461c53cb4fb2d09f7817f5b6b5e5974 100644 --- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt +++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt @@ -54,6 +54,10 @@ atlas_add_test( TestSCTEncode SCRIPT athena.py --threads=1 SCT_RawDataByteStreamCnv/testSCTEncode.py PROPERTIES TIMEOUT 300 ENVIRONMENT THREADS=1 ) +atlas_add_test( TestSCTDecodeNewConf + SCRIPT python -m SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConfig + PROPERTIES TIMEOUT 600 ) # Install files from the package: +atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/python/SCT_RawDataByteStreamCnvConfig.py b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/python/SCT_RawDataByteStreamCnvConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..8c1925173755198b8fadf7c545271f0104f392c5 --- /dev/null +++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/python/SCT_RawDataByteStreamCnvConfig.py @@ -0,0 +1,59 @@ +# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from InDetConfig.InDetRecToolConfig import SCT_CablingToolCfg, SCT_ConfigurationConditionsToolCfg +from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg + +def SCT_RodDecoderCfg(flags): + acc = ComponentAccumulator() + acc.merge(SCT_GeometryCfg(flags)) + SCT_CablingTool = acc.popToolsAndMerge(SCT_CablingToolCfg(flags)) + SCT_ConfigurationConditionsTool = acc.popToolsAndMerge(SCT_ConfigurationConditionsToolCfg(flags)) + acc.setPrivateTools(CompFactory.SCT_RodDecoder(name="InDetSCTRodDecoder", + SCT_CablingTool=SCT_CablingTool, + ConfigTool=SCT_ConfigurationConditionsTool)) + return acc + +def SCTRawDataProviderToolCfg(flags): + acc = ComponentAccumulator() + InDetSCTRodDecoder = acc.popToolsAndMerge(SCT_RodDecoderCfg(flags)) + acc.setPrivateTools(CompFactory.SCTRawDataProviderTool(name="InDetSCTRawDataProviderTool", + Decoder=InDetSCTRodDecoder)) + return acc + +def SCTRawDataProviderCfg(flags): + acc = ComponentAccumulator() + InDetSCTRawDataProviderTool = acc.popToolsAndMerge(SCTRawDataProviderToolCfg(flags)) + acc.addEventAlgo(CompFactory.SCTRawDataProvider(name="InDetSCTRawDataProvider", + ProviderTool=InDetSCTRawDataProviderTool)) + return acc + +def SCTEventFlagWriterCfg(flags): + acc = ComponentAccumulator() + acc.addEventAlgo(CompFactory.SCTEventFlagWriter(name="InDetSCTEventFlagWriter")) + return acc + +if __name__ == "__main__": + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior = 1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data17_13TeV.00330470.physics_Main.daq.RAW._lb0310._SFO-1._0001.data"] + ConfigFlags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2018-03" + ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01" + ConfigFlags.Detector.GeometrySCT = True + ConfigFlags.lock() + + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + acc = MainServicesCfg(ConfigFlags) + + from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg + acc.merge(ByteStreamReadCfg(ConfigFlags)) + + acc.merge(SCTRawDataProviderCfg(ConfigFlags)) + acc.merge(SCTEventFlagWriterCfg(ConfigFlags)) + + acc.run(maxEvents=10) diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/python/__init__.py b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f2f0fc1b7b487784e8781d2a41e43908019e0a7d --- /dev/null +++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/python/__init__.py @@ -0,0 +1 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetReadBS_jobOptions.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetReadBS_jobOptions.py index 227fa738084468abe796b5f55e662ed09595b738..273f4e58e632c5698d6c63c28472cf4dd3a86b15 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetReadBS_jobOptions.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetReadBS_jobOptions.py @@ -29,8 +29,10 @@ if DetFlags.readRDOBS.pixel_on(): RDOKey = InDetKeys.PixelRDOs(), ProviderTool = InDetPixelRawDataProviderTool) - from RegionSelector.RegSelToolConfig import makeRegSelTool_Pixel - InDetPixelRawDataProvider.RegSelTool = makeRegSelTool_Pixel() + from OverlayCommonAlgs.OverlayFlags import overlayFlags + if not (globalflags.isOverlay() and overlayFlags.isDataOverlay()): + from RegionSelector.RegSelToolConfig import makeRegSelTool_Pixel + InDetPixelRawDataProvider.RegSelTool = makeRegSelTool_Pixel() topSequence += InDetPixelRawDataProvider @@ -99,8 +101,10 @@ if DetFlags.readRDOBS.TRT_on(): RDOKey = InDetKeys.TRT_RDOs(), ProviderTool = InDetTRTRawDataProviderTool) - from RegionSelector.RegSelToolConfig import makeRegSelTool_TRT - InDetTRTRawDataProvider.RegSelTool = makeRegSelTool_TRT() + from OverlayCommonAlgs.OverlayFlags import overlayFlags + if not (globalflags.isOverlay() and overlayFlags.isDataOverlay()): + from RegionSelector.RegSelToolConfig import makeRegSelTool_TRT + InDetTRTRawDataProvider.RegSelTool = makeRegSelTool_TRT() topSequence += InDetTRTRawDataProvider if (InDetFlags.doPrintConfigurables()): diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt b/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt index 3746f67d0e701499181ccae396bd5664d2d0bbc0..85069ddd3d88e4d88da3edfaaa0c3fc72d2060ad 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt @@ -21,6 +21,8 @@ atlas_add_dictionary( SCT_MonitoringDict SCT_Monitoring/selection.xml ) # Run tests: +# This is a standalone test with ESD input. +# This is not essential and can be abandoned if it won't run. atlas_add_test( SCTLorentzMonAlg_test SCRIPT python -m SCT_Monitoring.SCTLorentzMonAlg PROPERTIES TIMEOUT 600 ) diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/doc/packagedoc.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/doc/packagedoc.h index 42a92f2463088cf69c1d3f4b083e474327d5eb4d..bd79e788f50e7341e14b4e9fa317d8d12e1ca44e 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/doc/packagedoc.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/doc/packagedoc.h @@ -29,7 +29,6 @@ Here are the active monitoring algorithms / tools: @subsection SCT_Monitoring_SCT_MonitoringConfigurationNewNew Configuration in the new DQ framework and the new job configuration framework InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTMonitoringConfig.py is the main configuration script. -Only SCTLorentzMonAlg and SCTTracksMonAlg are configured in the script using SCTLorentzMonAlg.py and SCTTracksMonAlg.py because the Inner Dector configuration is not fully ready in the new job configuration framework as of October, 2020. When the Reco_tf.py command is used, the chain is the following: - Reconstruction/RecJobTransforms/scripts/Reco_tf.py @@ -39,12 +38,6 @@ When the Reco_tf.py command is used, the chain is the following: - Control/AthenaMonitoring/python/AthenaMonitoringCfg.py - InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTMonitoringConfig.py -Individual algorithms can be run using the configuration scripts like: - -\verbatim -python -m SCT_Monitoring.SCTLorentzMonAlg -\endverbatim - @subsection SCT_Monitoring_SCT_MonitoringConfigurationNewOld Configuration in the new DQ framework and the old job configuration framework InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py is the main configuration script. diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTErrMonAlg.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTErrMonAlg.py new file mode 100644 index 0000000000000000000000000000000000000000..febbed7bf3b5ec99a69b5091e0b36204a24e4104 --- /dev/null +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTErrMonAlg.py @@ -0,0 +1,235 @@ +# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# + +'''@file SCTErrMonAlg_jobOptions.py +@author Susumu Oda +@date 2020-10-08 +@brief New style configuration of SCTErrMonAlg +''' + +def SCTErrMonAlgConfig(inputFlags): + + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + result = ComponentAccumulator() + + from AthenaMonitoring import AthMonitorCfgHelper + helper = AthMonitorCfgHelper(inputFlags, 'SCTErrMonCfg') + + from AthenaConfiguration.ComponentFactory import CompFactory + myMonAlg = helper.addAlgorithm(CompFactory.SCTErrMonAlg, 'SCTErrMonAlg') + myMonAlg.TriggerChain = "" + + # SCT conditions tools (update is necessary when the ID configuration in the new job framework is ready.) + ConditionsTools = [] + myMonAlg.conditionsTool = CompFactory.SCT_ConfigurationConditionsTool(name="InDetSCT_ConfigurationConditionsTool") + ConditionsTools += [myMonAlg.conditionsTool] + myMonAlg.SCT_ByteStreamErrorsTool = CompFactory.SCT_ByteStreamErrorsTool(name="SCT_ByteStreamErrorsTool") + myMonAlg.SCT_ByteStreamErrorsTool.ConfigTool = myMonAlg.conditionsTool + ConditionsTools += [myMonAlg.SCT_ByteStreamErrorsTool] + if inputFlags.InDet.useDCS: + myMonAlg.SCT_DCSConditionsTool = CompFactory.SCT_DCSConditionsTool(name="InDetSCT_DCSConditionsTool") + ConditionsTools += [myMonAlg.SCT_DCSConditionsTool] + else: + myMonAlg.UseDCS = False + ConditionsTools += [CompFactory.SCT_ReadCalibDataTool(name="InDetSCT_ReadCalibDataTool")] + if not inputFlags.Common.isOnline: + ConditionsTools += [CompFactory.SCT_MonitorConditionsTool(name="InDetSCT_MonitorConditionsTool")] + if not inputFlags.Input.isMC: + ConditionsTools += [CompFactory.SCT_TdaqEnabledTool(name="InDetSCT_TdaqEnabledTool")] + kwargs = {} + kwargs.setdefault("ConditionsTools", ConditionsTools) + myMonAlg.SCT_ConditionsSummaryTool = CompFactory.SCT_ConditionsSummaryTool(name="InDetSCT_ConditionsSummaryTool", **kwargs) + + ## The following does not work when running Reco_tf.py + ## because it configures condition algorithms + ## and they conflict with ones configured in the old framework. + # myMonAlg.SCT_ConditionsSummaryTool = result.popToolsAndMerge(InDetSCT_ConditionsSummaryToolCfg(inputFlags)) + # from InDetConfig.InDetRecToolConfig import SCT_ConfigurationCondAlgCfg, SCT_ConfigurationConditionsToolCfg + # result.merge(SCT_ConfigurationCondAlgCfg(inputFlags)) + # myMonAlg.conditionsTool = result.popToolsAndMerge(SCT_ConfigurationConditionsToolCfg(inputFlags)) + # from InDetConfig.InDetRecToolConfig import SCT_ByteStreamErrorsToolCfg + # myMonAlg.SCT_ByteStreamErrorsTool = result.popToolsAndMerge(SCT_ByteStreamErrorsToolCfg(inputFlags)) + # if inputFlags.InDet.useDCS: + # from SCT_ConditionsTools.SCT_DCSConditionsConfig import SCT_DCSConditionsCfg + # myMonAlg.SCT_DCSConditionsTool = result.popToolsAndMerge(SCT_DCSConditionsCfg(inputFlags)) + # else: + # myMonAlg.UseDCS = False + + # FilterTools + # There seems no new configureation corresponding to + # from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool + if inputFlags.Beam.Type=='collisions': + if inputFlags.Input.isMC: + from AthenaMonitoring.AthenaMonitoringConf import DQDummyFilterTool + myMonAlg.FilterTools += [DQDummyFilterTool()] + else: + from AthenaMonitoring.AthenaMonitoringConf import DQFilledBunchFilterTool + from TrigBunchCrossingTool.BunchCrossingTool import BunchCrossingTool + monFilledBunchFilterTool = DQFilledBunchFilterTool() + monFilledBunchFilterTool.bunchCrossingTool = BunchCrossingTool() + myMonAlg.FilterTools += [monFilledBunchFilterTool] + + myMonGroup = helper.addGroup(myMonAlg, "SCTErrMonitor", "SCT/") + + # Configure histograms + + from ROOT import SCT_Monitoring as sctMon #import SCT_MonitoringNumbers.h + + # Filled in fillHistograms + myMonGroup.defineHistogram(varname = "lumiBlock;NumberOfEventsVsLB", + cutmask = "is1D", + type = "TH1F", + title = "Num of events per LB ;LumiBlock", + path = "GENERAL/Conf", + xbins = sctMon.NBINS_LBs, + xmin = 0.5, + xmax = sctMon.NBINS_LBs+0.5) + + # Filled in fillHistograms + myMonGroup.defineHistogram(varname = "lumiBlock;NumberOfSCTFlagErrorsVsLB", + cutmask = "sctFlag", + type = "TH1F", + title = "Num of SCT Flag errors per LB ;LumiBlock", + path = "GENERAL/Conf", + xbins = sctMon.NBINS_LBs, + xmin = 0.5, + xmax = sctMon.NBINS_LBs+0.5) + + # Filled in fillHistograms + myMonGroup.defineHistogram(varname = "lumiBlock, sctFlag;FractionOfSCTFlagErrorsPerLB", + type = "TProfile", + title = "Frac of SCT Flag errors per LB ;LumiBlock", + path = "GENERAL/Conf", + xbins = sctMon.NBINS_LBs, + xmin = 0.5, + xmax = sctMon.NBINS_LBs+0.5) + + # Filled in fillConfigurationDetails + myMonGroup.defineHistogram(varname = "detailedConfBin, nBad;SCTConfDetails", + type = "TProfile", + title = "Exclusion from the Configuration", + path = "GENERAL/Conf", + xbins = sctMon.ConfbinsDetailed, + xmin = -0.5, + xmax = sctMon.ConfbinsDetailed-0.5, + xlabels = ["Modules", "Link 0", "Link 1", "Chips", "Strips (10^{2})"]) + + # Filled in fillHistograms + myMonGroup.defineHistogram(varname = "moduleOutBin, moduleOut;SCTConfOutM", + type = "TProfile", + title = "Num of Out Modules in All Region", + path = "GENERAL/Conf", + xbins = 1, + xmin = -0.5, + xmax = 0.5, + xlabels = ["Mod Out"]) + + # Fiiled in fillByteStreamErrors + from ROOT import SCT_ByteStreamErrors + for i in range(SCT_ByteStreamErrors.NUM_ERROR_TYPES): + myMonGroup.defineHistogram(varname = "lumiBlock, n_"+SCT_ByteStreamErrors.ErrorTypeDescription[i]+";SCT_"+SCT_ByteStreamErrors.ErrorTypeDescription[i]+"VsLbs", + type = "TProfile", + title = "Ave. "+SCT_ByteStreamErrors.ErrorTypeDescription[i]+" per LB in All Region;LumiBlock;Num of "+SCT_ByteStreamErrors.ErrorTypeDescription[i], + path = "GENERAL/Conf", + xbins = sctMon.NBINS_LBs, + xmin = 0.5, + xmax = sctMon.NBINS_LBs+0.5) + + # Fiiled in fillByteStreamErrors + for i in range(sctMon.N_ERRCATEGORY): + myMonGroup.defineHistogram(varname = "lumiBlock, n_"+sctMon.CategoryErrorsNames[i]+";SCT_LinksWith"+sctMon.CategoryErrorsNames[i]+"VsLbs", + type = "TProfile", + title = "Ave. Num of Links with "+sctMon.CategoryErrorsNames[i]+" per LB in All Region;LumiBlock;Num of Links with "+sctMon.CategoryErrorsNames[i], + path = "GENERAL/Conf", + xbins = sctMon.NBINS_LBs, + xmin = 0.5, + xmax = sctMon.NBINS_LBs+0.5) + + # Filled in fillByteStreamErrors + for errCate in range(sctMon.N_ERRCATEGORY): + for region in range(sctMon.N_REGIONS): + for layer in range(sctMon.N_ENDCAPSx2): + myMonGroup.defineHistogram(varname = "eta, phi, hasError_"+sctMon.CategoryErrorsNames[errCate]+"_"+sctMon.subDetNameShort[region].Data()+"_"+str(layer/2)+"_"+str(layer%2)+";SCT_NumberOf"+sctMon.CategoryErrorsNames[errCate]+sctMon.subDetNameShort[region].Data()+"_"+str(layer/2)+"_"+str(layer%2), + type = "TProfile2D", + title = "Num of "+sctMon.CategoryErrorsNames[errCate]+" per "+sctMon.layerName[region].Data()+str(layer/2)+"_"+str(layer%2), + path = "SCT"+sctMon.subDetNameShort[region].Data()+"/errors/"+sctMon.CategoryErrorsNames[errCate], + xbins = sctMon.N_ETA_BINS if region==sctMon.BARREL_INDEX else sctMon.N_ETA_BINS_EC, + xmin = (sctMon.FIRST_ETA_BIN if region==sctMon.BARREL_INDEX else sctMon.FIRST_ETA_BIN_EC)-0.5, + xmax = (sctMon.LAST_ETA_BIN if region==sctMon.BARREL_INDEX else sctMon.LAST_ETA_BIN_EC)+0.5, + ybins = sctMon.N_PHI_BINS if region==sctMon.BARREL_INDEX else sctMon.N_PHI_BINS_EC, + ymin = (sctMon.FIRST_PHI_BIN if region==sctMon.BARREL_INDEX else sctMon.FIRST_PHI_BIN_EC)-0.5, + ymax = (sctMon.LAST_PHI_BIN if region==sctMon.BARREL_INDEX else sctMon.LAST_PHI_BIN_EC)+0.5, + duration = "lb") + + # Filled in fillByteStreamErrorsHelper + myMonGroup.defineHistogram(varname = "maskedLinksBin;Masked Links", + weight = "maskedLinks", + type = "TH1I", + title = "Number of Masked Links for SCT,ECA,B,ECC", + path = "GENERAL/errors", + xbins = sctMon.N_REGIONS_INC_GENERAL, + xmin = -0.5, + xmax = sctMon.N_REGIONS_INC_GENERAL-0.5, + xlabels = ["EndCapC", "Barrel", "EndCapA", "All"]) + + # Filled in fillHistograms + myMonGroup.defineHistogram(varname = "flaggedWafersIndices, nFlaggedWafers;FlaggedWafers", + type = "TProfile", + title = "Number of flagged wafers for SCT,ECA,B,ECC", + path = "GENERAL/errors", + xbins = sctMon.N_REGIONS_INC_GENERAL, + xmin = -0.5, + xmax = sctMon.N_REGIONS_INC_GENERAL-0.5, + xlabels = ["EndCapC", "Barrel", "EndCapA", "All"]) + + # Filled in fillByteStreamErrors + coverageTitles = [ + "", # All (not used) + "Ave. Coverage of Enabled Links per LB", # All - Disabled + "Ave. Coverage of Links with No Bad LinkLevelError per LB", # All - BadLinkLevelError + "Ave. Coverage of Links with No Bad RODLevelError per LB", # All - BadRODLevelError + "Ave. Coverage of Links with No Bad Error per LB", # All - BadError + "Ave. Coverage of links Not Affected by PS Trip", # All - PSTrip (DCS) + "Ave. Coverage of Links With No Bad Problem per LB" # All - Summary + ] + for iProblem in range(1, sctMon.numberOfProblemForCoverage): + myMonGroup.defineHistogram(varname = "lumiBlock, detectorCoverage"+sctMon.coverageVarNames[iProblem]+";SCT_Coverage"+sctMon.coverageVarNames[iProblem]+"VsLbs", + type = "TProfile", + title = coverageTitles[iProblem]+";LumiBlock;Detector Coverage [%]", + path = "DetectorCoverage", + xbins = sctMon.NBINS_LBs, + xmin = 0.5, + xmax = sctMon.NBINS_LBs+0.5) + + # Fiiled in fillByteStreamErrors + myMonGroup.defineHistogram(varname = "lumiBlock, psTripModules;SCT_ModulesWithPSTripVsLbs", + type = "TProfile", + title = "Ave. Num of Modules Affected by PS Trip per LB in All Region;LumiBlock;Num. of Modules Affected by PS Trip", + path = "DetectorCoverage", + xbins = sctMon.NBINS_LBs, + xmin = 0.5, + xmax = sctMon.NBINS_LBs+0.5) + + # Filled in fillByteStreamErrorsHelper + xlabels = [SCT_ByteStreamErrors.ErrorTypeDescription[i] for i in range(SCT_ByteStreamErrors.NUM_ERROR_TYPES)] + for reg in range(sctMon.N_REGIONS): + nLayers = sctMon.n_layers[reg]*2 + ylabels = [str(i/2)+"_"+str(i%2) for i in range(nLayers)] + myMonGroup.defineHistogram(varname = "errorType, layerSide, errorFraction;RateErrorsPerLumi", + cutmask = "is"+sctMon.subDetNameShort[reg].Data(), + type = "TProfile2D", + title = "Rate of Error Types for "+sctMon.layerName[reg].Data()+" per Lumi-Block", + path = "SCT"+sctMon.subDetNameShort[reg].Data()+"/errors", + xbins = SCT_ByteStreamErrors.NUM_ERROR_TYPES, + xmin = -0.5, + xmax = SCT_ByteStreamErrors.NUM_ERROR_TYPES-0.5, + xlabels = xlabels, + ybins = nLayers, + ymin = -0.5, + ymax = nLayers-0.5, + ylabels = ylabels, + duration = "lb") + + result.merge(helper.result()) + return result diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitEffMonAlg.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitEffMonAlg.py index ed50ebf56f186e1eb407032dc93ba03ca1c6c200..09e7956c59a16098728cc5541594b077d396dccb 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitEffMonAlg.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitEffMonAlg.py @@ -155,7 +155,7 @@ def SCTHitEffMonAlgConfig(inputFlags): # SCTEC, SCTB, SCTEA for isub in range(sctMon.N_REGIONS): - profileLabels = range(limit[isub]) + profileLabels = list(range(limit[isub])) for k in range(limit[isub]): profileLabels[k] = dedicatedTitle(k, isub) # Efficiency @@ -180,7 +180,7 @@ def SCTHitEffMonAlgConfig(inputFlags): # Efficiency as a function of LB myMonGroup[isub].defineHistogram(varname= "LumiBlock, eff;"+"effLumiBlock", #different names for fill type= "TProfile", - title= "Efficiency vs Luminosity block in "+sctMon.subDetName[isub]+";Luminosity block"+";Efficiency", + title= "Efficiency vs Luminosity block in "+subDetName[isub]+";Luminosity block"+";Efficiency", path="eff", xbins=sctMon.NBINS_LBs, xmin=0.5, diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitsNoiseMonAlg.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitsNoiseMonAlg.py new file mode 100644 index 0000000000000000000000000000000000000000..21db3f66f76884bd29308615b09b2b4ca625fad8 --- /dev/null +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitsNoiseMonAlg.py @@ -0,0 +1,204 @@ +# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# + +'''@file SCTHitNoiseMonAlg.py +@author Susumu Oda +@date 2020-10-08 +@brief New style configuration of SCTHitNoiseMonAlg +''' + +def Title( i, isub): + m_layerStr = i / 2 + m_sideStr = i % 2 + m_region = isub + if m_region == 1 : + return "Layer " + str(m_layerStr) + " Side " + str(m_sideStr) + else: + return "Disk " + str(m_layerStr) + " Side " + str(m_sideStr) + + +def SCTHitsNoiseMonAlgConfig(inputFlags): + + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + result = ComponentAccumulator() + + from AthenaMonitoring import AthMonitorCfgHelper + helper = AthMonitorCfgHelper(inputFlags, 'SCTHitsNoiseMonCfg') + + from AthenaConfiguration.ComponentFactory import CompFactory + myMonAlg = helper.addAlgorithm(CompFactory.SCTHitsNoiseMonAlg, 'SCTHitsNoiseMonAlg') + myMonAlg.TriggerChain = "" + + # Trigger histogram will be made only for data. + myMonAlg.doTrigger = (not inputFlags.Input.isMC) + + from ROOT import SCT_Monitoring as sctMon #import SCT_MonitoringNumbers.h + + # Add a generic monitoring tool (a "group" in old language). The returned + # object here is the standard GenericMonitoringTool. + dimension = [sctMon.N_REGIONS] + + MonGroupArray = helper.addArray(dimension,myMonAlg,"SCTHitsNoiseMonitor","SCT") # SCTHitsNoiseMonitor_3 on index 0 !! + + myMonGroupGeneral = helper.addGroup( + myMonAlg, + "SCTHitsNoiseMonitorGeneral", + "SCT/GENERAL/" + ) + + # Configure histograms + + abbreviations = ["ECp", "", "ECm"] + names = ["Endcap A", "Barrel", "Endcap C"] + path = ["SCTEA", "SCTB", "SCTEC"] + noiseAbbreviations = ["ECA","BAR","ECC"] + titleAbbreviations = ["ECp","BAR","ECm"] + limits = [ sctMon.N_DISKS*2, sctMon.N_BARRELS*2, sctMon.N_DISKS*2 ] + + for isub in range(sctMon.N_REGIONS): + for i in range(limits[isub]): + + HitsMapName = "hitsmap" + abbreviations[isub] + "_" + str(i/2) + "_" + str(i%2) + HitsMapTitle = "SCT Hitmap for " + names[isub] + ": " + Title(i,isub) + MonGroupArray.__getitem__(isub).defineHistogram(varname= "eta_"+HitsMapName+",phi_"+HitsMapName+";"+HitsMapName, + type= "TH2F", + title= HitsMapTitle + ";Index in the direction of #eta;Index in the direction of #phi", + path= path[isub] + "/hits", + xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5, + ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5 , ymax=sctMon.l_phibin[isub]+0.5, + weight="numberOfStrips_"+HitsMapName ) + + streamhitmap = "mapsOfHitsOnTracks" + abbreviations[isub] + "_" + "trackhitsmap_" + str(i/2) + "_" + str(i%2) + histotitle = "SCT hits on tracks for " + names[isub] + " " + Title(i,isub) + MonGroupArray.__getitem__(isub).defineHistogram(varname= "eta_"+streamhitmap + ",phi_"+streamhitmap + ";"+streamhitmap, + type= "TH2F", + title= histotitle + ";Index in the direction of #eta;Index in the direction of #phi", + path= path[isub] + "/hits/mapsOfHitsOnTracks/", + xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5, + ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5 , ymax=sctMon.l_phibin[isub]+0.5 ) + + occMap = "occupancymap" + abbreviations[isub] + "_" + str(i/2) + "_" + str(i%2) + hitoccupancy = "hitoccupancymap" + abbreviations[isub] + "_" + str(i/2) + "_" + str(i%2) + histotitleR = "SCT Hit Occupancy map for " + names[isub] + ": " + Title(i,isub) + MonGroupArray.__getitem__(isub).defineHistogram(varname= "eta_"+occMap + ",phi_"+occMap + ",HO_"+occMap+";" + hitoccupancy, + type= "TProfile2D", + title= histotitleR + ";Index in the direction of #eta;Index in the direction of #phi", + path= path[isub] + "/Noise", + xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5, + ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5, ymax=sctMon.l_phibin[isub]+0.5 ) + + noiseoccupancy = "noiseoccupancymaptrigger" + abbreviations[isub] + "_" + str(i/2) + "_" + str(i%2) + m_NOTriggerItem = "L1_RD0_EMPTY" + histotitletrigger = "SCT Noise Occupancy map for " + m_NOTriggerItem + " Trigger and " + names[isub] + ": " + Title(i,isub) + MonGroupArray.__getitem__(isub).defineHistogram(varname= "eta_"+occMap + ",phi_"+occMap + ",NO_"+occMap+";" + noiseoccupancy, + type= "TProfile2D", + title= histotitletrigger + ";Index in the direction of #eta;Index in the direction of #phi", + cutmask= "IsSelectedTrigger_"+occMap, + path= path[isub] + "/Noise", + xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5, + ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5, ymax=sctMon.l_phibin[isub]+0.5 ) + + #End i Loop + + MonGroupArray.__getitem__(isub).defineHistogram(varname= "LB,HO;"+ noiseAbbreviations[isub] + "HO_vsLB", + type= "TProfile", + title= "HO vs LB for all region (SP noise)" + ";LumiBlock;Hit Occupancy [10^{-5}]", + path= path[isub] + "/Noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + MonGroupArray.__getitem__(isub).defineHistogram(varname= "LB,HO;"+ noiseAbbreviations[isub] + "HOTrigger_vsLB", + type= "TProfile", + title= "HO with trigger vs LB for all region (SP noise)" + ";LumiBlock;Hit Occupancy [10^{-5}]", + cutmask= "IsSelectedTrigger", + path= path[isub] + "/Noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + MonGroupArray.__getitem__(isub).defineHistogram(varname= "LB,NO;"+ noiseAbbreviations[isub] + "NO_vsLB", + type= "TProfile", + title= "NO vs LB for all region (SP noise)" + ";LumiBlock;Hit Occupancy [10^{-5}]", + path= path[isub] + "/Noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + MonGroupArray.__getitem__(isub).defineHistogram(varname= "LB,NO;"+ noiseAbbreviations[isub] + "NOTrigger_vsLB", + type= "TProfile", + title= "NO with Trigger vs LB for all region (SP noise)" + ";LumiBlock;Hit Occupancy [10^{-5}]", + cutmask= "IsSelectedTrigger", + path= path[isub] + "/Noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + MonGroupArray.__getitem__(isub).defineHistogram(varname= "LBHits,numberOfHitsFromSPs;" + "h_HSPHitsTrigger"+titleAbbreviations[isub]+"_vsLB", + type= "TProfile", + title= "Average num of SP Hits in " + titleAbbreviations[isub] + " with trigger vs LB" + ";LumiBlock;Average number of SP Hits", + cutmask= "isSelectedTriggerHits", + path= path[isub] + "/Noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + MonGroupArray.__getitem__(isub).defineHistogram(varname= "LBHits,numberOfHitsFromSPs;" + "h_HSPHits"+titleAbbreviations[isub]+"_vsLB", + type= "TProfile", + title= "Average num of SP Hits in " + titleAbbreviations[isub] + " vs LB" + ";LumiBlock;Average number of SP Hits", + path= path[isub] + "/Noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + MonGroupArray.__getitem__(isub).defineHistogram(varname= "LBHits,numberOfHitsFromAllRDOs;" + "h_HallHitsTrigger"+titleAbbreviations[isub]+"_vsLB", + type= "TProfile", + title= "Average num of all Hits in " + titleAbbreviations[isub] + " with trigger vs LB" + ";LumiBlock;Average number of SP Hits", + cutmask= "isSelectedTriggerHits", + path= path[isub] + "/Noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + MonGroupArray.__getitem__(isub).defineHistogram(varname= "LBHits,numberOfHitsFromAllRDOs;" + "h_HallHits"+titleAbbreviations[isub]+"_vsLB", + type= "TProfile", + title= "Average num of all Hits in " + titleAbbreviations[isub] + " vs LB" + ";LumiBlock;Average number of SP Hits", + path= path[isub] + "/Noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + #GENERAL + myMonGroupGeneral.defineHistogram(varname= "clu_size", + type= "TH1F", + title= "SCT Cluster Size" + ";Cluster Size;Num of Events", + path= "/hits", + xbins=200, xmin = 0, xmax = 200) + + myMonGroupGeneral.defineHistogram(varname= "LB,HO;"+ "HO_vsLB", + type= "TProfile", + title= "HO vs LB for all region (SP noise)" + ";LumiBlock;Hit Occupancy [10^{-5}]", + path= "/noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + myMonGroupGeneral.defineHistogram(varname= "LB,HO;"+ "HOTrigger_vsLB", + type= "TProfile", + title= "HO with trigger vs LB for all region (SP noise)" + ";LumiBlock;Hit Occupancy [10^{-5}]", + cutmask= "IsSelectedTrigger", + path= "/noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + myMonGroupGeneral.defineHistogram(varname= "LB,NO;"+ "NO_vsLB", + type= "TProfile", + title= "NO vs LB for all region (SP noise)" + ";LumiBlock;Hit Occupancy [10^{-5}]", + path= "/noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + myMonGroupGeneral.defineHistogram(varname= "LB,NO;"+ "NOTrigger_vsLB", + type= "TProfile", + title= "NO with Trigger vs LB for all region (SP noise)" + ";LumiBlock;Hit Occupancy [10^{-5}]", + cutmask= "IsSelectedTrigger", + path= "/noise", + xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5) + + myMonGroupGeneral.defineHistogram(varname= "Bec_TBinFracAll,TBin_TBinFracAll;" + "TBinFracAll", + type= "TProfile", + title= "fraction of 01X for each region" + "; ;Fraction of 01X", + path= "/tbin", + xbins= sctMon.N_REGIONS, xmin = 0., xmax = sctMon.N_REGIONS, + xlabels= names) + + myMonGroupGeneral.defineHistogram(varname= "sct_hits", + type= "TH1F", + title= "Total SCT Hits;Total SCT Hits;Entries", + path= "/hits/summary", + xbins= sctMon.N_NOISE_HIT_BINS, xmin = sctMon.FIRST_NOISE_HIT_BIN, xmax = sctMon.LAST_NOISE_HIT_BIN) + + result.merge(helper.result()) + return result + diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTMonitoringConfig.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTMonitoringConfig.py index e810beac3f93b7ebd5ca9a24439c2fa5ee50c609..a9f821c5f86113b488039c5fdb1573405af0911e 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTMonitoringConfig.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTMonitoringConfig.py @@ -1,11 +1,17 @@ # -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # def SCTMonitoringConfig(flags): from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator acc = ComponentAccumulator() if flags.DQ.Environment in ('online', 'tier0', 'tier0Raw'): + from .SCTErrMonAlg import SCTErrMonAlgConfig + acc.merge(SCTErrMonAlgConfig(flags)) + from .SCTHitEffMonAlg import SCTHitEffMonAlgConfig + acc.merge(SCTHitEffMonAlgConfig(flags)) + from .SCTHitsNoiseMonAlg import SCTHitsNoiseMonAlgConfig + acc.merge(SCTHitsNoiseMonAlgConfig(flags)) from .SCTLorentzMonAlg import SCTLorentzMonAlgConfig acc.merge(SCTLorentzMonAlgConfig(flags)) from .SCTTracksMonAlg import SCTTracksMonAlgConfig diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt index ed109d04c803d8c547f1a236f90b626385dafca0..45930adf8013f47e844d7ddaad7cc47060709f8f 100644 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt @@ -31,7 +31,7 @@ atlas_add_test( SCTOverlay_test ENVIRONMENT "JOBOPTSEARCHPATH=${_jobOPath}" ) atlas_add_test( TRTOverlay_test - SOURCES src/TRTOverlay.cxx test/TRTOverlay_test.cxx + SOURCES test/TRTOverlay_test.cxx src/TRTOverlay.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS} LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack TRT_ConditionsServicesLib TRT_ElectronPidToolsLib IdDictParser ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} ENVIRONMENT "JOBOPTSEARCHPATH=${_jobOPath}" ) diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/python/PixelOverlayConfig.py b/InnerDetector/InDetRawAlgs/InDetOverlay/python/PixelOverlayConfig.py index 1aa88bed519e313c72ac6ad4a07161ef7363c378..41968a19c5a53700b60e44d1dcc511867718c32d 100644 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/python/PixelOverlayConfig.py +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/python/PixelOverlayConfig.py @@ -14,6 +14,9 @@ def PixelRawDataProviderAlgCfg(flags, name="PixelRawDataProvider", **kwargs): kwargs.setdefault("RDOKey", flags.Overlay.BkgPrefix + "PixelRDOs") + from RegionSelector.RegSelToolConfig import regSelTool_Pixel_Cfg + kwargs.setdefault("RegSelTool", acc.popToolsAndMerge(regSelTool_Pixel_Cfg(flags))) + PixelRawDataProvider = CompFactory.PixelRawDataProvider alg = PixelRawDataProvider(name, **kwargs) acc.addEventAlgo(alg) diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/python/SCTOverlayConfig.py b/InnerDetector/InDetRawAlgs/InDetOverlay/python/SCTOverlayConfig.py index dcaa48d47e46cd95db59429488a0bfcab310089d..95951e63280c6a3149a6391ce0106a3ffcfcd3b6 100644 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/python/SCTOverlayConfig.py +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/python/SCTOverlayConfig.py @@ -38,6 +38,9 @@ def SCTRawDataProviderAlgCfg(flags, name="SCTRawDataProvider", **kwargs): kwargs.setdefault("LVL1IDKey", flags.Overlay.BkgPrefix + "SCT_LVL1ID") kwargs.setdefault("BCIDKey", flags.Overlay.BkgPrefix + "SCT_BCID") + from RegionSelector.RegSelToolConfig import regSelTool_SCT_Cfg + kwargs.setdefault("RegSelTool", acc.popToolsAndMerge(regSelTool_SCT_Cfg(flags))) + SCTRawDataProvider = CompFactory.SCTRawDataProvider alg = SCTRawDataProvider(name, **kwargs) acc.addEventAlgo(alg) @@ -95,6 +98,11 @@ def SCTOverlayAlgCfg(flags, name="SCTOverlay", **kwargs): "SCT_RDO_Container#SCT_RDOs" ])) + if flags.Overlay.DataOverlay: + acc.merge(OutputStreamCfg(flags, "RDO", ItemList=[ + "IDCInDetBSErrContainer#SCT_ByteStreamErrs" + ])) + if flags.Output.doWriteRDO_SGNL: from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg acc.merge(OutputStreamCfg(flags, "RDO_SGNL", ItemList=[ diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/python/TRTOverlayConfig.py b/InnerDetector/InDetRawAlgs/InDetOverlay/python/TRTOverlayConfig.py index fffe234ed0e4cfdff96a91a23ee46ddc396846f6..3968d375f92654e26f7a2e507f2d5b59cf645967 100644 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/python/TRTOverlayConfig.py +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/python/TRTOverlayConfig.py @@ -14,6 +14,9 @@ def TRTRawDataProviderAlgCfg(flags, name="TRTRawDataProvider", **kwargs): kwargs.setdefault("RDOKey", flags.Overlay.BkgPrefix + "TRT_RDOs") + from RegionSelector.RegSelToolConfig import regSelTool_TRT_Cfg + kwargs.setdefault("RegSelTool", acc.popToolsAndMerge(regSelTool_TRT_Cfg(flags))) + TRTRawDataProvider = CompFactory.TRTRawDataProvider alg = TRTRawDataProvider(name, **kwargs) acc.addEventAlgo(alg) diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx index c9de5b8a2e917f9f63d72f49e1fec7141d6c27d3..367675951898bcf72e68f9dfa8943cdc740c82fd 100644 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx @@ -9,6 +9,10 @@ #undef NDEBUG +// Otherwise we get warnings about mutable members in gmock. +#include "CxxUtils/checker_macros.h" +ATLAS_NO_CHECK_FILE_THREAD_SAFETY; + // Tested AthAlgorithm #include "../InDetOverlay/TRTOverlay.h" @@ -65,18 +69,18 @@ namespace OverlayTesting { MOCK_CONST_METHOD1(getDetectorOccupancy, std::map<int, double>(const TRT_RDO_Container*) ); // Dummy methods to confirm status - virtual StatusCode initialize() override final { + virtual StatusCode initialize() final { ATH_MSG_INFO ("initializing MockTRT_LocalOccupancy: " << name()); return StatusCode::SUCCESS; }; // dummy methods implementing in pure virtual interface methods (to make class non-abstract) /** Return the local occupancy for the sectors crossed by a given track */ - virtual float LocalOccupancy( const Trk::Track& ) const override { return 1.0; }; // not used - dummy implementation - virtual float LocalOccupancy(const double, const double) const override{ return 1.0; }; // not used - dummy implementation + virtual float LocalOccupancy( const Trk::Track& ) const { return 1.0; }; // not used - dummy implementation + virtual float LocalOccupancy(const double, const double) const { return 1.0; }; // not used - dummy implementation /** Return the global occupancy of the event*/ - virtual std::vector<float> GlobalOccupancy( ) const override { std::vector<float> dummyVect{}; return dummyVect; }; // not used - dummy implementation + virtual std::vector<float> GlobalOccupancy( ) const { std::vector<float> dummyVect{}; return dummyVect; }; // not used - dummy implementation }; DECLARE_COMPONENT( MockTRT_LocalOccupancy ) @@ -96,23 +100,23 @@ namespace OverlayTesting { virtual ~MockTRT_StrawStatusSummaryTool() = default; // Dummy methods to confirm status - virtual StatusCode initialize() override final { + virtual StatusCode initialize() final { ATH_MSG_INFO ("initializing MockTRT_StrawStatusSummaryTool: " << name()); return StatusCode::SUCCESS; }; - virtual int getStatus(const Identifier ) const override { return 1; }; // not used - dummy implementation - virtual int getStatusPermanent(const Identifier) const override { return 1; }; // not used - dummy implementation + virtual int getStatus(const Identifier ) const { return 1; }; // not used - dummy implementation + virtual int getStatusPermanent(const Identifier) const { return 1; }; // not used - dummy implementation MOCK_CONST_METHOD1(getStatusHT, int(const Identifier)); // This is the only method that we actually need! <-------------- - virtual bool get_status(const Identifier) const override { return false; }; // not used - dummy implementation - virtual bool get_statusHT(const Identifier) const override { return false; }; // not used - dummy implementation - virtual const StrawStatusContainer* getStrawStatusHTContainer() const override {return nullptr;}; // not used - dummy implementation + virtual bool get_status(const Identifier) const { return false; }; // not used - dummy implementation + virtual bool get_statusHT(const Identifier) const { return false; }; // not used - dummy implementation + virtual const StrawStatusContainer* getStrawStatusHTContainer() const {return nullptr;}; // not used - dummy implementation - virtual int getStatus(const Identifier, const EventContext& ) const override { return 1; }; // not used - dummy implementation - virtual int getStatusPermanent(const Identifier, const EventContext& ) const override { return 1; }; // not used - dummy implementation - virtual int getStatusHT(const Identifier, const EventContext& ) const override { return 1; }; // not used - dummy implementation - virtual bool get_status(const Identifier, const EventContext& ) const override { return false; }; // not used - dummy implementation - virtual bool get_statusHT(const Identifier, const EventContext& ) const override { return false; }; // not used - dummy implementation + virtual int getStatus(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation + virtual int getStatusPermanent(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation + virtual int getStatusHT(const Identifier, const EventContext& ) const { return 1; }; // not used - dummy implementation + virtual bool get_status(const Identifier, const EventContext& ) const { return false; }; // not used - dummy implementation + virtual bool get_statusHT(const Identifier, const EventContext& ) const { return false; }; // not used - dummy implementation }; @@ -359,7 +363,7 @@ namespace OverlayTesting { // check output makes sense SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"}; ASSERT_TRUE( outputDataHandle.isValid() ); - ASSERT_EQ( outputDataHandle->numberOfCollections(), 0 ); + ASSERT_EQ( outputDataHandle->numberOfCollections(), 0u ); } TEST_F(TRTOverlay_test, containers_with_matching_empty_collections) { @@ -390,7 +394,7 @@ namespace OverlayTesting { // check output makes sense SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"}; ASSERT_TRUE( outputDataHandle.isValid() ); - ASSERT_EQ( outputDataHandle->numberOfCollections(),1 ); + ASSERT_EQ( outputDataHandle->numberOfCollections(),1u ); const TRT_RDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash); ASSERT_NE( outputCollection, nullptr ); ASSERT_TRUE( outputCollection->empty() ); @@ -424,7 +428,7 @@ namespace OverlayTesting { // check output makes sense SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"}; ASSERT_TRUE( outputDataHandle.isValid() ); - ASSERT_EQ( outputDataHandle->numberOfCollections(), 2 ); + ASSERT_EQ( outputDataHandle->numberOfCollections(), 2u ); const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash); ASSERT_NE( outputCollection1, nullptr ); ASSERT_TRUE( outputCollection1->empty() ); @@ -482,10 +486,10 @@ namespace OverlayTesting { // check output makes sense SG::ReadHandle<TRT_RDO_Container> outputDataHandle{"StoreGateSvc+TRT_RDOs"}; ASSERT_TRUE( outputDataHandle.isValid() ); - ASSERT_EQ( outputDataHandle->numberOfCollections(), 1 ); + ASSERT_EQ( outputDataHandle->numberOfCollections(), 1u ); const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash); ASSERT_NE( outputCollection1, nullptr ); - ASSERT_EQ( outputCollection1->size(), 1 ); + ASSERT_EQ( outputCollection1->size(), 1u ); const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0)); ASSERT_NE( outputDigit1, nullptr ); ASSERT_EQ( outputDigit1->highLevel(), sigHT ); @@ -561,7 +565,7 @@ namespace OverlayTesting { ASSERT_TRUE( outputDataHandle.isValid() ); const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash); ASSERT_NE( outputCollection1, nullptr ); - ASSERT_EQ( outputCollection1->size(), 1 ); + ASSERT_EQ( outputCollection1->size(), 1u ); const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0)); ASSERT_NE( outputDigit1, nullptr ); ASSERT_EQ( outputDigit1->highLevel(), sigHT ); @@ -569,7 +573,7 @@ namespace OverlayTesting { ASSERT_EQ( outputDigit1->driftTimeBin(), sigDriftTimeBin ); const TRT_RDO_Collection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash); ASSERT_NE( outputCollection2, nullptr ); - ASSERT_EQ( outputCollection2->size(), 1 ); + ASSERT_EQ( outputCollection2->size(), 1u ); const TRT_LoLumRawData* outputDigit2 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection2->at(0)); ASSERT_NE( outputDigit2, nullptr ); ASSERT_EQ( outputDigit2->highLevel(), bkgHT ); @@ -637,7 +641,7 @@ namespace OverlayTesting { ASSERT_TRUE( outputDataHandle.isValid() ); const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash); ASSERT_NE( outputCollection1, nullptr ); - ASSERT_EQ( outputCollection1->size(), 1 ); + ASSERT_EQ( outputCollection1->size(), 1u ); const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0)); ASSERT_NE( outputDigit1, nullptr ); ASSERT_EQ( outputDigit1->highLevel(), sigHT ); @@ -723,12 +727,12 @@ namespace OverlayTesting { ASSERT_TRUE( outputDataHandle.isValid() ); const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash); ASSERT_NE( outputCollection1, nullptr ); - ASSERT_EQ( outputCollection1->size(), 1 ); + ASSERT_EQ( outputCollection1->size(), 1u ); const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0)); ASSERT_NE( outputDigit1, nullptr ); ASSERT_EQ( outputDigit1->highLevel(), sigHT ); ASSERT_EQ( outputDigit1->timeOverThreshold(), outputTOT ); - ASSERT_EQ( outputDigit1->driftTimeBin(), outputDriftTimeBin ); + ASSERT_EQ( outputDigit1->driftTimeBin(), static_cast<int>(outputDriftTimeBin) ); } TEST_F(TRTOverlay_test, containers_with_matching_collections_with_differing_LT_RDOs_same_strawID) { @@ -821,12 +825,12 @@ namespace OverlayTesting { ASSERT_TRUE( outputDataHandle.isValid() ); const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash); ASSERT_NE( outputCollection1, nullptr ); - ASSERT_EQ( outputCollection1->size(), 1 ); + ASSERT_EQ( outputCollection1->size(), 1u ); const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0)); ASSERT_NE( outputDigit1, nullptr ); ASSERT_EQ( outputDigit1->highLevel(), sigHT ); ASSERT_EQ( outputDigit1->timeOverThreshold(), outputTOT ); - ASSERT_EQ( outputDigit1->driftTimeBin(), outputDriftTimeBin ); + ASSERT_EQ( outputDigit1->driftTimeBin(), static_cast<int>(outputDriftTimeBin) ); } TEST_F(TRTOverlay_test, containers_with_matching_collections_with_differing_LT_RDOs_same_strawID_ForceHTbit) { @@ -918,12 +922,12 @@ namespace OverlayTesting { ASSERT_TRUE( outputDataHandle.isValid() ); const TRT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash); ASSERT_NE( outputCollection1, nullptr ); - ASSERT_EQ( outputCollection1->size(), 1 ); + ASSERT_EQ( outputCollection1->size(), 1u ); const TRT_LoLumRawData* outputDigit1 = dynamic_cast<const TRT_LoLumRawData*>(outputCollection1->at(0)); ASSERT_NE( outputDigit1, nullptr ); ASSERT_EQ( outputDigit1->highLevel(), true ); ASSERT_EQ( outputDigit1->timeOverThreshold(), outputTOT ); - ASSERT_EQ( outputDigit1->driftTimeBin(), outputDriftTimeBin ); + ASSERT_EQ( outputDigit1->driftTimeBin(), static_cast<int>(outputDriftTimeBin) ); } } // <-- namespace OverlayTesting diff --git a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointForSeed.h b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointForSeed.h index 9fd2a0b6cfda74fc7506797dc98fffbe6f0d86ca..2879259be2492d4be9d26985d895d7c1a440a07a 100644 --- a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointForSeed.h +++ b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointForSeed.h @@ -46,6 +46,7 @@ namespace InDet { void set(const Trk::SpacePoint*const&,const float*,const float*); void setQuality(float); void setParam(const float&); + void setScorePenalty(const float& par) {m_scorePenalty=par;} const Trk::SpacePoint* spacepoint; const float& x() const {return m_x;} @@ -55,8 +56,9 @@ namespace InDet { float phi() const {return atan2(m_y,m_x);} const float& covr() const {return m_covr;} const float& covz() const {return m_covz;} - const float& param() const {return m_param;} - const float& quality() const {return m_q ;} + const float& param() const {return m_param;} /// impact parameter + const float& scorePenalty() const {return m_scorePenalty;} /// penalty term in the seed score + const float& quality() const {return m_q ;} /// quality of the best seed this candidate was seen on const Trk::Surface* sur() const {return m_su;} const Trk::Surface* sun() const {return m_sn;} @@ -68,8 +70,9 @@ namespace InDet { float m_r ; // radius in beam system coordinates float m_covr; // float m_covz; // - float m_param; - float m_q ; + float m_param; /// impact parameter + float m_scorePenalty; /// penalty term in the seed score + float m_q ; /// quality of the best seed this candidate was seen on const Trk::Surface* m_su; const Trk::Surface* m_sn; }; diff --git a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/src/SiSpacePointsProSeed.cxx b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/src/SiSpacePointsProSeed.cxx index 4abe8730ade8aa0a20832578aea99e16e1ed27b4..4894433ae64f4ca0d6a5e8f560d0c61080edb2ea 100644 --- a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/src/SiSpacePointsProSeed.cxx +++ b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/src/SiSpacePointsProSeed.cxx @@ -114,6 +114,7 @@ namespace InDet { m_q = q; bool pixb = !m_s0->spacepoint->clusterList().second; bool pixt = !m_s2->spacepoint->clusterList().second; + /// if PPP or SSS, just update quality, don't cut if(pixb==pixt) { m_s0->setQuality(q); m_s1->setQuality(q); diff --git a/InnerDetector/InDetRecTools/InDetTrackSummaryHelperTool/InDetTrackSummaryHelperTool/InDetTrackSummaryHelperTool.h b/InnerDetector/InDetRecTools/InDetTrackSummaryHelperTool/InDetTrackSummaryHelperTool/InDetTrackSummaryHelperTool.h index d16e40b8d40bd89c2a0fee4e982ac123f4e0f927..b61b8bd890b322519ecd88d7521d9cd99fb848e3 100755 --- a/InnerDetector/InDetRecTools/InDetTrackSummaryHelperTool/InDetTrackSummaryHelperTool/InDetTrackSummaryHelperTool.h +++ b/InnerDetector/InDetRecTools/InDetTrackSummaryHelperTool/InDetTrackSummaryHelperTool/InDetTrackSummaryHelperTool.h @@ -57,34 +57,43 @@ namespace InDet { Output: Changes in information and hitPattern Input quantities rot, tsos are used to increment the counts for hits and outliers in information and to set the proper bits in hitPattern. */ - virtual void analyse(const Trk::Track& track, - const Trk::PRDtoTrackMap *prd_to_track_map, - const Trk::RIO_OnTrack* rot, - const Trk::TrackStateOnSurface* tsos, - std::vector<int>& information, - std::bitset<Trk::numberOfDetectorTypes>& hitPattern ) const override; - - virtual void analyse(const Trk::Track& track, - const Trk::PRDtoTrackMap *prd_to_track_map, - const Trk::CompetingRIOsOnTrack* crot, - const Trk::TrackStateOnSurface* tsos, - std::vector<int>& information, - std::bitset<Trk::numberOfDetectorTypes>& hitPattern ) const override; - - virtual void analyse(const Trk::Track& track, - const Trk::RIO_OnTrack* rot, - const Trk::TrackStateOnSurface* tsos, - std::vector<int>& information, - std::bitset<Trk::numberOfDetectorTypes>& hitPattern ) const override { - analyse(track,nullptr,rot,tsos,information,hitPattern); + using IExtendedTrackSummaryHelperTool::analyse; + virtual void analyse( + const EventContext& ctx, + const Trk::Track& track, + const Trk::PRDtoTrackMap* prd_to_track_map, + const Trk::RIO_OnTrack* rot, + const Trk::TrackStateOnSurface* tsos, + std::vector<int>& information, + std::bitset<Trk::numberOfDetectorTypes>& hitPattern) const override final; + + virtual void analyse( + const EventContext& ctx, + const Trk::Track& track, + const Trk::PRDtoTrackMap* prd_to_track_map, + const Trk::CompetingRIOsOnTrack* crot, + const Trk::TrackStateOnSurface* tsos, + std::vector<int>& information, + std::bitset<Trk::numberOfDetectorTypes>& hitPattern) const override final; + + virtual void analyse( + const Trk::Track& track, + const Trk::RIO_OnTrack* rot, + const Trk::TrackStateOnSurface* tsos, + std::vector<int>& information, + std::bitset<Trk::numberOfDetectorTypes>& hitPattern) const override + { + analyse(track, nullptr, rot, tsos, information, hitPattern); } - virtual void analyse(const Trk::Track& track, - const Trk::CompetingRIOsOnTrack* crot, - const Trk::TrackStateOnSurface* tsos, - std::vector<int>& information, - std::bitset<Trk::numberOfDetectorTypes>& hitPattern ) const override { - analyse(track,nullptr, crot,tsos,information,hitPattern); + virtual void analyse( + const Trk::Track& track, + const Trk::CompetingRIOsOnTrack* crot, + const Trk::TrackStateOnSurface* tsos, + std::vector<int>& information, + std::bitset<Trk::numberOfDetectorTypes>& hitPattern) const override + { + analyse(track, nullptr, crot, tsos, information, hitPattern); } /** Input : track, partHyp diff --git a/InnerDetector/InDetRecTools/InDetTrackSummaryHelperTool/src/InDetTrackSummaryHelperTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSummaryHelperTool/src/InDetTrackSummaryHelperTool.cxx index aaf99fd5f1e07b0c48e1876cdd85e3d7da4f0538..3205c62f0215d55edb3f22a854102330fa4c8f69 100755 --- a/InnerDetector/InDetRecTools/InDetTrackSummaryHelperTool/src/InDetTrackSummaryHelperTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackSummaryHelperTool/src/InDetTrackSummaryHelperTool.cxx @@ -108,7 +108,8 @@ namespace { } //========================================================================== -void InDet::InDetTrackSummaryHelperTool::analyse(const Trk::Track& track, +void InDet::InDetTrackSummaryHelperTool::analyse(const EventContext& ctx, + const Trk::Track& track, const Trk::PRDtoTrackMap *prd_to_track_map, const Trk::RIO_OnTrack* rot, const Trk::TrackStateOnSurface* tsos, @@ -238,7 +239,7 @@ void InDet::InDetTrackSummaryHelperTool::analyse(const Trk::Track& track, bool isArgonStraw = false; bool isKryptonStraw = false; if (not m_TRTStrawSummaryTool.empty()) { - int statusHT = m_TRTStrawSummaryTool->getStatusHT(id); + int statusHT = m_TRTStrawSummaryTool->getStatusHT(id,ctx); if ( statusHT == TRTCond::StrawStatus::Argon or statusHT == TRTCond::StrawStatus::Dead or statusHT == TRTCond::StrawStatus::EmulateArgon ) { @@ -302,7 +303,8 @@ void InDet::InDetTrackSummaryHelperTool::analyse(const Trk::Track& track, return; } -void InDet::InDetTrackSummaryHelperTool::analyse(const Trk::Track& track, +void InDet::InDetTrackSummaryHelperTool::analyse(const EventContext& ctx, + const Trk::Track& track, const Trk::PRDtoTrackMap *prd_to_track_map, const Trk::CompetingRIOsOnTrack* crot, const Trk::TrackStateOnSurface* tsos, @@ -310,7 +312,13 @@ void InDet::InDetTrackSummaryHelperTool::analyse(const Trk::Track& track, std::bitset<Trk::numberOfDetectorTypes>& hitPattern ) const { // re-produce prior behaviour (i.e. just take most probable ROT) - analyse(track, prd_to_track_map, &crot->rioOnTrack(crot->indexOfMaxAssignProb() ), tsos, information, hitPattern); + analyse(ctx, + track, + prd_to_track_map, + &crot->rioOnTrack(crot->indexOfMaxAssignProb()), + tsos, + information, + hitPattern); } void InDet::InDetTrackSummaryHelperTool::searchForHoles(const Trk::Track& track, diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt index c4c645b4ee8e596997c9e35babbcaa0b81a26398..7b3574e7378a388d1b99978c8dd0991fdde5d6a2 100644 --- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt +++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt @@ -5,33 +5,6 @@ # Declare the package name: atlas_subdir( SiClusterOnTrackTool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Database/AthenaPOOL/AthenaPoolUtilities - DetectorDescription/GeoPrimitives - GaudiKernel - InnerDetector/InDetConditions/InDetCondTools - InnerDetector/InDetDetDescr/SCT_ModuleDistortions - InnerDetector/InDetRecEvent/InDetPrepRawData - InnerDetector/InDetRecEvent/InDetRIO_OnTrack - Tracking/TrkEvent/TrkParameters - Tracking/TrkTools/TrkToolInterfaces - Tracking/TrkEvent/TrkRIO_OnTrack - Tracking/TrkEvent/TrkEventUtils - Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils - Control/StoreGate - PRIVATE - Event/EventPrimitives - InnerDetector/InDetConditions/PixelConditionsTools - InnerDetector/InDetConditions/PixelConditionsData - InnerDetector/InDetDetDescr/InDetIdentifier - InnerDetector/InDetDetDescr/InDetReadoutGeometry - InnerDetector/InDetDetDescr/PixelReadoutGeometry - InnerDetector/InDetDetDescr/PixelGeoModel - InnerDetector/InDetRecTools/SiClusterizationTool - Tracking/TrkDetDescr/TrkSurfaces ) - # External dependencies: find_package( Eigen ) @@ -40,7 +13,7 @@ atlas_add_component( SiClusterOnTrackTool src/*.cxx src/components/*.cxx INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GeoPrimitives GaudiKernel InDetPrepRawData InDetRIO_OnTrack TrkParameters TrkToolInterfaces StoreGateLib SGtests EventPrimitives InDetIdentifier InDetReadoutGeometry PixelReadoutGeometry SiClusterizationToolLib TrkSurfaces TrkRIO_OnTrack PixelConditionsData TrkNeuralNetworkUtilsLib TrkEventUtils) + LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GeoPrimitives GaudiKernel InDetPrepRawData InDetRIO_OnTrack TrkParameters TrkToolInterfaces StoreGateLib SGtests EventPrimitives InDetIdentifier InDetReadoutGeometry PixelReadoutGeometry SiClusterizationToolLib TrkSurfaces TrkRIO_OnTrack PixelConditionsData TrkNeuralNetworkUtilsLib TrkEventUtils SCT_ModuleDistortionsLib ) # Install files from the package: atlas_install_headers( SiClusterOnTrackTool ) diff --git a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx index 3d35224480ae26d2a1966aa462cb08a1ddbe5b00..441467c80a3d9a55d63084aaf69e7bbb67ecee6f 100644 --- a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx +++ b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx @@ -446,6 +446,7 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad assert( roadMakerData.elementUsageTracker[1].size() > static_cast<unsigned int>(n1) ); /// collect all compatible detector elements layer[1][n1].getBarrelDetElements(par_startingPoint, searchDirection, lDE, roadMakerData.elementUsageTracker[1][n1]); + } ++n1; } @@ -455,9 +456,9 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad if (par_targetPoint[2]>par_startingPoint[2]) { for (; n2<static_cast<int>(layer[2].size()); ++n2) { if (par_targetPoint[2] < layer[2][n2].z()) break; - assert( roadMakerData.elementUsageTracker[2].size() > static_cast<unsigned int>(n2) ); + assert( used[2].size() > static_cast<unsigned int>(n2) ); /// collect all compatible detector elements - layer[2][n2].getEndcapDetElements(par_startingPoint, searchDirection, lDE,roadMakerData.elementUsageTracker[2][n2]); + layer[2][n2].getEndcapDetElements(par_startingPoint, searchDirection, lDE,used[2][n2]); } } else { for (--n2; n2>=0; --n2) { diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h index b20a86b919b1d086ffac3e6b781bbf3e66f1779f..adc213c8c9e3ad9cdbd30eb8e7ad3f0687607992 100644 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h @@ -199,6 +199,11 @@ namespace InDet { FloatProperty m_drmin{this, "mindRadius", 5.}; FloatProperty m_maxdImpact{this, "maxdImpact", 10.}; FloatProperty m_maxdImpactSSS{this, "maxdImpactSSS", 50.}; + /// these flags allow to dynamically tighten the d0 cut on non-confirmed seeds based on + /// the penalty score they receive for kinking in the r-z plane. + /// The cut is adapted as cut_value = original - slope x penalty + FloatProperty m_dImpactCutSlopeUnconfirmedSSS{this, "dImpactCutSlopeUnconfirmedSSS", 1.0}; + FloatProperty m_dImpactCutSlopeUnconfirmedPPP{this, "dImpactCutSlopeUnconfirmedPPP", 0.}; FloatProperty m_maxdImpactDecays{this, "maxdImpactForDecays", 20.}; FloatProperty m_ptmin{this, "pTmin", 500.}; //@} @@ -246,6 +251,7 @@ namespace InDet { float m_dzdrmax0{0.}; ///< implicitly store eta cut float m_ipt{0.}; ///< inverse of 90% of the ptmin cut float m_ipt2{0.}; ///< inverse square of 90% of the pt min cut + // static constexpr float m_COF{134*.05*9}; ///< appears to be an approximated term related to multiple-scattering of particles traversing the ID during the seed formation static constexpr float m_COF{134*.05*9}; ///< appears to be an approximated term related to multiple-scattering of particles traversing the ID during the seed formation /// @name Binning parameters diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx index 9c5bbb9b71edb7559d742abeab5366d07499767e..5f097ebb3faed43f9d10ecb5d48e3486680ee718 100644 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx @@ -1987,12 +1987,14 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp /// evaluate distance the two closest-by SP in this seed candidate float dr = data.R[b]; if (data.R[t] < data.R[b]) dr = data.R[t]; - /// update the d0 estimate - d0+=std::abs((Tzb-data.Tz[t])/(dr*sTzb2)); + /// obtain a quality score - start from the d0 estimate, and add + /// a penalty term corresponding to how far the seed segments + /// deviate from a straight line in r-z + data.SP[t]->setScorePenalty(std::abs((Tzb-data.Tz[t])/(dr*sTzb2))); + data.SP[t]->setParam(d0); /// record one possible seed candidate, sort by the curvature data.CmSp.emplace_back(std::make_pair(B/std::sqrt(onePlusAsquare), data.SP[t])); /// store the transverse IP, will later be used as a quality estimator - data.SP[t]->setParam(d0); } } ///< end loop over top space point candidates @@ -2276,8 +2278,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison for (; it_commonTopSP!=ie; ++it_commonTopSP) { /// the seed quality is set to d0 initially - float seedQuality = (*it_commonTopSP).second->param(); - float originalSeedQuality = (*it_commonTopSP).second->param(); + float seedIP = (*it_commonTopSP).second->param(); + float seedQuality = seedIP + (*it_commonTopSP).second->scorePenalty(); + float originalSeedQuality = seedQuality; if(m_maxdImpact > 50){ //This only applies to LRT @@ -2288,7 +2291,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison float eta1=-std::log(std::tan(.5*theta1)); float Zot=bottomZ - (bottomR-originalSeedQuality) * ((topZ-bottomZ)/(topR-bottomR)); - float theta0=std::atan2((*it_commonTopSP).second->param(),Zot); + float theta0=std::atan2(seedIP,Zot); float eta0=-std::log(std::tan(.5*theta0)); float deltaEta=std::abs(eta1-eta0); //For LLP daughters, the direction of the track is correlated with the direction of the LLP (which is correlated with the direction of the point of closest approach @@ -2353,16 +2356,21 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison if (seedQuality > data.maxScore) continue; /// if we have PPS seeds and no confirmation SP exists (which would give the -200 bonus) - /// or the seed quality is worse than the quality of the individual SP, skip this seed + /// or the hits on this seed were already used on a higher quality PPP/SSS seed, kick this one if (bottomSPisPixel!=topSPisPixel) { if (seedQuality > 0. || (seedQuality > bottomSPQuality && seedQuality > centralSPQuality && seedQuality > (*it_commonTopSP).second->quality()) ) continue; } - /// if we have a SSS seed, apply the d0 cut. - /// Exception: If the SSS seed has a confirmation seed (-400 from SSS and -200 from confirmation), - /// then we skip the d0 cut - if (!bottomSPisPixel && (originalSeedQuality > m_maxdImpactSSS) && (seedQuality > m_seedScoreThresholdSSSConfirmationSeed)) continue; + /// If we have a non-confirmed seed, apply a stricter d0 cut. + /// This, is determined using the original cut and the score penalty modifier. + if (!isConfirmedSeed(SPb,it_commonTopSP->second,seedQuality)){ + /// PPP seeds + double maxdImpact = m_maxdImpact - (m_dImpactCutSlopeUnconfirmedPPP * (*it_commonTopSP).second->scorePenalty()); + /// SSS seeds + if (!bottomSPisPixel) maxdImpact = m_maxdImpactSSS - (m_dImpactCutSlopeUnconfirmedSSS * (*it_commonTopSP).second->scorePenalty()); + if (seedIP > maxdImpact) continue; + } /// this is a good seed, save it (unless we have too many seeds per SP) newOneSeed(data, SPb, SP0, (*it_commonTopSP).second, Zob, seedQuality); } ///< end of loop over top SP candidates @@ -2394,7 +2402,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::fillSeeds(EventData& data) const theSeed = (*it_seedCandidate).second; /// if this is not the highest-quality seed in the list and we have the first hit in the IBL, require a confirmation seed (score is then boosted by -200 for PPP + -200 for confirmation --> below -200) if (it_seedCandidate!=it_firstSeedCandidate && theSeed->spacepoint0()->radius() < m_radiusCutIBL && quality > m_seedScoreThresholdPPPConfirmationSeed) continue; - /// this will return false for strip seeds if the quality of the seed is worse than the one of all of the space points on the seed. + /// this will set the quality member of all points on the seed to the quality score of this candidate if (!theSeed->setQuality(quality)) continue; /// if we have space, write the seed directly into an existing slot diff --git a/LArCalorimeter/LArAlignment/LArAlignmentAlgs/CMakeLists.txt b/LArCalorimeter/LArAlignment/LArAlignmentAlgs/CMakeLists.txt index 25a055221bcd69e840d297af5f25b7c84f26b560..56a6ea1e5718ebc2f39c8287a3a9e1915530a5e1 100644 --- a/LArCalorimeter/LArAlignment/LArAlignmentAlgs/CMakeLists.txt +++ b/LArCalorimeter/LArAlignment/LArAlignmentAlgs/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: LArAlignmentAlgs -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArAlignmentAlgs ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Control/AthenaKernel - Database/RegistrationServices - GaudiKernel - PRIVATE - DetectorDescription/DetDescrCond/DetDescrConditions ) - # Component(s) in the package: atlas_add_component( LArAlignmentAlgs src/*.cxx diff --git a/LArCalorimeter/LArBadChannelTool/CMakeLists.txt b/LArCalorimeter/LArBadChannelTool/CMakeLists.txt index b241c2c5c6f3b35924a825127e0b36f460f866a4..ad0d7d2571ad96596389053efdc7318c67630b3a 100644 --- a/LArCalorimeter/LArBadChannelTool/CMakeLists.txt +++ b/LArCalorimeter/LArBadChannelTool/CMakeLists.txt @@ -1,55 +1,32 @@ -################################################################################ -# Package: LArBadChannelTool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArBadChannelTool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloConditions - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - Control/AthenaKernel - Control/StoreGate - Database/AthenaPOOL/AthenaPoolUtilities - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRecConditions - LArCalorimeter/LArCabling ) - # External dependencies: find_package( COOL COMPONENTS CoolKernel ) find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_library( LArBadChannelToolLib src/*.cxx PUBLIC_HEADERS LArBadChannelTool INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${CORAL_LIBRARIES} CaloConditions CaloIdentifier AthenaBaseComps AthenaKernel AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArRecConditions StoreGateLib SGtests LArCablingLib - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) + LINK_LIBRARIES ${COOL_LIBRARIES} ${CORAL_LIBRARIES} CaloIdentifier AthenaBaseComps AthenaKernel AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArRecConditions StoreGateLib LArCablingLib ) atlas_add_component( LArBadChannelTool src/components/*.cxx - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES LArBadChannelToolLib ) atlas_add_dictionary( BadChanDict LArBadChannelTool/LArBadChannelDBToolsDict.h LArBadChannelTool/selection.xml - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} CaloConditions CaloIdentifier AthenaBaseComps AthenaKernel StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArRecConditions LArCablingLib LArBadChannelToolLib ) - + LINK_LIBRARIES LArBadChannelToolLib ) atlas_add_test( LArBadChannelConfigTest SCRIPT python -m LArBadChannelTool.LArBadChannelConfig POST_EXEC_SCRIPT nopost.sh ) - # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-ignore=F401,F821 ) diff --git a/LArCalorimeter/LArCOOLConditions/CMakeLists.txt b/LArCalorimeter/LArCOOLConditions/CMakeLists.txt index 719c7aad5eb46b1481c087e178967debc829a134..e4a3bfdda2612eef3a0b5333fe69d80fb84436a9 100644 --- a/LArCalorimeter/LArCOOLConditions/CMakeLists.txt +++ b/LArCalorimeter/LArCOOLConditions/CMakeLists.txt @@ -1,37 +1,20 @@ -################################################################################ -# Package: LArCOOLConditions -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArCOOLConditions ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArCabling - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - PRIVATE - Control/AthenaKernel - Control/StoreGate - Database/AthenaPOOL/AthenaPoolUtilities ) - # External dependencies: find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_library( LArCOOLConditions src/*.cxx PUBLIC_HEADERS LArCOOLConditions - PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES Identifier GaudiKernel LArIdentifier LArCablingLib StoreGateLib SGtests LArElecCalib - PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel AthenaPoolUtilities ) + PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} + LINK_LIBRARIES AthenaKernel Identifier GaudiKernel LArIdentifier LArElecCalib + PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} AthenaPoolUtilities StoreGateLib ) atlas_add_dictionary( LArCOOLConditionsDict LArCOOLConditions/LArCOOLConditionsDict.h LArCOOLConditions/selection.xml - INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} Identifier GaudiKernel LArCablingLib LArIdentifier AthenaKernel StoreGateLib SGtests AthenaPoolUtilities LArCOOLConditions ) - + LINK_LIBRARIES LArCOOLConditions ) diff --git a/LArCalorimeter/LArCabling/CMakeLists.txt b/LArCalorimeter/LArCabling/CMakeLists.txt index 2b24348c698a7aa49d4983be1efae9d5fcfaaa83..e958c3fdd97d4fd92384144f7d66a598b895c6d9 100644 --- a/LArCalorimeter/LArCabling/CMakeLists.txt +++ b/LArCalorimeter/LArCabling/CMakeLists.txt @@ -1,46 +1,27 @@ -################################################################################ -# Package: LArCabling -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArCabling ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - Control/AthenaKernel - Control/StoreGate - Control/CxxUtils - Database/AthenaPOOL/AthenaPoolUtilities - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArIdentifier - PRIVATE - Tools/PathResolver ) - # External dependencies: find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) -find_package( ROOT COMPONENTS RIO Core Tree MathCore Hist pthread ) # Component(s) in the package: atlas_add_library( LArCablingLib src/*.cxx PUBLIC_HEADERS LArCabling - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES CaloIdentifier AthenaBaseComps AthenaKernel AthenaPoolUtilities Identifier GaudiKernel LArIdentifier StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} PathResolver ) + PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} + LINK_LIBRARIES CaloIdentifier AthenaBaseComps AthenaKernel AthenaPoolUtilities CxxUtils Identifier LArIdentifier StoreGateLib + PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} PathResolver ) atlas_add_component( LArCabling src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} LINK_LIBRARIES LArCablingLib ) atlas_add_dictionary( LArCablingDict LArCabling/LArCablingDict.h LArCabling/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CaloIdentifier AthenaBaseComps AthenaKernel StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArIdentifier PathResolver LArCablingLib ) + LINK_LIBRARIES LArCablingLib ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/LArCalorimeter/LArCalibDataQuality/CMakeLists.txt b/LArCalorimeter/LArCalibDataQuality/CMakeLists.txt index 6d6d3b1bae4361dc9462c782e739b5a343b0af9b..2a3d854e8e1b7fde9317b379cb23db8647edb45e 100644 --- a/LArCalorimeter/LArCalibDataQuality/CMakeLists.txt +++ b/LArCalorimeter/LArCalibDataQuality/CMakeLists.txt @@ -1,33 +1,15 @@ -################################################################################ -# Package: LArCalibDataQuality -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArCalibDataQuality ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - Control/StoreGate - GaudiKernel - LArCalorimeter/LArRawConditions - LArCalorimeter/LArRecConditions - LArCalorimeter/LArCabling - PRIVATE - Event/xAOD/xAODEventInfo - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawEvent ) - # Component(s) in the package: atlas_add_component( LArCalibDataQuality src/*.cxx src/components/*.cxx - LINK_LIBRARIES CaloIdentifier AthenaBaseComps StoreGateLib SGtests GaudiKernel LArRawConditions LArRecConditions LArCablingLib xAODEventInfo LArIdentifier LArRawEvent ) + LINK_LIBRARIES CaloIdentifier AthenaBaseComps StoreGateLib GaudiKernel LArElecCalib LArRawConditions LArRecConditions LArCablingLib xAODEventInfo LArIdentifier LArRawEvent ) # Install files from the package: -atlas_install_headers( LArCalibDataQuality ) -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) diff --git a/LArCalorimeter/LArCalibTools/CMakeLists.txt b/LArCalorimeter/LArCalibTools/CMakeLists.txt index bc5520802b16fa65f722823f22ceddf27e41618b..945a3c73452eaf396de9b1e8bf6ff7eda19fe129 100644 --- a/LArCalorimeter/LArCalibTools/CMakeLists.txt +++ b/LArCalorimeter/LArCalibTools/CMakeLists.txt @@ -1,48 +1,18 @@ -################################################################################ -# Package: LArCalibTools -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArCalibTools ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - Control/StoreGate - GaudiKernel - LArCalorimeter/LArCabling - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawConditions - LArCalorimeter/LArRecConditions - LArCalorimeter/LArRawEvent - LumiBlock/LumiBlockComps - Trigger/TrigAnalysis/TrigDecisionTool - PRIVATE - Calorimeter/CaloCondBlobObjs - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolUtilities - Event/EventInfo - Trigger/TrigAnalysis/TrigDecisionTool - LumiBlock/LumiBlockData - LArCalorimeter/LArCOOLConditions - LArCalorimeter/LArRawEvent - LArCalorimeter/LArCondUtils - LArCalorimeter/LArTools ) - # External dependencies: -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) -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( CORAL COMPONENTS CoralBase ) +find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO ) # Component(s) in the package: atlas_add_component( LArCalibTools src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CaloIdentifier AthenaBaseComps StoreGateLib SGtests GaudiKernel LArCablingLib LArIdentifier LArRawConditions LArRecConditions CaloCondBlobObjs AthenaKernel AthenaPoolUtilities EventInfo LArCOOLConditions LArRawEvent LArToolsLib TrigDecisionToolLib LumiBlockCompsLib ) + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} + LINK_LIBRARIES ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel AthenaPoolUtilities CaloCondBlobObjs CaloDetDescrLib CaloIdentifier EventInfo GaudiKernel LArCOOLConditions LArCablingLib LArElecCalib LArIdentifier LArRawConditions LArRawEvent LArRecConditions LArToolsLib LumiBlockData StoreGateLib TrigDecisionToolLib xAODEventInfo ) # Install files from the package: -atlas_install_headers( LArCalibTools ) atlas_install_joboptions( share/*.py ) - diff --git a/LArCalorimeter/LArCalibUtils/CMakeLists.txt b/LArCalorimeter/LArCalibUtils/CMakeLists.txt index 459654c622a378537fc584f9d4163d1f61aeb76a..a3af10ba9ce3c7d07c5acc5233d26eb341d7a89d 100644 --- a/LArCalorimeter/LArCalibUtils/CMakeLists.txt +++ b/LArCalorimeter/LArCalibUtils/CMakeLists.txt @@ -1,42 +1,14 @@ -################################################################################ -# Package: LArCalibUtils -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArCalibUtils ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - Control/AthenaKernel - Control/StoreGate - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawConditions - LArCalorimeter/LArRawEvent - LArCalorimeter/LArRawUtils - LArCalorimeter/LArRecConditions - LArCalorimeter/LArRecUtils - LArCalorimeter/LArCabling - TestBeam/TBEvent - PRIVATE - Calorimeter/CaloDetDescr - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODEventInfo - LArCalorimeter/LArBadChannelTool - LArCalorimeter/LArCOOLConditions - LArCalorimeter/LArSimEvent - Trigger/TrigAnalysis/TrigAnalysisInterfaces ) - # External dependencies: find_package( CLHEP ) -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) +find_package( CORAL COMPONENTS CoralBase ) find_package( Eigen ) find_package( GSL ) -find_package( ROOT COMPONENTS Minuit Core Tree MathCore Hist RIO pthread MathMore Minuit2 Matrix Physics HistPainter Rint Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 ) +find_package( ROOT COMPONENTS Minuit Core Tree MathCore Hist RIO Graf ) find_package( TBB ) # Component(s) in the package: @@ -44,9 +16,7 @@ atlas_add_component( LArCalibUtils src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${GSL_LIBRARIES} ${CORAL_LIBRARIES} ${EIGEN_LIBRARIES} ${TBB_LIBRARIES} ${CLHEP_LIBRARIES} CaloIdentifier AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier GaudiKernel LArIdentifier LArRawConditions LArRawEvent LArRawUtilsLib LArRecConditions LArRecUtilsLib LArCablingLib TBEvent CaloDetDescrLib AthenaPoolUtilities xAODEventInfo LArBadChannelToolLib LArCOOLConditions LArSimEvent TrigAnalysisInterfaces ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${GSL_LIBRARIES} ${CORAL_LIBRARIES} ${EIGEN_LIBRARIES} ${TBB_LIBRARIES} ${CLHEP_LIBRARIES} CaloIdentifier AthContainers AthenaBaseComps AthenaKernel StoreGateLib Identifier GaudiKernel LArElecCalib LArIdentifier LArRawConditions LArRawEvent LArRawUtilsLib LArRecConditions LArRecUtilsLib LArCablingLib TBEvent CaloDetDescrLib AthenaPoolUtilities xAODEventInfo LArBadChannelToolLib LArCOOLConditions LArSimEvent TrigAnalysisInterfaces ) # Install files from the package: -atlas_install_headers( LArCalibUtils ) -atlas_install_python_modules( python/*.py ) - +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibDigitMaker.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibDigitMaker.h index 1e110eeb8060ec8eea8b15fbf0fb41d33eb8a504..29bd7d575e7cd2702958fd3e83ee133a42dead45 100644 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibDigitMaker.h +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibDigitMaker.h @@ -23,6 +23,7 @@ class LArCalibDigitMaker : public AthAlgorithm StatusCode finalize(){return StatusCode::SUCCESS;} private: SG::ReadCondHandleKey<LArCalibLineMapping> m_calibMapKey{this,"CalibMapKey","LArCalibLineMap","SG Key of calib line mapping object"}; + SG::ReadCondHandleKey<LArCalibLineMapping> m_calibMapSCKey{this,"CalibMapSCKey","LArCalibIdMapSC","SG Key of calib line mapping object"}; std::vector<std::string> m_keylist; std::vector<unsigned> m_vPattern; std::vector<unsigned> m_vDAC; @@ -31,6 +32,8 @@ class LArCalibDigitMaker : public AthAlgorithm unsigned m_nTrigger; double m_delayScale; bool m_dontRun; + bool m_isSC; + }; #endif diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h index ad0221e3578db63e22607c2b9c339899858a73de..673d7a0a763baca49db68cf96068139a629b817a 100644 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h @@ -47,8 +47,9 @@ #include "LArCabling/LArOnOffIdMapping.h" #include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArCalibLineMapping.h" //#include "LArCalibTriggerAccumulator.h" - +#include "CaloDetDescr/ICaloSuperCellIDTool.h" #include <vector> #include <string> #include <map> @@ -76,6 +77,8 @@ public: private: SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKeySC{this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}; + //Private member functions // choose reconstruction mode (i.e. OF or Parabola) void chooseRecoMode() ; @@ -100,7 +103,8 @@ private: ToolHandle<LArParabolaPeakRecoTool> m_peakParabolaTool; ToolHandle<LArShapePeakRecoTool> m_peakShapeTool; ToolHandle<LArOFPeakRecoTool> m_peakOFTool; - + ToolHandle<ICaloSuperCellIDTool> m_sc2ccMappingTool; + unsigned m_event_counter; int m_delay; int m_ipassShape; @@ -162,6 +166,14 @@ private: uint16_t m_fatalFebErrorPattern; + // For calib line mapping, only used for SC for now + IntegerProperty m_nPulsedCalibLines; + std::vector<int> m_pulsedCalibLines; + SG::ReadCondHandleKey<LArCalibLineMapping> m_calibMapKey{this,"CalibMapKey","LArCalibLineMap","SG Key of calib line mapping object"}; + SG::ReadCondHandleKey<LArCalibLineMapping> m_calibMapSCKey{this,"CalibMapSCKey","LArCalibIdMapSC","SG Key of calib line mapping object"}; + + + }; #endif diff --git a/LArCalorimeter/LArCalibUtils/python/GetCoolChannelSelection.py b/LArCalorimeter/LArCalibUtils/python/GetCoolChannelSelection.py index 164c5e480d9ec16e370063a2864dcc82185e0140..5c4d9f00854b3d1abc37c945cf5c7daa1942e601 100644 --- a/LArCalorimeter/LArCalibUtils/python/GetCoolChannelSelection.py +++ b/LArCalorimeter/LArCalibUtils/python/GetCoolChannelSelection.py @@ -1,4 +1,4 @@ -# 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 __future__ import print_function @@ -6,8 +6,6 @@ def GetCoolChannelSelection(partition, gain, withPS): if (gain<0 or gain>3): print ("ERROR Gain out of range: ", gain) return "" - AccList=[] - PSList=[] if (gain==0): g=0 elif (gain==1): #Medium @@ -19,25 +17,25 @@ def GetCoolChannelSelection(partition, gain, withPS): return "" retString="" if (partition=="EMBA"): - retstring="%i:%i"%(g+35,g+66) + retString="%i:%i"%(g+35,g+66) if (withPS): - retstring+=",%s:%s"%(g+149,g+180) + retString+=",%s:%s"%(g+149,g+180) elif (partition=="EMBC"): - retstring="%i:%i"%(g+3,g+34) + retString="%i:%i"%(g+3,g+34) if (withPS): - retstring+=",%s:%s"%(g+117,g+148) + retString+=",%s:%s"%(g+117,g+148) elif (partition=="EMECA"): - retstring="%i:%i,%i,%i,%i,%i"\ + retString="%i:%i,%i,%i,%i,%i"\ %(g+92,g+116,g+232,g+234,g+236,g+238) if (withPS): - retstring+=",%s:%s"%(g+210,g+230) + retString+=",%s:%s"%(g+210,g+230) elif (partition=="EMECA"): - retstring="%i:%i,%i,%i,%i,%i"\ + retString="%i:%i,%i,%i,%i,%i"\ %(g+67,g+91,g+231,g+233,g+235,g+237) if (withPS): - retstring+=",%s:%s"%(g+181,g+209) + retString+=",%s:%s"%(g+181,g+209) - return retstring + return retString diff --git a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrMaker.cxx b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrMaker.cxx index b56db1c4e0e898ed9650b794231773e5ba8b803a..ebe0864264a3f7f6461c8956dee53d28fd11c686 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrMaker.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrMaker.cxx @@ -49,7 +49,6 @@ LArAutoCorrMaker::LArAutoCorrMaker(const std::string& name, ISvcLocator* pSvcLoc declareProperty("KeyOutput", m_keyoutput="LArAutoCorr"); declareProperty("events_ref", m_nref=50); declareProperty("nsigma", m_rms_cut=5); - declareProperty("Nsamples", m_nsamples=32); declareProperty("normalize", m_normalize=1); declareProperty("physics", m_physics=0); declareProperty("GroupingType", m_groupingType); @@ -139,7 +138,10 @@ StatusCode LArAutoCorrMaker::execute() ATH_MSG_DEBUG("Got LArDigitContainer with key " << *key_it <<", size=" << larDigitContainer->size()); ++m_nEvents; LArDigitContainer::const_iterator it=larDigitContainer->begin(); - LArDigitContainer::const_iterator it_end=larDigitContainer->end(); + LArDigitContainer::const_iterator it_end=larDigitContainer->end(); + m_nsamples = (*larDigitContainer->begin())->nsamples(); + ATH_MSG_DEBUG("NSAMPLES (from digit container) = " << m_nsamples ); + for(;it!=it_end;it++){ const HWIdentifier chid=(*it)->hardwareID(); const CaloGain::CaloGain gain=(*it)->gain(); diff --git a/LArCalorimeter/LArCalibUtils/src/LArCalibDigitMaker.cxx b/LArCalorimeter/LArCalibUtils/src/LArCalibDigitMaker.cxx index 7a4a666a50e156c3daf4e1a090c0ec688a3ece9a..c52a8c8f38632b83510d386852aaac7365423a94 100644 --- a/LArCalorimeter/LArCalibUtils/src/LArCalibDigitMaker.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArCalibDigitMaker.cxx @@ -33,6 +33,7 @@ LArCalibDigitMaker::LArCalibDigitMaker(const std::string& name, ISvcLocator* pSv declareProperty("BoardIDs",m_vBoardIDs); declareProperty("DelayScale",m_delayScale=(25./240.)*ns); declareProperty("DontRun",m_dontRun=false); //Put only Board configuration in DetectorStore + declareProperty("isSC",m_isSC=false); } LArCalibDigitMaker::~LArCalibDigitMaker() @@ -42,7 +43,18 @@ LArCalibDigitMaker::~LArCalibDigitMaker() StatusCode LArCalibDigitMaker::initialize() { ATH_MSG_DEBUG ( "======== LArCalibDigitMaker Initialize ========" ); - ATH_CHECK( m_calibMapKey.initialize() ); + // bool containsKeySC = false; + for (unsigned int i = 0; i < m_keylist.size(); ++i) { + if (m_keylist.at(i).compare("SC") == 0) { + m_isSC = true; + ATH_MSG_DEBUG ( "======== LArCalibDigitMaker isSC is True ========" ); + } + } + if(m_isSC){ + ATH_CHECK( m_calibMapSCKey.initialize() ); + }else{ + ATH_CHECK( m_calibMapKey.initialize() ); + } // std::cout << "Pattern.size()=" << m_vPattern.size() << std::endl; // std::cout << "DAC.size()=" << m_vDAC.size() << std::endl; @@ -51,6 +63,9 @@ StatusCode LArCalibDigitMaker::initialize() // std::cout << "BoardIDs.size()=" << m_vBoardIDs.size() << std::endl; //Check if calibParams are given consistently: Either all or non + + + if (!((m_vBoardIDs.size()==0 && m_vDAC.size()==0 && m_vDelay.size()==0 && m_vPattern.size()==0 && m_nTrigger==0) || (m_vBoardIDs.size() && m_vDAC.size() && m_vDelay.size() && m_vPattern.size() && m_nTrigger))) { ATH_MSG_ERROR ( "Problem with jobOptions! Please set either ALL calibration parameters" << std:: endl @@ -92,8 +107,18 @@ StatusCode LArCalibDigitMaker::execute() { const EventContext& ctx = Gaudi::Hive::currentContext(); - SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_calibMapKey}; - const LArCalibLineMapping* clcabling{*clHdl}; + + const LArCalibLineMapping *clcabling=0; + if(m_isSC) { + ATH_MSG_DEBUG ( "======== LArCalibDigitMaker: using SC calib line map" ); + SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_calibMapSCKey}; + clcabling=*clHdl; + } else { + SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_calibMapKey}; + clcabling=*clHdl; + } + + if(!clcabling) { ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_calibMapKey.key() ); return StatusCode::FAILURE; diff --git a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx index c28511fdd1b70f6c915be1157a87a8ec03c5b757..40177ba1d2ac3e23722ac526391948fdd2738399 100644 --- a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx @@ -26,6 +26,7 @@ LArRampBuilder::LArRampBuilder(const std::string& name, ISvcLocator* pSvcLocator m_peakParabolaTool("LArParabolaPeakRecoTool"), m_peakShapeTool("LArShapePeakRecoTool"), m_peakOFTool("LArOFPeakRecoTool"), + m_sc2ccMappingTool("CaloSuperCellIDTool"), m_event_counter(0), m_recoType(OF), m_onlineHelper(), @@ -87,6 +88,7 @@ StatusCode LArRampBuilder::initialize() StatusCode sc; if ( m_isSC ) { + ATH_MSG_DEBUG("==== LArRampBuilder - looking at SuperCells ===="); const LArOnline_SuperCellID* ll; sc = detStore()->retrieve(ll, "LArOnline_SuperCellID"); if (sc.isFailure()) { @@ -111,8 +113,19 @@ StatusCode LArRampBuilder::initialize() } } - + if ( m_isSC ) ATH_CHECK( m_sc2ccMappingTool.retrieve() ); + ATH_CHECK( m_cablingKey.initialize() ); + if ( m_isSC ) ATH_CHECK( m_cablingKeySC.initialize() ); + + // Initialise keys for calib line mapping + if (m_isSC){ + ATH_CHECK( m_calibMapSCKey.initialize() ); + ATH_CHECK( m_calibMapKey.initialize() ); + }else{ + ATH_CHECK( m_calibMapKey.initialize() ); + } + if(m_doBadChannelMask) { sc=m_badChannelMask.retrieve(); @@ -151,6 +164,9 @@ StatusCode LArRampBuilder::initialize() ATH_MSG_INFO( " register callback for HEC map " ); } } + + + return StatusCode::SUCCESS; } @@ -229,6 +245,55 @@ StatusCode LArRampBuilder::execute() if (m_event_counter==1) ATH_MSG_WARNING("No FebErrorSummaryObject found! Feb errors not checked!"); + + + ///* + // calib line mapping for SC + const LArCalibLineMapping *clCont=0; + const LArCalibLineMapping *clContSC=0; + if(m_isSC) { + ATH_MSG_DEBUG( "LArRampBuilder: using SC calib map" ); + SG::ReadCondHandle<LArCalibLineMapping> clHdlSC{m_calibMapSCKey}; + clContSC=*clHdlSC; + + if(!clContSC) { + ATH_MSG_WARNING( "Do not have SC calib line mapping !!!" ); + return StatusCode::FAILURE; + } else { + ATH_MSG_DEBUG( "DONE THE SETUP SC calib line" ); + } + }//} else { + // calib line mapping for main readout + SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_calibMapKey}; + clCont=*clHdl; + //} + if(!clCont) { + ATH_MSG_WARNING( "Do not have calib line mapping !!!" ); + return StatusCode::FAILURE; + } else { + ATH_MSG_DEBUG( "DONE THE SETUP calib line" ); + } + // end of calib line mapping + // */ + + const LArOnOffIdMapping* cabling(0); + if( m_isSC ){ + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKeySC}; + cabling = {*cablingHdl}; + if(!cabling) { + ATH_MSG_ERROR("Do not have mapping object " << m_cablingKeySC.key()); + return StatusCode::FAILURE; + } + }else{ + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + cabling = {*cablingHdl}; + if(!cabling) { + ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key()); + return StatusCode::FAILURE; + } + } + + std::vector<std::string>::const_iterator key_it=m_keylist.begin(); std::vector<std::string>::const_iterator key_it_e=m_keylist.end(); @@ -301,6 +366,8 @@ StatusCode LArRampBuilder::execute() int DAC = larCaliWave.getDAC(); IdentifierHash chidwave_hash = m_onlineHelper->channel_Hash(itVec.channelId()); + + bool IsBad = false; for(int i=0;i<24*NSamplesKeep;i++){ tempWave[i] = larCaliWave.getSample(i); @@ -371,6 +438,27 @@ StatusCode LArRampBuilder::execute() } } + // HEC Calibration lines + const std::vector<HWIdentifier>& calibLineV = clCont->calibSlotLine(chid); + ATH_MSG_DEBUG( "pulsed lines: "<< calibLineV.size() ); + if(m_isSC){ + const std::vector<HWIdentifier>& calibLineVSC = clContSC->calibSlotLine(chid); + ATH_MSG_DEBUG( "pulsed SC lines: "<< calibLineVSC.size() ); + } + // std::vector<HWIdentifier>::const_iterator calibLineIt = calibLineV.begin(); + // for(calibLineIt = calibLineV.begin(); calibLineIt != calibLineV.end();++calibLineIt) { + // ATH_MSG_DEBUG( "CALIB LINE "<< m_onlineHelper->channel(*calibLineIt) ); + // } + + std::vector<Identifier> ccellIds(0); + if( m_isSC ){ + Identifier myofflineID = cabling->cnvToIdentifier((*it)->hardwareID()) ; + + ccellIds = m_sc2ccMappingTool->superCellToOfflineID( myofflineID ); + ATH_MSG_DEBUG( "Cell: " << myofflineID << " " << (*it)->channelID() << " " << chid << " " << ccellIds.size() << " : " << ccellIds ); + } + + if (m_delay==-1) { //First (pulsed) cell to be processed: m_delay=(*it)->delay(); } @@ -440,16 +528,28 @@ StatusCode LArRampBuilder::execute() // << " mean " << (*it)->mean()[0] << " " << (*it)->mean()[1] << " " << (*it)->mean()[2] << " " << (*it)->mean()[3] // << " " << (*it)->mean()[4] << " " << (*it)->mean()[5] << " " << (*it)->mean()[6] << std::endl; // } - // } + // } + - LArCalibTriggerAccumulator& accpoints=(m_ramps->get(chid,gain))[(*it)->DAC()]; - //rawramp.addAccumulatedEvent( (*it)->mean(),(*it)->RMS(), (*it)->nTriggers() ); - LArCalibTriggerAccumulator::ERRTYPE ec=accpoints.add((*it)->sampleSum(),(*it)->sample2Sum(),(*it)->nTriggers()); - if (ec==LArCalibTriggerAccumulator::WrongNSamples) { - ATH_MSG_ERROR( "Failed to accumulate sub-steps: Inconsistent number of ADC samples"); - } - if (ec==LArCalibTriggerAccumulator::NumericOverflow) { - ATH_MSG_ERROR( "Failed to accumulate sub-steps: Numeric Overflow"); + if (m_isSC){ // Changed here to give DAC value for supercell, rather than DAC for a constituent cell + LArCalibTriggerAccumulator& accpoints=(m_ramps->get(chid,gain))[(*it)->DAC()*ccellIds.size()]; + LArCalibTriggerAccumulator::ERRTYPE ec=accpoints.add((*it)->sampleSum(),(*it)->sample2Sum(),(*it)->nTriggers()); + if (ec==LArCalibTriggerAccumulator::WrongNSamples) { + ATH_MSG_ERROR( "Failed to accumulate sub-steps: Inconsistent number of ADC samples"); + } + if (ec==LArCalibTriggerAccumulator::NumericOverflow) { + ATH_MSG_ERROR( "Failed to accumulate sub-steps: Numeric Overflow"); + } + }else{ + LArCalibTriggerAccumulator& accpoints=(m_ramps->get(chid,gain))[(*it)->DAC()]; + //rawramp.addAccumulatedEvent( (*it)->mean(),(*it)->RMS(), (*it)->nTriggers() ); + LArCalibTriggerAccumulator::ERRTYPE ec=accpoints.add((*it)->sampleSum(),(*it)->sample2Sum(),(*it)->nTriggers()); + if (ec==LArCalibTriggerAccumulator::WrongNSamples) { + ATH_MSG_ERROR( "Failed to accumulate sub-steps: Inconsistent number of ADC samples"); + } + if (ec==LArCalibTriggerAccumulator::NumericOverflow) { + ATH_MSG_ERROR( "Failed to accumulate sub-steps: Numeric Overflow"); + } } }//End loop over all cells } //End loop over all containers @@ -483,13 +583,17 @@ StatusCode LArRampBuilder::stop() else larRampComplete=NULL; + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; const LArOnOffIdMapping* cabling{*cablingHdl}; if(!cabling) { - ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key()); - return StatusCode::FAILURE; + ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key()); + return StatusCode::FAILURE; } + + + int containerCounter=0; //Outermost loop goes over all gains (different containers). //for (CaloGain::CaloGain gain=CaloGain::LARHIGHGAIN;gain<CaloGain::LARNGAIN;gain++) { @@ -525,6 +629,9 @@ StatusCode LArRampBuilder::stop() std::vector<float> adc0v; bool isADCsat = false; + + + for (;dac_it!=dac_it_e;dac_it++) { LArRawRamp::RAMPPOINT_t ramppoint; diff --git a/LArCalorimeter/LArCellRec/CMakeLists.txt b/LArCalorimeter/LArCellRec/CMakeLists.txt index 2adcbe8fc7a27a1302e13dca7bda2c494829b8b5..1387a70c0c2e24eadbc17b220944238489734085 100644 --- a/LArCalorimeter/LArCellRec/CMakeLists.txt +++ b/LArCalorimeter/LArCellRec/CMakeLists.txt @@ -1,46 +1,8 @@ -################################################################################ -# Package: LArCellRec -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArCellRec ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloConditions - Calorimeter/CaloDetDescr - Calorimeter/CaloEvent - Calorimeter/CaloIdentifier - Calorimeter/CaloInterface - Calorimeter/CaloRec - Calorimeter/CaloUtils - Control/AthAllocators - Control/AthenaBaseComps - Control/AthenaKernel - Control/StoreGate - Control/CxxUtils - DetectorDescription/AtlasDetDescr - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawEvent - LArCalorimeter/LArRecConditions - LArCalorimeter/LArCOOLConditions - LArCalorimeter/LArSimEvent - Event/xAOD/xAODTrigL1Calo - PRIVATE - Calorimeter/CaloTriggerTool - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODEventInfo - Generators/GeneratorObjects - LArCalorimeter/LArRecEvent - LArCalorimeter/LArCabling - LArCalorimeter/LArCOOLConditions - Trigger/TrigT1/TrigT1CaloCalibConditions - Trigger/TrigT1/TrigT1CaloCondSvc - Generators/AtlasHepMC ) - # External dependencies: find_package( CLHEP ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) @@ -51,25 +13,22 @@ atlas_add_component( LArCellRec src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${TBB_LIBRARIES} CaloConditions CaloDetDescrLib CaloEvent CaloIdentifier - CaloRecLib CaloUtilsLib AthAllocators AthenaBaseComps AthenaKernel StoreGateLib CxxUtils SGtests AtlasDetDescr Identifier GaudiKernel LArIdentifier - LArRawEvent LArRecConditions LArCOOLConditions LArSimEvent CaloTriggerToolLib AthenaPoolUtilities xAODEventInfo xAODTrigL1Calo GeneratorObjects - LArRecEvent LArCablingLib TrigT1CaloCalibConditions TrigT1CaloCondSvcLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${TBB_LIBRARIES} CaloConditions CaloDetDescrLib CaloEvent CaloIdentifier CaloInterfaceLib + CaloUtilsLib AthAllocators AthenaBaseComps AthenaKernel StoreGateLib CxxUtils Identifier GaudiKernel LArIdentifier + LArRawEvent LArRecConditions CaloTriggerToolLib AthenaPoolUtilities xAODEventInfo xAODTrigL1Calo + LArRecEvent LArCablingLib LArElecCalib TrigT1CaloCalibConditions TrigT1CaloCondSvcLib ) # Install files from the package: -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) - #atlas_add_test( LArBadFebMaskingTool_test # SCRIPT test/LArBadFebMaskingTool_test.sh # PROPERTIES TIMEOUT 600 # LOG_IGNORE_PATTERN "LArDetectorToolNV|is still valid|no data retrieved|Database being retired|Reading file|Unable to locate catalog|Resolved path|DigitizationFlags|^Domain|created CondCont|no dictionary for class|^ +[+]|Reading LArPedestalMC|IOV callback|^DetectorStore|Cache alignment" ) - atlas_add_test( LArCellDeadOTXCorr_test SCRIPT test/LArCellDeadOTXCorr_test.sh PROPERTIES TIMEOUT 600 LOG_IGNORE_PATTERN "LArDetectorToolNV|is still valid|no data retrieved|Database being retired|Reading file|Unable to locate catalog|Resolved path|DigitizationFlags|^Domain|created CondCont|no dictionary for class|^ +[+]|Reading LArPedestalMC|IOV callback|^DetectorStore|Cache alignment|object with key|recorded new|into Conditions|IOVDbSvc +INFO" ) - diff --git a/LArCalorimeter/LArCellRec/python/LArCellDeadOTXCorrToolDefault.py b/LArCalorimeter/LArCellRec/python/LArCellDeadOTXCorrToolDefault.py index 09421761b54e946f9cf42fd0d72811070bd7fd1c..d685adf6a24c65d205f84907e9ef5987370b5cec 100644 --- a/LArCalorimeter/LArCellRec/python/LArCellDeadOTXCorrToolDefault.py +++ b/LArCalorimeter/LArCellRec/python/LArCellDeadOTXCorrToolDefault.py @@ -1,12 +1,14 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration def LArCellDeadOTXCorrToolDefault(name='LArCellDeadOTXCorr'): + from AthenaCommon.Logging import logging + mlog = logging.getLogger( 'LArCellDeadOTXCorrToolDefault' ) - import traceback try : from LArCellRec.LArCellRecConf import LArCellDeadOTXCorr theLArCellDeadOTXCorr = LArCellDeadOTXCorr(name) - except: + except Exception: + import traceback mlog.error("could not get handle to LArCellDeadOTXCorr Quit") traceback.print_exc() return False @@ -51,9 +53,9 @@ def LArCellDeadOTXCorrToolDefault(name='LArCellDeadOTXCorr'): L1CaloDb="" - if not 'L1CaloDbConnection' in dir(): + if 'L1CaloDbConnection' not in dir(): if 'L1CaloSqliteDB' in dir(): - L1CaloDbConnection="<dbConnection>sqlite://;schema=" + L1CaloSqliteDB + ";dbname=L1CALO</dbConnection>" + L1CaloDbConnection="<dbConnection>sqlite://;schema=" + L1CaloSqliteDB + ";dbname=L1CALO</dbConnection>" # noqa: F821 else: L1CaloDb="TRIGGER" L1CaloDbConnection="" diff --git a/LArCalorimeter/LArCellRec/python/LArCellHVCorrDefault.py b/LArCalorimeter/LArCellRec/python/LArCellHVCorrDefault.py index 69b8315ac6565ceb985b144172a19abaa14e1174..d489b4915a8b95c31a8b2e91288b21de3c65cd13 100644 --- a/LArCalorimeter/LArCellRec/python/LArCellHVCorrDefault.py +++ b/LArCalorimeter/LArCellRec/python/LArCellHVCorrDefault.py @@ -1,17 +1,15 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration - -#from AthenaCommon.Logging import logging +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration #Note: This tool is used as CaloCellCorrection tool and by the CaloNoiseTool def LArCellHVCorrDefault(name="LArCellHVCorrDefault"): - # check if tool already exists + # check if tool already exists from AthenaCommon.AppMgr import ServiceMgr as svcMgr if hasattr(svcMgr.ToolSvc, name): # re-use previously configured (public) tool return getattr(svcMgr.ToolSvc, name) - from LArConditionsCommon import LArHVDB + from LArConditionsCommon import LArHVDB # noqa: F401 from LArCellRec.LArCellRecConf import LArCellHVCorr theLArCellHVCorr = LArCellHVCorr(name) diff --git a/LArCalorimeter/LArCellRec/python/LArCollisionTimeGetter.py b/LArCalorimeter/LArCellRec/python/LArCollisionTimeGetter.py index fdaaa599c67a4b133b6d3c76b1f20818b790b021..a175b97da2a9bda81c92cd64fd3832fbdc683728 100644 --- a/LArCalorimeter/LArCellRec/python/LArCollisionTimeGetter.py +++ b/LArCalorimeter/LArCellRec/python/LArCollisionTimeGetter.py @@ -1,6 +1,5 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# $Id$ # # @file LArCellRec/python/LArCollisionTimeGetter.py # @author scott snyder <snyder@bnl.gov> @@ -47,7 +46,7 @@ class LArCollisionTimeGetter ( Configured ) : objKeyStore.addTransient (self.outputType(),self.outputKey()) self.seq += self._handle - except: + except Exception: mlog.error ("Error configuring LArCollisionTimeAlg.") traceback.print_exc() diff --git a/LArCalorimeter/LArCellRec/python/LArNoisyROSummaryGetter.py b/LArCalorimeter/LArCellRec/python/LArNoisyROSummaryGetter.py index 41d5e6b8f153a7bdf5975999694e4aef330b0c5c..c5c6bda0285affe21bfad4f4524b0a44ee384497 100755 --- a/LArCalorimeter/LArCellRec/python/LArNoisyROSummaryGetter.py +++ b/LArCalorimeter/LArCellRec/python/LArNoisyROSummaryGetter.py @@ -21,7 +21,7 @@ class LArNoisyROSummaryGetter ( Configured ) : try: from CaloRec.CaloCellGetter import CaloCellGetter theCaloCellGetter = CaloCellGetter() - except: + except Exception: mlog.error("could not get handle to CaloCell Quit") traceback.print_exc() return False @@ -38,7 +38,7 @@ class LArNoisyROSummaryGetter ( Configured ) : # cannot have same name try: from LArCellRec.LArCellRecConf import LArNoisyROAlg,LArNoisyROTool - except: + except Exception: mlog.error("could not import LArNoisyROAlg or LArNoisyROTool") traceback.print_exc() return False diff --git a/LArCalorimeter/LArClusterRec/CMakeLists.txt b/LArCalorimeter/LArClusterRec/CMakeLists.txt index c108a617de4a645cb8f901da7d382002808e6105..54e498696df04d43715455ed73ecca7b753dbfb2 100644 --- a/LArCalorimeter/LArClusterRec/CMakeLists.txt +++ b/LArCalorimeter/LArClusterRec/CMakeLists.txt @@ -1,36 +1,15 @@ -################################################################################ -# Package: LArClusterRec -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArClusterRec ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloEvent - Calorimeter/CaloRec - Control/AthenaBaseComps - Control/StoreGate - Event/xAOD/xAODCaloEvent - GaudiKernel - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRecEvent - LArCalorimeter/LArCabling - PRIVATE - Calorimeter/CaloUtils - Control/AthContainers - DetectorDescription/Identifier - LArCalorimeter/LArRawEvent - LArCalorimeter/LArRecConditions) - # Component(s) in the package: atlas_add_component( LArClusterRec src/*.cxx src/components/*.cxx - LINK_LIBRARIES CaloEvent CaloRecLib AthenaBaseComps StoreGateLib SGtests xAODCaloEvent GaudiKernel LArIdentifier LArRecEvent LArCablingLib CaloUtilsLib AthContainers Identifier LArRawEvent ) + LINK_LIBRARIES CaloEvent CaloRecLib AthenaBaseComps StoreGateLib xAODCaloEvent GaudiKernel LArIdentifier LArRecEvent LArCablingLib CaloUtilsLib AthContainers Identifier LArRawEvent ) # Install files from the package: -atlas_install_headers( LArClusterRec ) -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) diff --git a/LArCalorimeter/LArCnv/LArByteStream/CMakeLists.txt b/LArCalorimeter/LArCnv/LArByteStream/CMakeLists.txt index af833d5353be96502cc08e01bdcd6a2fba6e2e6a..c8923e22a5156cee88fabab80ed4c53ca28d1507 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/CMakeLists.txt +++ b/LArCalorimeter/LArCnv/LArByteStream/CMakeLists.txt @@ -1,39 +1,8 @@ -# $Id: CMakeLists.txt 757209 2016-06-23 11:15:56Z krasznaa $ -################################################################################ -# Package: LArByteStream -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArByteStream ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Calorimeter/CaloDetDescr - Calorimeter/CaloIdentifier - Calorimeter/CaloUtils - Control/AthenaBaseComps - Control/AthenaKernel - Control/StoreGate - Event/xAOD/xAODEventInfo - Event/ByteStreamCnvSvcBase - Event/ByteStreamData - GaudiKernel - LArCalorimeter/LArIdentifier - LArCalorimeter/LArROD - LArCalorimeter/LArRawEvent - LArCalorimeter/LArRawUtils - LArCalorimeter/LArRecConditions - LArCalorimeter/LArRecEvent - LArCalorimeter/LArRecUtils - LArCalorimeter/LArCabling - PRIVATE - Calorimeter/CaloInterface - DetectorDescription/AtlasDetDescr - DetectorDescription/Identifier - Event/ByteStreamCnvSvc - LArCalorimeter/LArRawConditions ) - # External dependencies: find_package( tdaq-common COMPONENTS eformat eformat_write ) @@ -45,14 +14,14 @@ atlas_add_library( LArByteStreamLib LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} CaloIdentifier AthenaBaseComps AthenaKernel xAODEventInfo ByteStreamData GaudiKernel LArIdentifier LArRawEvent LArRecConditions LArRecEvent CaloDetDescrLib CaloUtilsLib StoreGateLib - ByteStreamCnvSvcBaseLib LArRODLib LArRawUtilsLib LArRecUtilsLib LArCablingLib + ByteStreamCnvSvcBaseLib LArRawUtilsLib LArRecUtilsLib LArCablingLib ByteStreamCnvSvcLib - PRIVATE_LINK_LIBRARIES AtlasDetDescr Identifier LArRawConditions ) + PRIVATE_LINK_LIBRARIES AtlasDetDescr CaloInterfaceLib Identifier LArRawConditions ) atlas_add_component( LArByteStream src/components/*.cxx LINK_LIBRARIES LArByteStreamLib ) # Install files from the package: -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.txt share/*.py ) diff --git a/LArCalorimeter/LArCnv/LArCondAthenaPool/CMakeLists.txt b/LArCalorimeter/LArCnv/LArCondAthenaPool/CMakeLists.txt index 0db331bdd0629a0cfc39809b74d10e09ea62729f..2f0d71d7a6941876ba2ee83b180331384d00157e 100644 --- a/LArCalorimeter/LArCnv/LArCondAthenaPool/CMakeLists.txt +++ b/LArCalorimeter/LArCnv/LArCondAthenaPool/CMakeLists.txt @@ -1,19 +1,8 @@ -################################################################################ -# Package: LArCondAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArCondAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Database/AthenaPOOL/AthenaPoolUtilities - PRIVATE - AtlasTest/TestTools - Database/AthenaPOOL/AthenaPoolCnvSvc - LArCalorimeter/LArCnv/LArCondTPCnv - LArCalorimeter/LArRawConditions ) - # Component(s) in the package: atlas_add_poolcnv_library( LArCondAthenaPoolPoolCnv src/*.cxx diff --git a/LArCalorimeter/LArCnv/LArCondTPCnv/CMakeLists.txt b/LArCalorimeter/LArCnv/LArCondTPCnv/CMakeLists.txt index ea3379c4087202a923474b0821c107109703fdfd..11000b86648b4688f0cc96ef74442b1426ccbc4f 100644 --- a/LArCalorimeter/LArCnv/LArCondTPCnv/CMakeLists.txt +++ b/LArCalorimeter/LArCnv/LArCondTPCnv/CMakeLists.txt @@ -1,106 +1,91 @@ -################################################################################ -# Package: LArCondTPCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArCondTPCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Database/AthenaPOOL/AthenaPoolCnvSvc - LArCalorimeter/LArRawConditions - PRIVATE - Control/AthenaKernel - LArCalorimeter/LArElecCalib ) - -# External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - # Component(s) in the package: atlas_add_tpcnv_library( LArCondTPCnv src/*.cxx PUBLIC_HEADERS LArCondTPCnv - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawConditions AthenaKernel ) + LINK_LIBRARIES AthenaPoolCnvSvcLib LArRawConditions + PRIVATE_LINK_LIBRARIES AthenaKernel LArElecCalib ) atlas_add_dictionary( LArCondTPCnvDict LArCondTPCnv/LArCondTPCnvDict.h LArCondTPCnv/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawConditions AthenaKernel LArCondTPCnv ) + LINK_LIBRARIES LArCondTPCnv ) atlas_add_dictionary( OLD_LArCondTPCnvDict LArCondTPCnv/LArCondTPCnvDict.h LArCondTPCnv/OLD_selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawConditions AthenaKernel LArCondTPCnv ) + LINK_LIBRARIES LArCondTPCnv ) atlas_add_test( LArAutoCorrSubsetCnv_p1_test SOURCES test/LArAutoCorrSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArCaliWaveSubsetCnv_p1_test SOURCES test/LArCaliWaveSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArCaliWaveSubsetCnv_p2_test SOURCES test/LArCaliWaveSubsetCnv_p2_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArDSPThresholdsSubsetCnv_p1_test SOURCES test/LArDSPThresholdsSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArMphysOverMcalSubsetCnv_p1_test SOURCES test/LArMphysOverMcalSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArOFCBinSubsetCnv_p1_test SOURCES test/LArOFCBinSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArPedestalMCCnv_p1_test SOURCES test/LArPedestalMCCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArPedestalSubsetCnv_p1_test SOURCES test/LArPedestalSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArPedestalSubsetCnv_p2_test SOURCES test/LArPedestalSubsetCnv_p2_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArPhysWaveSubsetCnv_p1_test SOURCES test/LArPhysWaveSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArRampSubsetCnv_p1_test SOURCES test/LArRampSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArShapeSubsetCnv_p1_test SOURCES test/LArShapeSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArShapeSubsetCnv_p2_test SOURCES test/LArShapeSubsetCnv_p2_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) atlas_add_test( LArSingleFloatSubsetCnv_p1_test SOURCES test/LArSingleFloatSubsetCnv_p1_test.cxx - LINK_LIBRARIES LArCondTPCnv ) + LINK_LIBRARIES GaudiKernel LArCondTPCnv TestTools ) diff --git a/LArCalorimeter/LArCnv/LArIdCnv/CMakeLists.txt b/LArCalorimeter/LArCnv/LArIdCnv/CMakeLists.txt index e70f6268749ddf889caf0b3b43a047e1f6b67d22..7bf3ec8fd4d72f029af108a4cc9f7e2a6a2b632c 100644 --- a/LArCalorimeter/LArCnv/LArIdCnv/CMakeLists.txt +++ b/LArCalorimeter/LArCnv/LArIdCnv/CMakeLists.txt @@ -1,27 +1,12 @@ -################################################################################ -# Package: LArIdCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArIdCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - DetectorDescription/DetDescrCnvSvc - PRIVATE - Calorimeter/CaloIdentifier - Control/StoreGate - DetectorDescription/IdDictDetDescr - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArIdentifier ) - # Component(s) in the package: atlas_add_component( LArIdCnv src/*.cxx - LINK_LIBRARIES DetDescrCnvSvcLib CaloIdentifier StoreGateLib SGtests IdDictDetDescr Identifier GaudiKernel LArIdentifier ) + LINK_LIBRARIES DetDescrCnvSvcLib CaloIdentifier StoreGateLib IdDictDetDescr Identifier GaudiKernel LArIdentifier ) # Install files from the package: -atlas_install_headers( LArIdCnv ) atlas_install_joboptions( share/*.py ) - diff --git a/LArCalorimeter/LArCnv/LArSimEventTPCnv/CMakeLists.txt b/LArCalorimeter/LArCnv/LArSimEventTPCnv/CMakeLists.txt index 76526fcf1dd8c529ab9c0df23da38b55217e58bf..b8f33c2cd49e77a4ffb0544f7dd78e0ee9217e1d 100644 --- a/LArCalorimeter/LArCnv/LArSimEventTPCnv/CMakeLists.txt +++ b/LArCalorimeter/LArCnv/LArSimEventTPCnv/CMakeLists.txt @@ -1,73 +1,48 @@ -################################################################################ -# Package: LArSimEventTPCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArSimEventTPCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Database/AthenaPOOL/AthenaPoolCnvSvc - LArCalorimeter/LArSimEvent - PRIVATE - AtlasTest/TestTools - Calorimeter/CaloIdentifier - Control/AthenaKernel - Control/StoreGate - DetectorDescription/IdDictParser - DetectorDescription/Identifier ) - -# External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - # Component(s) in the package: atlas_add_tpcnv_library( LArSimEventTPCnv src/*.cxx PUBLIC_HEADERS LArSimEventTPCnv - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArSimEvent TestTools CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser Identifier ) + LINK_LIBRARIES AthenaPoolCnvSvcLib LArSimEvent + PRIVATE_LINK_LIBRARIES AthenaKernel CaloIdentifier GaudiKernel Identifier StoreGateLib ) atlas_add_dictionary( LArSimEventTPCnvDict LArSimEventTPCnv/LArSimEventTPCnvDict.h LArSimEventTPCnv/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArSimEvent TestTools CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser Identifier LArSimEventTPCnv ) + LINK_LIBRARIES LArSimEventTPCnv ) atlas_add_dictionary( OLD_LArSimEventTPCnvDict LArSimEventTPCnv/LArSimEventTPCnvDict.h LArSimEventTPCnv/OLD_selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArSimEvent TestTools CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser Identifier LArSimEventTPCnv ) + LINK_LIBRARIES LArSimEventTPCnv ) atlas_add_test( LArHitCnv_p1_test SOURCES test/LArHitCnv_p1_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArSimEvent TestTools CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser Identifier LArSimEventTPCnv ) + LINK_LIBRARIES LArSimEventTPCnv TestTools ) atlas_add_test( LArHitContainerCnv_p1_test SOURCES test/LArHitContainerCnv_p1_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArSimEvent TestTools CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser Identifier LArSimEventTPCnv ) + LINK_LIBRARIES LArSimEventTPCnv TestTools ) atlas_add_test( LArHitContainerCnv_p2_test SOURCES test/LArHitContainerCnv_p2_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArSimEvent TestTools CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser Identifier LArSimEventTPCnv + LINK_LIBRARIES CaloIdentifier IdDictParser LArSimEventTPCnv StoreGateLib TestTools ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share" ) atlas_add_test( LArHitFloatCnv_p1_test SOURCES test/LArHitFloatCnv_p1_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArSimEvent TestTools CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser Identifier LArSimEventTPCnv ) + LINK_LIBRARIES LArSimEventTPCnv TestTools ) atlas_add_test( LArHitFloatContainerCnv_p2_test SOURCES test/LArHitFloatContainerCnv_p2_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArSimEvent TestTools CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser Identifier LArSimEventTPCnv + LINK_LIBRARIES CaloIdentifier IdDictParser LArSimEventTPCnv StoreGateLib TestTools ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share" ) - diff --git a/LArCalorimeter/LArCnv/LArTPCnv/CMakeLists.txt b/LArCalorimeter/LArCnv/LArTPCnv/CMakeLists.txt index 860e72a1a086949eedeb43aced71b114aca89317..f704ffd5411524a284200ee95ff95683faf5ba4f 100644 --- a/LArCalorimeter/LArCnv/LArTPCnv/CMakeLists.txt +++ b/LArCalorimeter/LArCnv/LArTPCnv/CMakeLists.txt @@ -1,101 +1,71 @@ -################################################################################ -# Package: LArTPCnv -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArTPCnv ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Database/AthenaPOOL/AthenaPoolCnvSvc - LArCalorimeter/LArRawEvent - LArCalorimeter/LArRecEvent - Control/CxxUtils - PRIVATE - AtlasTest/TestTools - Calorimeter/CaloIdentifier - Control/AthenaKernel - DetectorDescription/Identifier ) - -# External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - # Component(s) in the package: atlas_add_tpcnv_library( LArTPCnv src/*.cxx PUBLIC_HEADERS LArTPCnv - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier ) + LINK_LIBRARIES AthenaPoolCnvSvcLib CxxUtils Identifier LArRawEvent LArRecEvent + PRIVATE_LINK_LIBRARIES AthenaKernel CaloIdentifier GaudiKernel LArIdentifier ) atlas_add_dictionary( LArTPCnvDict LArTPCnv/LArTPCnvDict.h LArTPCnv/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES LArTPCnv ) atlas_add_dictionary( OLD_LArTPCnvDict LArTPCnv/LArTPCnvDict.h LArTPCnv/OLD_selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES LArTPCnv ) atlas_add_test( LArDigitContainerCnv_p1_test SOURCES test/LArDigitContainerCnv_p1_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) atlas_add_test( LArFebErrorSummaryCnv_p1_test SOURCES test/LArFebErrorSummaryCnv_p1_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) atlas_add_test( LArNoisyROSummaryCnv_p1_test SOURCES test/LArNoisyROSummaryCnv_p1_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) atlas_add_test( LArNoisyROSummaryCnv_p2_test SOURCES test/LArNoisyROSummaryCnv_p2_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) atlas_add_test( LArNoisyROSummaryCnv_p3_test SOURCES test/LArNoisyROSummaryCnv_p3_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) atlas_add_test( LArNoisyROSummaryCnv_p4_test SOURCES test/LArNoisyROSummaryCnv_p4_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) atlas_add_test( LArNoisyROSummaryCnv_p5_test SOURCES test/LArNoisyROSummaryCnv_p5_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) atlas_add_test( LArRawChannelCnv_p2_test SOURCES test/LArRawChannelCnv_p2_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) atlas_add_test( LArRawChannelContainerCnv_p4_test SOURCES test/LArRawChannelContainerCnv_p4_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) atlas_add_test( LArLATOMEHeaderContainerCnv_p1_test SOURCES test/LArLATOMEHeaderContainerCnv_p1_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv ) - + LINK_LIBRARIES GaudiKernel LArTPCnv TestTools ) diff --git a/LArCalorimeter/LArConfiguration/python/LArMonitoringConfig.py b/LArCalorimeter/LArConfiguration/python/LArMonitoringConfig.py index d884891989439bcc4cf39c7f084a620b2e59fb51..d5c8d636413b540d922bf0bb613bea008839cbbf 100644 --- a/LArCalorimeter/LArConfiguration/python/LArMonitoringConfig.py +++ b/LArCalorimeter/LArConfiguration/python/LArMonitoringConfig.py @@ -12,6 +12,8 @@ def LArMonitoringConfig(inputFlags): from LArMonitoring.LArNoisyROMonAlg import LArNoisyROMonConfig from LArMonitoring.LArFEBMonAlg import LArFEBMonConfig from LArMonitoring.LArHVCorrMonAlg import LArHVCorrMonConfig + from LArMonitoring.LArCoverageAlg import LArCoverageConfig + from LArMonitoring.LArNoiseCorrelationMonAlg import LArNoiseCorrelationMonConfig from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator acc = ComponentAccumulator() @@ -35,6 +37,8 @@ def LArMonitoringConfig(inputFlags): acc.merge(LArFEBMonConfig(inputFlags)) acc.merge(LArDigitMonConfig(inputFlags)) acc.merge(LArRODMonConfig(inputFlags)) + acc.merge(LArCoverageConfig(inputFlags)) + acc.merge(LArNoiseCorrelationMonConfig(inputFlags)) return acc diff --git a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArCellConditionsAlg.py b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArCellConditionsAlg.py index f677055139d9f8cd3e074f9070269b4d78b64cdb..6f221c59fa7a21ef044cc0ee37e6491d6e4e71fe 100644 --- a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArCellConditionsAlg.py +++ b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArCellConditionsAlg.py @@ -80,18 +80,6 @@ class LArCellConditionsAlg(PyAthena.Alg): self.msg.error("Failed to get CaloCell_ID") return StatusCode.Failure - - # ----------------------------------------------------------- - # Initialize LArCabling service - self.larCablingSvc=PyAthena.py_tool("LArCablingLegacyService") - if self.larCablingSvc is None: - self.msg.error('Problem retrieving LArCablingService pointer !') - return StatusCode.Failure - else: - self.msg.info('retrieved [%s]', self.larCablingSvc.name()) - - - self.bc_packing=LArBadChanBitPacking() self.noisepattern=0 @@ -130,13 +118,28 @@ class LArCellConditionsAlg(PyAthena.Alg): def execute(self): self.msg.info('running execute...') - #for some obscure reason, we need run dump before we can retrieve the flat objects using their abstract interface - garbagedump = open("sgdump.txt", 'w') - self._condStore.dump(garbagedump) - garbagedump.close() + #for debugging purposes: + #sgdump = open("sgdump.txt", 'w') + #self._condStore.dump(sgdump) + #sgdump.close() eid=ROOT.Gaudi.Hive.currentContext().eventID() + try: + condCont=self._condStore.retrieve("CondCont<LArOnOffIdMapping>","LArOnOffIdMap") + self.larCabling=condCont.find(eid) + except Exception: + print("ERROR, failed to get LArCabling") + return StatusCode.Failure + + + try: + condCont=self._condStore.retrieve("CondCont<LArBadChannelCont>","LArBadChannel") + self.badChannels=condCont.find(eid) + except Exception: + print("ERROR, failed to get LArBadChannels") + return StatusCode.Failure + if self.includeConditions: try: condCont=self._condStore.retrieve("CondCont<ILArPedestal>","LArPedestal") @@ -240,9 +243,9 @@ class LArCellConditionsAlg(PyAthena.Alg): t_int=int(rep,10) t=Identifier(c_uint(t_int)) if self.onlineID.is_lar(t): - print(t," IsLAr (online)") + print(t.get_identifier32().get_compact()," IsLAr (online)") if self.offlineID.is_lar(t): - print(t," isLAr (offline)") + print(t.get_identifier32().getCompact()," isLAr (offline)") except: pass @@ -255,7 +258,7 @@ class LArCellConditionsAlg(PyAthena.Alg): if s==-1:s=0 chid=self.getOnlineIDFromString(rep[s:]) if chid is not None and self.onlineID.is_lar(chid): - id=self.larCablingSvc.cnvToIdentifier(chid) + id=self.larCabling.cnvToIdentifier(chid) if id is None: id=self.noid self.printChannelInfo(id,chid) else: @@ -268,7 +271,7 @@ class LArCellConditionsAlg(PyAthena.Alg): if s==-1:s=0 id=self.getOfflineIDFromString(rep[s:]) if id is not None and self.offlineID.is_lar(id): - chid=self.larCablingSvc.createSignalChannelID(id) + chid=self.larCabling.createSignalChannelID(id) self.printChannelInfo(id,chid) else: print("ERROR: Could not interpret input.") @@ -278,11 +281,11 @@ class LArCellConditionsAlg(PyAthena.Alg): #Try to interpet input as identifiers chid=self.getOnlineIDFromString(rep) if chid is not None and self.onlineID.is_lar(chid): - id=self.larCablingSvc.cnvToIdentifier(chid) + id=self.larCabling.cnvToIdentifier(chid) else: #try interpret at offline ID id=self.getOfflineIDFromString(rep) if id is not None and self.offlineID.is_lar(id): - chid=self.larCablingSvc.createSignalChannelID(id) + chid=self.larCabling.createSignalChannelID(id) if chid is None or id is None: print( "ERROR: Could not interpret input.") @@ -295,7 +298,8 @@ class LArCellConditionsAlg(PyAthena.Alg): return StatusCode.Success def printChannelInfo(self,id,chid): - print(self.IdentifiersToString(chid,id)) + bc=self.badChannels.status(chid) + print(self.IdentifiersToString(chid,id)+ " " + self.bc_packing.stringStatus(bc)) if id!=self.noid: #Don't try to show anything more for disconnected channels if self.includeLocation: try: @@ -331,8 +335,8 @@ class LArCellConditionsAlg(PyAthena.Alg): ped=-9999 pedRMS=-9999 - print ("Ped: %.3f " % ped,end="") - print ("PedRMS: %.3f" % pedRMS,end="") + print (" Ped: %.3f " % ped,end="") + print (" PedRMS: %.3f" % pedRMS,end="") if self.larRamp is not None: ramp=self.larRamp.ADC2DAC(chid,gain) @@ -348,7 +352,7 @@ class LArCellConditionsAlg(PyAthena.Alg): print (" MphysOverMcal: %.5f" % mpmc,end="") else: print (" MphysOverMcal: None",end="") - print (os.linesep) + print ("") if self.includeDSPTh: if self.larDSPThr is not None: tQThr=self.larDSPThr.tQThr(chid) @@ -412,7 +416,7 @@ class LArCellConditionsAlg(PyAthena.Alg): onlName+="FT "+str(ft)+"("+ftname+")/Slot "+str(slot)+"/Chan "+str(chan) try: - calibLines=self.larCablingSvc.calibSlotLine(chid); + calibLines=self.larCabling.calibSlotLine(chid); if (len(calibLines)): onlName+="/CL" for calib_chid in calibLines: @@ -714,7 +718,7 @@ class LArCellConditionsAlg(PyAthena.Alg): outfile=None layer=None cl=None - tbl=maketrans(",:;#="," "); + tbl=str.maketrans(",:;#="," "); tokens=[] for t in input.translate(tbl).split(): if len(t): @@ -811,7 +815,7 @@ class LArCellConditionsAlg(PyAthena.Alg): print("Unknown Keyword",tokens[i] ) i=i+1 - print("Searching for cells with",end="") + print("Searching for cells with ",end="") if eta is not None: print(" %.3f <= eta <= %.3f" % (eta[0],eta[1]),end="") if phi is not None: print(" %.3f <= phi <= %.3f" % (phi[0],phi[1]),end="") if layer is not None: print(" %.0f <= layer <= %.0f" % (layer[0],layer[1]),end="") @@ -855,9 +859,14 @@ class LArCellConditionsAlg(PyAthena.Alg): #for idH in range(self.offlineID.calo_cell_hash_max()): //This one includes also tile cells for idH in range(182468): idHash=IdentifierHash(idH) - chid=self.larCablingSvc.createSignalChannelIDFromHash(idHash) + chid=self.larCabling.createSignalChannelIDFromHash(idHash) #print ("Loop hash=%i , on: %x , off: %x" % (idH, chid.get_identifier32().get_compact(), self.offlineID.cell_id(idHash).get_identifier32().get_compact())) + #Check Bad-Channel Status + bcstat=self.badChannels.status(chid) + if bctypes!=0: + bcw=bcstat.packedData() + if bcw & bctypes == 0: continue #Check Online Id @@ -868,7 +877,7 @@ class LArCellConditionsAlg(PyAthena.Alg): if cl is not None: try: - calibLines=self.larCablingSvc.calibSlotLine(chid); + calibLines=self.larCabling.calibSlotLine(chid); keep=False for foundCLs in calibLines: if self.onlineID.channel(foundCLs) == cl: @@ -891,13 +900,13 @@ class LArCellConditionsAlg(PyAthena.Alg): p=theDDE.phi() if eta is not None and (e<eta[0] or e>eta[1]): continue if phi is not None and (p<phi[0] or p>phi[1]): continue - ep=" eta=%.3f phi=%.3f" % (e,p) + ep=" eta=%.3f phi=%.3f " % (e,p) id=self.offlineID.cell_id(idHash) if subcalo is not None and subcalo!=self.offlineID.sub_calo(id): continue if layer is not None and (self.offlineID.sampling(id)<layer[0] or self.offlineID.sampling(id)>layer[1]): continue - br=self.output(self.IdentifiersToString(chid,id) + " " +ep,outfile) + br=self.output(self.IdentifiersToString(chid,id) + " " +ep+self.bc_packing.stringStatus(bcstat),outfile) if br: break if outfile is not None: outfile.close() diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/CMakeLists.txt b/LArCalorimeter/LArExample/TestLArDetDescr/CMakeLists.txt index 49484db3737f4ff99ac9f1cd30b51f6a03831537..1335816c0a9692fe8c9ddaa795dfaa63a690b443 100644 --- a/LArCalorimeter/LArExample/TestLArDetDescr/CMakeLists.txt +++ b/LArCalorimeter/LArExample/TestLArDetDescr/CMakeLists.txt @@ -1,25 +1,10 @@ -################################################################################ -# Package: TestLArDetDescr -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TestLArDetDescr ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloDetDescr - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - GaudiKernel - PRIVATE - Calorimeter/CaloGeoHelpers - Calorimeter/CaloTTDetDescr - Calorimeter/CaloTrackingGeometry - Control/StoreGate - LArCalorimeter/LArIdentifier ) - # External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) +find_package( Boost ) find_package( CLHEP ) # Component(s) in the package: @@ -27,9 +12,7 @@ atlas_add_component( TestLArDetDescr src/*.cxx src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} CaloDetDescrLib CaloIdentifier AthenaBaseComps GaudiKernel CaloGeoHelpers CaloTTDetDescr StoreGateLib SGtests LArIdentifier CaloTrackingGeometryLib ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} CaloDetDescrLib CaloIdentifier AthenaBaseComps GaudiKernel CaloGeoHelpers CaloTTDetDescr StoreGateLib LArIdentifier CaloTrackingGeometryLib ) # Install files from the package: -atlas_install_headers( TestLArDetDescr ) atlas_install_joboptions( share/*.py ) - diff --git a/LArCalorimeter/LArExample/TestLArHardwareID/CMakeLists.txt b/LArCalorimeter/LArExample/TestLArHardwareID/CMakeLists.txt index 7af2ab21a883cdcfb9aba52a92859350e50b34de..3fead7162f2ddf4a8f59f88a629f7cb485c6cd0e 100644 --- a/LArCalorimeter/LArExample/TestLArHardwareID/CMakeLists.txt +++ b/LArCalorimeter/LArExample/TestLArHardwareID/CMakeLists.txt @@ -1,32 +1,13 @@ -################################################################################ -# Package: TestLArHardwareID -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TestLArHardwareID ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Database/RegistrationServices - GaudiKernel - PRIVATE - Calorimeter/CaloIdentifier - Calorimeter/CaloTriggerTool - Control/AthenaKernel - Control/StoreGate - LArCalorimeter/LArCabling - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRecConditions - Tools/PathResolver ) - # Component(s) in the package: atlas_add_component( TestLArHardwareID src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel CaloIdentifier CaloTriggerToolLib AthenaKernel StoreGateLib SGtests LArCablingLib LArIdentifier LArRecConditions PathResolver RegistrationServicesLib ) + LINK_LIBRARIES AthenaBaseComps GaudiKernel CaloIdentifier CaloTriggerToolLib AthenaKernel StoreGateLib LArCablingLib LArIdentifier LArRecConditions PathResolver RegistrationServicesLib ) # Install files from the package: -atlas_install_headers( TestLArHardwareID ) atlas_install_joboptions( share/*.py ) - diff --git a/LArCalorimeter/LArG4/LArG4FastSimulation/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4FastSimulation/CMakeLists.txt index 9a4ca1d4c7296dbdd90e4a8ce083689f2e8ea86a..2f5b3a2a49224c0eb908952cc131b024a836425b 100644 --- a/LArCalorimeter/LArG4/LArG4FastSimulation/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4FastSimulation/CMakeLists.txt @@ -1,43 +1,21 @@ -################################################################################ -# Package: LArG4FastSimulation -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArG4FastSimulation ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - GaudiKernel - PRIVATE - Control/StoreGate - DetectorDescription/GeoModel/GeoSpecialShapes - DetectorDescription/GeoPrimitives - LArCalorimeter/LArG4/LArG4Code - LArCalorimeter/LArG4/LArG4ShowerLibSvc - LArCalorimeter/LArGeoModel/LArReadoutGeometry - LArCalorimeter/LArSimEvent - Simulation/G4Atlas/G4AtlasTools - Generators/AtlasHepMC ) - # External dependencies: find_package( CLHEP ) find_package( Geant4 ) -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( XercesC ) find_package( GeoModelCore ) -# tag ROOTBasicLibs was not recognized in automatic conversion in cmt2cmake - -# tag ROOTSTLDictLibs was not recognized in automatic conversion in cmt2cmake - # Component(s) in the package: atlas_add_component( LArG4FastSimulation src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEOMODELCORE_LIBRARIES} GaudiKernel StoreGateLib SGtests GeoSpecialShapes LArG4Code LArReadoutGeometry LArSimEvent G4AtlasToolsLib GeoPrimitives LArG4ShowerLibSvcLib ) + INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEOMODELCORE_LIBRARIES} GaudiKernel StoreGateLib GeoSpecialShapes LArG4Code LArReadoutGeometry LArSimEvent G4AtlasToolsLib GeoPrimitives LArG4ShowerLibSvcLib ) # Install files from the package: -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) diff --git a/LArCalorimeter/LArG4/LArG4ShowerLibSvc/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4ShowerLibSvc/CMakeLists.txt index ef9f5753b1f8211ce8d92600042f6834928ca103..5158176b0d6277994f62de3de76b3824b043a711 100644 --- a/LArCalorimeter/LArG4/LArG4ShowerLibSvc/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4ShowerLibSvc/CMakeLists.txt @@ -1,25 +1,11 @@ -################################################################################ -# Package: LArG4ShowerLibSvc -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArG4ShowerLibSvc ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - GaudiKernel - LArCalorimeter/LArG4/LArG4Code - PRIVATE - Control/AthenaKernel - LArCalorimeter/LArG4/LArG4ShowerLib - Tools/PathResolver ) - # External dependencies: -find_package( CLHEP ) find_package( Geant4 ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) -find_package( XercesC ) atlas_add_library( LArG4ShowerLibSvcLib LArG4ShowerLibSvc/*.h @@ -31,10 +17,10 @@ atlas_add_library( LArG4ShowerLibSvcLib atlas_add_component( LArG4ShowerLibSvc src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} LArG4ShowerLibSvcLib AthenaKernel LArG4ShowerLib PathResolver ) + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${GEANT4_LIBRARIES} LArG4ShowerLibSvcLib AthenaKernel LArG4ShowerLib PathResolver ) # 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 ) diff --git a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/CMakeLists.txt b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/CMakeLists.txt index 0a32bde9c9c0b55004324d745f30b4f6050ba899..3be7778afb9deb7c7faba2df91fe5eabb5046c78 100644 --- a/LArCalorimeter/LArG4TB/LArG4TBSimEvent/CMakeLists.txt +++ b/LArCalorimeter/LArG4TB/LArG4TBSimEvent/CMakeLists.txt @@ -1,32 +1,20 @@ -################################################################################ -# Package: LArG4TBSimEvent -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArG4TBSimEvent ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaKernel - Simulation/HitManagement ) - # External dependencies: find_package( CLHEP ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_library( LArG4TBSimEvent src/*.cxx PUBLIC_HEADERS LArG4TBSimEvent INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel HitManagement - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel HitManagement ) atlas_add_dictionary( LArG4TBSimEventDict LArG4TBSimEvent/LArG4TBSimEventDict.h LArG4TBSimEvent/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} HitManagement LArG4TBSimEvent ) - + LINK_LIBRARIES LArG4TBSimEvent ) diff --git a/LArCalorimeter/LArG4TB/LArG4TBSimEventAthenaPool/CMakeLists.txt b/LArCalorimeter/LArG4TB/LArG4TBSimEventAthenaPool/CMakeLists.txt index 62054562af64b4bca405aab96773ddcd92f2c980..a0ff8c5dda47812d673451ed6a80fbe1001d3062 100644 --- a/LArCalorimeter/LArG4TB/LArG4TBSimEventAthenaPool/CMakeLists.txt +++ b/LArCalorimeter/LArG4TB/LArG4TBSimEventAthenaPool/CMakeLists.txt @@ -1,17 +1,8 @@ -################################################################################ -# Package: LArG4TBSimEventAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArG4TBSimEventAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Database/AthenaPOOL/AthenaPoolUtilities - PRIVATE - Database/AthenaPOOL/AthenaPoolCnvSvc - LArCalorimeter/LArG4TB/LArG4TBSimEvent ) - # Component(s) in the package: atlas_add_poolcnv_library( LArG4TBSimEventAthenaPoolPoolCnv src/*.cxx diff --git a/LArCalorimeter/LArIdentifier/CMakeLists.txt b/LArCalorimeter/LArIdentifier/CMakeLists.txt index 696ba6bdc47961182169d66f223f060b90ac0557..75f9a77f4621d56bbb25abcf1b773274f6f16228 100644 --- a/LArCalorimeter/LArIdentifier/CMakeLists.txt +++ b/LArCalorimeter/LArIdentifier/CMakeLists.txt @@ -1,46 +1,28 @@ -################################################################################ -# Package: LArIdentifier -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArIdentifier ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaKernel - DetectorDescription/AtlasDetDescr - DetectorDescription/IdDict - DetectorDescription/Identifier - PRIVATE - Calorimeter/CaloIdentifier - Control/StoreGate - DetectorDescription/IdDictParser - GaudiKernel ) - # External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) +find_package( Boost ) # Component(s) in the package: atlas_add_library( LArIdentifier src/*.cxx PUBLIC_HEADERS LArIdentifier - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES AthenaKernel AtlasDetDescr IdDict Identifier StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CaloIdentifier AthenaKernel IdDictParser GaudiKernel ) + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} AthenaKernel AtlasDetDescr IdDict Identifier StoreGateLib + PRIVATE_LINK_LIBRARIES CaloIdentifier GaudiKernel ) atlas_add_dictionary( LArIdentifierDict LArIdentifier/LArIdentifierDict.h LArIdentifier/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasDetDescr IdDict Identifier CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser GaudiKernel LArIdentifier ) + LINK_LIBRARIES LArIdentifier ) atlas_add_executable( test_laronlineid test/test_laronlineid.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasDetDescr IdDict Identifier CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser GaudiKernel LArIdentifier ) + LINK_LIBRARIES GaudiKernel IdDictParser LArIdentifier ) atlas_add_executable( test_larhvid test/test_larhvid.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasDetDescr IdDict Identifier CaloIdentifier AthenaKernel StoreGateLib SGtests IdDictParser GaudiKernel LArIdentifier ) - + LINK_LIBRARIES GaudiKernel IdDictParser LArIdentifier ) diff --git a/LArCalorimeter/LArL1Sim/CMakeLists.txt b/LArCalorimeter/LArL1Sim/CMakeLists.txt index 7352e14a1c25284698654548105ad432c3e0d594..92691271c225c79f3fa616e075c590b861dfd2f2 100644 --- a/LArCalorimeter/LArL1Sim/CMakeLists.txt +++ b/LArCalorimeter/LArL1Sim/CMakeLists.txt @@ -1,46 +1,20 @@ -################################################################################ -# Package: LArL1Sim -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArL1Sim ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthAllocators - Control/AthenaBaseComps - GaudiKernel - LArCalorimeter/LArDigitization - LArCalorimeter/LArElecCalib - PRIVATE - Calorimeter/CaloDetDescr - Calorimeter/CaloEvent - Calorimeter/CaloIdentifier - Calorimeter/CaloTriggerTool - Control/AthenaKernel - Control/StoreGate - DetectorDescription/GeoModel/GeoModelInterfaces - Event/EventInfo - LArCalorimeter/LArCabling - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawEvent - LArCalorimeter/LArSimEvent - Tools/PathResolver ) - # External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) find_package( CLHEP ) # Component(s) in the package: atlas_add_component( LArL1Sim src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} AthAllocators AthenaBaseComps GaudiKernel LArDigitizationLib CaloDetDescrLib CaloEvent CaloIdentifier CaloTriggerToolLib AthenaKernel StoreGateLib SGtests EventInfo LArCablingLib LArIdentifier LArRawEvent LArSimEvent PathResolver ) + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthAllocators AthenaBaseComps GaudiKernel GeoModelInterfaces LArDigitizationLib CaloDetDescrLib CaloEvent CaloIdentifier CaloTriggerToolLib AthenaKernel StoreGateLib EventInfo LArCablingLib LArElecCalib LArIdentifier LArRawEvent LArSimEvent PathResolver ) # Install files from the package: -atlas_install_headers( LArL1Sim ) -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) atlas_install_runtime( share/Fcal_ptweights_table7.data ) diff --git a/LArCalorimeter/LArL1Sim/python/LArSCL1Getter.py b/LArCalorimeter/LArL1Sim/python/LArSCL1Getter.py index e5e7b1a5efb79882c4355b4b15be10bfd5abcd3e..235f308732c8b95e13184f06ae6053b5dec7701d 100644 --- a/LArCalorimeter/LArL1Sim/python/LArSCL1Getter.py +++ b/LArCalorimeter/LArL1Sim/python/LArSCL1Getter.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # LArSCL1 creation from LArHits with LArSCL1Maker algorithm @@ -19,7 +19,7 @@ class LArSCL1Getter ( Configured ) : try: from LArL1Sim.LArSCL1Getter import LArSCL1Getter theLArSCL1Getter=LArSCL1Getter() - except: + except Exception: mlog.error("could not get handle to LArSCL1Getter Quit") traceback.print_exc() return False @@ -34,7 +34,7 @@ class LArSCL1Getter ( Configured ) : # Instantiation of the C++ algorithm try: from LArL1Sim.LArL1SimConf import LArSCL1Maker - except: + except Exception: mlog.error("could not import LArL1Sim.LArSCL1Maker") traceback.print_exc() return False @@ -53,13 +53,12 @@ class LArSCL1Getter ( Configured ) : theLArSCL1Maker.SCL1ContainerName = "LArDigitSCL1" - self._LArSCL1Maker = theLArSCL1Maker ; + self._LArSCL1Maker = theLArSCL1Maker from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() # check if LArdigitization is run before. If yes, uses hit map from detector store produces from lardigitization - from Digitization.DigitizationFlags import jobproperties from AthenaCommon.DetFlags import DetFlags if DetFlags.digitize.LAr_on(): mlog.info("Using hit map from LArDigitMaker algoritm") diff --git a/LArCalorimeter/LArL1Sim/python/LArTTL1Getter.py b/LArCalorimeter/LArL1Sim/python/LArTTL1Getter.py index 16c380d2fd574df2127dbb8ed8906e849883b498..b3a48e1d73e8fa204e6ee5f4d65366cedf7170fc 100644 --- a/LArCalorimeter/LArL1Sim/python/LArTTL1Getter.py +++ b/LArCalorimeter/LArL1Sim/python/LArTTL1Getter.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Author: F. Ledroit (ledroit@lpsc.in2p3.fr) # LArTTL1 creation from LArHits with LArTTL1Maker algorithm @@ -20,7 +20,7 @@ class LArTTL1Getter ( Configured ) : try: from LArL1Sim.LArTTL1Getter import LArTTL1Getter theLArTTL1Getter=LArTTL1Getter() - except: + except Exception: mlog.error("could not get handle to LArTTL1Getter Quit") traceback.print_exc() return False @@ -35,13 +35,13 @@ class LArTTL1Getter ( Configured ) : # Instantiation of the C++ algorithm try: from LArL1Sim.LArL1SimConf import LArTTL1Maker - except: + except Exception: mlog.error("could not import LArL1Sim.LArTTL1Maker") traceback.print_exc() return False theLArTTL1Maker=LArTTL1Maker() - self._LArTTL1Maker = theLArTTL1Maker ; + self._LArTTL1Maker = theLArTTL1Maker # Configure LArTTL1Maker here #theLArTTL1Maker.SubDetectors="LAr_All" @@ -74,7 +74,6 @@ class LArTTL1Getter ( Configured ) : topSequence = AlgSequence() # check if LArdigitization is run before. If yes, uses hit map from detector store produces from lardigitization - from Digitization.DigitizationFlags import jobproperties from AthenaCommon.DetFlags import DetFlags if DetFlags.digitize.LAr_on(): mlog.info("Using hit map from LArDigitMaker algoritm") diff --git a/LArCalorimeter/LArMonitoring/CMakeLists.txt b/LArCalorimeter/LArMonitoring/CMakeLists.txt index 31507db6ee03aef44b8c5267f7bcd00a0fe686a8..2a72080d09e944a4404e94f18222e864231fd38c 100644 --- a/LArCalorimeter/LArMonitoring/CMakeLists.txt +++ b/LArCalorimeter/LArMonitoring/CMakeLists.txt @@ -1,40 +1,20 @@ -################################################################################ -# Package: LArMonitoring -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArMonitoring ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloDetDescr - Calorimeter/CaloGeoHelpers - Calorimeter/CaloIdentifier - Calorimeter/CaloInterface - Control/AthenaMonitoring - DetectorDescription/Identifier - Event/EventContainers - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawEvent - LArCalorimeter/LArRecConditions - LArCalorimeter/LArCabling - Trigger/TrigAnalysis/TrigDecisionTool - PRIVATE - Calorimeter/CaloConditions - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODEventInfo - Trigger/TrigAnalysis/TrigAnalysisInterfaces - LArCalorimeter/LArCOOLConditions - LArCalorimeter/LArRawConditions - LArCalorimeter/LArRecEvent ) - # External dependencies: find_package( Boost COMPONENTS filesystem thread system ) find_package( CLHEP ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 ) +atlas_add_library( LArStrHelper + src/LArStrHelper.cxx LArMonitoring/LArStrHelper.h + PUBLIC_HEADERS LArMonitoring + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES}) + + # Component(s) in the package: atlas_add_component( LArMonitoring src/*.cxx @@ -42,7 +22,12 @@ atlas_add_component( LArMonitoring INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} CaloDetDescrLib CaloGeoHelpers CaloIdentifier AthenaMonitoringLib SGtests Identifier LArIdentifier LArRawEvent LArRecConditions LArCablingLib TrigDecisionToolLib CaloConditions AthenaKernel AthenaPoolUtilities xAODEventInfo LArCOOLConditions LArRawConditions LArRecEvent ) +atlas_add_dictionary( LArStrHelperDict + LArMonitoring/LArStrHelperDict.h + LArMonitoring/selection.xml + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} LArStrHelper) + # Install files from the package: -atlas_install_python_modules( python/*.py - POST_BUILD_CMD ${ATLAS_FLAKE8} ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.txt share/*.py ) diff --git a/LArCalorimeter/LArMonitoring/LArMonitoring/LArStrHelper.h b/LArCalorimeter/LArMonitoring/LArMonitoring/LArStrHelper.h new file mode 100644 index 0000000000000000000000000000000000000000..339ed44625c8891ea23b556ca91476f6b1a5d4e7 --- /dev/null +++ b/LArCalorimeter/LArMonitoring/LArMonitoring/LArStrHelper.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/** + * @class LArStrHelper + * @author Margherita Spalla <margherita.spalla@cern.ch> + * @date 30-September-2020 + * @brief Helper class to manipulate strings for LArOnlineID names + * + * Helper class to manipulate strings for LArOnlineID names: + * Since most of the naming is done at python level in AthenaMT, we only add strictly needed functions. + * For now, it just contains the FEB naming scheme used by LArNoiseCorrelations. */ + + + +#ifndef LARMONITORING_LARSTRHELPER_H +#define LARMONITORING_LARSTRHELPER_H + + +#include "TString.h" + +class LArStrHelper +{ + public: + + /** @brief constructructor */ + LArStrHelper() {}; + + /** @brief default destructor */ + ~LArStrHelper() {}; + + /** FEB names */ + std::string febNameString(bool,int,int,int) const; + std::string fixFEBname(TString) const; +}; + + + +#endif diff --git a/LArCalorimeter/LArMonitoring/LArMonitoring/LArStrHelperDict.h b/LArCalorimeter/LArMonitoring/LArMonitoring/LArStrHelperDict.h new file mode 100644 index 0000000000000000000000000000000000000000..6716654427119c4f7b7c081bd29c85d6479501b7 --- /dev/null +++ b/LArCalorimeter/LArMonitoring/LArMonitoring/LArStrHelperDict.h @@ -0,0 +1,8 @@ + +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/** We need a dictionary, to be able to use the helper from python config */ + +#include "LArMonitoring/LArStrHelper.h" diff --git a/LArCalorimeter/LArMonitoring/LArMonitoring/selection.xml b/LArCalorimeter/LArMonitoring/LArMonitoring/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..54dfc20c8169758688c61e2384cbe9251c95ae99 --- /dev/null +++ b/LArCalorimeter/LArMonitoring/LArMonitoring/selection.xml @@ -0,0 +1,5 @@ +<lcgdict> + + <class name="LArStrHelper" /> + +</lcgdict> diff --git a/LArCalorimeter/LArMonitoring/python/GlobalVariables.py b/LArCalorimeter/LArMonitoring/python/GlobalVariables.py index 7efc51677dc39c81477ad5abddb8876170bbd3a8..9a9eaece64a12f0a3af5a5b490fa820ca5594a37 100644 --- a/LArCalorimeter/LArMonitoring/python/GlobalVariables.py +++ b/LArCalorimeter/LArMonitoring/python/GlobalVariables.py @@ -5,6 +5,13 @@ from __future__ import print_function from ROOT import TMath import AthenaCommon.SystemOfUnits as Units +#import cppyy +#cppyy.load_library("libLArStrHelperDict") +#import LArStrHelper +#import ROOT +#ROOT.gROOT.GetClass('LArStrHelper::febNameString') +from ROOT import LArStrHelper + class LArDQGlobals(object): __slots__ = ('HVeta_EMB','HVphi_EMB','HVeta_EMEC','HVphi_EMEC','HVeta_HECFcal','HVphi_HECFcal', 'LB_Bins','LB_Min','LB_Max','BCID_Bins','BCID_Min','BCID_Max', @@ -30,8 +37,9 @@ class LArDQGlobals(object): 'Cell_Time_Min','Cell_Time_Max','Emin','Emax','DEmin','DEmax','Qmin','Qmax','DQmin','DQmax', 'Tmin','Tmax','DTmin','DTmax','OnlineOffline','TTriggerTypeMax','MaxCellThresholdADC', 'CorruptionSource','Streams', - 'Partitions','Sides','Variables','Layers','Cell_Variables') - + 'Partitions','Sides','Variables','Layers','Cell_Variables', + 'febsBarrelA','febsEndcapA','febsBarrelC','febsEndcapC') + lArDQGlobals = LArDQGlobals() @@ -112,6 +120,25 @@ range_0_25=range(25) range_1_16=range(1,16) lArDQGlobals.Feedthrough_Slot_labels_Endcap=[str(If) if Is==1 else '' for If in range_0_25 for Is in range_1_16] +#feedthrough+slot ranges for noise correlation plots +lArDQGlobals.Sides=["A","C"] + + +#numbers from LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.h +#feedthroughString="ft" +#slotString="slot" +#barrelString="Barrel" +#endcapString="Endcap" +larStrHelp=LArStrHelper() +lArDQGlobals.febsBarrelA=[larStrHelp.febNameString(True,1,i_ft,i_slot) for i_ft in range_0_32 for i_slot in range_1_15] +lArDQGlobals.febsBarrelC=[larStrHelp.febNameString(True,0,i_ft,i_slot) for i_ft in range_0_32 for i_slot in range_1_15] +lArDQGlobals.febsEndcapA=[larStrHelp.febNameString(False,1,i_ft,i_slot) for i_ft in range_0_25 for i_slot in range_1_16] +lArDQGlobals.febsEndcapC=[larStrHelp.febNameString(False,0,i_ft,i_slot) for i_ft in range_0_25 for i_slot in range_1_16] +#lArDQGlobals.febsBarrelA=[barrelString+"A"+feedthroughString+str(i_ft).zfill(2)+slotString+str(i_slot).zfill(2) for i_ft in range_0_32 for i_slot in range_1_15] +#lArDQGlobals.febsBarrelC=[barrelString+"C"+feedthroughString+str(i_ft).zfill(2)+slotString+str(i_slot).zfill(2) for i_ft in range_0_32 for i_slot in range_1_15] +#lArDQGlobals.febsEndcapA=[endcapString+"A"+feedthroughString+str(i_ft).zfill(2)+slotString+str(i_slot).zfill(2) for i_ft in range_0_25 for i_slot in range_1_16] +#lArDQGlobals.febsEndcapC=[endcapString+"C"+feedthroughString+str(i_ft).zfill(2)+slotString+str(i_slot).zfill(2) for i_ft in range_0_25 for i_slot in range_1_16] + #ROD ranges lArDQGlobals.ROD_Crates={"EMBA":[1,4],"EMBC":[1,4],"EMECA":[1,3],"EMECC":[1,3],"HECA":[1],"HECC":[1],"FCalA":[1],"FCalC":[1]} @@ -250,7 +277,6 @@ lArDQGlobals.Gains=["Low Gain","Medium Gain","High Gain"] #Creation of the dictionnary lArDQGlobals.Cell_Variables={} -lArDQGlobals.Sides=["A","C"] lArDQGlobals.Variables=["etaRange","phiRange","etaNbin", "phiNbin","etasize","etaCellSize","etaMin"] lArDQGlobals.Layers=["0","1","2","3"] for Variable in lArDQGlobals.Variables : diff --git a/LArCalorimeter/LArMonitoring/python/LArAffectedRegionsAlg.py b/LArCalorimeter/LArMonitoring/python/LArAffectedRegionsAlg.py index 8db75938f1fc788ac12c54086ebe12d2aa0fa69c..5f2d78af2527c6402d067b0e4c1b98c869a54e8d 100644 --- a/LArCalorimeter/LArMonitoring/python/LArAffectedRegionsAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArAffectedRegionsAlg.py @@ -48,7 +48,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): from LArMonitoring.GlobalVariables import lArDQGlobals #to define the ranges - larAffReg_hist_path='AffectedRegionsNewAlg/' #histogram path + larAffReg_hist_path='AffectedRegions/' #histogram path #EMBPS @@ -61,7 +61,8 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupEMBPS.defineHistogram('etaPOS,phi;LArAffectedRegionsEMBAPS', + + affectedRegGroupEMBPS.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsEMBAPS', title='HV Affected Regions - EMBA - Presampler;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -70,7 +71,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_EMB["EMBAPS"][0],ymin=lArDQGlobals.HVphi_EMB["EMBAPS"][1],ymax=lArDQGlobals.HVphi_EMB["EMBAPS"][2], merge='weightedAverage' ) - affectedRegGroupEMBPS.defineHistogram('etaNEG,phi;LArAffectedRegionsEMBCPS', + affectedRegGroupEMBPS.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsEMBCPS', title='HV Affected Regions - EMBC - Presampler;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -91,7 +92,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupEMB.defineHistogram('etaPOS,phi;LArAffectedRegionsEMBA', + affectedRegGroupEMB.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsEMBA', title='HV Affected Regions - EMBA - Samplings 1-3;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -100,7 +101,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_EMB["EMBA"][0],ymin=lArDQGlobals.HVphi_EMB["EMBA"][1],ymax=lArDQGlobals.HVphi_EMB["EMBA"][2], merge='weightedAverage' ) - affectedRegGroupEMB.defineHistogram('etaNEG,phi;LArAffectedRegionsEMBC', + affectedRegGroupEMB.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsEMBC', title='HV Affected Regions - EMBC - Samplings 1-3;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -121,7 +122,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupEMECPS.defineHistogram('etaPOS,phi;LArAffectedRegionsEMECAPS', + affectedRegGroupEMECPS.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsEMECAPS', title='HV Affected Regions - EMECA - Presampler;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -130,7 +131,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_EMEC["EMECAPS"], merge='weightedAverage' ) - affectedRegGroupEMECPS.defineHistogram('etaNEG,phi;LArAffectedRegionsEMECCPS', + affectedRegGroupEMECPS.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsEMECCPS', title='HV Affected Regions - EMECC - Presampler;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -151,7 +152,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupEMEC.defineHistogram('etaPOS,phi;LArAffectedRegionsEMECA', + affectedRegGroupEMEC.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsEMECA', title='HV Affected Regions - EMECA - Samplings 1-3;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -160,7 +161,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_EMEC["EMECA"], merge='weightedAverage' ) - affectedRegGroupEMEC.defineHistogram('etaNEG,phi;LArAffectedRegionsEMECC', + affectedRegGroupEMEC.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsEMECC', title='HV Affected Regions - EMECC - Samplings 1-3;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -181,7 +182,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupHEC0.defineHistogram('etaPOS,phi;LArAffectedRegionsHECA0', + affectedRegGroupHEC0.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsHECA0', title='HV Affected Regions - HECA - Layer 1;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -190,7 +191,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_HECFcal["HECA"][0],ymin=lArDQGlobals.HVphi_HECFcal["HECA"][1],ymax=lArDQGlobals.HVphi_HECFcal["HECA"][2], merge='weightedAverage' ) - affectedRegGroupHEC0.defineHistogram('etaNEG,phi;LArAffectedRegionsHECC0', + affectedRegGroupHEC0.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsHECC0', title='HV Affected Regions - HECC - Layer 1;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -210,7 +211,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupHEC1.defineHistogram('etaPOS,phi;LArAffectedRegionsHECA1', + affectedRegGroupHEC1.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsHECA1', title='HV Affected Regions - HECA - Layer 2;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -219,7 +220,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_HECFcal["HECA"][0],ymin=lArDQGlobals.HVphi_HECFcal["HECA"][1],ymax=lArDQGlobals.HVphi_HECFcal["HECA"][2], merge='weightedAverage' ) - affectedRegGroupHEC1.defineHistogram('etaNEG,phi;LArAffectedRegionsHECC1', + affectedRegGroupHEC1.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsHECC1', title='HV Affected Regions - HECC - Layer 2;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -239,7 +240,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupHEC2.defineHistogram('etaPOS,phi;LArAffectedRegionsHECA2', + affectedRegGroupHEC2.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsHECA2', title='HV Affected Regions - HECA - Layer 3;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -248,7 +249,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_HECFcal["HECA"][0],ymin=lArDQGlobals.HVphi_HECFcal["HECA"][1],ymax=lArDQGlobals.HVphi_HECFcal["HECA"][2], merge='weightedAverage' ) - affectedRegGroupHEC2.defineHistogram('etaNEG,phi;LArAffectedRegionsHECC2', + affectedRegGroupHEC2.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsHECC2', title='HV Affected Regions - HECC - Layer 3;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -268,7 +269,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupHEC3.defineHistogram('etaPOS,phi;LArAffectedRegionsHECA3', + affectedRegGroupHEC3.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsHECA3', title='HV Affected Regions - HECA - Layer 4;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -277,7 +278,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_HECFcal["HECA"][0],ymin=lArDQGlobals.HVphi_HECFcal["HECA"][1],ymax=lArDQGlobals.HVphi_HECFcal["HECA"][2], merge='weightedAverage' ) - affectedRegGroupHEC3.defineHistogram('etaNEG,phi;LArAffectedRegionsHECC3', + affectedRegGroupHEC3.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsHECC3', title='HV Affected Regions - HECC - Layer 4;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -297,7 +298,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupFCAL0.defineHistogram('etaPOS,phi;LArAffectedRegionsFCALA0', + affectedRegGroupFCAL0.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsFCALA0', title='HV Affected Regions - FCALA - Layer 1;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -306,7 +307,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_HECFcal["FCalA"][0],ymin=lArDQGlobals.HVphi_HECFcal["FCalA"][1],ymax=lArDQGlobals.HVphi_HECFcal["FCalA"][2], merge='weightedAverage' ) - affectedRegGroupFCAL0.defineHistogram('etaNEG,phi;LArAffectedRegionsFCALC0', + affectedRegGroupFCAL0.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsFCALC0', title='HV Affected Regions - FCALC - Layer 1;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -326,7 +327,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupFCAL1.defineHistogram('etaPOS,phi;LArAffectedRegionsFCALA1', + affectedRegGroupFCAL1.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsFCALA1', title='HV Affected Regions - FCALA - Layer 2;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -335,7 +336,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_HECFcal["FCalA"][0],ymin=lArDQGlobals.HVphi_HECFcal["FCalA"][1],ymax=lArDQGlobals.HVphi_HECFcal["FCalA"][2], merge='weightedAverage' ) - affectedRegGroupFCAL1.defineHistogram('etaNEG,phi;LArAffectedRegionsFCALC1', + affectedRegGroupFCAL1.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsFCALC1', title='HV Affected Regions - FCALC - Layer 2;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -355,7 +356,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): 'run' ) - affectedRegGroupFCAL2.defineHistogram('etaPOS,phi;LArAffectedRegionsFCALA2', + affectedRegGroupFCAL2.defineHistogram('etaPOS,phi;RAW_LArAffectedRegionsFCALA2', title='HV Affected Regions - FCALA - Layer 3;#eta;#phi', type='TH2F', path=larAffReg_hist_path, @@ -364,7 +365,7 @@ def LArAffectedRegionsConfigCore(helper, algoinstance, inputFlags): ybins=lArDQGlobals.HVphi_HECFcal["FCalA"][0],ymin=lArDQGlobals.HVphi_HECFcal["FCalA"][1],ymax=lArDQGlobals.HVphi_HECFcal["FCalA"][2], merge='weightedAverage' ) - affectedRegGroupFCAL2.defineHistogram('etaNEG,phi;LArAffectedRegionsFCALC2', + affectedRegGroupFCAL2.defineHistogram('etaNEG,phi;RAW_LArAffectedRegionsFCALC2', title='HV Affected Regions - FCALC - Layer 3;#eta;#phi', type='TH2F', path=larAffReg_hist_path, diff --git a/LArCalorimeter/LArMonitoring/python/LArCollisionTimeMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArCollisionTimeMonAlg.py index 8f45137d2613ea9242d187986039919db567f13c..a56068e9ec383522772af1c7dfef527860ab0d7b 100644 --- a/LArCalorimeter/LArMonitoring/python/LArCollisionTimeMonAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArCollisionTimeMonAlg.py @@ -6,12 +6,12 @@ def LArCollisionTimeMonConfigOld(inputFlags): from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelperOld from LArMonitoring.LArMonitoringConf import LArCollisionTimeMonAlg - larColTime_hist_path='LArCollisionTimeNewAlg' + larColTime_hist_path='LArCollisionTime' helper = AthMonitorCfgHelperOld(inputFlags, 'LArCollisionTimeMonAlgOldCfg') LArCollisionTimeMonConfigCore(helper, LArCollisionTimeMonAlg,inputFlags,larColTime_hist_path) - larColTime_hist_path='LArClusterCollisionTimeNewAlg' + larColTime_hist_path='LArClusterCollisionTime' LArCollisionTimeMonConfigCore(helper, LArCollisionTimeMonAlg,inputFlags,larColTime_hist_path) helper.monSeq.LArClusterCollisionTimeMonAlg.Key = "ClusterCollTime" helper.monSeq.LArClusterCollisionTimeMonAlg.nCells = 0 @@ -29,12 +29,12 @@ def LArCollisionTimeMonConfig(inputFlags): from LArCellRec.LArCollisionTimeConfig import LArCollisionTimeCfg cfg = LArCollisionTimeCfg(inputFlags) - larColTime_hist_path='LArCollisionTimeNewAlg' + larColTime_hist_path='LArCollisionTime' from AthenaConfiguration.ComponentFactory import CompFactory LArCollisionTimeMonConfigCore(helper, CompFactory.LArCollisionTimeMonAlg,inputFlags,larColTime_hist_path) - larClusColTime_hist_path='LArClusterCollisionTimeNewAlg' + larClusColTime_hist_path='LArClusterCollisionTime' LArCollisionTimeMonConfigCore(helper, CompFactory.LArCollisionTimeMonAlg('LArClusterCollisionTimeMonAlg'),inputFlags,larClusColTime_hist_path) for algo in helper.monSeq.Members: if algo.name == 'LArClusterCollisionTimeMonAlg': @@ -47,7 +47,7 @@ def LArCollisionTimeMonConfig(inputFlags): def LArCollisionTimeMonConfigCore(helper, algoinstance,inputFlags,larColTime_hist_path): - larCollTimeMonAlg = helper.addAlgorithm(algoinstance,larColTime_hist_path[0:-6]+'MonAlg') + larCollTimeMonAlg = helper.addAlgorithm(algoinstance,larColTime_hist_path+'MonAlg') collTimeGroupName="LArCollisionTimeMonGroup" diff --git a/LArCalorimeter/LArMonitoring/python/LArCosmicsMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArCosmicsMonAlg.py index 5e52b031bf4c85a35b85b0aeb54b5615c7f0bd30..f969591a9d4b90959f6979f9cdf42f5bb16ae9d0 100644 --- a/LArCalorimeter/LArMonitoring/python/LArCosmicsMonAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArCosmicsMonAlg.py @@ -66,7 +66,7 @@ def LArCosmicsMonConfigCore(helper, algoinstance,inputFlags): 'run' ) - cosmic_path="CosmicsNewAlg/" + cosmic_path="Cosmics/" EM_bins=lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["C"]["2"]+lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["C"]["2"]+lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["A"]["2"]+lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["A"]["2"] cosmicMonGroup.defineHistogram('mon_eta_EM,mon_phi;Muon2DHitsECAL', diff --git a/LArCalorimeter/LArMonitoring/python/LArCoverageAlg.py b/LArCalorimeter/LArMonitoring/python/LArCoverageAlg.py index 3b8b75d3e45d6902031d73fcf0e3deb1c300df3e..af10cb77f78f68161c1c2a49b612862023d44fb5 100644 --- a/LArCalorimeter/LArMonitoring/python/LArCoverageAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArCoverageAlg.py @@ -21,14 +21,17 @@ def LArCoverageConfig(inputFlags): # The following class will make a sequence, configure algorithms, and link # them to GenericMonitoringTools + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaMonitoring import AthMonitorCfgHelper helper = AthMonitorCfgHelper(inputFlags,'LArCoverageCfgAlg') + from AthenaConfiguration.ComponentFactory import CompFactory LArCoverageConfigCore(helper, CompFactory.LArCoverageAlg,inputFlags) - cfg.merge(helper.result()) - return cfg + rv = ComponentAccumulator() + rv.merge(helper.result()) + return rv def LArCoverageConfigCore(helper, algoinstance,inputFlags): @@ -107,7 +110,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ### Configure histograms - coveragePath='CoverageNewAlg/' + coveragePath='Coverage/' # -- caloNoiseTool histograms -- @@ -140,7 +143,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): # -- badChannels histograms -- badChannels_path=coveragePath+'BadChannels/' - badChannelToolArrayBarrel.defineHistogram('mon_FtSlot,single_channel;DBBadChannelsBarrel', + badChannelToolArrayBarrel.defineHistogram('mon_FtSlot,single_channel;RAW_DBBadChannelsBarrel', type='TH2I', path=badChannels_path, title='Known Bad Channels - Barrel {0};Feedthrough(+Slot increasing);Channel', @@ -153,7 +156,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ymax=lArDQGlobals.FEB_N_channels-0.5, xlabels=lArDQGlobals.Feedthrough_Slot_labels_Barrel, merge='weightedAverage') - badChannelToolArrayEndcap.defineHistogram('mon_FtSlot,single_channel;DBBadChannelsEndcap', + badChannelToolArrayEndcap.defineHistogram('mon_FtSlot,single_channel;RAW_DBBadChannelsEndcap', type='TH2I', path=badChannels_path, title='Known Bad Channels - Endcap {0};Feedthrough(+Slot increasing);Channel', @@ -170,7 +173,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): #--coverageHW histograms coverage_path=coveragePath+'perPartition/' - coverageToolArrayEMBA.defineHistogram('mon_ChanFtSlot,mon_Channels;CoverageHW_EMBA_statusCode', + coverageToolArrayEMBA.defineHistogram('mon_ChanFtSlot,mon_Channels;RAW_CoverageHW_EMBA_statusCode', type='TH2I', path=coverage_path, title='Coverage - EMBA - statusCode={0};Feedthrough(+Slot increasing);Channel', @@ -182,7 +185,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ymax=lArDQGlobals.FEB_N_channels-0.5, xlabels=lArDQGlobals.Feedthrough_Slot_labels_Barrel) - coverageToolArrayEMBC.defineHistogram('mon_ChanFtSlot,mon_Channels;CoverageHW_EMBC_statusCode', + coverageToolArrayEMBC.defineHistogram('mon_ChanFtSlot,mon_Channels;RAW_CoverageHW_EMBC_statusCode', type='TH2I', path=coverage_path, title='Coverage - EMBC - statusCode={0};Feedthrough(+Slot increasing);Channel', @@ -194,7 +197,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ymax=lArDQGlobals.FEB_N_channels-0.5, xlabels=lArDQGlobals.Feedthrough_Slot_labels_Barrel) - coverageToolArrayEMECA.defineHistogram('mon_ChanFtSlot,mon_Channels;CoverageHW_EMECA_statusCode', + coverageToolArrayEMECA.defineHistogram('mon_ChanFtSlot,mon_Channels;RAW_CoverageHW_EMECA_statusCode', type='TH2I', path=coverage_path, title='Coverage - EMECA - statusCode={0};Feedthrough(+Slot increasing);Channel', @@ -206,7 +209,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ymax=lArDQGlobals.FEB_N_channels-0.5, xlabels=lArDQGlobals.Feedthrough_Slot_labels_Endcap) - coverageToolArrayEMECC.defineHistogram('mon_ChanFtSlot,mon_Channels;CoverageHW_EMECA_statusCode', + coverageToolArrayEMECC.defineHistogram('mon_ChanFtSlot,mon_Channels;RAW_CoverageHW_EMECA_statusCode', type='TH2I', path=coverage_path, title='Coverage - EMECC - statusCode={0};Feedthrough(+Slot increasing);Channel', @@ -218,7 +221,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ymax=lArDQGlobals.FEB_N_channels-0.5, xlabels=lArDQGlobals.Feedthrough_Slot_labels_Endcap) - coverageToolArrayHECA.defineHistogram('mon_ChanFtSlot,mon_Channels;CoverageHW_HECA_statusCode', + coverageToolArrayHECA.defineHistogram('mon_ChanFtSlot,mon_Channels;RAW_CoverageHW_HECA_statusCode', type='TH2I', path=coverage_path, title='Coverage - HECA - statusCode={0};Feedthrough(+Slot increasing);Channel', @@ -230,7 +233,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ymax=lArDQGlobals.FEB_N_channels-0.5, xlabels=lArDQGlobals.Feedthrough_Slot_labels_Endcap) - coverageToolArrayHECC.defineHistogram('mon_ChanFtSlot,mon_Channels;CoverageHW_HECA_statusCode', + coverageToolArrayHECC.defineHistogram('mon_ChanFtSlot,mon_Channels;RAW_CoverageHW_HECA_statusCode', type='TH2I', path=coverage_path, title='Coverage - HECC - statusCode={0};Feedthrough(+Slot increasing);Channel', @@ -242,7 +245,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ymax=lArDQGlobals.FEB_N_channels-0.5, xlabels=lArDQGlobals.Feedthrough_Slot_labels_Endcap) - coverageToolArrayFCalA.defineHistogram('mon_ChanFtSlot,mon_Channels;CoverageHW_FCalA_statusCode', + coverageToolArrayFCalA.defineHistogram('mon_ChanFtSlot,mon_Channels;RAW_CoverageHW_FCalA_statusCode', type='TH2I', path=coverage_path, title='Coverage - FCalA - statusCode={0};Feedthrough(+Slot increasing);Channel', @@ -254,7 +257,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ymax=lArDQGlobals.FEB_N_channels-0.5, xlabels=lArDQGlobals.Feedthrough_Slot_labels_Endcap) - coverageToolArrayFCalC.defineHistogram('mon_ChanFtSlot,mon_Channels;CoverageHW_FCalC_statusCode', + coverageToolArrayFCalC.defineHistogram('mon_ChanFtSlot,mon_Channels;RAW_CoverageHW_FCalC_statusCode', type='TH2I', path=coverage_path, title='Coverage - FCalC - statusCode={0};Feedthrough(+Slot increasing);Channel', @@ -267,7 +270,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xlabels=lArDQGlobals.Feedthrough_Slot_labels_Endcap) - coverageToolArrayEMBA.defineHistogram('mon_Eta,mon_Phi;CoverSampling0EMBA_StatusCode', + coverageToolArrayEMBA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling0EMBA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 0 - EMBA;#eta;#phi', @@ -275,7 +278,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["A"]["0"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMB"]["A"]["0"]) - coverageToolArrayEMBA.defineHistogram('mon_Eta,mon_Phi;CoverSampling1EMBA_StatusCode', + coverageToolArrayEMBA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling1EMBA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 1 - EMBA;#eta;#phi', @@ -283,7 +286,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["A"]["1"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMB"]["A"]["1"]) - coverageToolArrayEMBA.defineHistogram('mon_Eta,mon_Phi;CoverSampling2EMBA_StatusCode', + coverageToolArrayEMBA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling2EMBA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 2 - EMBA;#eta;#phi', @@ -291,7 +294,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["A"]["2"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMB"]["A"]["2"]) - coverageToolArrayEMBA.defineHistogram('mon_Eta,mon_Phi;CoverSampling3EMBA_StatusCode', + coverageToolArrayEMBA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling3EMBA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 3 - EMBA;#eta;#phi', @@ -299,7 +302,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["A"]["3"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMB"]["A"]["3"]) - coverageToolArrayEMBC.defineHistogram('mon_Eta,mon_Phi;CoverSampling0EMBC_StatusCode', + coverageToolArrayEMBC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling0EMBC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 0 - EMBC;#eta;#phi', @@ -307,7 +310,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["C"]["0"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMB"]["C"]["0"]) - coverageToolArrayEMBC.defineHistogram('mon_Eta,mon_Phi;CoverSampling1EMBC_StatusCode', + coverageToolArrayEMBC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling1EMBC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 1 - EMBC;#eta;#phi', @@ -315,7 +318,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["C"]["1"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMB"]["C"]["1"]) - coverageToolArrayEMBC.defineHistogram('mon_Eta,mon_Phi;CoverSampling2EMBC_StatusCode', + coverageToolArrayEMBC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling2EMBC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 2 - EMBC;#eta;#phi', @@ -323,7 +326,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["C"]["2"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMB"]["C"]["2"]) - coverageToolArrayEMBC.defineHistogram('mon_Eta,mon_Phi;CoverSampling3EMBC_StatusCode', + coverageToolArrayEMBC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling3EMBC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 3 - EMBC;#eta;#phi', @@ -332,7 +335,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMB"]["C"]["3"]) - coverageToolArrayEMECA.defineHistogram('mon_Eta,mon_Phi;CoverSampling0EMECA_StatusCode', + coverageToolArrayEMECA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling0EMECA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 0 - EMECA;#eta;#phi', @@ -340,7 +343,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["A"]["0"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMEC"]["A"]["0"]) - coverageToolArrayEMECA.defineHistogram('mon_Eta,mon_Phi;CoverSampling1EMECA_StatusCode', + coverageToolArrayEMECA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling1EMECA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 1 - EMECA;#eta;#phi', @@ -348,7 +351,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["A"]["1"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMEC"]["A"]["1"]) - coverageToolArrayEMECA.defineHistogram('mon_Eta,mon_Phi;CoverSampling2EMECA_StatusCode', + coverageToolArrayEMECA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling2EMECA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 2 - EMECA;#eta;#phi', @@ -356,7 +359,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["A"]["2"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMEC"]["A"]["2"]) - coverageToolArrayEMECA.defineHistogram('mon_Eta,mon_Phi;CoverSampling3EMECA_StatusCode', + coverageToolArrayEMECA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling3EMECA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 3 - EMECA;#eta;#phi', @@ -364,7 +367,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["A"]["3"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMEC"]["A"]["3"]) - coverageToolArrayEMECC.defineHistogram('mon_Eta,mon_Phi;CoverSampling0EMECC_StatusCode', + coverageToolArrayEMECC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling0EMECC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 0 - EMECC;#eta;#phi', @@ -372,7 +375,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["C"]["0"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMEC"]["C"]["0"]) - coverageToolArrayEMECC.defineHistogram('mon_Eta,mon_Phi;CoverSampling1EMECC_StatusCode', + coverageToolArrayEMECC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling1EMECC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 1 - EMECC;#eta;#phi', @@ -380,7 +383,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["C"]["1"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMEC"]["C"]["1"]) - coverageToolArrayEMECC.defineHistogram('mon_Eta,mon_Phi;CoverSampling2EMECC_StatusCode', + coverageToolArrayEMECC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling2EMECC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 2 - EMECC;#eta;#phi', @@ -388,7 +391,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["C"]["2"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMEC"]["C"]["2"]) - coverageToolArrayEMECC.defineHistogram('mon_Eta,mon_Phi;CoverSampling3EMECC_StatusCode', + coverageToolArrayEMECC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling3EMECC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 3 - EMECC;#eta;#phi', @@ -396,7 +399,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["C"]["3"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMEC"]["C"]["3"]) - coverageToolArrayHECA.defineHistogram('mon_Eta,mon_Phi;CoverSampling0HECA_StatusCode', + coverageToolArrayHECA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling0HECA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 0 - HECA;#eta;#phi', @@ -404,7 +407,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["A"]["0"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["HEC"]["A"]["0"]) - coverageToolArrayHECA.defineHistogram('mon_Eta,mon_Phi;CoverSampling1HECA_StatusCode', + coverageToolArrayHECA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling1HECA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 1 - HECA;#eta;#phi', @@ -412,7 +415,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["A"]["1"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["HEC"]["A"]["1"]) - coverageToolArrayHECA.defineHistogram('mon_Eta,mon_Phi;CoverSampling2HECA_StatusCode', + coverageToolArrayHECA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling2HECA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 2 - HECA;#eta;#phi', @@ -420,7 +423,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["A"]["2"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["HEC"]["A"]["2"]) - coverageToolArrayHECA.defineHistogram('mon_Eta,mon_Phi;CoverSampling3HECA_StatusCode', + coverageToolArrayHECA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling3HECA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 3 - HECA;#eta;#phi', @@ -428,7 +431,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["A"]["3"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["HEC"]["A"]["3"]) - coverageToolArrayHECC.defineHistogram('mon_Eta,mon_Phi;CoverSampling0HECC_StatusCode', + coverageToolArrayHECC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling0HECC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 0 - HECC;#eta;#phi', @@ -436,7 +439,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["C"]["0"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["HEC"]["C"]["0"]) - coverageToolArrayHECC.defineHistogram('mon_Eta,mon_Phi;CoverSampling1HECC_StatusCode', + coverageToolArrayHECC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling1HECC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 1 - HECC;#eta;#phi', @@ -444,7 +447,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["C"]["1"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["HEC"]["C"]["1"]) - coverageToolArrayHECC.defineHistogram('mon_Eta,mon_Phi;CoverSampling2HECC_StatusCode', + coverageToolArrayHECC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling2HECC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 2 - HECC;#eta;#phi', @@ -452,7 +455,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["C"]["2"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["HEC"]["C"]["2"]) - coverageToolArrayHECC.defineHistogram('mon_Eta,mon_Phi;CoverSampling3HECC_StatusCode', + coverageToolArrayHECC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling3HECC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 3 - HECC;#eta;#phi', @@ -460,7 +463,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["C"]["3"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["HEC"]["C"]["3"]) - coverageToolArrayFCalA.defineHistogram('mon_Eta,mon_Phi;CoverSampling1FCalA_StatusCode', + coverageToolArrayFCalA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling1FCalA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 1 - FCalA;#eta;#phi', @@ -468,7 +471,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["FCal"]["A"]["1"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["FCal"]["A"]["1"]) - coverageToolArrayFCalA.defineHistogram('mon_Eta,mon_Phi;CoverSampling2FCalA_StatusCode', + coverageToolArrayFCalA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling2FCalA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 2 - FCalA;#eta;#phi', @@ -476,7 +479,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["FCal"]["A"]["2"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["FCal"]["A"]["2"]) - coverageToolArrayFCalA.defineHistogram('mon_Eta,mon_Phi;CoverSampling3FCalA_StatusCode', + coverageToolArrayFCalA.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling3FCalA_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 3 - FCalA;#eta;#phi', @@ -484,7 +487,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["FCal"]["A"]["3"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["FCal"]["A"]["3"]) - coverageToolArrayFCalC.defineHistogram('mon_Eta,mon_Phi;CoverSampling1FCalC_StatusCode', + coverageToolArrayFCalC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling1FCalC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 1 - FCalC;#eta;#phi', @@ -492,7 +495,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["FCal"]["C"]["1"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["FCal"]["C"]["1"]) - coverageToolArrayFCalC.defineHistogram('mon_Eta,mon_Phi;CoverSampling2FCalC_StatusCode', + coverageToolArrayFCalC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling2FCalC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 2 - FCalC;#eta;#phi', @@ -500,7 +503,7 @@ def LArCoverageConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.Cell_Variables["etaRange"]["FCal"]["C"]["2"], ybins=lArDQGlobals.Cell_Variables["phiRange"]["FCal"]["C"]["2"]) - coverageToolArrayFCalC.defineHistogram('mon_Eta,mon_Phi;CoverSampling3FCalC_StatusCode', + coverageToolArrayFCalC.defineHistogram('mon_Eta,mon_Phi;RAW_CoverSampling3FCalC_StatusCode', type='TH2I', path=coverage_path, title='Coverage status code={0} - Sampling 3 - FCalC;#eta;#phi', diff --git a/LArCalorimeter/LArMonitoring/python/LArDigitMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArDigitMonAlg.py index a9e1abd40f637abe4fe01ef561cda0df696f15a5..5c341e0b0a6089838d8137890e1a2f34d5f501e0 100644 --- a/LArCalorimeter/LArMonitoring/python/LArDigitMonAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArDigitMonAlg.py @@ -61,13 +61,13 @@ def LArDigitMonConfigCore(helper, algoinstance,inputFlags): summaryGroup = helper.addGroup( larDigitMonAlg, summaryGroupName, - '/LAr/DigitsNewAlg' + '/LAr/Digits' ) summary_hist_path=summaryGroupName+'/' - summaryGroup.defineHistogram('sumbin,partition;Summary', + summaryGroup.defineHistogram('sumbin,partition;RAW_Summary', title='Gain', type='TH2F', path=summary_hist_path, @@ -75,7 +75,7 @@ def LArDigitMonConfigCore(helper, algoinstance,inputFlags): xbins=lArDQGlobals.N_DigitsSummary,xmin=-0.5,xmax=lArDQGlobals.N_DigitsSummary-0.5, ybins=lArDQGlobals.N_Partitions, ymin=-0.5, ymax=lArDQGlobals.N_Partitions-0.5, xlabels=lArDQGlobals.DigitsSummary,ylabels=lArDQGlobals.Partitions) - summaryGroup.defineHistogram('gain,partition;summaryGain', + summaryGroup.defineHistogram('gain,partition;RAW_summaryGain', title='Gain', type='TH2F', path=summary_hist_path, @@ -87,7 +87,7 @@ def LArDigitMonConfigCore(helper, algoinstance,inputFlags): # now individual partitions, because we need a different directories, will have only 2dim arrays (side) for subdet in range(0,lArDQGlobals.N_SubDet): array = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larDigitMonAlg,lArDQGlobals.SubDet[subdet]) - hist_path='/LAr/DigitsNewAlg/'+lArDQGlobals.SubDet[subdet]+'/' + hist_path='/LAr/Digits/'+lArDQGlobals.SubDet[subdet]+'/' slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5 slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5 slot_n = int(slot_up - slot_low) @@ -107,13 +107,13 @@ def LArDigitMonConfigCore(helper, algoinstance,inputFlags): weight='weight', xbins=int(slot_n),xmin=slot_low,xmax=slot_up, ybins=int(ft_n), ymin=ft_low, ymax=ft_up) - array.defineHistogram('Outslot,OutFT,Outweight;OutOfRange', + array.defineHistogram('Outslot,OutFT,Outweight;RAW_OutOfRange', title='% chan/FEB/events with max out of ', type='TProfile2D', path=hist_path, xbins=int(slot_n),xmin=slot_low,xmax=slot_up, ybins=int(ft_n), ymin=ft_low, ymax=ft_up) - array.defineHistogram('Outcrate,Outchan;OutOfRangeChan', + array.defineHistogram('Outcrate,Outchan;RAW_OutOfRangeChan', title='% chan/FEB/events with max out of ', type='TH2I', path=hist_path, @@ -128,13 +128,13 @@ def LArDigitMonConfigCore(helper, algoinstance,inputFlags): weight='weight', xbins=int(slot_n),xmin=slot_low,xmax=slot_up, ybins=int(ft_n), ymin=ft_low, ymax=ft_up) - array.defineHistogram('Saturslot,SaturFT,Saturweight;Saturation', + array.defineHistogram('Saturslot,SaturFT,Saturweight;RAW_Saturation', title='% chan/FEB/events with max=4095 ADC ', type='TProfile2D', path=hist_path, xbins=int(slot_n),xmin=slot_low,xmax=slot_up, ybins=int(ft_n), ymin=ft_low, ymax=ft_up) - array.defineHistogram('Saturcrate,Saturchan;SaturationChan', + array.defineHistogram('Saturcrate,Saturchan;RAW_SaturationChan', title='% chan/FEB/events with max=4095 ADC - Med/High Gain - All Stream', type='TH2I', path=hist_path, @@ -148,13 +148,13 @@ def LArDigitMonConfigCore(helper, algoinstance,inputFlags): path=hist_path, xbins=int(slot_n),xmin=slot_low,xmax=slot_up, ybins=int(ft_n), ymin=ft_low, ymax=ft_up) - array.defineHistogram('SaturLowslot,SaturLowFT,SaturLowweight;SaturationLow', + array.defineHistogram('SaturLowslot,SaturLowFT,SaturLowweight;RAW_SaturationLow', title='% chan/FEB/events with max=4095 ADC ', type='TProfile2D', path=hist_path, xbins=int(slot_n),xmin=slot_low,xmax=slot_up, ybins=int(ft_n), ymin=ft_low, ymax=ft_up) - array.defineHistogram('SaturLowcrate,SaturLowchan;SaturationChanLow', + array.defineHistogram('SaturLowcrate,SaturLowchan;RAW_SaturationChanLow', title='% chan/FEB/events with max=4095 ADC - Low Gain - All Stream', type='TH2I', path=hist_path, @@ -169,20 +169,20 @@ def LArDigitMonConfigCore(helper, algoinstance,inputFlags): weight='weight', xbins=int(slot_n),xmin=slot_low,xmax=slot_up, ybins=int(ft_n), ymin=ft_low, ymax=ft_up) - array.defineHistogram('Nullslot,NullFT,Nullweight;NullDigit', + array.defineHistogram('Nullslot,NullFT,Nullweight;RAW_NullDigit', title='% chan/FEB/events with min=0 ADC ', type='TProfile2D', path=hist_path, xbins=int(slot_n),xmin=slot_low,xmax=slot_up, ybins=int(ft_n), ymin=ft_low, ymax=ft_up) - array.defineHistogram('Nullcrate,Nullchan;NullDigitChan', + array.defineHistogram('Nullcrate,Nullchan;RAW_NullDigitChan', title='% chan/FEB/events with min=0 ADC - All Gain - All Stream', type='TH2I', path=hist_path, xbins=crates_n,xmin=crates_low,xmax=crates_up, ybins=chan_n, ymin=chan_low, ymax=chan_up) - array.defineHistogram('slot,FT,MaxPos;AvePosMaxDig', + array.defineHistogram('slot,FT,MaxPos;RAW_AvePosMaxDig', title='Average position of Max Digit ', type='TProfile2D', path=hist_path, diff --git a/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py index ac701c906374d76dabd1a368708489d543231b80..5d6d0ca9d400cd8faec7f39dfb7fb81d55e34a58 100644 --- a/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArFEBMonAlg.py @@ -86,7 +86,7 @@ def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebu Group = helper.addGroup( larFEBMonAlg, GroupName, - '/LAr/'+GroupName+'NewAlg/' + '/LAr/'+GroupName+'/' ) @@ -151,18 +151,18 @@ def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebu path=summary_hist_path, xbins=lArDQGlobals.EvtRej_Bins, xmin=lArDQGlobals.EvtRej_Min, xmax=lArDQGlobals.EvtRej_Max, xlabels=lArDQGlobals.EvtRej_labels) - Group.defineHistogram('EvtRej,EvtRejYield1D;EventsRejectedYield', + Group.defineHistogram('EvtRej,EvtRejYield1D;RAW_EventsRejectedYield', title='Data corruption yield:Corruption type:Yield(%)', type='TProfile', path=summary_hist_path, xbins=lArDQGlobals.EvtRej_Bins-1, xmin=lArDQGlobals.EvtRej_Min, xmax=lArDQGlobals.EvtRej_Max-1, xlabels=lArDQGlobals.EvtRejYield_labels) - Group.defineHistogram('LB0,EvtRejYield;YieldOfRejectedEventsVsLB', + Group.defineHistogram('LB0,EvtRejYield;RAW_YieldOfRejectedEventsVsLB', title='Yield of corrupted events (DATACORRUPTED):Luminosity Block:Yield(%)', type='TProfile', path=summary_hist_path, xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max) - Group.defineHistogram('LB0,EvtRejYieldOut;YieldOfRejectedEventsVsLBout', + Group.defineHistogram('LB0,EvtRejYieldOut;RAW_YieldOfRejectedEventsVsLBout', title='Yield of corrupted events (DATACORRUPTED) not vetoed by time window:Luminosity Block:Yield(%)', type='TProfile', path=summary_hist_path, @@ -203,7 +203,7 @@ def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebu isOnline=True if isOnline: - Group.defineHistogram('LBf,EvtRejYield;EventsRejectedLB', + Group.defineHistogram('LBf,EvtRejYield;RAW_EventsRejectedLB', titile='% of events rejected in current LB (online only)', type='TProfile', path=summary_hist_path, @@ -219,7 +219,7 @@ def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebu # Now per partition histograms for subdet in range(0,lArDQGlobals.N_SubDet): - hist_path='/LAr/'+GroupName+'NewAlg/'+lArDQGlobals.SubDet[subdet]+'/' + hist_path='/LAr/'+GroupName+'/'+lArDQGlobals.SubDet[subdet]+'/' slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5 slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5 slot_n = int(slot_up - slot_low) @@ -229,126 +229,126 @@ def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebu darray = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larFEBMonAlg,lArDQGlobals.SubDet[subdet]) - darray.defineHistogram('slotPar,FTPar;Parity', + darray.defineHistogram('slotPar,FTPar;RAW_Parity', title='Parity error:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotBcid,FTBcid;BCID', + darray.defineHistogram('slotBcid,FTBcid;RAW_BCID', title='BCID mismatch betw. 2 halves of FEB:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotRadd,FTRadd;RADD', + darray.defineHistogram('slotRadd,FTRadd;RAW_RADD', title='Sample header mismatch betw. 2 halves of FEB:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotEvtid,FTEvtid;EVTID', + darray.defineHistogram('slotEvtid,FTEvtid;RAW_EVTID', title='EVTID mismatch betw. 2 halves of FEB:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotScac,FTScac;SCACStatus', + darray.defineHistogram('slotScac,FTScac;RAW_SCACStatus', title='Wrong SCAC status in one half of a FEB:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotscout,FTscout;scaOutOfRange', + darray.defineHistogram('slotscout,FTscout;RAW_scaOutOfRange', title='Sca out of range:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotgain,FTgain;gainMismatch', + darray.defineHistogram('slotgain,FTgain;RAW_gainMismatch', title='Gain mismatch within time samples:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slottype,FTtype;typeMismatch', + darray.defineHistogram('slottype,FTtype;RAW_typeMismatch', title='Event type mismatch:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotsmp,FTsmp;badNbOfSamp', + darray.defineHistogram('slotsmp,FTsmp;RAW_badNbOfSamp', title='Non uniform number of samples:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotzero,FTzero;zeroSamp', + darray.defineHistogram('slotzero,FTzero;RAW_zeroSamp', title='Empty FEB data blocks:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotsum,FTsum;checkSum', + darray.defineHistogram('slotsum,FTsum;RAW_checkSum', title='Checksum / DSP block size:Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotmis,FTmis;missingHeader', + darray.defineHistogram('slotmis,FTmis;RAW_missingHeader', title='Missing header :Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotgain,FTgain;badGain', + darray.defineHistogram('slotgain,FTgain;RAW_badGain', title='Bad gain :Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotabs,FTabs;LArFEBMonErrorsAbsolute', + darray.defineHistogram('slotabs,FTabs;RAW_LArFEBMonErrorsAbsolute', title='Nb of events with at least one error :Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotmist,FTmist;missingTriggerType', + darray.defineHistogram('slotmist,FTmist;RAW_missingTriggerType', title='LVL1 trigger type missing or different from event type :Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotnb,FTnb;nbOfEvts', + darray.defineHistogram('slotnb,FTnb;RAW_nbOfEvts', title='Nb of events (DSP header check only) :Slot:FT', type='TH2I', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotnb,FTnb,weightsweet1;NbOfSweet1PerFEB', + darray.defineHistogram('slotnb,FTnb,weightsweet1;RAW_NbOfSweet1PerFEB', title='Average # of cells with (qfactor+time) readout :Slot:FT', type='TProfile2D', path=hist_path, xbins=slot_n,xmin=slot_low,xmax=slot_up, ybins=ft_n, ymin=ft_low, ymax=ft_up) - darray.defineHistogram('slotnb,FTnb,weightsweet2;NbOfSweet2PerFEB', + darray.defineHistogram('slotnb,FTnb,weightsweet2;RAW_NbOfSweet2PerFEB', title='Average # of cells with samples readout :Slot:FT', type='TProfile2D', path=hist_path, @@ -361,7 +361,7 @@ def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebu path=hist_path, xbins=lArDQGlobals.N_FEB_Parttions_Max, xmin=-0.5, xmax=lArDQGlobals.N_FEB_Parttions_Max-0.5) - darray.defineHistogram('slotMasked,FTMasked;knownFaultyFEB', + darray.defineHistogram('slotMasked,FTMasked;RAW_knownFaultyFEB', title='FEB with known errors (1:err. ignored 2:FEB masked):Slot:FT', type='TH2I', path=hist_path, @@ -375,7 +375,7 @@ def LArFEBMonConfigCore(helper,algoinstance,inputFlags, cellDebug=False, dspDebu xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max) if isOnline: - darray.defineHistogram('LBf,erronl;EventsRejectedLB', + darray.defineHistogram('LBf,erronl;RAW_EventsRejectedLB', titile='% of events rejected in current LB (online only)', type='TProfile', path=hist_path, diff --git a/LArCalorimeter/LArMonitoring/python/LArHVCorrMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArHVCorrMonAlg.py index f2defaa83d959b89307c7679468eebdbe81937f3..b5034bdd1d0ea595f8c39f46af6816a1d4541098 100644 --- a/LArCalorimeter/LArMonitoring/python/LArHVCorrMonAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArHVCorrMonAlg.py @@ -53,7 +53,7 @@ def LArHVCorrMonConfigCore(helper, algoinstance,inputFlags): from LArMonitoring.GlobalVariables import lArDQGlobals #to define the ranges - larHVCorr_hist_path='HVCorrectionNewAlg/' #histogram path + larHVCorr_hist_path='HVCorrection/' #histogram path hvCorrGroup = helper.addGroup( larHVCorrAlg, diff --git a/LArCalorimeter/LArMonitoring/python/LArNoiseCorrelationMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArNoiseCorrelationMonAlg.py new file mode 100644 index 0000000000000000000000000000000000000000..c4d8fb349a51877873fd6c6cf96f7ffb19df1088 --- /dev/null +++ b/LArCalorimeter/LArMonitoring/python/LArNoiseCorrelationMonAlg.py @@ -0,0 +1,248 @@ + +# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# + + +def LArNoiseCorrelationMonConfigOld(inputFlags): + from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelperOld + from LArMonitoring.LArMonitoringConf import LArNoiseCorrelationMonAlg + + helper = AthMonitorCfgHelperOld(inputFlags, 'LArNoiseCorrelationMonAlgCfg') + LArNoiseCorrelationMonConfigCore(helper, LArNoiseCorrelationMonAlg,inputFlags) + return helper.result() + +def LArNoiseCorrelationMonConfig(inputFlags): + '''Function to configures some algorithms in the monitoring system.''' + + # The following class will make a sequence, configure algorithms, and link + # them to GenericMonitoringTools + + from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelper + helper = AthMonitorCfgHelper(inputFlags,'LArNoiseCorrelationMonAlgCfg') + + from AthenaConfiguration.ComponentFactory import CompFactory + return LArNoiseCorrelationMonConfigCore(helper, CompFactory.LArNoiseCorrelationMonAlg,inputFlags) + +def LArNoiseCorrelationMonConfigCore(helper, algoinstance,inputFlags): + + + from LArMonitoring.GlobalVariables import lArDQGlobals + + larNoiseCorrelMonAlg = helper.addAlgorithm(algoinstance,'larNoiseCorrelMonAlg') + + #set custom list of FEBs to be monitored (if you want one): each FEB should be passed as a string of the form "BarrelAft01slot10" + FEBs_from_DQ_run_350440 = ["endcapAft19slot12","endcapAft19slot09","endcapAft20slot09"] + + customFEBStoMonitor=FEBs_from_DQ_run_350440 + + + #correct custom FEBs for upper-lower cases or single-digit ft and slot numbers (e.g. 3 instead of 03) + from ROOT import LArStrHelper + larStrHelp=LArStrHelper() + customFEBStoMonitor=[larStrHelp.fixFEBname(nm) for nm in customFEBStoMonitor] + + + # adding BadChan masker private tool + from AthenaConfiguration.ComponentFactory import isRun3Cfg + + + if isRun3Cfg(): + if inputFlags.DQ.Environment == 'online': + isOnline=True + else: + from AthenaCommon.AthenaCommonFlags import athenaCommonFlags + if athenaCommonFlags.isOnline: + isOnline=True + + isOnline=False #needed later + if isRun3Cfg() : + if inputFlags.DQ.Environment == 'online': + isOnline=True + + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + cfg=ComponentAccumulator() + + from LArBadChannelTool.LArBadChannelConfig import LArBadChannelMaskerCfg + acc= LArBadChannelMaskerCfg(inputFlags,problemsToMask=["highNoiseHG","highNoiseMG","highNoiseLG","deadReadout","deadPhys"],ToolName="BadLArRawChannelMask") + larNoiseCorrelMonAlg.LArBadChannelMask=acc.popPrivateTools() + cfg.merge(acc) + else : + from AthenaCommon.AthenaCommonFlags import athenaCommonFlags + if athenaCommonFlags.isOnline: + isOnline=True + + from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelMasker + theLArBadChannelsMasker=LArBadChannelMasker("BadLArRawChannelMask") + theLArBadChannelsMasker.DoMasking=True + theLArBadChannelsMasker.ProblemsToMask=["deadReadout","deadPhys","short","almostDead","highNoiseHG","highNoiseMG","highNoiseLG","sporadicBurstNoise"] + larNoiseCorrelMonAlg.LArBadChannelMask=theLArBadChannelsMasker + pass + + larNoiseCorrelMonAlg.IgnoreBadChannels=True + larNoiseCorrelMonAlg.TriggerChain = "HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY" #turn off for calibration run + larNoiseCorrelMonAlg.IsCalibrationRun = False + + #deal with custom febs to monitor (if any) + if len(customFEBStoMonitor)==0: + #we do not want to plot everything if online + if isOnline: + larNoiseCorrelMonAlg.PlotsOFF=True + pass + febsToMonitorBarrelA=lArDQGlobals.febsBarrelA + febsToMonitorEndcapA=lArDQGlobals.febsEndcapA + febsToMonitorBarrelC=lArDQGlobals.febsBarrelC + febsToMonitorEndcapC=lArDQGlobals.febsEndcapC + larNoiseCorrelMonAlg.PlotCustomFEBSset=False + larNoiseCorrelMonAlg.FEBlist=febsToMonitorBarrelA+febsToMonitorBarrelC+febsToMonitorEndcapA+febsToMonitorEndcapC + else: + setCustomFEBS=set(customFEBStoMonitor) + febsToMonitorBarrelA=list(setCustomFEBS.intersection(lArDQGlobals.febsBarrelA)) + febsToMonitorEndcapA=list(setCustomFEBS.intersection(lArDQGlobals.febsEndcapA)) + febsToMonitorBarrelC=list(setCustomFEBS.intersection(lArDQGlobals.febsBarrelC)) + febsToMonitorEndcapC=list(setCustomFEBS.intersection(lArDQGlobals.febsEndcapC)) + + if len(febsToMonitorBarrelA)==0 and len(febsToMonitorEndcapA)==0 and len(febsToMonitorBarrelC)==0 and len(febsToMonitorEndcapC)==0: + print("LArNoiseCorrelationMonAlg:WARNING. None of the following FEBs were recognised, no plot will be produced") + print(customFEBStoMonitor) + larNoiseCorrelMonAlg.PlotsOFF=True #lets protect ourselves against poor writing + larNoiseCorrelMonAlg.PlotCustomFEBSset=False + larNoiseCorrelMonAlg.FEBlist=lArDQGlobals.febsBarrelA+lArDQGlobals.febsEndcapA+lArDQGlobals.febsBarrelC+lArDQGlobals.febsEndcapC #to avoid having it empty, would it crash otherwise? + else: + #pass to algorithm +# customFEBStoMonitor_forAlgo=[[lArDQGlobals.dictBarrelEndcap[i[0]],lArDQGlobals.dictSides[i[1]],int(i[2]),int(i[3])] for i in customFEBStoMonitor] + # larNoiseCorrelMonAlg.FEBsToMonitor=customFEBStoMonitor_forAlgo + larNoiseCorrelMonAlg.PlotCustomFEBSset=True + larNoiseCorrelMonAlg.FEBlist=febsToMonitorBarrelA+febsToMonitorBarrelC+febsToMonitorEndcapA+febsToMonitorEndcapC + pass + pass + + #prepare the monitoring group + grpName="NoiseCorr" + larNoiseCorrelMonAlg.NoiseCorrGroupName=grpName + correlArray = helper.addArray([larNoiseCorrelMonAlg.FEBlist],larNoiseCorrelMonAlg,grpName,'/LAr/','run') +# correlArray = helper.addArray([lArDQGlobals.BarrelEndcap,lArDQGlobals.Sides,lArDQGlobals.Feedthrough_RangeMax,lArDQGlobals.Slot_RangeMax],larNoiseCorrelMonAlg,"NoiseCorrRAW",'/LAr/','run') + + hist_path='NoiseCorrelation/' + + average_plot_name="RAW_NoiseCorr_average" + average_var_and_name="chanMeanX,chanMean;"+average_plot_name + correlArray.defineHistogram(average_var_and_name, + title=average_plot_name, + type='TProfile', + path=hist_path+'BarrelA', + xbins=lArDQGlobals.FEB_N_channels,xmin=lArDQGlobals.FEB_channels_Min,xmax=lArDQGlobals.FEB_channels_Max, + pattern=febsToMonitorBarrelA) + + correlArray.defineHistogram(average_var_and_name, + title=average_plot_name, + type='TProfile', + path=hist_path+'EndcapA', + xbins=lArDQGlobals.FEB_N_channels,xmin=lArDQGlobals.FEB_channels_Min,xmax=lArDQGlobals.FEB_channels_Max, + pattern=febsToMonitorEndcapA) + + + correlArray.defineHistogram(average_var_and_name, + title=average_plot_name, + type='TProfile', + path=hist_path+'BarrelC', + xbins=lArDQGlobals.FEB_N_channels,xmin=lArDQGlobals.FEB_channels_Min,xmax=lArDQGlobals.FEB_channels_Max, + pattern=febsToMonitorBarrelC) + + correlArray.defineHistogram(average_var_and_name, + title=average_plot_name, + type='TProfile', + path=hist_path+'EndcapC', + xbins=lArDQGlobals.FEB_N_channels,xmin=lArDQGlobals.FEB_channels_Min,xmax=lArDQGlobals.FEB_channels_Max, + pattern=febsToMonitorEndcapC) + + + partialSum_plot_name="RAW_NoiseCorr_partialSum" + partialSum_var_and_name="chanPartSumX,chanPartSumY;"+partialSum_plot_name + + correlArray.defineHistogram(partialSum_var_and_name, + title=partialSum_plot_name, + type='TH2F', + weight='chanPartSum', + path=hist_path+'BarrelA', + xbins=lArDQGlobals.FEB_N_channels,xmin=lArDQGlobals.FEB_channels_Min,xmax=lArDQGlobals.FEB_channels_Max, + ybins=lArDQGlobals.FEB_N_channels,ymin=lArDQGlobals.FEB_channels_Min,ymax=lArDQGlobals.FEB_channels_Max, + pattern=febsToMonitorBarrelA) + + correlArray.defineHistogram(partialSum_var_and_name, + title=partialSum_plot_name, + type='TH2F', + weight='chanPartSum', + path=hist_path+'EndcapA', + xbins=lArDQGlobals.FEB_N_channels,xmin=lArDQGlobals.FEB_channels_Min,xmax=lArDQGlobals.FEB_channels_Max, + ybins=lArDQGlobals.FEB_N_channels,ymin=lArDQGlobals.FEB_channels_Min,ymax=lArDQGlobals.FEB_channels_Max, + pattern=febsToMonitorEndcapA) + + + correlArray.defineHistogram(partialSum_var_and_name, + title=partialSum_plot_name, + type='TH2F', + weight='chanPartSum', + path=hist_path+'BarrelC', + xbins=lArDQGlobals.FEB_N_channels,xmin=lArDQGlobals.FEB_channels_Min,xmax=lArDQGlobals.FEB_channels_Max, + ybins=lArDQGlobals.FEB_N_channels,ymin=lArDQGlobals.FEB_channels_Min,ymax=lArDQGlobals.FEB_channels_Max, + pattern=febsToMonitorBarrelC) + + correlArray.defineHistogram(partialSum_var_and_name, + title=partialSum_plot_name, + type='TH2F', + weight='chanPartSum', + path=hist_path+'EndcapC', + xbins=lArDQGlobals.FEB_N_channels,xmin=lArDQGlobals.FEB_channels_Min,xmax=lArDQGlobals.FEB_channels_Max, + ybins=lArDQGlobals.FEB_N_channels,ymin=lArDQGlobals.FEB_channels_Min,ymax=lArDQGlobals.FEB_channels_Max, + pattern=febsToMonitorEndcapC) + + print(correlArray) + + if isRun3Cfg(): + cfg.merge(helper.result()) + return cfg + else: + return helper.result() + + +if __name__=='__main__': + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + from AthenaCommon.Logging import log + from AthenaCommon.Constants import DEBUG #,WARNING + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + log.setLevel(DEBUG) + + + from LArMonitoring.LArMonConfigFlags import createLArMonConfigFlags + createLArMonConfigFlags() + + from AthenaConfiguration.TestDefaults import defaultTestFiles + ConfigFlags.Input.Files = defaultTestFiles.RAW + + ConfigFlags.Output.HISTFileName = 'LArNoiseCorrMonOutput.root' + ConfigFlags.DQ.enableLumiAccess = False + ConfigFlags.DQ.useTrigger = False + ConfigFlags.Beam.Type = 'collisions' + ConfigFlags.lock() + + from CaloRec.CaloRecoConfig import CaloRecoCfg + cfg=CaloRecoCfg(ConfigFlags) + + from LArCellRec.LArNoisyROSummaryConfig import LArNoisyROSummaryCfg + cfg.merge(LArNoisyROSummaryCfg(ConfigFlags)) + + # from LArMonitoring.LArNoiseCorrelationMonAlg import LArNoiseCorrelationMonConfig + aff_acc = LArNoiseCorrelationMonConfig(ConfigFlags) + + cfg.merge(aff_acc) + + log.setLevel(DEBUG) + ConfigFlags.dump() + f=open("LArNoiseCorrelationMon.pkl","wb") + cfg.store(f) + f.close() + +# cfg.run(100,OutputLevel=DEBUG) diff --git a/LArCalorimeter/LArMonitoring/python/LArNoisyROMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArNoisyROMonAlg.py index a0203ef6865ee8d0a0d64000b015243139873369..31d27d91ba7882874063a92017dfe980af76b119 100644 --- a/LArCalorimeter/LArMonitoring/python/LArNoisyROMonAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArNoisyROMonAlg.py @@ -124,7 +124,7 @@ def LArNoisyROMonConfigCore(helper,algoinstance,inputFlags, noisyROGroup = helper.addGroup( larNoisyROMonAlg, NoisyROMonGroupName, - '/LAr/NoisyRONewAlg/' + '/LAr/NoisyRO/' ) @@ -148,7 +148,7 @@ def LArNoisyROMonConfigCore(helper,algoinstance,inputFlags, xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max) for subdet in range(0,2): - hist_path='/LAr/NoisyRONewAlg/'+lArDQGlobals.SubDet[subdet]+'/' + hist_path='/LAr/NoisyRO/'+lArDQGlobals.SubDet[subdet]+'/' slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5 slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5 slot_n = int(slot_up - slot_low) @@ -157,6 +157,7 @@ def LArNoisyROMonConfigCore(helper,algoinstance,inputFlags, ft_n = int(ft_up - ft_low) darray = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larNoisyROMonAlg,lArDQGlobals.SubDet[subdet],topPath=hist_path) + # Known bad FEBS darray.defineHistogram('slotBad,FTBad;KnownBadFEB', title='Known Bad FEBs {0} ; Slot ; FT', type='TH2I', diff --git a/LArCalorimeter/LArMonitoring/python/LArRODMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArRODMonAlg.py index 7cafe8d3f5f45c3489497feb575cd0547f52c974..ab23c44b2255efe256d0fec528271379c4a0f2bb 100644 --- a/LArCalorimeter/LArMonitoring/python/LArRODMonAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArRODMonAlg.py @@ -80,7 +80,7 @@ def LArRODMonConfigCore(helper, algoinstance,inputFlags, cellDebug=False, dspDeb Group = helper.addGroup( larRODMonAlg, GroupName, - '/LAr/DSPMonitoringNewAlg' + '/LAr/DSPMonitoring' ) @@ -162,7 +162,7 @@ def LArRODMonConfigCore(helper, algoinstance,inputFlags, cellDebug=False, dspDeb ) #DQMD histos - dqmd_hist_path='/LAr/DSPMonitoringNewAlg/DQMD/' + dqmd_hist_path='/LAr/DSPMonitoring/DQMD/' darray = helper.addArray([lArDQGlobals.Partitions],larRODMonAlg,"RODMon") darray.defineHistogram('Ediff,Erange;DE_ranges', title='EOnline - E_offline for all ranges : E_offline - E_online (MeV) : Energy range',#'E_online - E_offline for all ranges : E_offline - E_online (MeV) : Energy range', type='TH2F', path=dqmd_hist_path, @@ -179,7 +179,7 @@ def LArRODMonConfigCore(helper, algoinstance,inputFlags, cellDebug=False, dspDeb #per partition, currently in one dir only - part_hist_path='/LAr/DSPMonitoringNewAlg/perPartition/' + part_hist_path='/LAr/DSPMonitoring/perPartition/' darray.defineHistogram('Ediff;DE', title='E_offline - E_online:E_offline - E_online', type='TH1F', path=part_hist_path, xbins=lArDQGlobals.DSPEnergy_Bins, xmin=lArDQGlobals.DSPEnergy_Min, xmax=lArDQGlobals.DSPEnergy_Max) @@ -190,19 +190,19 @@ def LArRODMonConfigCore(helper, algoinstance,inputFlags, cellDebug=False, dspDeb type='TH1F', path=part_hist_path, xbins=lArDQGlobals.DSPTime_Bins, xmin=lArDQGlobals.DSPTime_Min, xmax=lArDQGlobals.DSPTime_Max) - darray.defineHistogram('slot,FT;Out_E_FT_vs_SLOT',title='# of cells with E_offline - E_online > numerical precision : Slot : Feedthrough', + darray.defineHistogram('slot,FT;RAW_Out_E_FT_vs_SLOT',title='# of cells with E_offline - E_online > numerical precision : Slot : Feedthrough', type='TH2I', path=part_hist_path, weight='weight_e', xbins=lArDQGlobals.FEB_Slot["EMECA"][1], xmin=lArDQGlobals.FEB_Slot["EMECA"][0]-0.5, xmax=lArDQGlobals.FEB_Slot["EMECA"][1]+0.5, ybins=lArDQGlobals.FEB_Feedthrough["EMBA"][1]+1, ymin=lArDQGlobals.FEB_Feedthrough["EMBA"][0]-0.5, ymax=lArDQGlobals.FEB_Feedthrough["EMBA"][1]+0.5) - darray.defineHistogram('slot,FT;Out_T_FT_vs_SLOT',title='# of cells with E_offline - E_online > numerical precision : Slot : Feedthrough', + darray.defineHistogram('slot,FT;RAW_Out_T_FT_vs_SLOT',title='# of cells with E_offline - E_online > numerical precision : Slot : Feedthrough', type='TH2I', path=part_hist_path, weight='weight_t', xbins=lArDQGlobals.FEB_Slot["EMECA"][1], xmin=lArDQGlobals.FEB_Slot["EMECA"][0]-0.5, xmax=lArDQGlobals.FEB_Slot["EMECA"][1]+0.5, ybins=lArDQGlobals.FEB_Feedthrough["EMBA"][1]+1, ymin=lArDQGlobals.FEB_Feedthrough["EMBA"][0]-0.5, ymax=lArDQGlobals.FEB_Feedthrough["EMBA"][1]+0.5) - darray.defineHistogram('slot,FT;Out_Q_FT_vs_SLOT',title='# of cells with E_offline - E_online > numerical precision : Slot : Feedthrough', + darray.defineHistogram('slot,FT;RAW_Out_Q_FT_vs_SLOT',title='# of cells with E_offline - E_online > numerical precision : Slot : Feedthrough', type='TH2I', path=part_hist_path, weight='weight_q', xbins=lArDQGlobals.FEB_Slot["EMECA"][1], xmin=lArDQGlobals.FEB_Slot["EMECA"][0]-0.5, xmax=lArDQGlobals.FEB_Slot["EMECA"][1]+0.5, diff --git a/LArCalorimeter/LArMonitoring/src/LArNoiseCorrelationMonAlg.cxx b/LArCalorimeter/LArMonitoring/src/LArNoiseCorrelationMonAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bce34abd1dde3711fb63d4678c1fb65f07b81f29 --- /dev/null +++ b/LArCalorimeter/LArMonitoring/src/LArNoiseCorrelationMonAlg.cxx @@ -0,0 +1,314 @@ + +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ +/* +*/ + + +// ******************************************************************** +// NAME: LArNoiseCorrelationMonAlg.cxx +// PACKAGE: LArMonTools +// +// AUTHOR: Margherita Spalla (margherita.spalla@cern.ch) +// Based on structure of LArDigitMon by Helary Louis (helary@lapp.in2p3.fr) +// +// Computes and plots the correlation between single channels to monitor coherent noise. +// The correlation is computed as: +// corr(i,j) = Cov(i,j)/sqrt(Var(i)*Var(j)) where 'Cov(i,j)' is the sample covariance of channels i and j and 'Var(i)' is the sample variance of channel i. +// Variance and covariance are computed summing over all samples and all events for each channel: Cov(i,j)=[sum(x_i*x_j)-N*mean_i*mean_j]/(N-1) , where x_i is the single sample minus the pedestal. +// +// Correlation histograms are computed per FEB. The FEBs to be monitored are set in the JO. +// +// Available parameters in the jo file: +// 1) List of FEBs to be monitored: should be passed as a list of strings of the form 'BarrelCFT00Slot02'. If the list is empty, all FEBs are monitored. +// 2) control PublishAllFebsOnline: if it is set to true, switched off the monitoring in case the FEB list (1) is empty and the algorithm is running online. +// 3) list of triggers to be used ('TriggerChain'): to be passed as a single string "trigger_chain_1, trigger_chain_2". The default is "HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY", for the latter, only events in the abort gap are used, selection done by hand. +// 4) control IsCalibrationRun: to be set to true when running on calibration, it switches off the trigger selection. +// 5) control PublishPartialSums: tells the algorithm to also publish the partial sum histograms. default is false. + +// +// ******************************************************************** + + +//STL: +#include <sstream> +#include <iomanip> +#include <cmath> +#include <vector> +#include <algorithm> + +//ROOT +#include "TPRegexp.h" + + +//LAr infos: +#include "Identifier/HWIdentifier.h" +#include "LArIdentifier/LArOnlineID.h" +#include "LArRawEvent/LArDigit.h" +#include "LArRawEvent/LArDigitContainer.h" +#include "LArRecEvent/LArNoisyROSummary.h" + +//Events infos: +#include "xAODEventInfo/EventInfo.h" + +//for looping on FEBs +#include "LArRawEvent/LArFebHeaderContainer.h" + +//Helper: +#include "LArMonitoring/LArStrHelper.h" + +//Header: +#include "LArNoiseCorrelationMonAlg.h" + + + + + + +/*---------------------------------------------------------*/ +LArNoiseCorrelationMonAlg::LArNoiseCorrelationMonAlg( const std::string& name, ISvcLocator* pSvcLocator) + : AthMonitorAlgorithm(name, pSvcLocator), + m_LArOnlineIDHelper(nullptr), + m_badChannelMask("BadLArRawChannelMask",this) +{ + declareProperty("LArBadChannelMask",m_badChannelMask); +} + +/*---------------------------------------------------------*/ +LArNoiseCorrelationMonAlg::~LArNoiseCorrelationMonAlg() +{ } + + +/*---------------------------------------------------------*/ +StatusCode +LArNoiseCorrelationMonAlg::initialize() +{ + + ATH_MSG_INFO( "Initialize LArNoiseCorrelationMonAlg" ); + + ATH_CHECK(detStore()->retrieve( m_LArOnlineIDHelper, "LArOnlineID" )); + + ATH_CHECK(m_cablingKey.initialize()); + ATH_CHECK(m_keyPedestal.initialize()); + ATH_CHECK(m_LArDigitContainerKey.initialize()); + + /** Get bad-channel mask (only if jO IgnoreBadChannels is true)*/ + if (m_ignoreKnownBadChannels) { + ATH_CHECK(m_badChannelMask.retrieve()); + } else m_badChannelMask.disable(); + + /** Configure event info */ + ATH_CHECK(m_eventInfoKey.initialize()); + + // initialize superclass + ATH_CHECK( AthMonitorAlgorithm::initialize() ); + + /*now the group*/ + m_noiseCorrGroups=Monitored::buildToolMap<int>(m_tools,m_noiseCorrGroupName,m_FEBlist); + + return StatusCode::SUCCESS; +} + + +/*---------------------------------------------------------*/ +StatusCode +LArNoiseCorrelationMonAlg::fillHistograms(const EventContext& ctx) const +{ + if(m_plotsOFF) { + ATH_MSG_DEBUG("Plotting switched off, either we are online and custom FEB list is empty, OR something went wrong with the custom list of FEBs passed"); + return StatusCode::SUCCESS; + } + + ATH_MSG_DEBUG("in fillHists()" ); + + + /** check trigger */ + bool passTrig = m_isCalibrationRun; + if(!m_isCalibrationRun) { + /**EventID is a part of EventInfo, search event informations:*/ + SG::ReadHandle<xAOD::EventInfo> thisEvent{m_eventInfoKey,ctx}; + if (!thisEvent.isValid()) { + ATH_MSG_ERROR("xAOD::EventInfo retrieval failed"); + return StatusCode::FAILURE; + } + + const ToolHandle<Trig::TrigDecisionTool> trigTool=getTrigDecisionTool(); + + bool passBCID; + if(trigTool) { + // BCIDs of the abort gap + const int ABORT_GAP_START = 3446; + const int ABORT_GAP_END = 3563; + for(auto trig_chain : m_vTrigChainNames) { + passBCID = ((trig_chain == "HLT_noalg_cosmiccalo_L1RD1_EMPTY")?(thisEvent->bcid() >= ABORT_GAP_START && thisEvent->bcid() <= ABORT_GAP_END):true); + passTrig=(passTrig || (passBCID && trigTool->isPassed(trig_chain))); + } + } + } + + if (!passTrig) { + ATH_MSG_DEBUG ( " Failed trigger selection " ); + return StatusCode::SUCCESS; + } else { + ATH_MSG_DEBUG ( " Pass trigger selection " ); + } + + /*setup vectors for filling: want to use collactions and array or I'll call fill() tousands of times */ + std::map<std::string,std::vector<std::pair<int,double> > > meanMap; + std::map<std::string,std::vector<std::pair<std::pair<int,int>,double> > > partSumMap; + + /*retrieve cabling*/ + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey,ctx}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_ERROR("Do not have cabling map with key: "<<m_cablingKey.key()); + return StatusCode::FAILURE; + } + + /*retrieve pedestal*/ + SG::ReadCondHandle<ILArPedestal> pedestalHdl{m_keyPedestal,ctx}; + const ILArPedestal* pedestals=*pedestalHdl; + + /** retrieve LArDigitContainer*/ + SG::ReadHandle<LArDigitContainer> pLArDigitContainer{m_LArDigitContainerKey,ctx}; + + ATH_MSG_DEBUG ( " LArDigitContainer size "<<pLArDigitContainer->size()<<" for key "<<m_LArDigitContainerKey); + /** Define iterators to loop over Digits containers*/ + LArDigitContainer::const_iterator itDig = pLArDigitContainer->begin(); + LArDigitContainer::const_iterator itDig_2; + LArDigitContainer::const_iterator itDig_e= pLArDigitContainer->end(); + + /** helper for feb names*/ + LArStrHelper larStrHelp; + + /** Loop over digits*/ + for ( ; itDig!=itDig_e;++itDig) { + const LArDigit* pLArDigit = *itDig; + + /** Retrieve pedestals */ + HWIdentifier id = pLArDigit->hardwareID(); + CaloGain::CaloGain gain = pLArDigit->gain(); + float pedestal = pedestals->pedestal(id,gain); + + if(!isGoodChannel(id,pedestal,cabling)) + continue; + + /** Retrieve samples*/ + const std::vector<short>* digito = &pLArDigit->samples(); + + /** Retrieve once, all the cell info:*/ + HWIdentifier febID = m_LArOnlineIDHelper->feb_Id(id); + int ch1 = m_LArOnlineIDHelper->channel(id); + + std::string febSTR = larStrHelp.febNameString(m_LArOnlineIDHelper->isEMBchannel(id),m_LArOnlineIDHelper->pos_neg(id),m_LArOnlineIDHelper->feedthrough(id),m_LArOnlineIDHelper->slot(id)); + //febString(febID); + /** If we are only plotting a sub-set of FEBs, check if it belongs to that set */ + if(m_plotCustomFEBSset) { + bool plotThisFEB=false; + for(uint ifm=0;ifm<m_FEBlist.size();ifm++) { + if(febSTR==m_FEBlist[ifm]) { + plotThisFEB=true; + break; + } + } + if(!plotThisFEB) continue; + } + + /** Second loop over digit */ + bool av_set=false; + for(itDig_2 = itDig; itDig_2!=itDig_e;++itDig_2) + { + const LArDigit* pLArDigit2 = *itDig_2; + HWIdentifier id2 = pLArDigit2->hardwareID(); + if(m_LArOnlineIDHelper->feb_Id(id2)!=febID) continue; + + /** get the pedestal */ + CaloGain::CaloGain gain2 = pLArDigit2->gain(); + float pedestal2 = pedestals->pedestal(id2,gain2); + + if(!isGoodChannel(id2,pedestal2,cabling)) continue; + + /** get the channel number */ + int ch2 = m_LArOnlineIDHelper->channel(id2); + + /** get the samples */ + const std::vector<short>* digito2 = &pLArDigit2->samples(); + std::vector<short>::const_iterator iterSam2= digito2->begin(); + std::vector<short>::const_iterator iterSam= digito->begin(); + + double part_sum=0; + int Nsam=pLArDigit->nsamples(); + if(pLArDigit2->nsamples()!=Nsam) + { + ATH_MSG_WARNING( Form("Different number of samples between channels %d vs %d: skipping these two",Nsam,pLArDigit2->nsamples()) ); + continue; + } + + /** Loop over the samples and compute average and sum of squares*/ + for(int i=0;i<Nsam;i++,iterSam++,iterSam2++) + { + if(!av_set) { /** fill the mean only once per ch1. This code is here to avoid one additional loop over samples before the second loop. */ + meanMap[febSTR].push_back(std::make_pair(ch1,(*iterSam-pedestal))); + } + /** now compute sum of squares */ + part_sum+=((*iterSam-pedestal)*(*iterSam2-pedestal2)); + } + av_set=true; /** now the average is set and I won't do this again in next ch2 loop*/ + partSumMap[febSTR].push_back(std::make_pair(std::make_pair(ch1,ch2),part_sum)); + }/** End of second loop on LArDigit*/ + }/** End of loop on LArDigit*/ + + //now fill the plots + for(std::map<std::string,std::vector<std::pair<int,double> > >::iterator feb_iter = meanMap.begin(); feb_iter != meanMap.end(); ++feb_iter) { + std::string febid = feb_iter->first; + auto chanMean = Monitored::Collection("chanMean",feb_iter->second,[](const std::pair<int,double> ch){return ch.second;}); + auto chanMeanX = Monitored::Collection("chanMeanX",feb_iter->second,[](const std::pair<int,double> ch){return ch.first;}); + auto chanPartSum = Monitored::Collection("chanPartSum",partSumMap[febid],[](const std::pair<std::pair<int,int>,double> ch){return ch.second;}); + auto chanPartSumX = Monitored::Collection("chanPartSumX",partSumMap[febid],[](const std::pair<std::pair<int,int>,double> ch){return std::min(ch.first.first,ch.first.second);}); + auto chanPartSumY = Monitored::Collection("chanPartSumY",partSumMap[febid],[](const std::pair<std::pair<int,int>,double> ch){return std::max(ch.first.first,ch.first.second);}); //needs max and min to fill the correlation plot always on the same side of the diagonal, otherwise it would be mixed up + + //fill the correct FEB + fill(m_tools[m_noiseCorrGroups.at(febid)],chanMean,chanMeanX,chanPartSum,chanPartSumX,chanPartSumY); + + /* actual correlations will be computed at post-processing stage */ + + } + return StatusCode::SUCCESS; +} + + + +/*---------------------------------------------------------*/ +/** check if channel is ok for monitoring */ + bool LArNoiseCorrelationMonAlg::isGoodChannel(const HWIdentifier ID,const float ped, const LArOnOffIdMapping *cabling) const + { + /** Remove problematic channels*/ + if (m_ignoreKnownBadChannels && m_badChannelMask->cellShouldBeMasked(ID)) + return false; + + /**skip cells with no pedestals reference in db.*/ + if(ped <= (1.0+LArElecCalib::ERRORCODE)) + return false; + + /**skip disconnected channels:*/ + if(!cabling->isOnlineConnected(ID)) + return false; + + return true; + } + + +/*---------------------------------------------------------*/ +/** build the FEB string, following instructions from python config */ +std::string LArNoiseCorrelationMonAlg::febString(const HWIdentifier afeb) const { + std::string eb=m_LArOnlineIDHelper->isEMBchannel(afeb) ? "Barrel" : "Endcap"; + std::string ac=(m_LArOnlineIDHelper->pos_neg(afeb)==1) ? "A" : "C"; + int FT = m_LArOnlineIDHelper->feedthrough(afeb); + int SL = m_LArOnlineIDHelper->slot(afeb); + return eb+ac+Form("ft%02d",FT)+Form("slot%02d",SL); +} + + + + diff --git a/LArCalorimeter/LArMonitoring/src/LArNoiseCorrelationMonAlg.h b/LArCalorimeter/LArMonitoring/src/LArNoiseCorrelationMonAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..b2e49d0deac53d95a624ed9fa654277493841d35 --- /dev/null +++ b/LArCalorimeter/LArMonitoring/src/LArNoiseCorrelationMonAlg.h @@ -0,0 +1,102 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +/** + * @class LArNoiseCorrelationMonAlg + * @author Margherita Spalla + * base on LArNoiseCorrelationMon + * + */ + +#ifndef LARMONITORING_LARCORRMON_H +#define LARMONITORING_LARCORRMON_H + +//inheritance: +#include "AthenaMonitoring/AthMonitorAlgorithm.h" + + +//LAr services: +#include "LArElecCalib/ILArPedestal.h" +#include "LArRecConditions/ILArBadChannelMasker.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/ReadHandleKey.h" +#include "LArCabling/LArOnOffIdMapping.h" + + +//STL: +#include <string> + + + +class LArOnlineID; +class HWIdentifier; + + +class LArNoiseCorrelationMonAlg final: public AthMonitorAlgorithm +{ + + +public: + LArNoiseCorrelationMonAlg(const std::string& name, ISvcLocator* pSvcLocator); + + /** @brief Default destructor */ + virtual ~LArNoiseCorrelationMonAlg(); + + + + virtual StatusCode initialize() override; + virtual StatusCode fillHistograms(const EventContext& ctx) const override; + + +private: + + /** services */ + const LArOnlineID* m_LArOnlineIDHelper; + + /** Handle to bad-channel mask */ + ToolHandle<ILArBadChannelMasker> m_badChannelMask; + + /** Handle to cabling */ + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + + /** Handle to pedestal */ + SG::ReadCondHandleKey<ILArPedestal> m_keyPedestal{this,"LArPedestalKey","LArPedestal","SG key of LArPedestal CDO"}; + + /** Handle to event info */ + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfo", "EventInfo"}; + + + /**correlation histograms*/ + + /** list of FEBs to monitor. FEB names are expected to be strings of the form used in 'febString' method, e.g. 'BarrelCFT00Slot02' */ + + Gaudi::Property<std::vector<std::string > > m_FEBsToMonitor {this, "FEBsToMonitor", std::vector<std::string>(0)}; + Gaudi::Property<bool> m_plotCustomFEBSset {this, "PlotCustomFEBSset", false}; + Gaudi::Property<std::vector<std::string> > m_FEBlist {this, "FEBlist", std::vector<std::string>(0)}; + + + Gaudi::Property<bool> m_plotsOFF {this, "PlotsOFF", false}; //to avoid plotting everything when online or in case the wrong custom list is passed + + /** to avoid asking for triggers in case of a calibration run*/ + Gaudi::Property<bool> m_isCalibrationRun {this, "IsCalibrationRun", false}; + + + /**bool use to mask the bad channels*/ + Gaudi::Property<bool> m_ignoreKnownBadChannels{this, "IgnoreBadChannels", false}; + + /** Handle to digits */ + SG::ReadHandleKey<LArDigitContainer> m_LArDigitContainerKey{this,"LArDigitContainerKey","FREE","SG key of LArDigitContainer read from Bytestream"}; + + /** the group array **/ + Gaudi::Property<std::string> m_noiseCorrGroupName {this, "NoiseCorrGroupName", "NoiseCorr"}; + std::map<std::string,int> m_noiseCorrGroups; + + /** Declare methods used*/ + bool isGoodChannel(const HWIdentifier id,const float ped,const LArOnOffIdMapping *cabling) const; + std::string febString(const HWIdentifier) const; + + +}; + +#endif diff --git a/LArCalorimeter/LArMonitoring/src/LArStrHelper.cxx b/LArCalorimeter/LArMonitoring/src/LArStrHelper.cxx new file mode 100644 index 0000000000000000000000000000000000000000..aac92cc77644363185c466adfad0bba5e0d0dbdb --- /dev/null +++ b/LArCalorimeter/LArMonitoring/src/LArStrHelper.cxx @@ -0,0 +1,40 @@ + +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "LArMonitoring/LArStrHelper.h" + + + + +std::string LArStrHelper::febNameString(bool isBarrel,int pos_neg ,int feedthrough,int slot) const { + std::string eb=isBarrel ? "Barrel" : "Endcap"; + std::string ac=(pos_neg==1) ? "A" : "C"; + return eb+ac+Form("ft%02d",feedthrough)+Form("slot%02d",slot); +} + + +/** fix custom strings to avoid errors due to uppr-lower cases */ +std::string LArStrHelper::fixFEBname(TString nm) const { + TString res=nm; + res.ToLower(); + res.ReplaceAll("barrela","BarrelA"); + res.ReplaceAll("barrelc","BarrelC"); + res.ReplaceAll("endcapa","EndcapA"); + res.ReplaceAll("endcapc","EndcapC"); + res.ReplaceAll("endcapa","EndcapA"); + //check for single digit slots of feedthrough and try to correct them + int pos = res.Index("ft")+2; + TString num=res(pos,2); + if(!num.IsDec()) { + num=num(0,1); + if(num.IsDec()) res.Replace(pos,1,"0"+num,2); + } + pos = res.Index("slot")+4; + num = res(pos,2); + if(num.Length()<2) { + if(num.IsDec()) res.Replace(pos,1,"0"+num,2); + } + return (std::string)res; +} diff --git a/LArCalorimeter/LArMonitoring/src/components/LArMonitoring_entries.cxx b/LArCalorimeter/LArMonitoring/src/components/LArMonitoring_entries.cxx index e4c3c673647f45df3ad1d998dfb71b383c11d358..89d8890e0719d1fa7e859ee69c2d5d905f500881 100755 --- a/LArCalorimeter/LArMonitoring/src/components/LArMonitoring_entries.cxx +++ b/LArCalorimeter/LArMonitoring/src/components/LArMonitoring_entries.cxx @@ -7,7 +7,7 @@ #include "../LArNoisyROMonAlg.h" #include "../LArHVCorrectionMonAlg.h" #include "../LArCosmicsMonAlg.h" - +#include "../LArNoiseCorrelationMonAlg.h" DECLARE_COMPONENT(LArCollisionTimeMonAlg) DECLARE_COMPONENT(LArAffectedRegionsAlg) @@ -18,3 +18,4 @@ DECLARE_COMPONENT(LArCoverageAlg) DECLARE_COMPONENT(LArNoisyROMonAlg) DECLARE_COMPONENT(LArHVCorrectionMonAlg) DECLARE_COMPONENT(LArCosmicsMonAlg) +DECLARE_COMPONENT(LArNoiseCorrelationMonAlg) diff --git a/LArCalorimeter/LArOnlDbPrep/CMakeLists.txt b/LArCalorimeter/LArOnlDbPrep/CMakeLists.txt index 4bd32ce71f6ebdbd8e52b5f4e6151c25789a9959..c35e7186ad9f2cb8a1ff774586a8a8e17c7939a4 100644 --- a/LArCalorimeter/LArOnlDbPrep/CMakeLists.txt +++ b/LArCalorimeter/LArOnlDbPrep/CMakeLists.txt @@ -1,40 +1,20 @@ -################################################################################ -# Package: LArOnlDbPrep -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArOnlDbPrep ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Calorimeter/CaloTriggerTool - Control/AthenaBaseComps - GaudiKernel - LArCalorimeter/LArRecConditions - LArCalorimeter/LArCabling - PRIVATE - Calorimeter/CaloDetDescr - Calorimeter/CaloInterface - Control/StoreGate - Database/AthenaPOOL/AthenaPoolUtilities - LArCalorimeter/LArCOOLConditions - LArCalorimeter/LArIdentifier ) - # External dependencies: find_package( COOL COMPONENTS CoolKernel ) find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_component( LArOnlDbPrep src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CaloIdentifier CaloTriggerToolLib AthenaBaseComps GaudiKernel LArRecConditions LArCablingLib CaloDetDescrLib StoreGateLib SGtests AthenaPoolUtilities LArCOOLConditions LArIdentifier CaloInterfaceLib ) + INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} + LINK_LIBRARIES ${COOL_LIBRARIES} ${CORAL_LIBRARIES} CaloIdentifier CaloTriggerToolLib AthenaBaseComps GaudiKernel LArRecConditions LArCablingLib CaloDetDescrLib StoreGateLib AthenaPoolUtilities LArCOOLConditions LArIdentifier CaloInterfaceLib ) # Install files from the package: -atlas_install_headers( LArOnlDbPrep ) atlas_install_joboptions( share/*.py ) atlas_install_scripts( share/*.sh ) diff --git a/LArCalorimeter/LArROD/CMakeLists.txt b/LArCalorimeter/LArROD/CMakeLists.txt index ad2d74386b4dd0d379771c46e012b1de023efb13..c53b25571f05363e89f606f199e43a9d8db36461 100644 --- a/LArCalorimeter/LArROD/CMakeLists.txt +++ b/LArCalorimeter/LArROD/CMakeLists.txt @@ -1,35 +1,8 @@ -################################################################################ -# Package: LArROD -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArROD ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - Control/StoreGate - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArCabling - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawConditions - LArCalorimeter/LArRawEvent - LArCalorimeter/LArRawUtils - LArCalorimeter/LArRecConditions - LArCalorimeter/LArRecUtils - TestBeam/TBEvent - PRIVATE - Control/CxxUtils - Calorimeter/CaloDetDescr - Calorimeter/CaloEvent - Commission/CommissionEvent - Control/AthContainers - Database/AthenaPOOL/AthenaPoolUtilities - LArCalorimeter/LArCOOLConditions ) - # External dependencies: find_package( CLHEP ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) @@ -42,8 +15,8 @@ atlas_add_library( LArRODLib INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier AthenaBaseComps Identifier GaudiKernel LArIdentifier LArRawConditions LArRawEvent LArRecConditions TBEvent StoreGateLib SGtests LArCablingLib LArRawUtilsLib LArRecUtilsLib CaloDetDescrLib - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CommissionEvent AthContainers AthenaPoolUtilities LArCOOLConditions ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier AthContainers AthenaBaseComps AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArRawConditions LArRawEvent LArRecConditions TBEvent StoreGateLib LArCablingLib LArElecCalib LArRawUtilsLib LArRecUtilsLib + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloDetDescrLib CommissionEvent LArCOOLConditions ) atlas_add_component( LArROD src/components/*.cxx diff --git a/LArCalorimeter/LArRawConditions/CMakeLists.txt b/LArCalorimeter/LArRawConditions/CMakeLists.txt index 645d7097b2336815e9a722f7300781c72075530b..92accfdbc3bb88beda0fc13cc64f43956bea8929 100644 --- a/LArCalorimeter/LArRawConditions/CMakeLists.txt +++ b/LArCalorimeter/LArRawConditions/CMakeLists.txt @@ -1,56 +1,28 @@ -################################################################################ -# Package: LArRawConditions -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArRawConditions ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Control/AthenaKernel - Control/AthContainers - Control/SGTools - Control/StoreGate - Database/AthenaPOOL/AthenaPoolUtilities - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - LArCalorimeter/LArCabling - LArCalorimeter/LArRecConditions - PRIVATE - DetectorDescription/IdDictParser - LArCalorimeter/LArTools ) - -# External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - # Component(s) in the package: atlas_add_library( LArRawConditions src/*.cxx PUBLIC_HEADERS LArRawConditions - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES CaloIdentifier AthenaKernel AthContainers SGTools AthenaPoolUtilities Identifier GaudiKernel LArIdentifier StoreGateLib SGtests LArToolsLib LArCablingLib LArRecConditions - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) + LINK_LIBRARIES CaloIdentifier AthenaKernel AthContainers AthenaPoolUtilities Identifier GaudiKernel LArIdentifier StoreGateLib LArElecCalib LArCablingLib ) atlas_add_dictionary( LArRawConditions1Dict LArRawConditions/LArRawConditionsDict1.h LArRawConditions/selection1.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} CaloIdentifier AthenaKernel AthContainers SGTools StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArToolsLib LArCablingLib LArRawConditions LArRecConditions) + LINK_LIBRARIES LArRawConditions ) atlas_add_dictionary( LArRawConditions2Dict LArRawConditions/LArRawConditionsDict2.h LArRawConditions/selection2.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} CaloIdentifier AthenaKernel AthContainers SGTools StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArToolsLib LArCablingLib LArRawConditions ) + LINK_LIBRARIES LArRawConditions ) # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) - atlas_add_test( LArConditionsContainerDB_test SOURCES test/LArConditionsContainerDB_test.cxx LINK_LIBRARIES LArRawConditions ) diff --git a/LArCalorimeter/LArRawEvent/CMakeLists.txt b/LArCalorimeter/LArRawEvent/CMakeLists.txt index a2b566bebfee4e44083e102ed639f5c608be8372..708999adfe5ba4c1cb40a085222402d389d2ad8e 100644 --- a/LArCalorimeter/LArRawEvent/CMakeLists.txt +++ b/LArCalorimeter/LArRawEvent/CMakeLists.txt @@ -1,34 +1,20 @@ -################################################################################ -# Package: LArRawEvent -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArRawEvent ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Control/AthenaKernel - Control/AthContainers - DetectorDescription/Identifier ) - # External dependencies: find_package( CLHEP ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_library( LArRawEvent src/*.cxx PUBLIC_HEADERS LArRawEvent INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier AthContainers Identifier - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel CaloIdentifier AthContainers Identifier ) atlas_add_dictionary( LArRawEventDict LArRawEvent/LArRawEventDict.h LArRawEvent/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloIdentifier AthContainers Identifier AthenaKernel LArRawEvent ) - + LINK_LIBRARIES LArRawEvent ) diff --git a/LArCalorimeter/LArRawUtils/CMakeLists.txt b/LArCalorimeter/LArRawUtils/CMakeLists.txt index 5c672622a834872fc4b386260ccefa636dba2f13..1eacf72f7c56f243264910aa1a45585581ef59c8 100644 --- a/LArCalorimeter/LArRawUtils/CMakeLists.txt +++ b/LArCalorimeter/LArRawUtils/CMakeLists.txt @@ -1,31 +1,13 @@ -################################################################################ -# Package: LArRawUtils -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArRawUtils ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Calorimeter/CaloTTDetDescr - Control/AthenaBaseComps - Control/AthenaKernel - Control/StoreGate - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawEvent - Calorimeter/CaloTriggerTool - PRIVATE - DetectorDescription/AtlasDetDescr - LArCalorimeter/LArCabling ) - # Component(s) in the package: atlas_add_library( LArRawUtilsLib src/*.cxx PUBLIC_HEADERS LArRawUtils - LINK_LIBRARIES CaloIdentifier CaloTTDetDescr AthenaBaseComps AthenaKernel Identifier GaudiKernel LArIdentifier LArRawEvent StoreGateLib SGtests CaloTriggerToolLib LArToolsLib + LINK_LIBRARIES CaloIdentifier CaloTTDetDescr AthenaBaseComps AthenaKernel Identifier GaudiKernel LArCablingLib LArIdentifier LArRawEvent StoreGateLib CaloTriggerToolLib PRIVATE_LINK_LIBRARIES AtlasDetDescr ) atlas_add_component( LArRawUtils diff --git a/LArCalorimeter/LArRecConditions/CMakeLists.txt b/LArCalorimeter/LArRecConditions/CMakeLists.txt index bd92fe9a79be1020bc5015049e87b03a82430647..6e20c9ac90d03c0e345209b9da8e8712294f7b6a 100644 --- a/LArCalorimeter/LArRecConditions/CMakeLists.txt +++ b/LArCalorimeter/LArRecConditions/CMakeLists.txt @@ -1,41 +1,26 @@ -################################################################################ -# Package: LArRecConditions -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArRecConditions ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - LArCalorimeter/LArIdentifier - Control/AthenaKernel - Control/AthenaBaseComps - DetectorDescription/Identifier - GaudiKernel - PRIVATE - LArCalorimeter/LArElecCalib - LArCalorimeter/LArCabling ) - # External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) +find_package( CORAL COMPONENTS CoralBase ) # Component(s) in the package: atlas_add_library( LArRecConditions src/*.cxx PUBLIC_HEADERS LArRecConditions - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES CaloIdentifier LArIdentifier AthenaKernel Identifier GaudiKernel AthenaBaseComps LArElecCalib LArCablingLib - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) + INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} + LINK_LIBRARIES ${CORAL_LIBRARIES} CaloIdentifier AthenaKernel Identifier GaudiKernel AthenaBaseComps LArElecCalib LArCablingLib + PRIVATE_LINK_LIBRARIES LArIdentifier ) atlas_add_dictionary( LArRecConditionsDict LArRecConditions/LArRecConditionsDict.h LArRecConditions/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} CaloIdentifier AthenaKernel Identifier GaudiKernel LArRecConditions) + LINK_LIBRARIES LArRecConditions ) +# Test(s) in the package: atlas_add_test (test_LArBadChannelCont - SOURCES - test/test_LArBadChannelCont.cxx - LINK_LIBRARIES Identifier CxxUtils StoreGateLib LArRecConditions - ) + SOURCES + test/test_LArBadChannelCont.cxx + LINK_LIBRARIES LArRecConditions ) diff --git a/LArCalorimeter/LArRecEvent/CMakeLists.txt b/LArCalorimeter/LArRecEvent/CMakeLists.txt index 1f4fa867e5d1ab40e626c68b99cce3363fd3768d..efd6bcdb7bcfc88c27a46f648d9b146fccf0876f 100644 --- a/LArCalorimeter/LArRecEvent/CMakeLists.txt +++ b/LArCalorimeter/LArRecEvent/CMakeLists.txt @@ -1,34 +1,16 @@ -################################################################################ -# Package: LArRecEvent -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArRecEvent ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloEvent - Calorimeter/CaloIdentifier - Control/AthenaKernel - Control/AthContainers - DetectorDescription/Identifier - PRIVATE - Event/FourMomUtils ) - -# External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - # Component(s) in the package: atlas_add_library( LArRecEvent src/*.cxx PUBLIC_HEADERS LArRecEvent - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES CaloEvent CaloIdentifier AthContainers Identifier - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} FourMomUtils ) + LINK_LIBRARIES CaloEvent CaloIdentifier AthContainers AthenaKernel Identifier + PRIVATE_LINK_LIBRARIES FourMomUtils ) atlas_add_dictionary( LArRecEventDict LArRecEvent/LArRecEventDict.h LArRecEvent/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloIdentifier AthContainers Identifier FourMomUtils LArRecEvent ) - + LINK_LIBRARIES LArRecEvent ) diff --git a/LArCalorimeter/LArRecUtils/CMakeLists.txt b/LArCalorimeter/LArRecUtils/CMakeLists.txt index 1f2fb686f8774cf687f8934b9476131ac395b061..1645d736d9d6368aded27a11b599cee93700b803 100644 --- a/LArCalorimeter/LArRecUtils/CMakeLists.txt +++ b/LArCalorimeter/LArRecUtils/CMakeLists.txt @@ -1,67 +1,32 @@ -################################################################################ -# Package: LArRecUtils -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArRecUtils ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloDetDescr - Calorimeter/CaloEvent - Calorimeter/CaloIdentifier - Calorimeter/CaloInterface - Calorimeter/CaloUtils - Calorimeter/CaloConditions - Control/AthenaBaseComps - Control/AthenaKernel - Control/AthAllocators - Control/StoreGate - Database/AthenaPOOL/AthenaPoolUtilities - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArCabling - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawConditions - LArCalorimeter/LArRawEvent - LArCalorimeter/LArRecEvent - PRIVATE - AtlasTest/TestTools - Calorimeter/CaloGeoHelpers - Control/SGTools - Event/xAOD/xAODEventInfo - LArCalorimeter/LArCOOLConditions - LArCalorimeter/LArRecConditions - LArCalorimeter/LArRawUtils - Tools/PathResolver ) - # External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) +find_package( Boost ) find_package( CLHEP ) find_package( Eigen ) -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) +find_package( CORAL COMPONENTS CoralBase ) # Component(s) in the package: atlas_add_library( LArRecUtilsLib src/*.cxx PUBLIC_HEADERS LArRecUtils - INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CORAL_LIBRARIES} ${EIGEN_LIBRARIES} CaloEvent CaloIdentifier AthenaBaseComps AthenaKernel AthAllocators AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArRawEvent LArRecEvent CaloDetDescrLib CaloUtilsLib StoreGateLib SGtests LArCablingLib LArRawUtilsLib LArRecConditions LArRawConditions - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} TestTools CaloGeoHelpers SGTools xAODEventInfo LArCOOLConditions PathResolver CaloConditions ) + LINK_LIBRARIES AthAllocators AthenaBaseComps AthenaKernel CaloIdentifier CaloUtilsLib LArCOOLConditions LArElecCalib LArIdentifier LArRawEvent LArRecConditions LArRecEvent StoreGateLib + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${CORAL_LIBRARIES} ${EIGEN_LIBRARIES} ${ROOT_LIBRARIES} AthenaPoolUtilities CaloConditions CaloDetDescrLib CaloEvent CaloGeoHelpers CaloInterfaceLib GaudiKernel Identifier LArCablingLib LArHV LArRawConditions LArRawUtilsLib LArReadoutGeometry PathResolver SGTools ) atlas_add_component( LArRecUtils src/components/*.cxx - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} CaloDetDescrLib CaloEvent CaloIdentifier CaloUtilsLib AthenaBaseComps AthenaKernel AthAllocators StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArCablingLib LArIdentifier LArRawConditions LArRawEvent LArRecEvent TestTools CaloGeoHelpers SGTools xAODEventInfo LArCOOLConditions LArRawUtilsLib PathResolver LArRecUtilsLib LArRecConditions LArRawConditions CaloConditions) + LINK_LIBRARIES LArRecUtilsLib ) +# Test(s) in the package: atlas_add_test( dummy_test SOURCES test/dummy_test.cxx - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} CaloDetDescrLib CaloEvent CaloIdentifier CaloUtilsLib AthenaBaseComps AthenaKernel AthAllocators StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArCablingLib LArIdentifier LArRawConditions LArRawEvent LArRecEvent TestTools CaloGeoHelpers SGTools xAODEventInfo LArCOOLConditions LArRawUtilsLib CaloConditions PathResolver LArRecUtilsLib ) + LINK_LIBRARIES LArRecUtilsLib ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/LArCalorimeter/LArRegionSelector/CMakeLists.txt b/LArCalorimeter/LArRegionSelector/CMakeLists.txt index f616cf4727e57c05f17c21f78da1f6bc2accdd1d..46f91af193060d053a0367f6b9040e3bfb09adf5 100644 --- a/LArCalorimeter/LArRegionSelector/CMakeLists.txt +++ b/LArCalorimeter/LArRegionSelector/CMakeLists.txt @@ -1,30 +1,8 @@ -################################################################################ -# Package: LArRegionSelector -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArRegionSelector ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - DetectorDescription/Identifier - DetectorDescription/IRegionSelector - DetectorDescription/RegionSelector - DetectorDescription/RegSelLUT - InnerDetector/InDetConditions/PixelConditionsData - GaudiKernel - PRIVATE - Calorimeter/CaloDetDescr - Calorimeter/CaloTTDetDescr - Calorimeter/CaloTriggerTool - Control/StoreGate - Event/ByteStreamData - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawUtils - LArCalorimeter/LArCabling ) - # External dependencies: find_package( tdaq-common ) @@ -33,9 +11,7 @@ atlas_add_component( LArRegionSelector src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} CaloIdentifier AthenaBaseComps Identifier RegionSelectorLib GaudiKernel CaloDetDescrLib CaloTTDetDescr CaloTriggerToolLib StoreGateLib SGtests ByteStreamData ByteStreamData_test LArIdentifier LArRawUtilsLib LArCablingLib PixelConditionsData ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} CaloIdentifier AthenaBaseComps Identifier IRegionSelector RegionSelectorLib GaudiKernel CaloDetDescrLib CaloTTDetDescr CaloTriggerToolLib StoreGateLib ByteStreamData LArIdentifier LArRawUtilsLib PixelConditionsData ) # Install files from the package: -atlas_install_headers( LArRegionSelector ) atlas_install_joboptions( share/*.py ) - diff --git a/LArCalorimeter/LArSim/CMakeLists.txt b/LArCalorimeter/LArSim/CMakeLists.txt index 6bac08440bc87f032b66a6b5ec5fcb0261058dbf..eb83225f98bcf974d0d5fef86559423bde6fd7f9 100644 --- a/LArCalorimeter/LArSim/CMakeLists.txt +++ b/LArCalorimeter/LArSim/CMakeLists.txt @@ -1,26 +1,13 @@ -################################################################################ -# Package: LArSim -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArSim ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - GaudiKernel - LArCalorimeter/LArSimEvent - PRIVATE - Calorimeter/CaloIdentifier - Control/StoreGate ) - # Component(s) in the package: atlas_add_component( LArSim src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel LArSimEvent CaloIdentifier StoreGateLib SGtests ) + LINK_LIBRARIES AthenaBaseComps GaudiKernel LArSimEvent CaloIdentifier StoreGateLib ) # Install files from the package: -atlas_install_headers( LArSim ) atlas_install_joboptions( share/*.txt share/*.py ) - diff --git a/LArCalorimeter/LArSimEvent/CMakeLists.txt b/LArCalorimeter/LArSimEvent/CMakeLists.txt index 48067c191d90f80495a0196f3d53886ca663f7f4..6fca6c43202638ac6b2abcd0a13cf3d05476df93 100644 --- a/LArCalorimeter/LArSimEvent/CMakeLists.txt +++ b/LArCalorimeter/LArSimEvent/CMakeLists.txt @@ -1,35 +1,20 @@ -################################################################################ -# Package: LArSimEvent -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArSimEvent ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaKernel - DetectorDescription/Identifier - Simulation/HitManagement - PRIVATE - Control/StoreGate ) - # External dependencies: find_package( CLHEP ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_library( LArSimEvent src/*.cxx PUBLIC_HEADERS LArSimEvent INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel Identifier HitManagement StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel Identifier HitManagement StoreGateLib ) atlas_add_dictionary( LArSimEventDict LArSimEvent/LArSimEventDict.h LArSimEvent/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel Identifier HitManagement StoreGateLib SGtests LArSimEvent ) - + LINK_LIBRARIES LArSimEvent ) diff --git a/LArCalorimeter/LArTBEvent/CMakeLists.txt b/LArCalorimeter/LArTBEvent/CMakeLists.txt index fdc8a60c5c6b99a3d37e97993e2161dc5553d1a0..d70559557f2e410650ec54329d2b3650854f304b 100644 --- a/LArCalorimeter/LArTBEvent/CMakeLists.txt +++ b/LArCalorimeter/LArTBEvent/CMakeLists.txt @@ -1,15 +1,8 @@ -################################################################################ -# Package: LArTBEvent -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArTBEvent ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthContainers - Control/AthenaKernel ) - # Component(s) in the package: atlas_add_library( LArTBEvent src/*.cxx diff --git a/LArCalorimeter/LArTest/LArCalibTest/CMakeLists.txt b/LArCalorimeter/LArTest/LArCalibTest/CMakeLists.txt index e0efce0719a38bf92d08808404d8717644af8bdd..c373496edc31731f7d53eeb32d9b91e049ece7bc 100644 --- a/LArCalorimeter/LArTest/LArCalibTest/CMakeLists.txt +++ b/LArCalorimeter/LArTest/LArCalibTest/CMakeLists.txt @@ -1,27 +1,10 @@ -################################################################################ -# Package: LArCalibTest -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArCalibTest ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloConditions - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - GaudiKernel - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawEvent - LArCalorimeter/LArRecConditions - LArCalorimeter/LArCabling - PRIVATE - Calorimeter/CaloDetDescr - Control/StoreGate - Event/xAOD/xAODEventInfo - LArCalorimeter/LArRawConditions - LArCalorimeter/LArCOOLConditions - Tools/PathResolver ) +# External dependencies: +find_package( CORAL COMPONENTS CoralBase ) # Component(s) in the package: atlas_add_component( LArCalibTest @@ -29,10 +12,9 @@ atlas_add_component( LArCalibTest src/DumpCaloBadChannels.cxx src/FixLArElecCalib.cxx src/components/*.cxx - LINK_LIBRARIES CaloConditions CaloIdentifier AthenaBaseComps GaudiKernel LArIdentifier LArRawEvent LArRecConditions LArCablingLib CaloDetDescrLib StoreGateLib SGtests xAODEventInfo LArRawConditions LArCOOLConditions PathResolver ) + LINK_LIBRARIES ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel AthenaPoolUtilities CaloConditions CaloDetDescrLib CaloIdentifier GaudiKernel Identifier LArCOOLConditions LArCablingLib LArElecCalib LArIdentifier LArRawConditions LArRawEvent LArRecConditions PathResolver StoreGateLib xAODEventInfo ) # Install files from the package: -atlas_install_headers( LArCalibTest ) -atlas_install_python_modules( python/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) diff --git a/LArCalorimeter/LArTest/LArCalibTest/python/HECNoiseD3PDMaker.py b/LArCalorimeter/LArTest/LArCalibTest/python/HECNoiseD3PDMaker.py index c19fa00d222d626e003a34cbf838f8e5f582a1b8..c1c1e66173d7715fd650e633108b7926b335d5a5 100644 --- a/LArCalorimeter/LArTest/LArCalibTest/python/HECNoiseD3PDMaker.py +++ b/LArCalorimeter/LArTest/LArCalibTest/python/HECNoiseD3PDMaker.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # D3PDMaker @@ -58,7 +58,7 @@ class HECNoiseD3PDMaker(PyAthena.Alg): self.cid = self.cdd.getCaloCell_ID() self.tdt = PyAthena.py_tool('Trig::TrigDecisionTool/TrigDecisionTool') self.ntfile = TFile(self.NtupleFileName,"RECREATE") - self.hectree = TTree("HECNoise","HECNoise"); + self.hectree = TTree("HECNoise","HECNoise") self.iRun = array('i',[0]) self.iEvent = array('L',[0]) self.iEventCount = array('i',[0]) @@ -101,30 +101,30 @@ class HECNoiseD3PDMaker(PyAthena.Alg): self.hectree.Branch(tl+"_Prescale",self.fPrescale[tl],tl+"_Prescale/F") self.hectree.Branch(tl+"_Trigger",self.iTrigger[tl],tl+"_Trigger/I") pass - self.hectree.Branch("iTime",self.iTime,"iTime/I"); - self.hectree.Branch("iLB",self.iLB,"iLB/I"); - self.hectree.Branch("iBCID",self.iBCID,"iBCID/I"); + self.hectree.Branch("iTime",self.iTime,"iTime/I") + self.hectree.Branch("iLB",self.iLB,"iLB/I") + self.hectree.Branch("iBCID",self.iBCID,"iBCID/I") self.hectree.Branch("avgMu",self.avgMu,"avgMu/F") self.hectree.Branch("actMu",self.actMu,"actMu/F") - self.hectree.Branch("iGain",self.iGain,"iGain/I"); - self.hectree.Branch("iOID",self.iOID,"iOID/l"); - self.hectree.Branch("iSide",self.iSide,"iSide/I"); - self.hectree.Branch("iSamp",self.iSamp,"iSamp/I"); - self.hectree.Branch("iReg",self.iReg,"iReg/I"); - self.hectree.Branch("iEta",self.iEta,"iEta/I"); - self.hectree.Branch("iPhi",self.iPhi,"iPhi/I"); + self.hectree.Branch("iGain",self.iGain,"iGain/I") + self.hectree.Branch("iOID",self.iOID,"iOID/l") + self.hectree.Branch("iSide",self.iSide,"iSide/I") + self.hectree.Branch("iSamp",self.iSamp,"iSamp/I") + self.hectree.Branch("iReg",self.iReg,"iReg/I") + self.hectree.Branch("iEta",self.iEta,"iEta/I") + self.hectree.Branch("iPhi",self.iPhi,"iPhi/I") self.hectree.Branch("iQuality",self.iQuality,"iQuality/I") - self.hectree.Branch("e",self.e,"e/F"); - self.hectree.Branch("t",self.t,"t/F"); - self.hectree.Branch("eta",self.eta,"eta/F"); - self.hectree.Branch("phi",self.phi,"phi/F"); - self.hectree.Branch("z",self.z,"z/F"); - self.hectree.Branch("r",self.r,"r/F"); - self.hectree.Branch("Ped",self.Ped,"Ped/F"); - self.hectree.Branch("PedRMS",self.PedRMS,"PedRMS/F"); - self.hectree.Branch("iDigi",self.iDigi,"iDigi[32]/I"); - self.hectree.Branch("iMax",self.iMax,"iMax/I"); - self.hectree.Branch("iMin",self.iMin,"iMin/I"); + self.hectree.Branch("e",self.e,"e/F") + self.hectree.Branch("t",self.t,"t/F") + self.hectree.Branch("eta",self.eta,"eta/F") + self.hectree.Branch("phi",self.phi,"phi/F") + self.hectree.Branch("z",self.z,"z/F") + self.hectree.Branch("r",self.r,"r/F") + self.hectree.Branch("Ped",self.Ped,"Ped/F") + self.hectree.Branch("PedRMS",self.PedRMS,"PedRMS/F") + self.hectree.Branch("iDigi",self.iDigi,"iDigi[32]/I") + self.hectree.Branch("iMax",self.iMax,"iMax/I") + self.hectree.Branch("iMin",self.iMin,"iMin/I") # return True diff --git a/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt b/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt index 1b62213e33d9866783aef639e939e1562cb889a2..2f49412409fa073aab9f08e0e87b8ff5dd5e5079 100644 --- a/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt +++ b/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt @@ -1,34 +1,8 @@ -################################################################################ -# Package: LArConditionsTest -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArConditionsTest ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloInterface - Control/AthenaBaseComps - Control/StoreGate - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArCabling - LArCalorimeter/LArElecCalib - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawConditions - LArCalorimeter/LArRawUtils - LArCalorimeter/LArTools - PRIVATE - Calorimeter/CaloDetDescr - Calorimeter/CaloEvent - Calorimeter/CaloIdentifier - Control/AthenaKernel - Database/AthenaPOOL/AthenaPoolUtilities - LArCalorimeter/LArCOOLConditions ) - -# External dependencies: -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) - # Component(s) in the package: atlas_add_component( LArConditionsTest src/LArConditionsTest_entries.cxx @@ -36,15 +10,11 @@ atlas_add_component( LArConditionsTest src/LArCondDataTest.cxx src/LArConditionsTestAlg.cxx src/LArCablingTest.cxx - INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${CORAL_LIBRARIES} AthenaBaseComps StoreGateLib SGtests Identifier GaudiKernel LArCablingLib LArIdentifier LArRawConditions LArRawUtilsLib LArToolsLib CaloDetDescrLib CaloEvent CaloIdentifier AthenaKernel AthenaPoolUtilities LArCOOLConditions CaloInterfaceLib ) + LINK_LIBRARIES AthenaBaseComps StoreGateLib Identifier GaudiKernel LArCablingLib LArElecCalib LArIdentifier LArRawConditions LArRawUtilsLib LArRecConditions CaloDetDescrLib CaloEvent CaloIdentifier AthenaKernel CaloInterfaceLib ) # Install files from the package: -atlas_install_headers( LArConditionsTest ) atlas_install_joboptions( share/*.py ) - - function (larconditions_run_test testName) cmake_parse_arguments( ARG "" "DEPENDS" "" ${ARGN} ) @@ -63,7 +33,6 @@ function (larconditions_run_test testName) endif() endfunction (larconditions_run_test) - larconditions_run_test (LArConditionsTest) larconditions_run_test (LArConditionsTestWriteNoReg) larconditions_run_test (LArConditionsTestReadNoReg DEPENDS LArConditionsTestWriteNoReg) diff --git a/LArCalorimeter/LArTest/LArEventTest/CMakeLists.txt b/LArCalorimeter/LArTest/LArEventTest/CMakeLists.txt index 66bbb1a95eaaf4846af79e3eff19a7aa3324b6a9..3d3f783689d592971a3281c3baa2b9e256517bb1 100644 --- a/LArCalorimeter/LArTest/LArEventTest/CMakeLists.txt +++ b/LArCalorimeter/LArTest/LArEventTest/CMakeLists.txt @@ -1,37 +1,18 @@ -################################################################################ -# Package: LArEventTest -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArEventTest ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloIdentifier - Control/AthenaBaseComps - Control/StoreGate - GaudiKernel - LArCalorimeter/LArIdentifier - LArCalorimeter/LArRawConditions - LArCalorimeter/LArRawEvent - LArCalorimeter/LArCabling - TestBeam/TBEvent - PRIVATE - Calorimeter/CaloEvent - Event/xAOD/xAODEventInfo - LArCalorimeter/LArElecCalib ) - # External dependencies: find_package( CLHEP ) +find_package( ROOT COMPONENTS Core Tree ) # Component(s) in the package: atlas_add_component( LArEventTest src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier AthenaBaseComps StoreGateLib SGtests GaudiKernel LArIdentifier LArRawConditions LArRawEvent LArCablingLib TBEvent CaloEvent xAODEventInfo ) + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} CaloIdentifier AthenaBaseComps StoreGateLib GaudiKernel LArElecCalib LArIdentifier LArRawConditions LArRawEvent LArCablingLib TBEvent CaloEvent xAODEventInfo ) # Install files from the package: -atlas_install_headers( LArEventTest ) atlas_install_joboptions( share/*.py ) - diff --git a/LArCalorimeter/LArTools/CMakeLists.txt b/LArCalorimeter/LArTools/CMakeLists.txt index 5d16c2c0c2792affe06a113ee6f1202189ff003b..cc3b936ceafb1422abf4fe6be522e75d75c8f590 100644 --- a/LArCalorimeter/LArTools/CMakeLists.txt +++ b/LArCalorimeter/LArTools/CMakeLists.txt @@ -1,23 +1,8 @@ -################################################################################ -# Package: LArTools -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( LArTools ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Control/AthenaKernel - DetectorDescription/Identifier - GaudiKernel - LArCalorimeter/LArCabling - LArCalorimeter/LArElecCalib - PRIVATE - Calorimeter/CaloIdentifier - Database/AthenaPOOL/AthenaPoolUtilities - LArCalorimeter/LArRecConditions ) - # External dependencies: find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) find_package( ROOT COMPONENTS RIO Core Tree MathCore Hist pthread ) @@ -27,19 +12,17 @@ atlas_add_library( LArToolsLib src/*.cxx PUBLIC_HEADERS LArTools PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES AthenaBaseComps AthenaKernel Identifier GaudiKernel LArCablingLib LArElecCalib - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CaloIdentifier AthenaPoolUtilities LArRecConditions ) + LINK_LIBRARIES AthenaBaseComps AthenaKernel CxxUtils Identifier GaudiKernel LArElecCalib + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CaloIdentifier AthenaPoolUtilities LArCablingLib LArRecConditions ) atlas_add_component( LArTools src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} LINK_LIBRARIES LArToolsLib ) atlas_add_dictionary( LArToolsDict LArTools/LArToolsDict.h LArTools/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel Identifier GaudiKernel LArCablingLib CaloIdentifier AthenaPoolUtilities LArRecConditions LArToolsLib ) + LINK_LIBRARIES LArToolsLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/NSWCalibTools/INSWCalibTool.h b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/NSWCalibTools/INSWCalibTool.h index e4bec41e8632c6af32b0c1e9a3cfe101a2aa78c3..c1248b88044395536372acf5877942da95c20046 100644 --- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/NSWCalibTools/INSWCalibTool.h +++ b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/NSWCalibTools/INSWCalibTool.h @@ -30,11 +30,12 @@ namespace NSWCalib { }; } - + namespace Muon { class MM_RawData; class MMPrepData; + class STGC_RawData; class INSWCalibTool : virtual public IAlgTool { @@ -44,9 +45,10 @@ namespace Muon { public: // interface methods - virtual StatusCode calibrateClus(const Muon::MMPrepData* prepData, const Amg::Vector3D& globalPos, std::vector<NSWCalib::CalibratedStrip>& calibClus) const = 0; + virtual StatusCode calibrateClus(const Muon::MMPrepData* prepRawData, const Amg::Vector3D& globalPos, std::vector<NSWCalib::CalibratedStrip>& calibClus) const = 0; virtual StatusCode calibrateStrip(const Muon::MM_RawData* mmRawData, NSWCalib::CalibratedStrip& calibStrip) const = 0; virtual StatusCode calibrateStrip(const double time, const double charge, const double lorentzAngle, NSWCalib::CalibratedStrip&calibStrip) const = 0; + virtual StatusCode calibrateStrip(const Muon::STGC_RawData* sTGCRawData, NSWCalib::CalibratedStrip& calibStrip) const = 0; virtual StatusCode mmGasProperties(float &vDrift, float &longDiff, float &transDiff, float &interactionDensityMean, float &interactionDensitySigma, TF1* &lorentzAngleFunction) const = 0; }; diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx index 5f59708b5579c0b6afcc25dcced22dd265c7f5df..85e0ad17ca7bed15ccd2eed0a869501f06d19087 100644 --- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx +++ b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx @@ -6,6 +6,7 @@ #include "GaudiKernel/SystemOfUnits.h" #include "GaudiKernel/PhysicalConstants.h" #include "MuonReadoutGeometry/MMReadoutElement.h" +#include "MuonReadoutGeometry/sTgcReadoutElement.h" namespace { static constexpr double const& toRad = M_PI/180; @@ -138,6 +139,8 @@ StatusCode Muon::NSWCalibTool::calibrateClus(const Muon::MMPrepData* prepData, c return StatusCode::SUCCESS; } + + StatusCode Muon::NSWCalibTool::calibrateStrip(const double time, const double charge, const double lorentzAngle, NSWCalib::CalibratedStrip& calibStrip) const { calibStrip.charge = charge; calibStrip.time = time; @@ -153,6 +156,7 @@ StatusCode Muon::NSWCalibTool::calibrateStrip(const double time, const double ch return StatusCode::SUCCESS; } + StatusCode Muon::NSWCalibTool::calibrateStrip(const Muon::MM_RawData* mmRawData, NSWCalib::CalibratedStrip& calibStrip) const { Identifier rdoId = mmRawData->identify(); @@ -178,6 +182,28 @@ StatusCode Muon::NSWCalibTool::calibrateStrip(const Muon::MM_RawData* mmRawData, return StatusCode::SUCCESS; } +StatusCode Muon::NSWCalibTool::calibrateStrip(const Muon::STGC_RawData* sTGCRawData, NSWCalib::CalibratedStrip& calibStrip) const +{ + Identifier rdoId = sTGCRawData->identify(); + + // MuonDetectorManager from the conditions store + SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey}; + const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr(); + + //get globalPos + Amg::Vector3D globalPos; + const MuonGM::sTgcReadoutElement* detEl = muDetMgr->getsTgcReadoutElement(rdoId); + detEl->stripGlobalPosition(rdoId,globalPos); + + calibStrip.charge =sTGCRawData->charge(); + calibStrip.time = sTGCRawData->time() - globalPos.norm() * reciprocalSpeedOfLight + m_timeOffset; + calibStrip.identifier = sTGCRawData->identify(); + + return StatusCode::SUCCESS; +} + + + double Muon::NSWCalibTool::pdoToCharge(const int pdoCounts, const Identifier& stripID) const { double charge = 0; if (m_idHelperSvc->isMM(stripID)){ diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.h b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.h index 9ec27924373a450fe76743a5f73258eeee98f235..981f6bf2caa0e8adbb94dc527a6394f80ce1b0e9 100644 --- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.h +++ b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.h @@ -4,23 +4,24 @@ #ifndef NSWCalibTool_h #define NSWCalibTool_h -#include <map> -#include <string> - #include "NSWCalibTools/INSWCalibTool.h" - #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ServiceHandle.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonPrepRawData/MMPrepData.h" #include "MuonRDO/MM_RawData.h" +#include "MuonRDO/STGC_RawData.h" #include "StoreGate/ReadCondHandleKey.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MagFieldConditions/AtlasFieldCacheCondObj.h" #include "TRandom3.h" #include "TTree.h" +#include "TF1.h" + +#include <string> +#include <vector> namespace Muon { @@ -33,8 +34,9 @@ namespace Muon { virtual ~NSWCalibTool() = default; virtual StatusCode calibrateClus(const Muon::MMPrepData* prepData, const Amg::Vector3D& globalPos, std::vector<NSWCalib::CalibratedStrip>& calibClus) const override; - virtual StatusCode calibrateStrip(const double time, const double charge, const double lorentzAngle, NSWCalib::CalibratedStrip& calibStrip) const override; + virtual StatusCode calibrateStrip(const double time, const double charge, const double lorentzAngle, NSWCalib::CalibratedStrip& calibStrip) const override; virtual StatusCode calibrateStrip(const Muon::MM_RawData* mmRawData, NSWCalib::CalibratedStrip& calibStrip) const override; + virtual StatusCode calibrateStrip(const Muon::STGC_RawData* sTGCRawData, NSWCalib::CalibratedStrip& calibStrip) const override; double pdoToCharge(const int pdoCounts, const Identifier& stripID) const; int chargeToPdo(const float charge, const Identifier& stripID) const; @@ -43,6 +45,7 @@ namespace Muon { virtual StatusCode finalize() override; StatusCode mmGasProperties(float &vDrift, float &longDiff, float &transDiff, float &interactionDensityMean, float &interactionDensitySigma, TF1* &lorentzAngleFunction) const override; + private: ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h index f1dfc00daa68171bcfe03787e5dfe0a8757308c1..df6421468c77ed97dd52faa1fdde3608008de9ea 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h @@ -2,19 +2,13 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/*************************************************************************** - sTgc Readout Element properties - ----------------------------------------- -***************************************************************************/ - #ifndef MUONGEOMODEL_STGCREADOUTELEMENT_H -# define MUONGEOMODEL_STGCREADOUTELEMENT_H +#define MUONGEOMODEL_STGCREADOUTELEMENT_H #include "MuonReadoutGeometry/MuonClusterReadoutElement.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MuonChannelDesign.h" #include "MuonReadoutGeometry/MuonPadDesign.h" - #include "MuonIdHelpers/sTgcIdHelper.h" class BLinePar; @@ -23,7 +17,6 @@ namespace Trk{ class PlaneSurface; } - namespace MuonGM { /** An sTgcReadoutElement corresponds to a single STGC module; therefore diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTimingTools/src/MuonHitTimingTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTimingTools/src/MuonHitTimingTool.cxx index f033040f489681871332ca263d06da16dc14422b..31eb878914877a5d34b15e39a4a56342dcaf8964 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTimingTools/src/MuonHitTimingTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTimingTools/src/MuonHitTimingTool.cxx @@ -10,7 +10,9 @@ namespace Muon { MuonHitTimingTool::MuonHitTimingTool(const std::string& t, const std::string& n, const IInterface* p): - AthAlgTool(t,n,p) { + AthAlgTool(t,n,p), + m_hitTimingTools(this) + { declareInterface<IMuonHitTimingTool>(this); for( unsigned int tech = 0;tech<MuonStationIndex::TechnologyIndexMax;++tech ){ diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.h index 6a45faabff7f2f04209ee615a22df85ff3d3c8a7..2b072f2b099c76feedcd42283ce1bb8733adbd4d 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.h @@ -44,7 +44,9 @@ namespace Muon { virtual ~MuonTrackSummaryHelperTool()=default; virtual StatusCode initialize() override; - + + using IExtendedTrackSummaryHelperTool::analyse; + using IExtendedTrackSummaryHelperTool::updateSharedHitCount; virtual void analyse( const Trk::Track& trk, const Trk::RIO_OnTrack* rot, diff --git a/MuonSpectrometer/MuonTruthAlgs/src/MuonTruthDecorationAlg.cxx b/MuonSpectrometer/MuonTruthAlgs/src/MuonTruthDecorationAlg.cxx index ac46b17927242b38bee6d7e814197fc47f79b0ff..5441a5177ad5004f6dd83c4f913e240d65416b45 100644 --- a/MuonSpectrometer/MuonTruthAlgs/src/MuonTruthDecorationAlg.cxx +++ b/MuonSpectrometer/MuonTruthAlgs/src/MuonTruthDecorationAlg.cxx @@ -635,11 +635,11 @@ namespace Muon { } } truthParticle.auxdata<std::vector<unsigned long long> >("truthMdtHits")=mdtTruthHits; - truthParticle.auxdata<std::vector<unsigned long long> >("truthCscHits")=cscTruthHits; + if (m_idHelperSvc->hasCSC()) truthParticle.auxdata<std::vector<unsigned long long> >("truthCscHits")=cscTruthHits; truthParticle.auxdata<std::vector<unsigned long long> >("truthTgcHits")=tgcTruthHits; truthParticle.auxdata<std::vector<unsigned long long> >("truthRpcHits")=rpcTruthHits; - truthParticle.auxdata<std::vector<unsigned long long> >("truthStgcHits")=stgcTruthHits; - truthParticle.auxdata<std::vector<unsigned long long> >("truthMMHits")=mmTruthHits; + if (m_idHelperSvc->hasSTgc()) truthParticle.auxdata<std::vector<unsigned long long> >("truthStgcHits")=stgcTruthHits; + if (m_idHelperSvc->hasMM()) truthParticle.auxdata<std::vector<unsigned long long> >("truthMMHits")=mmTruthHits; ATH_MSG_VERBOSE("Added "<<mdtTruthHits.size()<<" mdt truth hits, "<<cscTruthHits.size()<<" csc truth hits, "<<rpcTruthHits.size()<<" rpc truth hits, and "<<tgcTruthHits.size()<<" tgc truth hits"); } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/python/TgcRawDataMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/python/TgcRawDataMonitorAlgorithm.py index f1aca9130cdf715edb83d9e0d5e41d59ec79ded9..617f0a5b3c988c6bc2004b8f1fe3cfdca1dfa576 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/python/TgcRawDataMonitorAlgorithm.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/python/TgcRawDataMonitorAlgorithm.py @@ -24,7 +24,15 @@ def TgcRawDataMonitoringConfig(inputFlags): tgcRawDataMonAlg.TagTrigList += ',HLT_mu26_ivarmedium_L1MU20' tgcRawDataMonAlg.TagTrigList += ',HLT_mu6' tgcRawDataMonAlg.TagTrigList += ',HLT_mu6_L1MU6' + tgcRawDataMonAlg.TagTrigList += ',HLT_mu6_idperf' + tgcRawDataMonAlg.TagTrigList += ',HLT_mu14' tgcRawDataMonAlg.TagTrigList += ',HLT_mu20_mu8noL1;HLT_mu20' + tgcRawDataMonAlg.TagTrigList += ',HLT_mu24_mu8noL1;HLT_mu24' + tgcRawDataMonAlg.TagTrigList += ',HLT_mu50_L1MU20' + tgcRawDataMonAlg.TagTrigList += ',HLT_mu60_0eta105_msonly_L1MU20' + + tgcRawDataMonAlg.TagAndProbe = False + tgcRawDataMonAlg.TagAndProbeZmumu = False if not inputFlags.DQ.triggerDataAvailable: tgcRawDataMonAlg.MuonRoIContainerName = '' @@ -91,12 +99,104 @@ def TgcRawDataMonitoringConfig(inputFlags): myGroup.defineHistogram('hit_bunch;TgcPrd_Timing',title='TgcPrd_Timing;Timing;Number of events', path=hitPath,xbins=4,xmin=-1.5,xmax=1.5,xlabels=['Previous','Current','Next']) + for side in ['A', 'C']:# side-A or side-C + for station in range(1,5):# M1,2,3,4 + for s_or_w in ['S','W']:# strip or wire + name = "%sM%02i%s" % (side,station,s_or_w) + x_name = "lb_for_%s" % (name) + y_name = name + nbins = 10 + if station==1: + nbins = 648 + elif station==2 or station==3: + nbins = 528 + else: # station==4 + nbins = 90 + + myGroup.defineHistogram(x_name+','+y_name+';'+y_name+'_vs_lb', + title=y_name+'_vs_lb;Luminosity block;Chamber index',type='TH2F', + path=hitPath,xbins=100,xmin=-0.5,xmax=99.5, + ybins=nbins,ymin=0.5,ymax=nbins+0.5,opt='kAddBinsDynamically') + x_name = name + y_name = "timing_for_%s" % (name) + myGroup.defineHistogram(x_name+','+y_name+';'+y_name, + title='Timing_for_'+name+';Chamber index;Timing',type='TH2F', + path=hitPath,xbins=nbins,xmin=0.5,xmax=nbins+0.5, + ybins=3,ymin=-1.5,ymax=1.5,ylabels=['Previous','Current','Next']) + + x_name = "x_%s" % (name) + y_name = "y_%s" % (name) + nbinsx = 10 + nbinsy = 10 + if station==1: + nbinsx = 15 + nbinsy = 48 + elif station==2 or station==3: + nbinsx = 12 + nbinsy = 48 + else: # station==4 + nbinsx = 4 + nbinsy = 24 + + myGroup.defineHistogram(x_name+','+y_name+';'+name+'_vs_iEta', + title=name+'_vs_iEta;iEta;Chamber index',type='TH2F',path=hitPath, + xbins=nbinsx,xmin=0.5,xmax=nbinsx+0.5, + ybins=nbinsy,ymin=0.5,ymax=nbinsy+0.5) + + coinPath = 'Coin/' myGroup.defineHistogram('coin_n;TgcCoin_nCoins',title='TgcPrd_nCoins;Number of coincidences;Number of events', path=coinPath,xbins=100,xmin=0,xmax=1000,opt='kAddBinsDynamically') myGroup.defineHistogram('coin_bunch;TgcCoin_Timing',title='TgcCoin_Timing;Timing;Number of events', path=coinPath,xbins=4,xmin=-1.5,xmax=1.5,xlabels=['Previous','Current','Next']) + + hitDetailsPath = 'HitDetails/' + for side in ['A', 'C']:# side-A or side-C + for sector in range(1,13):# Sector 01,,,12 + for station in range(1,5):# M1,2,3,4 + for phi in range(4):# internal phi 0,1,2,3 + for eta in range(6):# eta index 1,,,5 for Endcap, and 0 for Forward + for lay in range(1,4):# sub-layer 1,2,3 (triplet) or 1,2 (doublet) + chamber_name = "%s%02dM%02df%02d%s%02dL%02d" % (side,sector,station,phi,'F' if eta==0 else 'E',eta,lay) + for s_or_w in ['S','W']:# strip or wire + nbins = 100 + if s_or_w=="S": + nbins = 32 + else: + if station==1: + if eta==1: nbins = 24 + elif eta==2: nbins = 23 + elif eta==3: + if lay==1: nbins = 61 + else: nbins = 62 + elif eta==4: + if lay==1: nbins = 92 + else: nbins = 91 + else: # forward + if lay==2: nbins = 104 + else: nbins = 105 + elif station==2: + if eta==1 or eta==2 or eta==3: nbins = 32 + elif eta==4: nbins = 103 + elif eta==5: nbins = 110 + else: nbins = 125 # forward + elif station==3: + if eta==1: nbins = 31 + elif eta==2: nbins = 30 + elif eta==3: nbins = 32 + elif eta==4: nbins = 106 + elif eta==5: nbins = 96 + else: nbins = 122 + else: # EI/FI + if eta==1: nbins = 24 # EI + else: nbins = 32 # FI + + myGroup.defineHistogram('hits_on_'+chamber_name+s_or_w, + title='Hits_on_'+chamber_name+s_or_w+";Channel ID;Number of events", + path=hitDetailsPath,xbins=nbins,xmin=0.5,xmax=nbins+0.5) + + acc = helper.result() result.merge(acc) return result diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx index 5c60f071005e44865e473cb7757dd35b484f888c..913e4b3308dcfde5e163231092834469ad100228 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx @@ -143,15 +143,31 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) mymuon.tagged = triggerMatching(muon,m_trigTagDefs)==StatusCode::SUCCESS ? true : false; /* fill info of isolation among muons */ mymuon.isolated = true; + mymuon.probeOK = false; + if(!m_TagAndProbe.value()) mymuon.probeOK = true; for(const auto& muon2 : *muons){ if( muon == muon2 )continue; + TLorentzVector muonvec2; muonvec2.SetPtEtaPhiM(muon2->pt(),muon2->eta(),muon2->phi(),m_muonMass.value()); float dr = muonvec2.DeltaR( mymuon.fourvec ); if( dr < m_isolationWindow.value() ){ mymuon.isolated = false; - break; } + + if( muon2->muonType()!=xAOD::Muon::Combined )continue; + if( muon2->author()!=xAOD::Muon::MuidCo && muon2->author()!=xAOD::Muon::STACO )continue; + if( muon2->quality()!=xAOD::Muon::Tight && muon2->quality()!=xAOD::Muon::Medium )continue; + if( triggerMatching(muon2,m_trigTagDefs)!=StatusCode::SUCCESS )continue; + if(!m_TagAndProbeZmumu.value()){ + mymuon.probeOK=true; + }else{ + if( muon->charge() == muon2->charge() )continue; + double dimuon_mass = (muonvec2 + mymuon.fourvec).M(); + if(std::abs( dimuon_mass - m_zMass.value()) > m_zMassWindow.value() )continue; + mymuon.probeOK=true; + } + } /* fill extrapolation info (only to TGC) */ extrapolate( muon, mymuon ); @@ -179,32 +195,18 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) } if(pass) mymuon.matchedL1ThrInclusive.insert(ithr); } + /* store MyMuon */ mymuons.push_back( mymuon ); } - /* fill probe of tag-and-probe info */ - for(auto mymuon : mymuons){ - mymuon.probeOK_any = false; - mymuon.probeOK_Z = false; - for(const auto& mu2 : mymuons){ - if( mymuon.muon == mu2.muon )continue; - if( !mu2.tagged )continue; - mymuon.probeOK_any = true; - if( mymuon.muon->charge() == mu2.muon->charge() )continue; - double dimuon_mass = (mu2.fourvec + mymuon.fourvec).M(); - if(std::abs( dimuon_mass - m_zMass.value()) > m_zMassWindow.value() )continue; - mymuon.probeOK_Z = true; - break; - } - } - auto muon_eta = Monitored::Collection("muon_eta",mymuons,[](const MyMuon& m){return (m.muon->pt()/1000>30)?m.muon->eta():-10;});variables.push_back(muon_eta); - auto muon_phi = Monitored::Collection("muon_phi",mymuons,[](const MyMuon& m){return (m.muon->pt()/1000>30)?m.muon->phi():-10;});variables.push_back(muon_phi); - auto muon_phi_rpc = Monitored::Collection("muon_phi_rpc",mymuons,[](const MyMuon& m){return (std::abs(m.muon->eta())<1.05&&m.muon->pt()/1000>30)?m.muon->phi():-10;});variables.push_back(muon_phi_rpc); - auto muon_phi_tgc = Monitored::Collection("muon_phi_tgc",mymuons,[](const MyMuon& m){return (std::abs(m.muon->eta())>1.05&&std::abs(m.muon->eta())<2.4&&m.muon->pt()/1000>30)?m.muon->phi():-10;});variables.push_back(muon_phi_tgc); - auto muon_pt_rpc = Monitored::Collection("muon_pt_rpc",mymuons,[](const MyMuon& m){return (std::abs(m.muon->eta())<1.05)?m.muon->pt()/1000:-10;});variables.push_back(muon_pt_rpc); - auto muon_pt_tgc = Monitored::Collection("muon_pt_tgc",mymuons,[](const MyMuon& m){return (std::abs(m.muon->eta())>1.05&&std::abs(m.muon->eta())<2.4)?m.muon->pt()/1000:-10;});variables.push_back(muon_pt_tgc); + auto muon_eta = Monitored::Collection("muon_eta",mymuons,[](const MyMuon& m){return (m.probeOK&&m.muon->pt()/1000>30)?m.muon->eta():-10;});variables.push_back(muon_eta); + auto muon_phi = Monitored::Collection("muon_phi",mymuons,[](const MyMuon& m){return (m.probeOK&&m.muon->pt()/1000>30)?m.muon->phi():-10;});variables.push_back(muon_phi); + auto muon_phi_rpc = Monitored::Collection("muon_phi_rpc",mymuons,[](const MyMuon& m){return (m.probeOK&&std::abs(m.muon->eta())<1.05&&m.muon->pt()/1000>30)?m.muon->phi():-10;});variables.push_back(muon_phi_rpc); + auto muon_phi_tgc = Monitored::Collection("muon_phi_tgc",mymuons,[](const MyMuon& m){return (m.probeOK&&std::abs(m.muon->eta())>1.05&&std::abs(m.muon->eta())<2.4&&m.muon->pt()/1000>30)?m.muon->phi():-10;});variables.push_back(muon_phi_tgc); + auto muon_pt_rpc = Monitored::Collection("muon_pt_rpc",mymuons,[](const MyMuon& m){return (m.probeOK&&std::abs(m.muon->eta())<1.05)?m.muon->pt()/1000:-10;});variables.push_back(muon_pt_rpc); + auto muon_pt_tgc = Monitored::Collection("muon_pt_tgc",mymuons,[](const MyMuon& m){return (m.probeOK&&std::abs(m.muon->eta())>1.05&&std::abs(m.muon->eta())<2.4)?m.muon->pt()/1000:-10;});variables.push_back(muon_pt_tgc); auto muon_l1passThr1 = Monitored::Collection("muon_l1passThr1",mymuons,[](const MyMuon& m){return m.matchedL1ThrInclusive.find(1)!=m.matchedL1ThrInclusive.end();});variables.push_back(muon_l1passThr1); auto muon_l1passThr2 = Monitored::Collection("muon_l1passThr2",mymuons,[](const MyMuon& m){return m.matchedL1ThrInclusive.find(2)!=m.matchedL1ThrInclusive.end();});variables.push_back(muon_l1passThr2); auto muon_l1passThr3 = Monitored::Collection("muon_l1passThr3",mymuons,[](const MyMuon& m){return m.matchedL1ThrInclusive.find(3)!=m.matchedL1ThrInclusive.end();});variables.push_back(muon_l1passThr3); @@ -236,6 +238,12 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) } const TgcIdHelper& tgcIdHelper = m_idHelperSvc->tgcIdHelper(); std::vector<TgcHit> tgcHits; + std::set<TString> chamber_list; + std::map<TString,std::vector<TgcHit>> tgcHitsMap; + std::map<TString,std::vector<int>> tgcHitPhiMap; + std::map<TString,std::vector<int>> tgcHitEtaMap; + std::map<TString,std::vector<int>> tgcHitPhiMapGlobal; + std::map<TString,std::vector<int>> tgcHitTiming; for(auto tgccnt : *tgcPrd){ for(auto data : *tgccnt){ TgcHit tgcHit; @@ -268,7 +276,101 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) tgcHit.phi = tgcIdHelper.stationPhi(id); tgcHit.station = tgcIdHelper.stationName(id); tgcHit.bunch = bunch; + + tgcHit.igasGap = tgcHit.gasGap; + tgcHit.ieta = tgcHit.eta; + tgcHit.iphi = tgcHit.phi; + tgcHit.side = ( tgcHit.ieta > 0 )?("A"):("C"); + tgcHit.iside = ( tgcHit.ieta > 0 )?(0):(1); + tgcHit.M = 0; + tgcHit.istation = tgcHit.station; + if( tgcHit.istation == 41 || tgcHit.istation == 42 ) tgcHit.M = 1; + else if( tgcHit.istation == 43 || tgcHit.istation == 44 ) tgcHit.M = 2; + else if( tgcHit.istation == 45 || tgcHit.istation == 46 ) tgcHit.M = 3; + else if( tgcHit.istation == 47 || tgcHit.istation == 48 ) tgcHit.M = 4; // EIFI + if(tgcHit.M == 0){ + ATH_MSG_ERROR("unknown station: " << tgcHit.istation); + } + + if( tgcHit.M != 4 ){ // Big Wheel, (M1,M2,M3) + if( tgcHit.istation % 2 == 0 ){ // Endcap + int iphi2 = tgcHit.iphi + 1; // 2,3,4,..,49 + if(iphi2>=48)iphi2-=48; // 0,1,2,3 ..., 47 + tgcHit.sector = int(iphi2 / 4) + 1; // 1,2,3,,,12 + tgcHit.f = iphi2 - (tgcHit.sector-1) * 4; // 0,1,2,3 + tgcHit.E = (tgcHit.M==1) ? ( 5 - TMath::Abs( tgcHit.ieta ) ) : ( 6 - TMath::Abs( tgcHit.ieta ) ); + tgcHit.L = tgcHit.igasGap; + tgcHit.name = Form( "%s%02iM%02if%02iE%02iL%02i%s", tgcHit.side.Data(), tgcHit.sector, tgcHit.M, tgcHit.f, tgcHit.E, tgcHit.L,(tgcHit.isStrip>0)?("S"):("W")); + }else{ // Forward + int iphi2 = tgcHit.iphi; // 1,2,3,4,..,25 + if(iphi2>=24)iphi2-=24; // 0,1,2,3 ...,23 + tgcHit.sector = int(iphi2 / 2) + 1; // 1,2,3,,,12 + tgcHit.f = iphi2 - (tgcHit.sector-1) * 2; // 0,1 + if(tgcHit.f==1)tgcHit.f = 2;//0,2 + tgcHit.E = 0; // F + tgcHit.L = tgcHit.igasGap; + tgcHit.name = Form( "%s%02iM%02if%02iF00L%02i%s", tgcHit.side.Data(), tgcHit.sector, tgcHit.M, tgcHit.f, tgcHit.L,(tgcHit.isStrip>0)?("S"):("W")); + } + }else{ // Small Wheel (M4) + if( tgcHit.istation == 47 ){// FI + tgcHit.sector = 0; + tgcHit.f = tgcHit.iphi; // 1,2,3..24 + tgcHit.E = 0; + tgcHit.L = tgcHit.igasGap; + tgcHit.name = Form("%s00M04f%02iF00L%02i%s",tgcHit.side.Data(),tgcHit.f,tgcHit.L,(tgcHit.isStrip>0)?("S"):("W")); + }else if( tgcHit.istation == 48 ){// EI + int iphi2 = (tgcHit.iphi>=21)?(tgcHit.iphi-21):(tgcHit.iphi); // 0,1,2,..,20 + if(iphi2>=0&&iphi2<=2){ tgcHit.sector = 1; tgcHit.f = iphi2;} + else if(iphi2>=3&&iphi2<=5){ tgcHit.sector = 3; tgcHit.f = iphi2-3;} + else if(iphi2>=6&&iphi2<=8){ tgcHit.sector = 5; tgcHit.f = iphi2-6;} + else if(iphi2>=9&&iphi2<=10){ tgcHit.sector = 7; tgcHit.f = iphi2-9 +1;} + else if(iphi2>=11&&iphi2<=13){ tgcHit.sector = 9; tgcHit.f = iphi2-11;} + else if(iphi2>=14&&iphi2<=15){ tgcHit.sector = 11; tgcHit.f = iphi2-13;} + else if(iphi2>=16&&iphi2<=18){ tgcHit.sector = 13; tgcHit.f = iphi2-16;} + else if(iphi2>=19&&iphi2<=20){ tgcHit.sector = 15; tgcHit.f = iphi2-19 +1;} + tgcHit.E = 1; + tgcHit.L = tgcHit.igasGap; + tgcHit.name = Form("%s%02iM04f%02iE01L%02i%s",tgcHit.side.Data(),tgcHit.sector,tgcHit.f,tgcHit.L,(tgcHit.isStrip>0)?("S"):("W")); + }else{ + ATH_MSG_ERROR("Unknown detector"); + } + } tgcHits.push_back(tgcHit); + tgcHitsMap[tgcHit.name].push_back(tgcHit); + chamber_list.insert(tgcHit.name); + + TString station_name = Form("%sM%02i%s",tgcHit.side.Data(),tgcHit.M,(tgcHit.isStrip>0)?("S"):("W")); + int phimap_index = 0; + int etamap_index = 0; + int phimap_global_index = 0; // no empty bins compare to the above index + if( tgcHit.M==1 ){ + phimap_index = (tgcHit.sector - 1) * 4 + tgcHit.f + 1; + int tmpeta = (tgcHit.E==0)?(5):(tgcHit.E); + etamap_index = (tmpeta - 1) * 3 + tgcHit.L; + int tmpphi = tgcHit.f; + if( tgcHit.E==0 && tgcHit.f==2 ) tmpphi = 1; + if( tgcHit.E>0 ) phimap_global_index = (tmpeta - 1) * 144 + (tgcHit.sector - 1) * 12 + tmpphi * 3 + tgcHit.L; + else phimap_global_index = 576 + (tgcHit.sector - 1) * 6 + tmpphi * 3 + tgcHit.L; + }else if( tgcHit.M==2 || tgcHit.M==3 ){ + phimap_index = (tgcHit.sector - 1) * 4 + tgcHit.f + 1; + int tmpeta = (tgcHit.E==0)?(6):(tgcHit.E); + etamap_index = (tmpeta - 1) * 2 + tgcHit.L; + int tmpphi = tgcHit.f; + if( tgcHit.E==0 && tgcHit.f==2 ) tmpphi = 1; + if( tgcHit.E>0 ) phimap_global_index = (tmpeta - 1) * 96 + (tgcHit.sector - 1) * 8 + tmpphi * 2 + tgcHit.L; + else phimap_global_index = 480 + (tgcHit.sector - 1) * 4 + tmpphi * 2 + tgcHit.L; + }else if( tgcHit.M==4 ){ + phimap_index = tgcHit.iphi; + int tmpeta = (tgcHit.E==0)?(2):(tgcHit.E); + etamap_index = (tmpeta - 1) * 2 + tgcHit.L; + if( tgcHit.E>0 ) phimap_global_index = (tgcHit.iphi-1) * 2 + tgcHit.L; + else phimap_global_index = 42 + (tgcHit.iphi-1) * 2 + tgcHit.L; + } + tgcHitPhiMap[station_name].push_back(phimap_index); + tgcHitEtaMap[station_name].push_back(etamap_index); + tgcHitPhiMapGlobal[station_name].push_back(phimap_global_index); + tgcHitTiming[station_name].push_back(bunch); + } } @@ -276,6 +378,23 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) auto hit_bunch = Monitored::Collection("hit_bunch",tgcHits,[](const TgcHit& m){return m.bunch;});variables.push_back(hit_bunch); auto hit_sideA = Monitored::Collection("hit_sideA",tgcHits,[](const TgcHit& m){return m.z>0;});variables.push_back(hit_sideA); auto hit_sideC = Monitored::Collection("hit_sideC",tgcHits,[](const TgcHit& m){return m.z<0;});variables.push_back(hit_sideC); + + for(auto chamber_name : chamber_list){ + auto hits_on_a_chamber = Monitored::Collection(Form("hits_on_%s",chamber_name.Data()),tgcHitsMap[chamber_name],[](const TgcHit& m){return m.channel;}); + fill(m_packageName,hits_on_a_chamber); + } + + for(auto phimap : tgcHitPhiMap){ + auto x = Monitored::Collection(Form("x_%s",phimap.first.Data()),tgcHitEtaMap[phimap.first],[](const int& m){return m;}); + auto y = Monitored::Collection(Form("y_%s",phimap.first.Data()),phimap.second,[](const int& m){return m;}); + fill(m_packageName,x,y); + } + for(auto phimap : tgcHitPhiMapGlobal){ + auto x = Monitored::Scalar<int>(Form("lb_for_%s",phimap.first.Data()),GetEventInfo(ctx)->lumiBlock()); + auto y = Monitored::Collection(Form("%s",phimap.first.Data()),phimap.second,[](const int& m){return m;}); + auto z = Monitored::Collection(Form("timing_for_%s",phimap.first.Data()),tgcHitTiming[phimap.first],[](const int& m){return m;}); + fill(m_packageName,x,y,z); + } SG::ReadHandle<Muon::TgcCoinDataContainer> tgcCoinCurr(m_TgcCoinDataContainerCurrBCKey, ctx); if(!tgcCoinCurr.isValid()){ diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h index b22c1e8c6e8a3f2c916c7adae8c4db6eeb58f6f5..5c7a7e031352cba646655e6cb7d8f219234fcdaa 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h @@ -37,6 +37,7 @@ class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { bool isolated; bool probeOK_any; bool probeOK_Z; + bool probeOK; std::set<int> matchedL1ThrExclusive; std::set<int> matchedL1ThrInclusive; }; @@ -55,6 +56,18 @@ class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { int phi; int station; int bunch; + int sector; + int f; + int E; + int M; + int iphi; + int ieta; + int L; + TString name; + int istation; + int igasGap; + int iside; + TString side; }; struct TgcTrig{ float x_In; @@ -84,7 +97,6 @@ class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { int bunch; int inner; }; - private: ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; @@ -99,7 +111,8 @@ class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { StringProperty m_packageName{this,"PackageName","TgcRawDataMonitor","group name for histograming"}; StringProperty m_trigTagList{this,"TagTrigList","HLT_mu26_ivarmedium_L1MU20","list of triggers to be used for trigger matching"}; - BooleanProperty m_TagAndProbe{this,"TagAndProbe",true,"switch to perform tag-and-probe method"}; + BooleanProperty m_TagAndProbe{this,"TagAndProbe",false,"switch to perform tag-and-probe method"}; + BooleanProperty m_TagAndProbeZmumu{this,"TagAndProbeZmumu",false,"switch to perform tag-and-probe method Z->mumu"}; BooleanProperty m_anaTgcPrd{this,"AnaTgcPrd",false,"switch to perform analysis on TGC PRD/Coin"}; BooleanProperty m_anaOfflMuon{this,"AnaOfflMuon",true,"switch to perform analysis on xAOD::Muon"}; BooleanProperty m_anaMuonRoI{this,"AnaMuonRoI",true,"switch to perform analysis on xAOD::LVL1MuonRoI"}; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonSegmentPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonSegmentPlots.cxx index da495e1c3cdb9fbd780346b427e254c59e44ca7e..d8c2eef6d022e1ab667f82d7fb824cd4bd32b871 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonSegmentPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonSegmentPlots.cxx @@ -33,7 +33,7 @@ void RecoMuonSegmentPlots::fill(const xAOD::Muon& mu){ //use the link to fill void RecoMuonSegmentPlots::fill(const std::vector<ElementLink<DataVector<xAOD::MuonSegment_v1>>> Mu_Segments){ - for(const auto Mu_Segment : Mu_Segments){ + for(const auto& Mu_Segment : Mu_Segments){ const ElementLink<DataVector<xAOD::MuonSegment_v1>> Mu_seg = Mu_Segment; if(Mu_seg.isValid()){ const xAOD::MuonSegment* seg = *Mu_seg; diff --git a/Projects/AnalysisBase/version.txt b/Projects/AnalysisBase/version.txt index 44e031ba9ba43444a4a4413b5755e21a977f3470..0398faf11c23a7b4f71ebf50cfb8ce6d4b0b4b99 100644 --- a/Projects/AnalysisBase/version.txt +++ b/Projects/AnalysisBase/version.txt @@ -1 +1 @@ -22.2.0 +22.2.1 diff --git a/Reconstruction/Jet/JetRec/share/JetRecAlgTestCfg.py b/Reconstruction/Jet/JetRec/share/JetRecAlgTestCfg.py index 9232884db3d359d1aeb11019c4c070e5eaff954c..13c4c42a69c36b4ae4072b962577500eb63a017f 100755 --- a/Reconstruction/Jet/JetRec/share/JetRecAlgTestCfg.py +++ b/Reconstruction/Jet/JetRec/share/JetRecAlgTestCfg.py @@ -128,6 +128,7 @@ def JetBuildAlgCfg(ConfigFlags,buildjetsname): jclust.JetAlgorithm = "AntiKt" jclust.JetRadius = 1.0 jclust.PtMin = 10e3 # MeV + jclust.GhostArea = 0.01 jclust.InputPseudoJets = "PseudoJetMerged_"+buildjetsname jclust.JetInputType = 1 # Hardcoded "magic number" for now # See https://gitlab.cern.ch/atlas/athena/blob/master/Event/xAOD/xAODJet/xAODJet/JetContainerInfo.h diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx index d8ac1397b87b62c0a5c0d348918a0e38e05acd44..36d8095c5900d21136461da32c09016e12a27bdb 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx @@ -22,10 +22,10 @@ MuonCombinedInDetCandidateAlg::MuonCombinedInDetCandidateAlg(const std::string& StatusCode MuonCombinedInDetCandidateAlg::initialize() { - ATH_CHECK(m_trackSelector.retrieve()); + ATH_CHECK(m_trackSelector.retrieve(DisableTool{m_trackSelector.empty()})); ATH_CHECK(m_muonSystemExtensionTool.retrieve()); ATH_CHECK(m_indetTrackParticleLocation.initialize()); - ATH_CHECK(m_indetForwardTrackParticleLocation.initialize()); + ATH_CHECK(m_indetForwardTrackParticleLocation.initialize(m_doSiliconForwardMuons)); ATH_CHECK(m_candidateCollectionName.initialize()); ATH_CHECK(m_forwardTrackSelector.retrieve(DisableTool{!m_doSiliconForwardMuons})); @@ -88,7 +88,9 @@ MuonCombinedInDetCandidateAlg::create(const ToolHandle<Trk::ITrackSelectorTool>& for (auto* tp : indetTrackParticles) { ++trackIndex; - if (!isValidTrackParticle(currentTrackSelector, tp)) continue; + if(!currentTrackSelector.empty()){ + if (!isValidTrackParticle(currentTrackSelector, tp)) continue; + } ElementLink<xAOD::TrackParticleContainer> link(indetTrackParticles, trackIndex); if (!link.isValid()) { diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py index 0fe51f4a91002c57d78daa3f30bb3c839dc79a3e..770684779cfff619eabce34086623e8af2656863 100644 --- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py +++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py @@ -1284,6 +1284,14 @@ if ( rec.doAOD() or rec.doWriteAOD()) and not rec.readAOD() : if rec.readESD() or recAlgs.doTrackParticleCellAssociation(): addClusterToCaloCellAOD("InDetTrackParticlesAssociatedClusters") + if rec.readESD() and rec.doTau: + from CaloRec.CaloRecConf import CaloThinCellsByClusterAlg + alg = CaloThinCellsByClusterAlg('CaloThinCellsByClusterAlg_TauInitialPi0Clusters', + StreamName = 'StreamAOD', + Clusters = 'TauInitialPi0Clusters', + Cells = 'TauCommonPi0Cells') + topSequence += alg + except Exception: treatException("Could not make AOD cells" ) diff --git a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx index af610bb51f00badf21c15c062801d41798d5b5ed..591ec931f52703dbbd71ecd9880b50ff26b4e243 100644 --- a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx +++ b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx @@ -155,7 +155,7 @@ namespace xAOD { // muon etcone isolation const Muon* muon = dynamic_cast<const Muon*>(&particle); - if(muon) return caloCellIsolation(result,*muon,cones,corrlist,coneCoreSize, derefMap); + if(muon) return caloCellIsolation(result,*muon,cones,corrlist,coneCoreSize,derefMap); // egamma etcone isolation const Egamma* egam = dynamic_cast<const Egamma*>(ip); @@ -719,62 +719,82 @@ namespace xAOD { conesf.push_back(cone); if(cone>maxConeSize) maxConeSize = cone; } - - const xAOD::CaloCluster* muonCluster=*muon.clusterLink(); - if(!muonCluster){//have to figure this part out - ATH_MSG_WARNING("muon has no cluster, cannot calculate etcone isolation"); - return false; - } /// add coreCone if asked -- make sure it's the last one! or a better const double coreConeDR = coneCoreSize; bool doCoreCone = (!m_saveOnlyRequestedCorrections || result.corrlist.calobitset.test(static_cast<unsigned int>(Iso::coreCone))); if(doCoreCone && maxConeSize<coreConeDR) maxConeSize = coreConeDR; - /// start the calculation - ATH_MSG_DEBUG("calculating etcone for # " << conesf.size() << " cones"); - Trk::CaloCellSelectorLayerdR selector(maxConeSize); - selector.preSelectAction(*muonCluster); - ATH_MSG_DEBUG("looping over cells " << muonCluster->size()); - for(unsigned int i=0; i<conesf.size(); i++){ - double totE = 0.; - selector.setConeSize(conesf[i]); - xAOD::CaloCluster::const_cell_iterator cell_itr=muonCluster->begin(); - for(; cell_itr!=muonCluster->end(); ++cell_itr){ - if( !selector.select(**cell_itr) ) continue; - if (m_ExcludeTG3 && CaloCell_ID::TileGap3 == (*cell_itr)->caloDDE()->getSampling()) continue; - totE += (*cell_itr)->et(); + + if(!muon.clusterLink().isValid()){ + ATH_MSG_DEBUG("no valid cluster link"); + //no cluster, set everything to 0 + for(unsigned int i=0; i<conesf.size(); i++) result.etcones[i] = 0; + if(doCoreCone){ + ATH_MSG_DEBUG("starting etcone, coreCone"); + double totE = 0.; + std::map<Iso::IsolationCorrectionParameter,float> corecorr; + corecorr[Iso::coreEnergy] = totE; + corecorr[Iso::coreArea] = coreConeDR*coreConeDR*M_PI; + result.coreCorrections[Iso::coreCone] = corecorr; + ATH_MSG_DEBUG("done etcone, coreCone"); + /// apply the correction if required. + if(result.corrlist.calobitset.test(static_cast<unsigned int>(Iso::coreCone))){ + double ecore = totE; + ATH_MSG_DEBUG("Applying coreCone correction for trackParticle etcone isolation."); + for( unsigned int i=0;i<result.etcones.size();++i ) { + result.etcones[i] -= ecore; + ATH_MSG_DEBUG("i: " << i << " cone [before] " << result.etcones[i]+ecore << " cone [after] " << result.etcones[i]); + } + } } - result.etcones[i] = totE; - ATH_MSG_DEBUG("etcone raw: coneSize = " << conesf[i] << "; etcone = " << result.etcones[i]); } - ATH_MSG_DEBUG("done looping over cells "); - /// do coreCone - if(doCoreCone){ - ATH_MSG_DEBUG("starting etcone, coreCone"); - double totE = 0.; - selector.setConeSize(coreConeDR); - xAOD::CaloCluster::const_cell_iterator cell_itr=muonCluster->begin(); - for(; cell_itr!=muonCluster->end(); ++cell_itr){ - if( !selector.select(**cell_itr) ) continue; - if (m_ExcludeTG3 && CaloCell_ID::TileGap3 == (*cell_itr)->caloDDE()->getSampling()) continue; - totE += (*cell_itr)->et(); + else{ + const xAOD::CaloCluster* muonCluster=*muon.clusterLink(); + /// start the calculation + ATH_MSG_DEBUG("calculating etcone for # " << conesf.size() << " cones"); + Trk::CaloCellSelectorLayerdR selector(maxConeSize); + selector.preSelectAction(*muonCluster); + ATH_MSG_DEBUG("looping over cells " << muonCluster->size()); + for(unsigned int i=0; i<conesf.size(); i++){ + double totE = 0.; + selector.setConeSize(conesf[i]); + xAOD::CaloCluster::const_cell_iterator cell_itr=muonCluster->begin(); + for(; cell_itr!=muonCluster->end(); ++cell_itr){ + if( !selector.select(**cell_itr) ) continue; + if (m_ExcludeTG3 && CaloCell_ID::TileGap3 == (*cell_itr)->caloDDE()->getSampling()) continue; + totE += (*cell_itr)->et(); + } + result.etcones[i] = totE; + ATH_MSG_DEBUG("etcone raw: coneSize = " << conesf[i] << "; etcone = " << result.etcones[i]); } - std::map<Iso::IsolationCorrectionParameter,float> corecorr; - corecorr[Iso::coreEnergy] = totE; - corecorr[Iso::coreArea] = coreConeDR*coreConeDR*M_PI; - result.coreCorrections[Iso::coreCone] = corecorr; - ATH_MSG_DEBUG("done etcone, coreCone"); - - /// apply the correction if required. - if(result.corrlist.calobitset.test(static_cast<unsigned int>(Iso::coreCone))){ - double ecore = totE; - ATH_MSG_DEBUG("Applying coreCone correction for trackParticle etcone isolation."); - for( unsigned int i=0;i<result.etcones.size();++i ) { - result.etcones[i] -= ecore; - ATH_MSG_DEBUG("i: " << i << " cone [before] " << result.etcones[i]+ecore << " cone [after] " << result.etcones[i]); - } + ATH_MSG_DEBUG("done looping over cells "); + /// do coreCone + if(doCoreCone){ + ATH_MSG_DEBUG("starting etcone, coreCone"); + double totE = 0.; + selector.setConeSize(coreConeDR); + xAOD::CaloCluster::const_cell_iterator cell_itr=muonCluster->begin(); + for(; cell_itr!=muonCluster->end(); ++cell_itr){ + if( !selector.select(**cell_itr) ) continue; + if (m_ExcludeTG3 && CaloCell_ID::TileGap3 == (*cell_itr)->caloDDE()->getSampling()) continue; + totE += (*cell_itr)->et(); + } + std::map<Iso::IsolationCorrectionParameter,float> corecorr; + corecorr[Iso::coreEnergy] = totE; + corecorr[Iso::coreArea] = coreConeDR*coreConeDR*M_PI; + result.coreCorrections[Iso::coreCone] = corecorr; + ATH_MSG_DEBUG("done etcone, coreCone"); + + /// apply the correction if required. + if(result.corrlist.calobitset.test(static_cast<unsigned int>(Iso::coreCone))){ + double ecore = totE; + ATH_MSG_DEBUG("Applying coreCone correction for trackParticle etcone isolation."); + for( unsigned int i=0;i<result.etcones.size();++i ) { + result.etcones[i] -= ecore; + ATH_MSG_DEBUG("i: " << i << " cone [before] " << result.etcones[i]+ecore << " cone [after] " << result.etcones[i]); + } + } } } - // calculate etcore if(!m_saveOnlyRequestedCorrections || result.corrlist.calobitset.test(static_cast<unsigned int>(Iso::coreMuon))){ diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSelectedTrackCopy.h b/Reconstruction/egamma/egammaAlgs/src/egammaSelectedTrackCopy.h index 1457745db97f25b5093e0f723861b63efe8a2099..e72fa6abe1de26733eb06933cf57dcdeade7601d 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaSelectedTrackCopy.h +++ b/Reconstruction/egamma/egammaAlgs/src/egammaSelectedTrackCopy.h @@ -168,13 +168,13 @@ private: "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT" }; - mutable Gaudi::Accumulators::Counter<unsigned long> m_AllClusters; - mutable Gaudi::Accumulators::Counter<unsigned long> m_SelectedClusters; - mutable Gaudi::Accumulators::Counter<unsigned long> m_AllTracks; - mutable Gaudi::Accumulators::Counter<unsigned long> m_SelectedTracks; - mutable Gaudi::Accumulators::Counter<unsigned long> m_AllSiTracks; - mutable Gaudi::Accumulators::Counter<unsigned long> m_SelectedSiTracks; - mutable Gaudi::Accumulators::Counter<unsigned long> m_AllTRTTracks; - mutable Gaudi::Accumulators::Counter<unsigned long> m_SelectedTRTTracks; + mutable Gaudi::Accumulators::Counter<> m_AllClusters; + mutable Gaudi::Accumulators::Counter<> m_SelectedClusters; + mutable Gaudi::Accumulators::Counter<> m_AllTracks; + mutable Gaudi::Accumulators::Counter<> m_SelectedTracks; + mutable Gaudi::Accumulators::Counter<> m_AllSiTracks; + mutable Gaudi::Accumulators::Counter<> m_SelectedSiTracks; + mutable Gaudi::Accumulators::Counter<> m_AllTRTTracks; + mutable Gaudi::Accumulators::Counter<> m_SelectedTRTTracks; }; #endif diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaTopoClusterCopier.h b/Reconstruction/egamma/egammaAlgs/src/egammaTopoClusterCopier.h index 7661343ec097b78cd2870e81bdde3b9658a0eb79..6508d069edc78e594fbcdd211c3738c3276f88f4 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaTopoClusterCopier.h +++ b/Reconstruction/egamma/egammaAlgs/src/egammaTopoClusterCopier.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef EGAMMAALGS_EGAMMATOPOCLUSTERCOPIER_H @@ -44,12 +44,12 @@ class egammaTopoClusterCopier : public AthReentrantAlgorithm { "View container of selected topoclusters"}; Gaudi::Property<float> m_etaCut {this, "EtaCut", 2.6, "maximum |eta| of selected clusters"}; - Gaudi::Property<float> m_ECut {this, "ECut", 500, "minimum energy of selected clusters"}; + Gaudi::Property<float> m_ECut {this, "ECut", 700, "minimum energy of selected clusters"}; Gaudi::Property<float> m_EMFracCut {this, "EMFracCut", 0.5, "mimimum EM fraction"}; - mutable Gaudi::Accumulators::Counter<long int> m_AllClusters; - mutable Gaudi::Accumulators::Counter<long int> m_PassPreSelection; - mutable Gaudi::Accumulators::Counter<long int> m_PassSelection; + mutable Gaudi::Accumulators::Counter<> m_AllClusters; + mutable Gaudi::Accumulators::Counter<> m_PassPreSelection; + mutable Gaudi::Accumulators::Counter<> m_PassSelection; }; #endif // EGAMMATOOLS_EMCLUSTERTOOL_H diff --git a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py index 340d2986ad9abe19359067d58a493b84ad4d0b12..e6c32409eafae56602daaa18087177774825ae79 100644 --- a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py +++ b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from __future__ import print_function from InDetRecExample import TrackingCommon as TrackingCommon @@ -6,32 +6,31 @@ from InDetRecExample import TrackingCommon as TrackingCommon print("EMCommonRefitter.py") -def getGSFTrackFitter(): - egRotCreator = TrackingCommon.getInDetRotCreator( - name='egRotCreator', - private=True) +def getGSFTrackFitter(doRefitOnMeasurementBase=True): + + egRotCreator = None + if not doRefitOnMeasurementBase: + egRotCreator = TrackingCommon.getInDetRotCreator( + name='egRotCreator', + private=True) - TrackingCommon.createAndAddCondAlg( - TrackingCommon.getRIO_OnTrackErrorScalingCondAlg, - 'RIO_OnTrackErrorScalingCondAlg') + TrackingCommon.createAndAddCondAlg( + TrackingCommon.getRIO_OnTrackErrorScalingCondAlg, + 'RIO_OnTrackErrorScalingCondAlg') - # get Rk propagator + # setup Rk propagator from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import ( Trk__RungeKuttaPropagator as Propagator) egTrkPropagator = Propagator(name='egTrkPropagator') egTrkPropagator.AccuracyParameter = 0.0001 - # Setup the Navigator (default) - from TrkDetDescrSvc.AtlasTrackingGeometrySvc import ( - AtlasTrackingGeometrySvc) - - from TrkExTools.TrkExToolsConf import Trk__Navigator - egTrkNavigator = Trk__Navigator( + # setup Navigator + egTrkNavigator = TrackingCommon.getInDetNavigator( name='egTrkNavigator', - TrackingGeometrySvc=AtlasTrackingGeometrySvc) + private=True) - # Set up the GSF + # setup the GSF from TrkGaussianSumFilter.TrkGaussianSumFilterConf import ( Trk__GsfMaterialMixtureConvolution) @@ -59,7 +58,7 @@ def getGSFTrackFitter(): ToolForExtrapolation=GsfExtrapolator, ReintegrateOutliers=True, MakePerigee=True, - RefitOnMeasurementBase=True, + RefitOnMeasurementBase=doRefitOnMeasurementBase, DoHitSorting=True, ToolForROTCreation=egRotCreator) # --- end of fitter loading diff --git a/Reconstruction/tauRec/python/TauRecBuilder.py b/Reconstruction/tauRec/python/TauRecBuilder.py index cdab5f3e925a016e0ad897c3a02412181076a8f6..1efea1c0173164b153605da9a3e923e95a9ee649 100644 --- a/Reconstruction/tauRec/python/TauRecBuilder.py +++ b/Reconstruction/tauRec/python/TauRecBuilder.py @@ -13,61 +13,34 @@ ################################################################################ import os, sys, string - from AthenaCommon.Logging import logging from AthenaCommon.SystemOfUnits import * from AthenaCommon.Constants import * from AthenaCommon.BeamFlags import jobproperties import traceback - from RecExConfig.Configured import Configured from .TauRecConfigured import TauRecConfigured -# global tauRec config keys - to be replaced with tauRecFlags -_outputType = "xAOD::TauJetContainer" -_outputKey = "TauJets" -_outputAuxType = "xAOD::TauJetAuxContainer" -_outputAuxKey = "TauJetsAux." - ################################################################################ ## @class TauRecCoreBuilder -# Build proper tau candidates and associate tracks, vertex and cells +# Build tau candidates and associate tracks, vertex and cells ################################################################################ class TauRecCoreBuilder ( TauRecConfigured ) : - """Build proper tau candidates and associate tracks, vertex and cells. + """Build tau candidates and associate tracks, vertex and cells. Calculate properties based on cell informations. - Find clusters used for Pi0 identification and eflow variables. - PhotonConversion will be run here too. - """ - - _output = { _outputType:_outputKey , _outputAuxType:_outputAuxKey, - 'xAOD::TauTrackContainer' : 'TauTracks', - 'xAOD::CaloClusterContainer' : 'TauShotClusters', - 'xAOD::PFOContainer' : 'TauShotParticleFlowObjects', - 'CaloCellContainer' : 'TauCommonPi0Cells', - } - + Find cells used for Pi0 identification and eflow variables. + """ def __init__(self, name = "TauCoreBuilder",doPi0Clus=False, doTJVA=False): self.name = name self.doPi0Clus = doPi0Clus self.do_TJVA = doTJVA TauRecConfigured.__init__(self, name, doPi0Clus) - - def configure(self): mlog = logging.getLogger ('TauCoreBuilder.py::configure:') mlog.info('entering') - - - from RecExConfig.RecFlags import rec - - from RecExConfig.ObjKeyStore import objKeyStore - objKeyStore.addManyTypesStreamESD(self._output) - objKeyStore.addManyTypesStreamAOD(self._output) - objKeyStore.addManyTypesTransient(self._output) - + import tauRec.TauAlgorithmsHolder as taualgs from tauRec.tauRecFlags import tauFlags @@ -119,10 +92,4 @@ class TauRecCoreBuilder ( TauRecConfigured ) : def TauBuilderToolHandle(self): return self._TauBuilderToolHandle - def outputKey(self): - return self._output[self._outputType] - - def outputType(self): - return self._outputType - #end diff --git a/Reconstruction/tauRec/python/TauRecRunConfigured.py b/Reconstruction/tauRec/python/TauRecRunConfigured.py index b31874fd000c18ab6c1bedee7c787161a0041434..ea01dfddb4014521152688cfd33c2b2a15594bb1 100644 --- a/Reconstruction/tauRec/python/TauRecRunConfigured.py +++ b/Reconstruction/tauRec/python/TauRecRunConfigured.py @@ -31,14 +31,14 @@ class TauRecRunConfigured ( Configured ) : from tauRec.tauRecFlags import tauFlags self._TauRunnerAlgHandle = TauRunnerAlg ( name=self.name+'Alg', Key_tauInputContainer="tmp_TauJets", - Key_Pi0ClusterInputContainer="TauPi0SubtractedClusters", + Key_Pi0ClusterInputContainer="TauInitialPi0Clusters", Key_tauOutputContainer="TauJets", Key_neutralPFOOutputContainer="TauNeutralParticleFlowObjects", Key_pi0ClusterOutputContainer="TauPi0Clusters", Key_hadronicPFOOutputContainer="TauHadronicParticleFlowObjects", Key_vertexOutputContainer = "TauSecondaryVertices", Key_chargedPFOOutputContainer = "TauChargedParticleFlowObjects", - Key_pi0Container= "finalTauPi0s" + Key_pi0Container= "TauFinalPi0s" ) Configured.__init__(self, ignoreExistingDataObject=ignoreExistingDataObject) diff --git a/Reconstruction/tauRec/python/TauRecRunner.py b/Reconstruction/tauRec/python/TauRecRunner.py index 04cc5c067417f579f731679ef27fe102aabee0ca..789d13b2ef57f91633a904d7e289185083e4d5ff 100644 --- a/Reconstruction/tauRec/python/TauRecRunner.py +++ b/Reconstruction/tauRec/python/TauRecRunner.py @@ -13,59 +13,37 @@ ################################################################################ import os, sys, string - from AthenaCommon.Logging import logging from AthenaCommon.SystemOfUnits import * from AthenaCommon.Constants import * from AthenaCommon.BeamFlags import jobproperties import traceback - from RecExConfig.Configured import Configured from .TauRecRunConfigured import TauRecRunConfigured -# global tauRec config keys -_outputType = "xAOD::TauJetContainer" -_outputKey = "TauJets" -_outputAuxType = "xAOD::TauJetAuxContainer" -_outputAuxKey = "TauJetsAux." - ################################################################################ ## @class TauRecRunner # Build proper tau candidates and associate tracks, vertex and cells ################################################################################ class TauRecRunner ( TauRecRunConfigured ) : - """Build proper tau candidates and associate tracks, vertex and cells. - Calculate properties based on cell informations. - Find clusters used for Pi0 identification and eflow variables. - PhotonConversion will be run here too. + """Build final tau candidates. + Run algorithms that require pi0 cells, and all downstream algorithms. """ - _output = { _outputType:_outputKey , _outputAuxType:_outputAuxKey } - def __init__(self, name = "TauRecRunner"): self.name = name TauRecRunConfigured.__init__(self, name) - - def configure(self): mlog = logging.getLogger ('TauRecRunner.py::configure:') mlog.info('entering') - from RecExConfig.RecFlags import rec - - # xxx ToDo: still needed? - from RecExConfig.ObjKeyStore import objKeyStore - objKeyStore.addManyTypesStreamESD(self._output) - objKeyStore.addManyTypesStreamAOD(self._output) - - import tauRec.TauAlgorithmsHolder as taualgs - - from tauRec.tauRecFlags import tauFlags - + from RecExConfig.RecFlags import rec + import tauRec.TauAlgorithmsHolder as taualgs + from tauRec.tauRecFlags import tauFlags tools = [] - + tools.append(taualgs.getPi0ClusterCreator()) tools.append(taualgs.getPi0ClusterScaler()) tools.append(taualgs.getPi0ScoreCalculator()) @@ -129,14 +107,6 @@ class TauRecRunner ( TauRecRunConfigured ) : # run first part of Tau Builder TauRecRunConfigured.WrapTauRecToolExecHandle(self, tool=tools) - return True - - - def outputKey(self): - return self._output[self._outputType] - - def outputType(self): - return self._outputType - + return True #end diff --git a/Reconstruction/tauRec/share/Pi0ClusterMaker_jobOptions.py b/Reconstruction/tauRec/share/Pi0ClusterMaker_jobOptions.py index 1b97e0974cb774656b7d1b4bb63eb8719a95d337..4ee5fe96b024e82c59aa90c6cad7c39590547316 100644 --- a/Reconstruction/tauRec/share/Pi0ClusterMaker_jobOptions.py +++ b/Reconstruction/tauRec/share/Pi0ClusterMaker_jobOptions.py @@ -249,8 +249,8 @@ TopoSplitterForTaus.RestrictHECIWandFCalNeighbors = False TopoSplitterForTaus.WeightingOfNegClusters = jobproperties.CaloTopoClusterFlags.doTreatEnergyCutAsAbsolute() # cluster maker -cluster_container = 'TauPi0SubtractedClusters' -CaloTopoForTausMaker = CaloClusterMaker ("TauPi0SubtractedClusterMaker") +cluster_container = 'TauInitialPi0Clusters' +CaloTopoForTausMaker = CaloClusterMaker ("TauInitialPi0ClusterMaker") CaloTopoForTausMaker.ClustersOutputName=cluster_container CaloTopoForTausMaker.ClusterMakerTools=[ TopoClusterForTaus.getFullName(), diff --git a/Reconstruction/tauRec/share/TauAODList.py b/Reconstruction/tauRec/share/TauAODList.py index 0df44446948e96f2e21c0a5eb0996d31412c70d5..df83c6b16998eb42febc13a8b340ce0f9a5ea9b0 100644 --- a/Reconstruction/tauRec/share/TauAODList.py +++ b/Reconstruction/tauRec/share/TauAODList.py @@ -11,38 +11,46 @@ TauAODList = [] #------------------------------------------------------------------------------ -# Tau Pi0 cluster -#------------------------------------------------------------------------------ -#TauAODList += [ "xAOD::CaloClusterContainer#TauPi0Clusters" ] -#TauAODList += [ "xAOD::CaloClusterAuxContainer#TauPi0ClustersAux." ] - -TauAODList += [ "xAOD::CaloClusterContainer#TauPi0SubtractedClusters" ] -TauAODList += [ "xAOD::CaloClusterAuxContainer#TauPi0SubtractedClustersAux." ] -TauAODList += [ "CaloClusterCellLinkContainer#TauPi0SubtractedClusters_links" ] - -#------------------------------------------------------------------------------ -# TauRec main xAOD containers +# Taus #------------------------------------------------------------------------------ TauAODList += [ "xAOD::TauJetContainer#TauJets" ] TauAODList += [ "xAOD::TauJetAuxContainer#TauJetsAux.-mu.-nVtxPU.-ABS_ETA_LEAD_TRACK.-TAU_ABSDELTAPHI.-TAU_ABSDELTAETA.-absipSigLeadTrk" ] #------------------------------------------------------------------------------ -# TauRec tauTrack xAOD containers +# Tau tracks #------------------------------------------------------------------------------ TauAODList += [ "xAOD::TauTrackContainer#TauTracks" ] TauAODList += [ "xAOD::TauTrackAuxContainer#TauTracksAux." ] #------------------------------------------------------------------------------ -# Secondary Vertex for Tau Decay +# Secondary vertex #------------------------------------------------------------------------------ TauAODList += [ "xAOD::VertexContainer#TauSecondaryVertices" ] TauAODList += [ "xAOD::VertexAuxContainer#TauSecondaryVerticesAux.-vxTrackAtVertex" ] +#------------------------------------------------------------------------------ +# Pi0 cells +#------------------------------------------------------------------------------ +TauAODList += [ "CaloCellContainer#TauCommonPi0Cells" ] +TauAODList += [ "CaloClusterCellLinkContainer#TauInitialPi0Clusters_links" ] + +#------------------------------------------------------------------------------ +# Pi0 initial clusters +#------------------------------------------------------------------------------ +TauAODList += [ "xAOD::CaloClusterContainer#TauInitialPi0Clusters" ] +TauAODList += [ "xAOD::CaloClusterAuxContainer#TauInitialPi0ClustersAux." ] + +#------------------------------------------------------------------------------ +# Shot clusters +#------------------------------------------------------------------------------ +TauAODList += [ "xAOD::CaloClusterContainer#TauShotClusters"] +TauAODList += [ "xAOD::CaloClusterAuxContainer#TauShotClustersAux."] + #------------------------------------------------------------------------------ # Final reconstructed 4-vectors of Pi0s #------------------------------------------------------------------------------ -TauAODList += [ "xAOD::ParticleContainer#finalTauPi0s" ] -TauAODList += [ "xAOD::ParticleAuxContainer#finalTauPi0sAux." ] +TauAODList += [ "xAOD::ParticleContainer#TauFinalPi0s" ] +TauAODList += [ "xAOD::ParticleAuxContainer#TauFinalPi0sAux." ] #------------------------------------------------------------------------------ # Shot ParticleFlowObjects @@ -68,18 +76,10 @@ TauAODList += [ "xAOD::PFOAuxContainer#TauNeutralParticleFlowObjectsAux." ] TauAODList += [ "xAOD::PFOContainer#TauHadronicParticleFlowObjects" ] TauAODList += [ "xAOD::PFOAuxContainer#TauHadronicParticleFlowObjectsAux." ] +#------------------------------------------------------------------------------ +# Di-tau AOD content +#------------------------------------------------------------------------------ from DiTauRec.DiTauRecFlags import jobproperties if jobproperties.DiTauRecFlags.doDiTauRec(): include("DiTauRec/DiTauAODList.py") TauAODList += DiTauAODList - - -#------------------------------------------------------------------------- -# eflowObjects for tau -#-------------------------------------------------------------------------- -#TauAODList += [ "eflowObjectContainer#eflowObjects_tauMode" ] -#TauAODList += [ "xAOD::PFOContainer#neutralTauPFO_eflowRec" ] -#TauAODList += [ "xAOD::PFOAuxContainer#neutralTauPFO_eflowRecAux." ] -#TauAODList += [ "xAOD::PFOContainer#chargedTauPFO_eflowRec" ] -#TauAODList += [ "xAOD::PFOAuxContainer#chargedTauPFO_eflowRecAux." ] - diff --git a/Reconstruction/tauRec/share/TauESDList.py b/Reconstruction/tauRec/share/TauESDList.py index 97ef76bd7a22eb60166d760894fd3a97cd367567..5313f4b1f07d1828486bdc24295d7d30b2fc3d8e 100644 --- a/Reconstruction/tauRec/share/TauESDList.py +++ b/Reconstruction/tauRec/share/TauESDList.py @@ -11,66 +11,46 @@ TauESDList = [] #------------------------------------------------------------------------------ -# Tau1P3P cell cluster +# Taus #------------------------------------------------------------------------------ -#TauESDList += [ "CaloClusterContainer#Tau1P3PCellCluster" ] -#TauESDList += [ "CaloCellLinkContainer#Tau1P3PCellCluster_Link" ] -#TauESDList += [ "CaloShowerContainer#Tau1P3PCellCluster_Data" ] - -#------------------------------------------------------------------------------ -# TauRec cell cluster -#------------------------------------------------------------------------------ -#TauESDList += [ "CaloClusterContainer#TauRecCellCluster" ] -#TauESDList += [ "CaloCellLinkContainer#TauRecCellCluster_Link" ] -#TauESDList += [ "CaloShowerContainer#TauRecCellCluster_Data" ] +TauESDList += [ "xAOD::TauJetContainer#TauJets" ] +TauESDList += [ "xAOD::TauJetAuxContainer#TauJetsAux." ] #------------------------------------------------------------------------------ -# Tau1P3P Pi0 cluster +# Tau tracks #------------------------------------------------------------------------------ -#TauESDList += [ "CaloClusterContainer#TauPi0ClusterContainer" ] -#TauESDList += [ "CaloCellLinkContainer#TauPi0ClusterContainer_Link" ] -#TauESDList += [ "CaloShowerContainer#TauPi0ClusterContainer_Data" ] -#TauESDList += [ "CaloCellContainer#TauCommonPi0CellContainer" ] # for studies of the cell-based algorithm +TauESDList += [ "xAOD::TauTrackContainer#TauTracks" ] +TauESDList += [ "xAOD::TauTrackAuxContainer#TauTracksAux." ] #------------------------------------------------------------------------------ -# Tau Pi0 cluster +# Secondary vertex #------------------------------------------------------------------------------ -TauESDList += [ "xAOD::CaloClusterContainer#TauPi0Clusters" ] -TauESDList += [ "xAOD::CaloClusterAuxContainer#TauPi0ClustersAux." ] - +TauESDList += [ "xAOD::VertexContainer#TauSecondaryVertices" ] +TauESDList += [ "xAOD::VertexAuxContainer#TauSecondaryVerticesAux.-vxTrackAtVertex" ] #------------------------------------------------------------------------------ -# Tau Pi0 cluster cell container and links +# Pi0 cells #------------------------------------------------------------------------------ -TauESDList += [ "CaloClusterCellLinkContainer#TauPi0Clusters_links" ] TauESDList += [ "CaloCellContainer#TauCommonPi0Cells" ] +TauESDList += [ "CaloClusterCellLinkContainer#TauInitialPi0Clusters_links" ] #------------------------------------------------------------------------------ -# TauRec main xAOD containers +# Pi0 initial clusters #------------------------------------------------------------------------------ -TauESDList += [ "xAOD::TauJetContainer#TauJets" ] -TauESDList += [ "xAOD::TauJetAuxContainer#TauJetsAux." ] +TauESDList += [ "xAOD::CaloClusterContainer#TauInitialPi0Clusters" ] +TauESDList += [ "xAOD::CaloClusterAuxContainer#TauInitialPi0ClustersAux." ] #------------------------------------------------------------------------------ -# TauRec tauTrack xAOD containers +# Shot clusters #------------------------------------------------------------------------------ -TauESDList += [ "xAOD::TauTrackContainer#TauTracks" ] -TauESDList += [ "xAOD::TauTrackAuxContainer#TauTracksAux." ] +TauESDList += [ "xAOD::CaloClusterContainer#TauShotClusters"] +TauESDList += [ "xAOD::CaloClusterAuxContainer#TauShotClustersAux."] #------------------------------------------------------------------------------ -# Secondary Vertex for Tau Decay +# Final reconstructed 4-vectors of Pi0s #------------------------------------------------------------------------------ -TauESDList += [ "xAOD::VertexContainer#TauSecondaryVertices" ] -TauESDList += [ "xAOD::VertexAuxContainer#TauSecondaryVerticesAux.-vxTrackAtVertex" ] - -TauESDList += [ "xAOD::ParticleContainer#finalTauPi0s" ] -TauESDList += [ "xAOD::ParticleAuxContainer#finalTauPi0sAux." ] -##------------------------------------------------------------------------------ -## Tau shot clusters -##------------------------------------------------------------------------------ -#TauESDList += [ "CaloClusterContainer#TauShotClusters" ] -#TauESDList += [ "CaloCellLinkContainer#TauShotClusters_Link" ] -#TauESDList += [ "CaloShowerContainer#TauShotClusters_Data" ] +TauESDList += [ "xAOD::ParticleContainer#TauFinalPi0s" ] +TauESDList += [ "xAOD::ParticleAuxContainer#TauFinalPi0sAux." ] #------------------------------------------------------------------------------ # Shot ParticleFlowObjects @@ -95,29 +75,11 @@ TauESDList += [ "xAOD::PFOAuxContainer#TauNeutralParticleFlowObjectsAux." ] #------------------------------------------------------------------------------ TauESDList += [ "xAOD::PFOContainer#TauHadronicParticleFlowObjects" ] TauESDList += [ "xAOD::PFOAuxContainer#TauHadronicParticleFlowObjectsAux." ] - - -#------------------------------------------------------------------------- -# eflowObjects for tau -#-------------------------------------------------------------------------- -#TauESDList += [ "eflowObjectContainer#eflowObjects_tauMode" ] -#TauESDList += [ "xAOD::PFOContainer#neutralTauPFO_eflowRec" ] -#TauESDList += [ "xAOD::PFOAuxContainer#neutralTauPFO_eflowRecAux." ] -#TauESDList += [ "xAOD::PFOContainer#chargedTauPFO_eflowRec" ] -#TauESDList += [ "xAOD::PFOAuxContainer#chargedTauPFO_eflowRecAux." ] - - - -##------------------------------------------------------------------------------ -## Tau1P3P cell EM012 cluster -##------------------------------------------------------------------------------ -#TauESDList += [ "CaloClusterContainer#Tau1P3PCellEM012ClusterContainer" ] -#TauESDList += [ "CaloCellLinkContainer#Tau1P3PCellEM012ClusterContainer_Link" ] -#TauESDList += [ "CaloShowerContainer#Tau1P3PCellEM012ClusterContainer_Data" ] - +#------------------------------------------------------------------------------ +# Di-tau AOD content +#------------------------------------------------------------------------------ from DiTauRec.DiTauRecFlags import jobproperties if jobproperties.DiTauRecFlags.doDiTauRec(): include("DiTauRec/DiTauESDList.py") TauESDList += DiTauESDList - pass diff --git a/Reconstruction/tauRec/share/tau_standalone_EMPFlow_ESDtoAOD.py b/Reconstruction/tauRec/share/tau_standalone_EMPFlow_ESDtoAOD.py index 6db4f8ab4bcd399c9ef4983d0bbd4ec51b2dfd25..28e43e49d3a45451b0987c1580ead7cc4ce2e613 100644 --- a/Reconstruction/tauRec/share/tau_standalone_EMPFlow_ESDtoAOD.py +++ b/Reconstruction/tauRec/share/tau_standalone_EMPFlow_ESDtoAOD.py @@ -1,5 +1,6 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -athenaCommonFlags.FilesInput=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/input/standalone.ESD.pool.root"] +athenaCommonFlags.FilesInput = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/input/standalone.ESD.pool.root"] +athenaCommonFlags.PoolAODOutput = "EMPFlow_AOD.pool.root" from RecExConfig.RecFlags import rec rec.doEgamma.set_Value_and_Lock(False) diff --git a/Reconstruction/tauRec/share/tau_standalone_LCTopo_ESDtoAOD.py b/Reconstruction/tauRec/share/tau_standalone_LCTopo_ESDtoAOD.py index aa9aa66da1571e0c044db77b39b4afb43f986b40..cd4fe2c5999e229f9e0d4e26eafc63742d0f8436 100644 --- a/Reconstruction/tauRec/share/tau_standalone_LCTopo_ESDtoAOD.py +++ b/Reconstruction/tauRec/share/tau_standalone_LCTopo_ESDtoAOD.py @@ -1,5 +1,6 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -athenaCommonFlags.FilesInput=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/input/standalone.ESD.pool.root"] +athenaCommonFlags.FilesInput = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/input/standalone.ESD.pool.root"] +athenaCommonFlags.PoolAODOutput = "LCTopo_AOD.pool.root" from RecExConfig.RecFlags import rec rec.doEgamma.set_Value_and_Lock(False) diff --git a/Reconstruction/tauRec/tauRec/TauRunnerAlg.h b/Reconstruction/tauRec/tauRec/TauRunnerAlg.h index 68c5da9a297e28578dacab6e435fed5906445887..498c3e194b272a61efc676790091d6673f215a5f 100644 --- a/Reconstruction/tauRec/tauRec/TauRunnerAlg.h +++ b/Reconstruction/tauRec/tauRec/TauRunnerAlg.h @@ -48,16 +48,15 @@ class TauRunnerAlg: public AthAlgorithm ToolHandleArray<ITauToolBase> m_tools{this, "Tools", {}, "Tools building taus"}; SG::ReadHandleKey<xAOD::TauJetContainer> m_tauInputContainer{this,"Key_tauInputContainer","tmp_TauJets","input temp tau key"}; - SG::ReadHandleKey<xAOD::CaloClusterContainer> m_pi0ClusterInputContainer{this,"Key_Pi0ClusterInputContainer", "TauPi0SubtractedClusters", "input pi0 cluster"}; - - SG::WriteHandleKey<xAOD::TauJetContainer> m_tauOutputContainer{this,"Key_tauOutputContainer","TauJets","output tau data key"}; + SG::ReadHandleKey<xAOD::CaloClusterContainer> m_pi0ClusterInputContainer{this,"Key_Pi0ClusterInputContainer", "TauInitialPi0Clusters", "input pi0 cluster"}; + SG::WriteHandleKey<xAOD::TauJetContainer> m_tauOutputContainer{this,"Key_tauOutputContainer","TauJets","output tau data key"}; SG::WriteHandleKey<xAOD::PFOContainer> m_neutralPFOOutputContainer{this,"Key_neutralPFOOutputContainer", "TauNeutralParticleFlowObjects", "tau neutral pfo out key"}; SG::WriteHandleKey<xAOD::CaloClusterContainer> m_pi0ClusterOutputContainer{this,"Key_pi0ClusterOutputContainer", "TauPi0Clusters", "tau pi0cluster output"}; SG::WriteHandleKey<xAOD::PFOContainer> m_hadronicPFOOutputContainer{this,"Key_hadronicPFOOutputContainer", "TauHadronicParticleFlowObjects", "tau hadronic pfo out key"}; SG::WriteHandleKey<xAOD::VertexContainer> m_vertexOutputContainer{this,"Key_vertexOutputContainer", "TauSecondaryVertices", "input vertex container key"}; SG::WriteHandleKey<xAOD::PFOContainer> m_chargedPFOOutputContainer{this,"Key_chargedPFOOutputContainer", "TauChargedParticleFlowObjects", "tau charged pfo out key"}; - SG::WriteHandleKey<xAOD::ParticleContainer> m_pi0Container{this,"Key_pi0Container", "finalTauPi0s", "tau final pi0s output"}; + SG::WriteHandleKey<xAOD::ParticleContainer> m_pi0Container{this,"Key_pi0Container", "TauFinalPi0s", "tau final pi0s output"}; }; diff --git a/Reconstruction/tauRec/test/test_tau_standalone_EMPFlow_serial.sh b/Reconstruction/tauRec/test/test_tau_standalone_EMPFlow_serial.sh index 75abe15b5b8245f49e8961a619b5f405799e01ac..03eb7c3417b31b8c7fdb90ad55bae50907d64538 100755 --- a/Reconstruction/tauRec/test/test_tau_standalone_EMPFlow_serial.sh +++ b/Reconstruction/tauRec/test/test_tau_standalone_EMPFlow_serial.sh @@ -17,15 +17,15 @@ athena.py --evtMax ${NEVENTS} tauRec/tau_standalone_EMPFlow_ESDtoAOD.py >> tau_ echo "art-result: $? Reconstrution" # compare the AOD file -art.py compare ref --entries ${NEVENTS} --mode detailed --order-trees --diff-root AOD.pool.root ${REF_DIR}/EMPFlow_AOD.pool.root >> AOD_diff_root.log 2>&1 +art.py compare ref --entries ${NEVENTS} --mode detailed --order-trees --diff-root EMPFlow_AOD.pool.root ${REF_DIR}/EMPFlow_AOD.pool.root >> AOD_diff_root.log 2>&1 echo "art-result: $? diff-root" # run the physics validation -Reco_tf.py --maxEvents ${NEVENTS} --validationFlags 'noExample,doTau' --inputAODFile AOD.pool.root --outputNTUP_PHYSVALFile NTUP_PHYSVAL.root +Reco_tf.py --maxEvents ${NEVENTS} --validationFlags 'noExample,doTau' --inputAODFile EMPFlow_AOD.pool.root --outputNTUP_PHYSVALFile EMPFlow_NTUP_PHYSVAL.root echo "art-result: $? PhysVal" # compare the histograms -rootcomp.py NTUP_PHYSVAL.root ${REF_DIR}/NTUP_PHYSVAL.root >> rootcomp.log 2>&1 +rootcomp.py EMPFlow_NTUP_PHYSVAL.root ${REF_DIR}/EMPFlow_NTUP_PHYSVAL.root >> rootcomp.log 2>&1 echo "art-result: $? rootcomp" # run dcube @@ -33,6 +33,6 @@ INPUT_DIR="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/input" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ --plot --output dcube \ --config ${INPUT_DIR}/config_mc.xml \ - --reference ${REF_DIR}/NTUP_PHYSVAL.root \ - NTUP_PHYSVAL.root + --reference ${REF_DIR}/EMPFlow_NTUP_PHYSVAL.root \ + EMPFlow_NTUP_PHYSVAL.root echo "art-result: $? dcube" diff --git a/Reconstruction/tauRec/test/test_tau_standalone_LCTopo_multithread.sh b/Reconstruction/tauRec/test/test_tau_standalone_LCTopo_multithread.sh index 0d4cd79d42e761f0ce7ce209a2dc5bcd66173df3..2cae1a2a38c6325000218b3a599ec9dc2c8fc922 100755 --- a/Reconstruction/tauRec/test/test_tau_standalone_LCTopo_multithread.sh +++ b/Reconstruction/tauRec/test/test_tau_standalone_LCTopo_multithread.sh @@ -18,15 +18,15 @@ athena.py --threads 4 --evtMax ${NEVENTS} tauRec/tau_standalone_LCTopo_ESDtoAOD echo "art-result: $? Reconstrution" # compare the AOD file -art.py compare ref --entries ${NEVENTS} --mode detailed --excluded-vars=mc_event_number --order-trees --diff-root AOD.pool.root ${REF_DIR}/LCTopo_AOD.pool.root >> AOD_diff_root.log 2>&1 +art.py compare ref --entries ${NEVENTS} --mode detailed --excluded-vars=mc_event_number --order-trees --diff-root LCTopo_AOD.pool.root ${REF_DIR}/LCTopo_AOD.pool.root >> AOD_diff_root.log 2>&1 echo "art-result: $? diff-root" # run the physics validation -Reco_tf.py --maxEvents ${NEVENTS} --validationFlags 'noExample,doTau' --inputAODFile AOD.pool.root --outputNTUP_PHYSVALFile NTUP_PHYSVAL.root +Reco_tf.py --maxEvents ${NEVENTS} --validationFlags 'noExample,doTau' --inputAODFile LCTopo_AOD.pool.root --outputNTUP_PHYSVALFile LCTopo_NTUP_PHYSVAL.root echo "art-result: $? PhysVal" # compare the histograms -rootcomp.py NTUP_PHYSVAL.root ${REF_DIR}/NTUP_PHYSVAL.root >> rootcomp.log 2>&1 +rootcomp.py LCTopo_NTUP_PHYSVAL.root ${REF_DIR}/LCTopo_NTUP_PHYSVAL.root >> rootcomp.log 2>&1 echo "art-result: $? rootcomp" # run dcube @@ -34,6 +34,6 @@ INPUT_DIR="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/input" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ --plot --output dcube \ --config ${INPUT_DIR}/config_mc.xml \ - --reference ${REF_DIR}/NTUP_PHYSVAL.root \ - NTUP_PHYSVAL.root + --reference ${REF_DIR}/LCTopo_NTUP_PHYSVAL.root \ + LCTopo_NTUP_PHYSVAL.root echo "art-result: $? dcube" diff --git a/Reconstruction/tauRec/test/test_tau_standalone_LCTopo_serial.sh b/Reconstruction/tauRec/test/test_tau_standalone_LCTopo_serial.sh index bd8d31d55a5560229f12b82bb1444f0bc4ee4fd1..cc4c9338eb8fffd3190e2bbed917539df27c12d6 100755 --- a/Reconstruction/tauRec/test/test_tau_standalone_LCTopo_serial.sh +++ b/Reconstruction/tauRec/test/test_tau_standalone_LCTopo_serial.sh @@ -17,15 +17,15 @@ athena.py --evtMax ${NEVENTS} tauRec/tau_standalone_LCTopo_ESDtoAOD.py >> tau_s echo "art-result: $? Reconstrution" # compare the AOD file -art.py compare ref --entries ${NEVENTS} --mode detailed --order-trees --diff-root AOD.pool.root ${REF_DIR}/LCTopo_AOD.pool.root >> AOD_diff_root.log 2>&1 +art.py compare ref --entries ${NEVENTS} --mode detailed --order-trees --diff-root LCTopo_AOD.pool.root ${REF_DIR}/LCTopo_AOD.pool.root >> AOD_diff_root.log 2>&1 echo "art-result: $? diff-root" # run the physics validation -Reco_tf.py --maxEvents ${NEVENTS} --validationFlags 'noExample,doTau' --inputAODFile AOD.pool.root --outputNTUP_PHYSVALFile NTUP_PHYSVAL.root +Reco_tf.py --maxEvents ${NEVENTS} --validationFlags 'noExample,doTau' --inputAODFile LCTopo_AOD.pool.root --outputNTUP_PHYSVALFile LCTopo_NTUP_PHYSVAL.root echo "art-result: $? PhysVal" # compare the histograms -rootcomp.py NTUP_PHYSVAL.root ${REF_DIR}/NTUP_PHYSVAL.root >> rootcomp.log 2>&1 +rootcomp.py LCTopo_NTUP_PHYSVAL.root ${REF_DIR}/LCTopo_NTUP_PHYSVAL.root >> rootcomp.log 2>&1 echo "art-result: $? rootcomp" # run dcube @@ -33,6 +33,6 @@ INPUT_DIR="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/input" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ --plot --output dcube \ --config ${INPUT_DIR}/config_mc.xml \ - --reference ${REF_DIR}/NTUP_PHYSVAL.root \ - NTUP_PHYSVAL.root + --reference ${REF_DIR}/LCTopo_NTUP_PHYSVAL.root \ + LCTopo_NTUP_PHYSVAL.root echo "art-result: $? dcube" diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/ISF_FatrasRecoTools/ISF_TrackSummaryHelperTool.h b/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/ISF_FatrasRecoTools/ISF_TrackSummaryHelperTool.h index 7790f808ca3aefe74df1f6dc90c2903ed1627653..f1478e30d46c23998fead8b51a9a6778473d54f4 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/ISF_FatrasRecoTools/ISF_TrackSummaryHelperTool.h +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/ISF_FatrasRecoTools/ISF_TrackSummaryHelperTool.h @@ -44,6 +44,8 @@ namespace iFatras { Output: Changes in information and hitPattern Input quantities rot, tsos are used to increment the counts for hits and outliers in information and to set the proper bits in hitPattern. */ + using IExtendedTrackSummaryHelperTool::analyse; + using IExtendedTrackSummaryHelperTool::updateSharedHitCount; virtual void analyse(const Trk::Track& track, const Trk::PRDtoTrackMap *prd_to_track_map, const Trk::RIO_OnTrack* rot, diff --git a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh index 23c4d193328d4a445091c7dcbf48195d51b39cb9..ab71694d01310f2d8869cb1d30ee75ed26d20437 100755 --- a/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh +++ b/Simulation/Tests/OverlayTests/test/test_DataOverlay_ConfigTest_Zmumu_TRT.sh @@ -16,7 +16,7 @@ events=2 Overlay_tf.py \ ---detectors TRT \ +--detectors TRT Pixel \ --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.OverlaySim/HITS.pool.root \ --inputBS_SKIMFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc15_valid.00200010.overlay_streamsAll_2016_pp_1.skim.DRAW.r8381/DRAW.09331084._000146.pool.root.1 \ --outputRDOFile legacyDataOverlayRDO.pool.root \ @@ -30,7 +30,7 @@ Overlay_tf.py \ --athenaopts '"--config-only=ConfigLegacy.pkl"' Overlay_tf.py \ ---detectors TRT \ +--detectors TRT Pixel \ --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.OverlaySim/HITS.pool.root \ --inputBS_SKIMFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc15_valid.00200010.overlay_streamsAll_2016_pp_1.skim.DRAW.r8381/DRAW.09331084._000146.pool.root.1 \ --outputRDOFile legacyDataOverlayRDO.pool.root \ @@ -52,7 +52,7 @@ if [ $rc -eq 0 ] then Overlay_tf.py \ --CA \ - --detectors TRT \ + --detectors TRT Pixel \ --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.OverlaySim/HITS.pool.root \ --inputBS_SKIMFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc15_valid.00200010.overlay_streamsAll_2016_pp_1.skim.DRAW.r8381/DRAW.09331084._000146.pool.root.1 \ --outputRDOFile dataOverlayRDO.pool.root \ diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/CMakeLists.txt b/TileCalorimeter/TileCalib/TileCalibBlobObjs/CMakeLists.txt index abd78ab1797b0d481037510f33f2b465a6612d7b..277bec86c0e0cd829b0f107901ff05cbf7ad1427 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/CMakeLists.txt +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/CMakeLists.txt @@ -5,9 +5,6 @@ # Declare the package name: atlas_subdir( TileCalibBlobObjs ) -atlas_depends_on_subdirs( PRIVATE - AtlasTest/TestTools ) - # External dependencies: find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) @@ -20,7 +17,7 @@ atlas_add_library( TileCalibBlobObjs PUBLIC_HEADERS TileCalibBlobObjs INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${CORAL_LIBRARIES} + LINK_LIBRARIES CxxUtils ${CORAL_LIBRARIES} PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ) atlas_add_dictionary( TileCalibBlobObjsDict diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/ATLAS_CHECK_THREAD_SAFETY b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..5475dd5db21812f27da21a55f500c9f2f990ffe0 --- /dev/null +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +TileCalorimeter/TileCalib/TileCalibBlobObjs diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/Exception.h b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/Exception.h index 5bca938e15543fe40a61511fe311d4609b98bdeb..eb48dee0534e08368e1e18df67d4e78f2c60ccff 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/Exception.h +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/Exception.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECALIBBLOBOBJS_EXCEPTION_H @@ -22,13 +22,14 @@ namespace TileCalib { class Exception : public std::exception { public: explicit Exception( const std::string& domain, const std::string& message) - : m_domain(domain), m_message(message){} + : m_domain(domain), m_message(message) + { + format(); + } virtual ~Exception() throw() {} virtual const char* what() const throw(){ - static std::string result; - result = m_domain + ": "+ m_message; - return result.c_str(); + return m_result.c_str(); } virtual const std::string& domain() const{ @@ -38,11 +39,18 @@ namespace TileCalib { protected: virtual void setMessage( const std::string& message ){ m_message = message; + format(); } private: + void format() + { + m_result = m_domain + ": "+ m_message; + } + std::string m_domain; std::string m_message; + std::string m_result; }; diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileBchPrbs.h b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileBchPrbs.h index 8bf2eb7336bc4a1f4468f88a8f10cc2bf82f118f..4bd15e77f4ca4afabd8fcf45ad83f5504fede5da 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileBchPrbs.h +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileBchPrbs.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECALIBBLOBOBJS_TILEBCHPRBS_H @@ -102,9 +102,7 @@ class TileBchPrbs private: /** @brief Initializes the problem description map*/ - static void initPrbDesc(); - /** @brief PROBLEM to description association. */ - static std::map<Prb,std::string> m_prbNames; + static std::map<Prb,std::string> initPrbDesc(); }; #endif diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileBchStatus.h b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileBchStatus.h index b61fe36d25e2511d1551f43b8e3419c081e08366..d6fa86171cc6a5b959440637720ff7a3c61409e9 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileBchStatus.h +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileBchStatus.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECALIBBLOBOBJS_TILEBCHSTATUS_H @@ -11,8 +11,10 @@ */ #include "TileCalibBlobObjs/TileBchPrbs.h" +#include "CxxUtils/checker_macros.h" #include <set> #include <string> +#include <mutex> class TileBchStatus { @@ -64,12 +66,43 @@ class TileBchStatus private: PrbSet m_prbSet; //=== reference sets - static PrbSet m_refBad; - static PrbSet m_refNoisy; - static PrbSet m_refNoGainL1; - static PrbSet m_refBadTiming; - static PrbSet m_refWrongBCID; - static PrbSet m_refTimingDmuBcOffset; + struct LockedPrbSet + { + size_t size() const + { + std::lock_guard lock (m_mutex); + return m_set.size(); + } + void set (const PrbSet& s) + { + std::lock_guard lock (m_mutex); + m_set = s; + } + void set (PrbSet&& s) + { + std::lock_guard lock (m_mutex); + m_set = std::move(s); + } + operator TileBchStatus() const + { + std::lock_guard lock (m_mutex); + return TileBchStatus (m_set, true); + } + bool test (const PrbSet& s) const; + + private: + PrbSet m_set; + mutable std::mutex m_mutex; + }; + + TileBchStatus (const PrbSet& s, bool) : m_prbSet (s) {} + + static LockedPrbSet s_refBad ATLAS_THREAD_SAFE; + static LockedPrbSet s_refNoisy ATLAS_THREAD_SAFE; + static LockedPrbSet s_refNoGainL1 ATLAS_THREAD_SAFE; + static LockedPrbSet s_refBadTiming ATLAS_THREAD_SAFE; + static LockedPrbSet s_refWrongBCID ATLAS_THREAD_SAFE; + static LockedPrbSet s_refTimingDmuBcOffset ATLAS_THREAD_SAFE; }; // @@ -109,7 +142,7 @@ TileBchStatus::isAffected() const inline bool TileBchStatus::isBad() const { - return m_prbSet.size() ? (testFor(m_refBad).size() != 0) : false; + return m_prbSet.size() ? (s_refBad.test (m_prbSet)) : false; } // @@ -117,7 +150,7 @@ TileBchStatus::isBad() const inline bool TileBchStatus::isNoisy() const { - return m_prbSet.size() ? (testFor(m_refNoisy).size() != 0) : false; + return m_prbSet.size() ? (s_refNoisy.test (m_prbSet)) : false; } // @@ -141,7 +174,7 @@ TileBchStatus::isIgnoredInHlt() const inline bool TileBchStatus::isNoGainL1() const { - return m_prbSet.size() ? (testFor(m_refNoGainL1).size()!=0) : false; + return m_prbSet.size() ? (s_refNoGainL1.test (m_prbSet)) : false; } // @@ -157,7 +190,7 @@ TileBchStatus::isHalfGainL1() const inline bool TileBchStatus::isBadTiming() const { - return m_prbSet.size() ? (testFor(m_refBadTiming).size() != 0) : false; + return m_prbSet.size() ? (s_refBadTiming.test (m_prbSet)) : false; } // @@ -165,7 +198,7 @@ TileBchStatus::isBadTiming() const inline bool TileBchStatus::isTimingDmuBcOffset() const { - return m_prbSet.size() ? (testFor(m_refTimingDmuBcOffset).size() != 0) : false; + return m_prbSet.size() ? (s_refTimingDmuBcOffset.test (m_prbSet)) : false; } // @@ -173,7 +206,7 @@ TileBchStatus::isTimingDmuBcOffset() const inline bool TileBchStatus::isWrongBCID() const { - return m_prbSet.size() ? (testFor(m_refWrongBCID).size() != 0) : false; + return m_prbSet.size() ? (s_refWrongBCID.test (m_prbSet)) : false; } #endif diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerBase.h b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerBase.h index b7559e457253dbad30e10a51655684abf534d54a..7668d6c410851fcb1f5a0159231515d3503d3bc0 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerBase.h +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECALIBBLOBOBJS_TILECALIBDRAWERBASE_H @@ -131,7 +131,8 @@ class TileCalibDrawerBase{ //================================================================== /** @brief Returns start address of iEle-th basic unit. @param iEle sequential basic unit number */ - void* getAddress(unsigned int iEle) const; + const void* getAddress(unsigned int iEle) const; + void* getAddress(unsigned int iEle); /** @brief The header size in units of uint32_t. */ static const unsigned int m_hdrSize32 = 5; @@ -140,6 +141,9 @@ class TileCalibDrawerBase{ /** @brief Ctor for const blob. */ TileCalibDrawerBase(const coral::Blob& blob); + /** @brief Ctor for non-const blob. */ + TileCalibDrawerBase(coral::Blob& blob); + /** @brief (re-)creation of the referenced BLOB object. @param objType Object type @param objVersion Object version @@ -165,12 +169,15 @@ class TileCalibDrawerBase{ void dumpHeader(std::ostream& stm) const; private: - /** @brief Reference to the BLOB*/ - coral::Blob* m_blob; + /** @brief Non-const reference to the BLOB. + (Only present if we were created with a non-const blob.) */ + coral::Blob* m_blob_nc; + /** @brief Const reference to the BLOB (always there) */ + const coral::Blob* m_blob; /** @brief Cache blob starting address as uint_32t* */ - uint32_t* m_blobStart32; + const uint32_t* m_blobStart32; /** @brief Cache blob starting address as uint_16t* */ - uint16_t* m_blobStart16; + const uint16_t* m_blobStart16; /** @brief Cache blob size in units of uint32_t */ uint64_t m_blobSize32; /** @brief Is this TileCalibDrawer owner of the BLOB */ @@ -236,13 +243,25 @@ TileCalibDrawerBase::getCommentSizeUint32() const // //_________________________________________________________ -__attribute__((always_inline)) inline void* +__attribute__((always_inline)) inline const void* TileCalibDrawerBase::getAddress(unsigned int iEle) const { if(iEle>=getNObjs()){ throw TileCalib::IndexOutOfRange("TileCalibDrawerBase::getAddress", iEle, getNObjs()); } - return static_cast<void*>( m_blobStart32 + m_hdrSize32 + getObjSizeUint32()*iEle ); + return static_cast<const void*>( m_blobStart32 + m_hdrSize32 + getObjSizeUint32()*iEle ); +} + +// +//_________________________________________________________ +__attribute__((always_inline)) inline void* +TileCalibDrawerBase::getAddress(unsigned int iEle) +{ + if(iEle>=getNObjs()){ + throw TileCalib::IndexOutOfRange("TileCalibDrawerBase::getAddress", iEle, getNObjs()); + } + uint32_t* blobStart32 = static_cast<uint32_t*>(m_blob_nc->startingAddress()); + return static_cast<void*>( blobStart32 + m_hdrSize32 + getObjSizeUint32()*iEle ); } // @@ -251,8 +270,8 @@ __attribute__((always_inline)) inline uint64_t TileCalibDrawerBase::getTimeStamp() const { if(!getCommentSizeUint32()) return 0; - return *(reinterpret_cast<uint64_t*>(m_blobStart32 + m_hdrSize32 + - getNObjs()*getObjSizeUint32())); + return *(reinterpret_cast<const uint64_t*>(m_blobStart32 + m_hdrSize32 + + getNObjs()*getObjSizeUint32())); } #endif diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerBch.h b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerBch.h index d6431bfe9dd62e16cea46a1abeaf283e7433fae2..befa67a9582d004e526df3cff8e6ad3832800f0f 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerBch.h +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerBch.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECALIBBLOBOBJS_TILECALIBDRAWERBCH_H @@ -66,9 +66,10 @@ class TileCalibDrawerBch : public TileCalibDrawerDat<uint32_t> uint32_t& adcStatus, uint32_t& chnStatus) const; protected: - /** @brief Ctor. */ + /** @brief Ctor (const). */ TileCalibDrawerBch(const coral::Blob& blob); - + /** @brief Ctor (non-const). */ + TileCalibDrawerBch(coral::Blob& blob); }; // diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerDat.h b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerDat.h index fb40c5f077a3686c3a37673430b3406d5ceab5cc..5817b3f821b74027e2d03a3022d07eb893ce68ae 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerDat.h +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerDat.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECALIBBLOBOBJS_TILECALIBDRAWERDAT_H @@ -84,9 +84,12 @@ class TileCalibDrawerDat : public TileCalibDrawerBase virtual void dump(std::ostream& stm) const; protected: - /** @brief Ctor. + /** @brief Ctor (const). Derived classes should set doTypeCheck=false and do their own check. */ TileCalibDrawerDat(const coral::Blob& blob) : TileCalibDrawerBase(blob){} + /** @brief Ctor (non-const). + Derived classes should set doTypeCheck=false and do their own check. */ + TileCalibDrawerDat(coral::Blob& blob) : TileCalibDrawerBase(blob){} /** @brief Returns a pointer to the first value for the specified channel & ADC. @param channel The channel number; If channel number >= getNChans() @@ -94,7 +97,8 @@ class TileCalibDrawerDat : public TileCalibDrawerBase if channel number > (maximum number of channels in drawer) otherwise it is reset to 0 without warning (default policy) @param adc The gain index; if >= getNGains() it is reset to 0 without warning (default policy) */ - T* getAddress(unsigned int channel, unsigned int adc) const; + const T* getAddress(unsigned int channel, unsigned int adc) const; + T* getAddress(unsigned int channel, unsigned int adc); }; // @@ -186,8 +190,17 @@ TileCalibDrawerDat<T>::setData(unsigned int channel, unsigned int adc, const std // //______________________________________________________________ -template<class T> T* +template<class T> const T* TileCalibDrawerDat<T>::getAddress(unsigned int channel, unsigned int adc) const +{ + unsigned int idx = channel*getNGains() + adc; + return static_cast<const T*>(TileCalibDrawerBase::getAddress(idx)); +} + +// +//______________________________________________________________ +template<class T> T* +TileCalibDrawerDat<T>::getAddress(unsigned int channel, unsigned int adc) { unsigned int idx = channel*getNGains() + adc; return static_cast<T*>(TileCalibDrawerBase::getAddress(idx)); diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerFlt.h b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerFlt.h index 030eb815c60c76fea3fb576d4560c9f98d47726f..87351753b1ef6622198459e13a7353ce82899d29 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerFlt.h +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerFlt.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECALIBBLOBOBJS_TILECALIBDRAWERFLT_H @@ -88,8 +88,10 @@ class TileCalibDrawerFlt : public TileCalibDrawerDat<float> protected: - /** @brief Ctor. */ + /** @brief Ctor (const). */ TileCalibDrawerFlt(const coral::Blob& blob); + /** @brief Ctor (non-const). */ + TileCalibDrawerFlt(coral::Blob& blob); }; diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerOfc.h b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerOfc.h index a99b5c383470f14ca325ff463ee6e1fb51def98f..ba4de032366f67eaa5e54a7570948ddeaf50cdb6 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerOfc.h +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/TileCalibDrawerOfc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECALIBDRAWEROFC_H @@ -164,22 +164,32 @@ class TileCalibDrawerOfc : public TileCalibDrawerBase { void setPhases(unsigned int channel, unsigned int adc, const std::vector<float>& phases); protected: - /** @brief Ctor. */ + /** @brief Ctor (const). */ TileCalibDrawerOfc(const coral::Blob& blob); + /** @brief Ctor (non0const). */ + TileCalibDrawerOfc(coral::Blob& blob); private: + void initCheck(); + /** @brief Returns pointer to first data OFC for a given field, ADC & phase. @param field The field identifier @param channel The channel number @param adc The gain index @param phase The phase */ - float* getOfcStartAddress(unsigned int field, unsigned int channel, unsigned int adc, float& phase) const; + const float* getOfcStartAddress(unsigned int field, unsigned int channel, unsigned int adc, float& phase) const; + float* getOfcStartAddress(unsigned int field, unsigned int channel, unsigned int adc, float& phase); + + unsigned int getOfcStartOffset(unsigned int field, unsigned int channel, unsigned int adc, float& phase) const; /** @brief Returns pointer to the requested phase value @param channel The channel number @param adc The gain index @param phaseIdx The phase index */ - int32_t* getPhaseStartAddress(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const; + const int32_t* getPhaseStartAddress(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const; + int32_t* getPhaseStartAddress(unsigned int channel, unsigned int adc, unsigned int phaseIdx); + + unsigned int getPhaseStartOffset(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const; /** Returns the index for a given phase @param channel The channel number @@ -192,14 +202,14 @@ class TileCalibDrawerOfc : public TileCalibDrawerBase { //______________________________________________________________ __attribute__((always_inline)) inline uint32_t TileCalibDrawerOfc::getNSamples() const { - return *(static_cast<uint32_t*>(getAddress(0))); + return *(static_cast<const uint32_t*>(getAddress(0))); } // //______________________________________________________________ __attribute__((always_inline)) inline int32_t TileCalibDrawerOfc::getNPhases() const { - return *(static_cast<int32_t*>(getAddress(1))); + return *(static_cast<const int32_t*>(getAddress(1))); } // @@ -208,9 +218,9 @@ __attribute__((always_inline)) inline unsigned int TileCalibDrawerOfc::getPhaseNumber(unsigned int channel, unsigned int adc, float& phase) const { int db_phase = (int) std::round(phase * (1 / PHASE_PRECISION)); // Phases are stored as int(10*phase) in DB - int32_t* beg = getPhaseStartAddress(channel, adc, 0); - int32_t* end = beg + std::abs(getNPhases()); - int32_t* pos = std::lower_bound(beg, end, db_phase); + const int32_t* beg = getPhaseStartAddress(channel, adc, 0); + const int32_t* end = beg + std::abs(getNPhases()); + const int32_t* pos = std::lower_bound(beg, end, db_phase); if (pos == end || (*pos != db_phase && pos != beg && (*pos - db_phase) > (db_phase - *(pos - 1)))) { --pos; @@ -255,7 +265,7 @@ inline void TileCalibDrawerOfc::fillOfc (unsigned int channel,unsigned int adc, , float* w_a, float* w_b, float* w_c, float* g, float* dg) const { - float* startAddress = getOfcStartAddress(TileCalibDrawerOfc::FieldA, channel, adc, phase); + const float* startAddress = getOfcStartAddress(TileCalibDrawerOfc::FieldA, channel, adc, phase); size_t allSamplesSize = getNSamples() * sizeof(float); size_t fieldSize = getObjSizeUint32() * getNSamples(); @@ -287,8 +297,8 @@ inline void TileCalibDrawerOfc::setOfc(unsigned int field,unsigned int channel, // //______________________________________________________________ __attribute__((always_inline)) -inline int32_t* TileCalibDrawerOfc::getPhaseStartAddress(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const { - +inline unsigned int TileCalibDrawerOfc::getPhaseStartOffset(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const +{ if(phaseIdx >= static_cast<unsigned int>(std::abs(getNPhases()))){ throw TileCalib::IndexOutOfRange("TileCalibDrawerOfc::getPhaseStartAddress", phaseIdx, std::abs(getNPhases())); } @@ -307,14 +317,30 @@ inline int32_t* TileCalibDrawerOfc::getPhaseStartAddress(unsigned int channel, u unsigned int offset = 2; unsigned int nPhases = std::abs(getNPhases()); offset += channel * nPhases * getNGains() + adc * nPhases + phaseIdx; - return static_cast<int32_t*>(getAddress(offset)); + return offset; +} + +// +//______________________________________________________________ +__attribute__((always_inline)) +inline const int32_t* TileCalibDrawerOfc::getPhaseStartAddress(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const +{ + return static_cast<const int32_t*>(getAddress(getPhaseStartOffset(channel, adc, phaseIdx))); } // //______________________________________________________________ __attribute__((always_inline)) -inline float* TileCalibDrawerOfc::getOfcStartAddress(unsigned int field, unsigned int channel, unsigned int adc, float& phase) const { +inline int32_t* TileCalibDrawerOfc::getPhaseStartAddress(unsigned int channel, unsigned int adc, unsigned int phaseIdx) +{ + return static_cast<int32_t*>(getAddress(getPhaseStartOffset(channel, adc, phaseIdx))); +} +// +//______________________________________________________________ +__attribute__((always_inline)) +inline unsigned int TileCalibDrawerOfc::getOfcStartOffset(unsigned int field, unsigned int channel, unsigned int adc, float& phase) const +{ //=== check default policy if(channel >= getNChans()) { @@ -362,7 +388,23 @@ inline float* TileCalibDrawerOfc::getOfcStartAddress(unsigned int field, unsigne unsigned int lChan = lAdc * nGain; offset += channel * lChan + adc * lAdc + iPhase * lPhase + field * nSample; - return static_cast<float*>(getAddress(offset)); + return offset; +} + +// +//______________________________________________________________ +__attribute__((always_inline)) +inline const float* TileCalibDrawerOfc::getOfcStartAddress(unsigned int field, unsigned int channel, unsigned int adc, float& phase) const +{ + return static_cast<const float*>(getAddress(getOfcStartOffset(field, channel, adc, phase))); +} + +// +//______________________________________________________________ +__attribute__((always_inline)) +inline float* TileCalibDrawerOfc::getOfcStartAddress(unsigned int field, unsigned int channel, unsigned int adc, float& phase) +{ + return static_cast<float*>(getAddress(getOfcStartOffset(field, channel, adc, phase))); } #endif diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchPrbs.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchPrbs.cxx index ad4f05a5954c7fc9d3c9060e8f24d7793718919f..535b096cbbee334848f9d9589c3b92fb44be1cce 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchPrbs.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchPrbs.cxx @@ -1,85 +1,85 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TileCalibBlobObjs/TileBchPrbs.h" -//________________________________________________________________ -std::map<TileBchPrbs::Prb,std::string> TileBchPrbs::m_prbNames; - // //________________________________________________________________ std::string TileBchPrbs::getDescription(const Prb& prb) { - if(!m_prbNames.size()) { initPrbDesc(); } - std::map<Prb,std::string>::const_iterator iMap = m_prbNames.find(prb); + static const std::map<Prb,std::string> prbNames = initPrbDesc(); + std::map<Prb,std::string>::const_iterator iMap = prbNames.find(prb); std::string desc("<no description available>"); - if(iMap!=m_prbNames.end()){ desc=iMap->second; } + if(iMap!=prbNames.end()){ desc=iMap->second; } return desc; } // //________________________________________________________________ -void +std::map<TileBchPrbs::Prb,std::string> TileBchPrbs::initPrbDesc() { - m_prbNames[TileBchPrbs::Invalid ] = "Invalid"; + std::map<Prb,std::string> prbNames; + prbNames[TileBchPrbs::Invalid ] = "Invalid"; //=== adc - m_prbNames[TileBchPrbs::GeneralMaskAdc ] = "ADC masked (unspecified)"; - m_prbNames[TileBchPrbs::AdcDead ] = "ADC dead"; - m_prbNames[TileBchPrbs::StuckBit ] = "Stuck bit"; - m_prbNames[TileBchPrbs::SevereStuckBit ] = "Severe stuck bit"; - m_prbNames[TileBchPrbs::DataCorruption ] = "Data corruption"; - m_prbNames[TileBchPrbs::SevereDataCorruption ] = "Severe data corruption"; - m_prbNames[TileBchPrbs::VeryLargeHfNoise ] = "Very large HF noise"; - m_prbNames[TileBchPrbs::NoData ] = "No data"; - m_prbNames[TileBchPrbs::WrongDspConfig ] = "Wrong DSP configuration"; - m_prbNames[TileBchPrbs::LargeHfNoise ] = "Large HF noise"; - m_prbNames[TileBchPrbs::CorrelatedNoise ] = "Correlated noise"; - m_prbNames[TileBchPrbs::LargeLfNoise ] = "Large LF noise"; - m_prbNames[TileBchPrbs::NoCis ] = "No CIS calibration"; - m_prbNames[TileBchPrbs::BadCis ] = "Bad CIS calibration"; - m_prbNames[TileBchPrbs::IgnoredByDQV ] = "Ignored by DQV"; + prbNames[TileBchPrbs::GeneralMaskAdc ] = "ADC masked (unspecified)"; + prbNames[TileBchPrbs::AdcDead ] = "ADC dead"; + prbNames[TileBchPrbs::StuckBit ] = "Stuck bit"; + prbNames[TileBchPrbs::SevereStuckBit ] = "Severe stuck bit"; + prbNames[TileBchPrbs::DataCorruption ] = "Data corruption"; + prbNames[TileBchPrbs::SevereDataCorruption ] = "Severe data corruption"; + prbNames[TileBchPrbs::VeryLargeHfNoise ] = "Very large HF noise"; + prbNames[TileBchPrbs::NoData ] = "No data"; + prbNames[TileBchPrbs::WrongDspConfig ] = "Wrong DSP configuration"; + prbNames[TileBchPrbs::LargeHfNoise ] = "Large HF noise"; + prbNames[TileBchPrbs::CorrelatedNoise ] = "Correlated noise"; + prbNames[TileBchPrbs::LargeLfNoise ] = "Large LF noise"; + prbNames[TileBchPrbs::NoCis ] = "No CIS calibration"; + prbNames[TileBchPrbs::BadCis ] = "Bad CIS calibration"; + prbNames[TileBchPrbs::IgnoredByDQV ] = "Ignored by DQV"; //=== channel - m_prbNames[TileBchPrbs::GeneralMaskChannel ] = "Channel masked (unspecified)"; - m_prbNames[TileBchPrbs::NoPmt ] = "No PMT connected"; - m_prbNames[TileBchPrbs::NoHV ] = "No HV"; - m_prbNames[TileBchPrbs::WrongHV ] = "Wrong HV"; - m_prbNames[TileBchPrbs::NoLaser ] = "No laser calibration"; - m_prbNames[TileBchPrbs::BadLaser ] = "Bad laser calibration"; - m_prbNames[TileBchPrbs::NoCesium ] = "No cesium calibration"; - m_prbNames[TileBchPrbs::BadCesium ] = "Bad cesium calibration"; - m_prbNames[TileBchPrbs::NoTiming ] = "No timing set in dskew"; - m_prbNames[TileBchPrbs::BadTiming ] = "Bad timing"; - m_prbNames[TileBchPrbs::Emergency ] = "Module in emergency mode"; - m_prbNames[TileBchPrbs::HVReadoutPb ] = "HV readout problem"; - m_prbNames[TileBchPrbs::BrokenClearFibre ] = "Broken clear fibre"; - m_prbNames[TileBchPrbs::IgnoreCs ] = "Ignore cesium"; - m_prbNames[TileBchPrbs::UnstableCs ] = "Unstable cesium"; - m_prbNames[TileBchPrbs::WrongBCID ] = "Wrong BCID"; - m_prbNames[TileBchPrbs::TimingDmuBcOffset ] = "Timing DMU BC offset"; - m_prbNames[TileBchPrbs::BurntIntegrator ] = "Burnt Integrator"; + prbNames[TileBchPrbs::GeneralMaskChannel ] = "Channel masked (unspecified)"; + prbNames[TileBchPrbs::NoPmt ] = "No PMT connected"; + prbNames[TileBchPrbs::NoHV ] = "No HV"; + prbNames[TileBchPrbs::WrongHV ] = "Wrong HV"; + prbNames[TileBchPrbs::NoLaser ] = "No laser calibration"; + prbNames[TileBchPrbs::BadLaser ] = "Bad laser calibration"; + prbNames[TileBchPrbs::NoCesium ] = "No cesium calibration"; + prbNames[TileBchPrbs::BadCesium ] = "Bad cesium calibration"; + prbNames[TileBchPrbs::NoTiming ] = "No timing set in dskew"; + prbNames[TileBchPrbs::BadTiming ] = "Bad timing"; + prbNames[TileBchPrbs::Emergency ] = "Module in emergency mode"; + prbNames[TileBchPrbs::HVReadoutPb ] = "HV readout problem"; + prbNames[TileBchPrbs::BrokenClearFibre ] = "Broken clear fibre"; + prbNames[TileBchPrbs::IgnoreCs ] = "Ignore cesium"; + prbNames[TileBchPrbs::UnstableCs ] = "Unstable cesium"; + prbNames[TileBchPrbs::WrongBCID ] = "Wrong BCID"; + prbNames[TileBchPrbs::TimingDmuBcOffset ] = "Timing DMU BC offset"; + prbNames[TileBchPrbs::BurntIntegrator ] = "Burnt Integrator"; //=== DSP - m_prbNames[TileBchPrbs::IgnoredInDsp ] = "Ignored in DSP"; - m_prbNames[TileBchPrbs::IgnoredInHlt ] = "Ignored in HLT"; + prbNames[TileBchPrbs::IgnoredInDsp ] = "Ignored in DSP"; + prbNames[TileBchPrbs::IgnoredInHlt ] = "Ignored in HLT"; //=== Trigger - m_prbNames[TileBchPrbs::TrigGeneralMask ] = "Channel masked for LV1 (unspecified)"; - m_prbNames[TileBchPrbs::TrigNoGain ] = "LV1 channel no gain"; - m_prbNames[TileBchPrbs::TrigHalfGain ] = "LV1 channel half gain"; - m_prbNames[TileBchPrbs::TrigNoisy ] = "LV1 channel noisy"; - m_prbNames[TileBchPrbs::DisableForL1 ] = "Channel disabled for LV1"; + prbNames[TileBchPrbs::TrigGeneralMask ] = "Channel masked for LV1 (unspecified)"; + prbNames[TileBchPrbs::TrigNoGain ] = "LV1 channel no gain"; + prbNames[TileBchPrbs::TrigHalfGain ] = "LV1 channel half gain"; + prbNames[TileBchPrbs::TrigNoisy ] = "LV1 channel noisy"; + prbNames[TileBchPrbs::DisableForL1 ] = "Channel disabled for LV1"; //=== online channel - m_prbNames[TileBchPrbs::OnlineBadTiming ] = "Online bad timing"; - m_prbNames[TileBchPrbs::OnlineTimingDmuBcOffset] = "Online timing DMU BC offset"; - m_prbNames[TileBchPrbs::OnlineWrongBCID ] = "Online wrong BCID"; + prbNames[TileBchPrbs::OnlineBadTiming ] = "Online bad timing"; + prbNames[TileBchPrbs::OnlineTimingDmuBcOffset] = "Online timing DMU BC offset"; + prbNames[TileBchPrbs::OnlineWrongBCID ] = "Online wrong BCID"; //=== online adc - m_prbNames[TileBchPrbs::OnlineGeneralMaskAdc ] = "Online ADC masked (unspecified)"; + prbNames[TileBchPrbs::OnlineGeneralMaskAdc ] = "Online ADC masked (unspecified)"; + + return prbNames; } diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchStatus.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchStatus.cxx index e4dfd2127616b4a53a5c08ec20dfbf392bbeb767..5754c95535e060d6867ad8d4313e9f363bdd2544 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchStatus.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileBchStatus.cxx @@ -1,23 +1,23 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TileCalibBlobObjs/TileBchStatus.h" #include <algorithm> //=== static memebers -TileBchStatus::PrbSet TileBchStatus::m_refBad; -TileBchStatus::PrbSet TileBchStatus::m_refNoisy; -TileBchStatus::PrbSet TileBchStatus::m_refNoGainL1; -TileBchStatus::PrbSet TileBchStatus::m_refBadTiming; -TileBchStatus::PrbSet TileBchStatus::m_refWrongBCID; -TileBchStatus::PrbSet TileBchStatus::m_refTimingDmuBcOffset; +TileBchStatus::LockedPrbSet TileBchStatus::s_refBad ATLAS_THREAD_SAFE; +TileBchStatus::LockedPrbSet TileBchStatus::s_refNoisy ATLAS_THREAD_SAFE; +TileBchStatus::LockedPrbSet TileBchStatus::s_refNoGainL1 ATLAS_THREAD_SAFE; +TileBchStatus::LockedPrbSet TileBchStatus::s_refBadTiming ATLAS_THREAD_SAFE; +TileBchStatus::LockedPrbSet TileBchStatus::s_refWrongBCID ATLAS_THREAD_SAFE; +TileBchStatus::LockedPrbSet TileBchStatus::s_refTimingDmuBcOffset ATLAS_THREAD_SAFE; // //_________________________________________________________ TileBchStatus::TileBchStatus() { - if(!m_refBad.size()) initClassifierDefinitions(); + if(!s_refBad.size()) initClassifierDefinitions(); } // @@ -25,7 +25,7 @@ TileBchStatus::TileBchStatus() TileBchStatus::TileBchStatus(const PrbSet& prbSet) : m_prbSet(prbSet) { - if(!m_refBad.size()) initClassifierDefinitions(); + if(!s_refBad.size()) initClassifierDefinitions(); } // @@ -91,50 +91,62 @@ void TileBchStatus::initClassifierDefinitions() { //=== define which problems trigger a bad state + PrbSet refBad; //=== adc - m_refBad.insert(TileBchPrbs::GeneralMaskAdc); - m_refBad.insert(TileBchPrbs::AdcDead); - m_refBad.insert(TileBchPrbs::SevereStuckBit); - m_refBad.insert(TileBchPrbs::SevereDataCorruption); - m_refBad.insert(TileBchPrbs::VeryLargeHfNoise); - m_refBad.insert(TileBchPrbs::NoData); - m_refBad.insert(TileBchPrbs::WrongDspConfig); + refBad.insert(TileBchPrbs::GeneralMaskAdc); + refBad.insert(TileBchPrbs::AdcDead); + refBad.insert(TileBchPrbs::SevereStuckBit); + refBad.insert(TileBchPrbs::SevereDataCorruption); + refBad.insert(TileBchPrbs::VeryLargeHfNoise); + refBad.insert(TileBchPrbs::NoData); + refBad.insert(TileBchPrbs::WrongDspConfig); //=== channel - m_refBad.insert(TileBchPrbs::GeneralMaskChannel); - m_refBad.insert(TileBchPrbs::NoPmt); - m_refBad.insert(TileBchPrbs::NoHV); - m_refBad.insert(TileBchPrbs::WrongHV); + refBad.insert(TileBchPrbs::GeneralMaskChannel); + refBad.insert(TileBchPrbs::NoPmt); + refBad.insert(TileBchPrbs::NoHV); + refBad.insert(TileBchPrbs::WrongHV); //=== online (adc) - m_refBad.insert(TileBchPrbs::OnlineGeneralMaskAdc); + refBad.insert(TileBchPrbs::OnlineGeneralMaskAdc); + s_refBad.set (std::move (refBad)); + PrbSet refNoisy; //=== define which problems trigger a noisy state - m_refNoisy.insert(TileBchPrbs::LargeHfNoise); - m_refNoisy.insert(TileBchPrbs::CorrelatedNoise); - m_refNoisy.insert(TileBchPrbs::LargeLfNoise); + refNoisy.insert(TileBchPrbs::LargeHfNoise); + refNoisy.insert(TileBchPrbs::CorrelatedNoise); + refNoisy.insert(TileBchPrbs::LargeLfNoise); + s_refNoisy.set (std::move (refNoisy)); + PrbSet refNoGainL1; //=== define which problems trigger a NoGainL1 state - m_refNoGainL1.insert(TileBchPrbs::AdcDead); - m_refNoGainL1.insert(TileBchPrbs::NoPmt); - m_refNoGainL1.insert(TileBchPrbs::NoHV); - m_refNoGainL1.insert(TileBchPrbs::TrigGeneralMask); - m_refNoGainL1.insert(TileBchPrbs::TrigNoGain); - m_refNoGainL1.insert(TileBchPrbs::TrigNoisy); - m_refNoGainL1.insert(TileBchPrbs::DisableForL1); + refNoGainL1.insert(TileBchPrbs::AdcDead); + refNoGainL1.insert(TileBchPrbs::NoPmt); + refNoGainL1.insert(TileBchPrbs::NoHV); + refNoGainL1.insert(TileBchPrbs::TrigGeneralMask); + refNoGainL1.insert(TileBchPrbs::TrigNoGain); + refNoGainL1.insert(TileBchPrbs::TrigNoisy); + refNoGainL1.insert(TileBchPrbs::DisableForL1); + s_refNoGainL1.set (std::move (refNoGainL1)); + PrbSet refBadTiming; //=== define which problems trigger a bad timing - m_refBadTiming.insert(TileBchPrbs::BadTiming); + refBadTiming.insert(TileBchPrbs::BadTiming); //=== online - m_refBadTiming.insert(TileBchPrbs::OnlineBadTiming); + refBadTiming.insert(TileBchPrbs::OnlineBadTiming); + s_refBadTiming.set (std::move (refBadTiming)); + PrbSet refTimingDmuBcOffset; //=== define which problems trigger an affected timing - m_refTimingDmuBcOffset.insert(TileBchPrbs::TimingDmuBcOffset); + refTimingDmuBcOffset.insert(TileBchPrbs::TimingDmuBcOffset); //=== online - m_refTimingDmuBcOffset.insert(TileBchPrbs::OnlineTimingDmuBcOffset); + refTimingDmuBcOffset.insert(TileBchPrbs::OnlineTimingDmuBcOffset); + s_refTimingDmuBcOffset.set (std::move (refTimingDmuBcOffset)); + PrbSet refWrongBCID; //=== define which problems trigger a wrong BCID - m_refWrongBCID.insert(TileBchPrbs::WrongBCID); + refWrongBCID.insert(TileBchPrbs::WrongBCID); //=== online - m_refWrongBCID.insert(TileBchPrbs::OnlineWrongBCID); + refWrongBCID.insert(TileBchPrbs::OnlineWrongBCID); + s_refWrongBCID.set (std::move (refWrongBCID)); } // @@ -142,7 +154,7 @@ TileBchStatus::initClassifierDefinitions() void TileBchStatus::defineBad(const TileBchStatus& status) { - m_refBad = status.getPrbs(); + s_refBad.set (status.getPrbs()); } // @@ -150,7 +162,7 @@ TileBchStatus::defineBad(const TileBchStatus& status) void TileBchStatus::defineNoisy(const TileBchStatus& status) { - m_refNoisy = status.getPrbs(); + s_refNoisy.set (status.getPrbs()); } // @@ -158,7 +170,7 @@ TileBchStatus::defineNoisy(const TileBchStatus& status) void TileBchStatus::defineNoGainL1(const TileBchStatus& status) { - m_refNoGainL1 = status.getPrbs(); + s_refNoGainL1.set (status.getPrbs()); } // @@ -166,7 +178,7 @@ TileBchStatus::defineNoGainL1(const TileBchStatus& status) void TileBchStatus::defineBadTiming(const TileBchStatus& status) { - m_refBadTiming = status.getPrbs(); + s_refBadTiming.set (status.getPrbs()); } // @@ -174,7 +186,7 @@ TileBchStatus::defineBadTiming(const TileBchStatus& status) void TileBchStatus::defineTimingDmuBcOffset(const TileBchStatus& status) { - m_refTimingDmuBcOffset = status.getPrbs(); + s_refTimingDmuBcOffset.set (status.getPrbs()); } // @@ -182,7 +194,7 @@ TileBchStatus::defineTimingDmuBcOffset(const TileBchStatus& status) void TileBchStatus::defineWrongBCID(const TileBchStatus& status) { - m_refWrongBCID = status.getPrbs(); + s_refWrongBCID.set (status.getPrbs()); } // @@ -190,7 +202,7 @@ TileBchStatus::defineWrongBCID(const TileBchStatus& status) TileBchStatus TileBchStatus::getDefinitionBad() { - return TileBchStatus(m_refBad); + return s_refBad; } // @@ -198,7 +210,7 @@ TileBchStatus::getDefinitionBad() TileBchStatus TileBchStatus::getDefinitionNoisy() { - return TileBchStatus(m_refNoisy); + return s_refNoisy; } // @@ -206,7 +218,7 @@ TileBchStatus::getDefinitionNoisy() TileBchStatus TileBchStatus::getDefinitionNoGainL1() { - return TileBchStatus(m_refNoGainL1); + return s_refNoGainL1; } // @@ -214,7 +226,7 @@ TileBchStatus::getDefinitionNoGainL1() TileBchStatus TileBchStatus::getDefinitionBadTiming() { - return TileBchStatus(m_refBadTiming); + return s_refBadTiming; } // @@ -222,7 +234,7 @@ TileBchStatus::getDefinitionBadTiming() TileBchStatus TileBchStatus::getDefinitionTimingDmuBcOffset() { - return TileBchStatus(m_refTimingDmuBcOffset); + return s_refTimingDmuBcOffset; } // @@ -230,7 +242,7 @@ TileBchStatus::getDefinitionTimingDmuBcOffset() TileBchStatus TileBchStatus::getDefinitionWrongBCID() { - return TileBchStatus(m_refWrongBCID); + return s_refWrongBCID; } // @@ -255,3 +267,14 @@ TileBchStatus::getString() const } return prbStr; } + +// +//_________________________________________________________ +bool TileBchStatus::LockedPrbSet::test (const PrbSet& s) const +{ + std::lock_guard lock (m_mutex); + PrbSet overlapp; + std::insert_iterator<PrbSet> insItr(overlapp, overlapp.begin()); + std::set_intersection(m_set.begin(),m_set.end(), s.begin(), s.end(), insItr); + return !overlapp.empty(); +} diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerBase.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerBase.cxx index 143b62f2c84f050f85ff4a6e4c007afa1a8e7680..a968e8516289c2ac220fc22589404dbbce058d27 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerBase.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerBase.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TileCalibBlobObjs/TileCalibDrawerBase.h" @@ -10,9 +10,22 @@ // //_____________________________________________________________ TileCalibDrawerBase::TileCalibDrawerBase(const coral::Blob& blob) : - m_blob(const_cast<coral::Blob*>(&blob)), - m_blobStart32(static_cast<uint32_t*>(m_blob->startingAddress())), - m_blobStart16(static_cast<uint16_t*>(m_blob->startingAddress())), + m_blob_nc(nullptr), + m_blob(&blob), + m_blobStart32(static_cast<const uint32_t*>(m_blob->startingAddress())), + m_blobStart16(static_cast<const uint16_t*>(m_blob->startingAddress())), + m_blobSize32(m_blob->size()/sizeof(uint32_t)), + m_isBlobOwner(false) +{ +} + +// +//_____________________________________________________________ +TileCalibDrawerBase::TileCalibDrawerBase(coral::Blob& blob) : + m_blob_nc(&blob), + m_blob(&blob), + m_blobStart32(static_cast<const uint32_t*>(m_blob->startingAddress())), + m_blobStart16(static_cast<const uint16_t*>(m_blob->startingAddress())), m_blobSize32(m_blob->size()/sizeof(uint32_t)), m_isBlobOwner(false) { @@ -29,9 +42,10 @@ TileCalibDrawerBase::~TileCalibDrawerBase() // //_____________________________________________________________ TileCalibDrawerBase::TileCalibDrawerBase(const TileCalibDrawerBase& other) : - m_blob(new coral::Blob(*other.m_blob)), - m_blobStart32(static_cast<uint32_t*>(m_blob->startingAddress())), - m_blobStart16(static_cast<uint16_t*>(m_blob->startingAddress())), + m_blob_nc(new coral::Blob(*other.m_blob)), + m_blob(m_blob_nc), + m_blobStart32(static_cast<const uint32_t*>(m_blob->startingAddress())), + m_blobStart16(static_cast<const uint16_t*>(m_blob->startingAddress())), m_blobSize32(m_blob->size()/sizeof(uint32_t)), m_isBlobOwner(true) { @@ -44,6 +58,8 @@ TileCalibDrawerBase::operator=(const TileCalibDrawerBase& other) { //=== catch self-assignment if(&other == this) {return *this;} + if (m_isBlobOwner) delete m_blob; + m_blob_nc = other.m_blob_nc; m_blob = other.m_blob; m_blobStart32 = other.m_blobStart32; m_blobStart16 = other.m_blobStart16; @@ -58,10 +74,10 @@ void TileCalibDrawerBase::clone(const TileCalibDrawerBase& other) { //=== copy content of other blob - *m_blob = *other.m_blob; + *m_blob_nc = *other.m_blob; //=== and reset cached attributes - m_blobStart32 = static_cast<uint32_t*>(m_blob->startingAddress()); - m_blobStart16 = static_cast<uint16_t*>(m_blob->startingAddress()); + m_blobStart32 = static_cast<const uint32_t*>(m_blob->startingAddress()); + m_blobStart16 = static_cast<const uint16_t*>(m_blob->startingAddress()); m_blobSize32 = m_blob->size()/sizeof(uint32_t); } @@ -92,24 +108,27 @@ TileCalibDrawerBase::createBlob(uint16_t objType, //=== create blob uint32_t blobSizeInBytes = dataSizeByte+commentSizeChar; - m_blob->resize(blobSizeInBytes); - m_blobStart32 = static_cast<uint32_t*>(m_blob->startingAddress()); - m_blobStart16 = static_cast<uint16_t*>(m_blob->startingAddress()); - m_blobSize32 = m_blob->size()/sizeof(uint32_t); + m_blob_nc->resize(blobSizeInBytes); + uint32_t* blobStart32 = static_cast<uint32_t*>(m_blob_nc->startingAddress()); + uint16_t* blobStart16 = static_cast<uint16_t*>(m_blob_nc->startingAddress()); + m_blobSize32 = m_blob_nc->size()/sizeof(uint32_t); + + m_blobStart32 = blobStart32; + m_blobStart16 = blobStart16; //=== fill header - m_blobStart16[0] = objType; - m_blobStart16[1] = objVersion; - m_blobStart32[1] = objSizeUint32; - m_blobStart32[2] = nObjs; - m_blobStart16[6] = nChans; - m_blobStart16[7] = nGains; - m_blobStart32[4] = commentSizeChar/sizeof(uint32_t); + blobStart16[0] = objType; + blobStart16[1] = objVersion; + blobStart32[1] = objSizeUint32; + blobStart32[2] = nObjs; + blobStart16[6] = nChans; + blobStart16[7] = nGains; + blobStart32[4] = commentSizeChar/sizeof(uint32_t); //==== fill comment fields if(commentSizeChar){ if(!timeStamp) timeStamp = ::time(0); - uint64_t* pTimeStamp = reinterpret_cast<uint64_t*>(m_blobStart32+dataSizeByte/sizeof(uint32_t)); + uint64_t* pTimeStamp = reinterpret_cast<uint64_t*>(blobStart32+dataSizeByte/sizeof(uint32_t)); pTimeStamp[0] = timeStamp; char* pChar = reinterpret_cast<char*>(++pTimeStamp); std::string::const_iterator iStr = author.begin(); @@ -128,9 +147,10 @@ std::string TileCalibDrawerBase::getAuthor() const { if(!getCommentSizeUint32()) return std::string(""); - char* iBeg = reinterpret_cast<char*>(m_blobStart32 + m_hdrSize32 + - getNObjs()*getObjSizeUint32() + - sizeof(uint64_t)/sizeof(uint32_t)); + const char* iBeg = + reinterpret_cast<const char*>(m_blobStart32 + m_hdrSize32 + + getNObjs()*getObjSizeUint32() + + sizeof(uint64_t)/sizeof(uint32_t)); return std::string(iBeg); } @@ -141,10 +161,11 @@ std::string TileCalibDrawerBase::getComment() const { if(!getCommentSizeUint32()) return std::string(""); - char* iBeg = reinterpret_cast<char*>(m_blobStart32 + m_hdrSize32 + - getNObjs()*getObjSizeUint32() + - sizeof(uint64_t)/sizeof(uint32_t)); - char* iEnd = iBeg + getCommentSizeChar(); + const char* iBeg = + reinterpret_cast<const char*>(m_blobStart32 + m_hdrSize32 + + getNObjs()*getObjSizeUint32() + + sizeof(uint64_t)/sizeof(uint32_t)); + const char* iEnd = iBeg + getCommentSizeChar(); iBeg = std::find(iBeg,iEnd,0); return std::string(++iBeg); } @@ -156,7 +177,8 @@ TileCalibDrawerBase::getDate() const { if(!getCommentSizeUint32()) return std::string(""); ::time_t timeStamp = getTimeStamp(); - char* iBeg = ::ctime(&timeStamp); + char buf[32]; + char* iBeg = ::ctime_r(&timeStamp, buf); char* iEnd = iBeg; while(*iEnd!='\n'){++iEnd;} return std::string(iBeg,iEnd-iBeg); diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerBch.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerBch.cxx index 2e877d3ecbea8e14114230978eb1cc7d2de96824..e5cd01dd99aa5c028170d8e267c839c067b6d2f0 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerBch.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerBch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TileCalibBlobObjs/TileCalibDrawerBch.h" @@ -47,3 +47,16 @@ TileCalibDrawerBch::TileCalibDrawerBch(const coral::Blob& blob) } } +// +//_______________________________________________________________ +TileCalibDrawerBch::TileCalibDrawerBch(coral::Blob& blob) + : TileCalibDrawerDat<uint32_t>(blob) +{ + //=== check for correct blob type + if(getBlobSize()){ + if(getObjType() != getType()){ + throw TileCalib::TypeConflict("TileCalibDrawerBch::Ctor",getObjType(),getType()); + } + } +} + diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerFlt.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerFlt.cxx index 532af9ec33b2cafeaf8116b58e9209f49c42a8a4..7383deaff493178b4beb0140569fb871fd59f47c 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerFlt.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerFlt.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TileCalibBlobObjs/TileCalibDrawerFlt.h" @@ -47,6 +47,18 @@ TileCalibDrawerFlt::TileCalibDrawerFlt(const coral::Blob& blob) : } } +// +//_______________________________________________________________ +TileCalibDrawerFlt::TileCalibDrawerFlt(coral::Blob& blob) : + TileCalibDrawerDat<float>(blob) +{ + if(getBlobSize()){ + if(getObjType() != getType()){ + throw TileCalib::TypeConflict("TileCalibDrawerFlt::Ctor",getObjType(),getType()); + } + } +} + // //______________________________________________________________ float diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerOfc.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerOfc.cxx index 6a6eff5518852bb305f0f6e1f93733affd81d892..0800db6b4843397a599df631f659e431518bbdf1 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerOfc.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/src/TileCalibDrawerOfc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TileCalibBlobObjs/TileCalibDrawerOfc.h" @@ -41,6 +41,21 @@ const TileCalibDrawerOfc* TileCalibDrawerOfc::getInstance(const coral::Blob& blo //_______________________________________________________________ TileCalibDrawerOfc::TileCalibDrawerOfc(const coral::Blob& blob) : TileCalibDrawerBase(blob) +{ + initCheck(); +} + +// +//_______________________________________________________________ +TileCalibDrawerOfc::TileCalibDrawerOfc(coral::Blob& blob) + : TileCalibDrawerBase(blob) +{ + initCheck(); +} + +// +//_______________________________________________________________ +void TileCalibDrawerOfc::initCheck() { if(getBlobSize()){ diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/test/TileCalibDrawerFlt_test.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/test/TileCalibDrawerFlt_test.cxx index 2ac95e8a1c0687ae8b06e2b3a3faecc52d445efc..681a89b118f42f99ee23688e9e0255c46685bc40 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/test/TileCalibDrawerFlt_test.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/test/TileCalibDrawerFlt_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #undef NDEBUG @@ -14,6 +14,7 @@ #include "CoralBase/AttributeListSpecification.h" #include "TestTools/FLOATassert.h" +#include "CxxUtils/checker_macros.h" #include <algorithm> #include <cassert> @@ -34,7 +35,7 @@ const std::vector<std::vector<float> > channel0data = { const std::vector<float> channel1data = {100, 200, 300, 1000, 2000, 3000}; -void testTileCalibDrawerFltV100() { +void testTileCalibDrawerFltV100 ATLAS_NOT_THREAD_SAFE () { std::cout << "testTileCalibDrawerFltV100\n"; @@ -67,7 +68,7 @@ void testTileCalibDrawerFltV100() { } -void testTileCalibDrawerFltV200() { +void testTileCalibDrawerFltV200 ATLAS_NOT_THREAD_SAFE () { std::cout << "testTileCalibDrawerFltV200\n"; @@ -119,7 +120,7 @@ void testTileCalibDrawerFltV200() { -int main() { +int main ATLAS_NOT_THREAD_SAFE () { testTileCalibDrawerFltV100(); diff --git a/TileCalorimeter/TileCalib/TileCalibBlobObjs/test/TileCalibDrawerOfc_test.cxx b/TileCalorimeter/TileCalib/TileCalibBlobObjs/test/TileCalibDrawerOfc_test.cxx index ee464824d6d4e85a298fb9b98e36f7eab9299014..f7d0b2a95ec7ad9b76c0010a5aa50b4e03c0ea1b 100644 --- a/TileCalorimeter/TileCalib/TileCalibBlobObjs/test/TileCalibDrawerOfc_test.cxx +++ b/TileCalorimeter/TileCalib/TileCalibBlobObjs/test/TileCalibDrawerOfc_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #undef NDEBUG @@ -14,6 +14,7 @@ #include "CoralBase/AttributeListSpecification.h" #include "TestTools/FLOATassert.h" +#include "CxxUtils/checker_macros.h" #include <algorithm> #include <cassert> @@ -31,7 +32,7 @@ static const int NGAINS(1); static const unsigned int NSAMPLES(1); -void test1() { +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -176,7 +177,7 @@ int prepareReferenceFile () { } -int main() { +int main ATLAS_NOT_THREAD_SAFE () { // prepareReferenceFile(); diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCablingService.h b/TileCalorimeter/TileConditions/TileConditions/TileCablingService.h index 93a207fb8407c5379638fc5fc2ef45f07ab74611..c857eba1c3797645384a3f76aca795449eaba9e9 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCablingService.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCablingService.h @@ -280,6 +280,7 @@ public: inline bool isRun2Cabling() const { return m_run2; } inline bool isRun2PlusCabling() const { return m_run2plus; } inline bool isRun3Cabling() const { return m_run3; } + inline int runPeriod() const { return (2 * int(m_run2) + 3 * int(m_run3)); } }; #endif // TILECONDITIONS_TILECABLINGSERVICE_H diff --git a/TileCalorimeter/TileDetDescr/TileDetDescr/ATLAS_CHECK_THREAD_SAFETY b/TileCalorimeter/TileDetDescr/TileDetDescr/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..01d4c820a357e5ef8379324621d552365684608d --- /dev/null +++ b/TileCalorimeter/TileDetDescr/TileDetDescr/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +TileCalorimeter/TileDetDescr diff --git a/TileCalorimeter/TileSimEvent/TileSimEvent/ATLAS_CHECK_THREAD_SAFETY b/TileCalorimeter/TileSimEvent/TileSimEvent/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..d38aea3cadff612cb3e00bfd9be22f215a16c504 --- /dev/null +++ b/TileCalorimeter/TileSimEvent/TileSimEvent/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +TileCalorimeter/TileSimEvent diff --git a/TileCalorimeter/TileSimEvent/src/TileHit.cxx b/TileCalorimeter/TileSimEvent/src/TileHit.cxx index 366c386ddc8327ff7a30c4cca3e298afb38f0c1b..6dd6c3ad8047f8f03b82faf5edfd428a932a6166 100755 --- a/TileCalorimeter/TileSimEvent/src/TileHit.cxx +++ b/TileCalorimeter/TileSimEvent/src/TileHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //******************************************************************** @@ -30,8 +30,10 @@ #include <cmath> +namespace { // get cabling -TileCablingService * s_cabling = TileCablingService::getInstance(); +const TileCablingService * const s_cabling = TileCablingService::getInstance(); +} TileHit::TileHit(const Identifier & id, float energy, float time) : m_pmt_id( id ) diff --git a/TileCalorimeter/TileSvc/TileByteStream/CMakeLists.txt b/TileCalorimeter/TileSvc/TileByteStream/CMakeLists.txt index 4b90a794ae06fcfe79c0fbc98dd7849a1a0acdca..5e74919d270b93029ab9228f177bd58005ec7af7 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/CMakeLists.txt +++ b/TileCalorimeter/TileSvc/TileByteStream/CMakeLists.txt @@ -6,30 +6,6 @@ # Declare the package name: atlas_subdir( TileByteStream ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthenaBaseComps - Control/AthenaKernel - Event/ByteStreamCnvSvcBase - Event/ByteStreamData - GaudiKernel - TileCalorimeter/TileEvent - TileCalorimeter/TileIdentifier - TileCalorimeter/TileL2Algs - PRIVATE - Tools/PathResolver - AtlasTest/TestTools - Calorimeter/CaloDetDescr - Calorimeter/CaloIdentifier - Control/StoreGate - DetectorDescription/IdDictParser - Event/ByteStreamCnvSvc - TileCalorimeter/TileCalib/TileCalibBlobObjs - TileCalorimeter/TileConditions - TileCalorimeter/TileDetDescr - TileCalorimeter/TileRecUtils ) - # External dependencies: find_package( tdaq-common COMPONENTS eformat eformat_write ) @@ -41,7 +17,7 @@ atlas_add_library( TileByteStreamLib LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps AthenaKernel ByteStreamData GaudiKernel TileEvent TileIdentifier ByteStreamCnvSvcBaseLib CaloDetDescrLib StoreGateLib ByteStreamCnvSvcLib TileConditionsLib - TileL2AlgsLib TileRecUtilsLib + TileL2AlgsLib TileRecUtilsLib CxxUtils PRIVATE_LINK_LIBRARIES CaloIdentifier TileCalibBlobObjs TileDetDescr ) diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileBeamElemContByteStreamCnv.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileBeamElemContByteStreamCnv.h index 0d9e43cd42e779ad982ecb294c71beedac3f5244..0c71e9569f4c88e55754409eb152549b1dd8de4a 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileBeamElemContByteStreamCnv.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileBeamElemContByteStreamCnv.h @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILEBYTESTREAM_TILEBEAMELEM_BYTESTREAMCNV_H #define TILEBYTESTREAM_TILEBEAMELEM_BYTESTREAMCNV_H // Gaudi includes -#include "GaudiKernel/Converter.h" +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ContextSpecificPtr.h" @@ -21,6 +21,8 @@ #include "eformat/ROBFragment.h" #include "eformat/FullEventFragment.h" +#include "CxxUtils/checker_macros.h" + class DataObject; class StatusCode; class IAddressCreator; @@ -37,20 +39,19 @@ template <class TYPE> class CnvFactory; /** * @class TileBeamElemContByteStreamCnv - * @brief This Converter class provides conversion from ByteStream to TileBeamElemContainer + * @brief This AthConstConverter class provides conversion from ByteStream to TileBeamElemContainer * @author Alexander Solodkov */ class TileBeamElemContByteStreamCnv - : public Converter - , public ::AthMessaging + : public AthConstConverter { public: TileBeamElemContByteStreamCnv(ISvcLocator* svcloc); virtual StatusCode initialize() override; - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override; - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override; + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; virtual StatusCode finalize() override; /// Storage type and class ID @@ -66,20 +67,17 @@ class TileBeamElemContByteStreamCnv inline bool validBeamFrag() const { return m_robFrag.isValid(); } private: - - std::string m_name; - /** Pointer to IROBDataProviderSvc */ ServiceHandle<IROBDataProviderSvc> m_robSvc; /** Pointer to TileROD_Decoder */ ToolHandle<TileROD_Decoder> m_decoder; - Gaudi::Hive::ContextSpecificPtr< - const eformat::FullEventFragment<const uint32_t*> > m_event; + mutable Gaudi::Hive::ContextSpecificPtr< + const eformat::FullEventFragment<const uint32_t*> > m_event ATLAS_THREAD_SAFE; - Gaudi::Hive::ContextSpecificPtr< - const eformat::ROBFragment<const uint32_t*> > m_robFrag; + mutable Gaudi::Hive::ContextSpecificPtr< + const eformat::ROBFragment<const uint32_t*> > m_robFrag ATLAS_THREAD_SAFE; std::vector<uint32_t> m_ROBID; @@ -87,7 +85,7 @@ class TileBeamElemContByteStreamCnv const TileHid2RESrcID* m_hid2re; /** Queue of data objects to recycle. */ - Athena::RecyclableDataQueue<TileMutableBeamElemContainer> m_queue; + mutable Athena::RecyclableDataQueue<TileMutableBeamElemContainer> m_queue ATLAS_THREAD_SAFE; }; #endif diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileDigitsContByteStreamCnv.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileDigitsContByteStreamCnv.h index 1318cf163fa0dae3a51c533699a4a5004ae8c907..42ed78ea30f5a022b8d25ca40f01d09f1d6bdb04 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileDigitsContByteStreamCnv.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileDigitsContByteStreamCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -7,13 +7,13 @@ #define TILEBYTESTREAM_TILEDIGITS_BYTESTREAMCNV_H -#include "AthenaBaseComps/AthMessaging.h" +#include "AthenaBaseComps/AthConstConverter.h" #include "TileEvent/TileMutableDigitsContainer.h" #include "AthenaKernel/RecyclableDataObject.h" -#include "GaudiKernel/Converter.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" +#include "CxxUtils/checker_macros.h" class DataObject; @@ -35,7 +35,7 @@ template <class TYPE> class CnvFactory; /** * @class TileDigitsContByteStreamCnv - * @brief This Converter class provides conversion from ByteStream to TileDigitsContainer + * @brief This AthConstConverter class provides conversion from ByteStream to TileDigitsContainer * @author Alexander Solodkov * * This class provides methods to convert the bytestream data into TileDigits. @@ -43,8 +43,7 @@ template <class TYPE> class CnvFactory; */ class TileDigitsContByteStreamCnv - : public Converter - , public ::AthMessaging + : public AthConstConverter { public: @@ -53,8 +52,8 @@ class TileDigitsContByteStreamCnv typedef TileDigitsContByteStreamTool BYTESTREAMTOOL; virtual StatusCode initialize() override; - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override; - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override; + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; virtual StatusCode finalize() override; /// Storage type and class ID @@ -63,9 +62,6 @@ class TileDigitsContByteStreamCnv static const CLID& classID(); private: - - std::string m_name; - // BYTESTREAMTOOL* m_tool ; ToolHandle<TileDigitsContByteStreamTool> m_tool; @@ -82,7 +78,7 @@ class TileDigitsContByteStreamCnv const TileHid2RESrcID* m_hid2re; /** Queue of data objects to recycle. */ - Athena::RecyclableDataQueue<TileMutableDigitsContainer> m_queue; + mutable Athena::RecyclableDataQueue<TileMutableDigitsContainer> m_queue ATLAS_THREAD_SAFE; }; #endif diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileDigitsContByteStreamTool.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileDigitsContByteStreamTool.h index ae6afec99e8b52a966060a46e07ead10b4eb5130..288f01833424c58455b8132252f6e718fbe2911b 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileDigitsContByteStreamTool.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileDigitsContByteStreamTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILEBYTESTREAM_TILEDIGITS_BYTESTREAMTOOL_H @@ -43,12 +43,12 @@ class TileDigitsContByteStreamTool: public AthAlgTool { */ static const InterfaceID& interfaceID(); - virtual StatusCode initialize(); - virtual StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; /** Provides conversion from TileDigitsContainer to BS */ - StatusCode convert(DIGITS* cont, FullEventAssembler<TileHid2RESrcID> *fea); + StatusCode convert(DIGITS* cont, FullEventAssembler<TileHid2RESrcID> *fea) const; private: diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileL2ContByteStreamCnv.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileL2ContByteStreamCnv.h index fa3dd8144264ad1a838841babe572da88a000a43..ed049f3cfef425efa1b817d0717d5cf3bcf175ee 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileL2ContByteStreamCnv.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileL2ContByteStreamCnv.h @@ -1,19 +1,20 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILEBYTESTREAM_TILEL2_BYTESTREAMCNV_H #define TILEBYTESTREAM_TILEL2_BYTESTREAMCNV_H +#include "AthenaBaseComps/AthConstConverter.h" #include "TileEvent/TileContainer.h" -#include "AthenaBaseComps/AthMessaging.h" #include "AthenaKernel/RecyclableDataObject.h" #include "AthenaKernel/BaseInfo.h" -#include "GaudiKernel/Converter.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" +#include "CxxUtils/checker_macros.h" + class DataObject; class StatusCode; @@ -53,7 +54,7 @@ SG_BASE (TileRecyclableL2Container, TileL2Container); /** * @class TileL2ContByteStreamCnv - * @brief This Converter class provides conversion between ByteStream and TileL2Container + * @brief This AthConstConverter class provides conversion between ByteStream and TileL2Container * @author Aranzazu Ruiz * * This class provides methods to convert the bytestream data into @@ -62,8 +63,7 @@ SG_BASE (TileRecyclableL2Container, TileL2Container); */ class TileL2ContByteStreamCnv - : public Converter - , public ::AthMessaging + : public AthConstConverter { public: TileL2ContByteStreamCnv(ISvcLocator* svcloc); @@ -71,8 +71,8 @@ class TileL2ContByteStreamCnv typedef TileL2ContByteStreamTool BYTESTREAMTOOL ; virtual StatusCode initialize() override; - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override; - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override; + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; virtual StatusCode finalize() override; /// Storage type and class ID @@ -81,9 +81,6 @@ class TileL2ContByteStreamCnv static const CLID& classID(); private: - - std::string m_name; - // BYTESTREAMTOOL* m_tool ; ToolHandle<BYTESTREAMTOOL> m_tool; @@ -100,7 +97,7 @@ class TileL2ContByteStreamCnv ToolHandle<TileROD_Decoder> m_decoder; /** Queue of data objects to recycle. */ - Athena::RecyclableDataQueue<TileRecyclableL2Container> m_queue; + mutable Athena::RecyclableDataQueue<TileRecyclableL2Container> m_queue ATLAS_THREAD_SAFE; }; #endif diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileL2ContByteStreamTool.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileL2ContByteStreamTool.h index bd1a1aace718eebe26a43ef56c7aa3dae2e69507..1c42c259c60d3e79fa97800f89472bc171288a28 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileL2ContByteStreamTool.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileL2ContByteStreamTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //**************************************************************************** @@ -55,11 +55,11 @@ class TileL2ContByteStreamTool: public AthAlgTool { /** AlgTool InterfaceID */ static const InterfaceID& interfaceID( ); - virtual StatusCode initialize(); - virtual StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; /** Provides conversion from TileL2Container to BS */ - StatusCode convert(TileL2Container* cont, FullEventAssembler<TileHid2RESrcID> *fea); + StatusCode convert(TileL2Container* cont, FullEventAssembler<TileHid2RESrcID> *fea) const; private: diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileLaserObjByteStreamCnv.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileLaserObjByteStreamCnv.h index 280adf13ebec28eaa6ba03905cb8d65e8b085cc4..a5f208d50f4f6e1bcfa387d152142a74695f40fb 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileLaserObjByteStreamCnv.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileLaserObjByteStreamCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //author Renato Febbraro @@ -10,12 +10,11 @@ #define TILELASEROBJ_BYTESTREAMCNV_H // Gaudi includes -#include "GaudiKernel/Converter.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" // Athena includes -#include "AthenaBaseComps/AthMessaging.h" +#include "AthenaBaseComps/AthConstConverter.h" #include "eformat/ROBFragment.h" @@ -37,8 +36,7 @@ template <class TYPE> class CnvFactory; class TileLaserObjByteStreamCnv - : public Converter - , public ::AthMessaging + : public AthConstConverter { public: TileLaserObjByteStreamCnv(ISvcLocator* svcloc); @@ -46,8 +44,8 @@ class TileLaserObjByteStreamCnv typedef TileLaserObjByteStreamTool BYTESTREAMTOOL ; virtual StatusCode initialize() override; - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override; - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override; + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; /// Storage type and class ID virtual long repSvcType() const override { return i_repSvcType(); } @@ -55,9 +53,6 @@ class TileLaserObjByteStreamCnv static const CLID& classID(); private: - - std::string m_name; - /** Pointer to IROBDataProviderSvc */ ServiceHandle<IROBDataProviderSvc> m_robSvc; diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamCnv.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamCnv.h index 7a0a28374e5b794136cb3cb97c07417df20f605d..9708d6317ca1fe6c6c010bfebc9350e4adda5e9c 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamCnv.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamCnv.h @@ -1,13 +1,12 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILEBYTESTREAM_TILEMURCVCONTBYTESTREAMCNV_H #define TILEBYTESTREAM_TILEMURCVCONTBYTESTREAMCNV_H +#include "AthenaBaseComps/AthConstConverter.h" #include "TileEvent/TileContainer.h" -#include "AthenaBaseComps/AthMessaging.h" -#include "GaudiKernel/Converter.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" @@ -27,15 +26,14 @@ template <class TYPE> class CnvFactory; /** * @class TileMuRcvContByteStreamCnv - * @brief This Converter class provides conversion between ByteStream and TileMuRcvCont + * @brief This AthConstConverter class provides conversion between ByteStream and TileMuRcvCont * @author Joao Gentil Saraiva * * This class provides methods to convert the bytestream data into TileMuRcv objects and vice versa. */ class TileMuRcvContByteStreamCnv - : public Converter - , public ::AthMessaging + : public AthConstConverter { public: TileMuRcvContByteStreamCnv(ISvcLocator* svcloc); @@ -43,8 +41,8 @@ class TileMuRcvContByteStreamCnv typedef TileMuRcvContByteStreamTool BYTESTREAMTOOL ; virtual StatusCode initialize() override; - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override; - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override; + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; virtual StatusCode finalize() override; /// Storage type and class ID @@ -53,9 +51,6 @@ class TileMuRcvContByteStreamCnv static const CLID& classID(); private: - - std::string m_name; - /** Pointer to TileMuRcvContByteStreamTool */ ToolHandle<BYTESTREAMTOOL> m_tool; diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamTool.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamTool.h index 1e233b2850d3769b98138101bc74cf5adeb2e2a5..5aa481e6928e6c5fd8e58695f2df7207c345e874 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamTool.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileMuRcvContByteStreamTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //**************************************************************************** @@ -50,11 +50,11 @@ class TileMuRcvContByteStreamTool: public AthAlgTool { /** AlgTool InterfaceID */ static const InterfaceID& interfaceID( ); - virtual StatusCode initialize(); - virtual StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; /** Provides conversion from TileMuRcvContainer to bytestream */ - StatusCode convert(TileMuonReceiverContainer* cont, FullEventAssembler<TileHid2RESrcID> *fea); + StatusCode convert(TileMuonReceiverContainer* cont, FullEventAssembler<TileHid2RESrcID> *fea) const; private: diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileRawChannelContByteStreamCnv.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileRawChannelContByteStreamCnv.h index 4c90241ec5efd8cf0cde39972fff56dcd2541b1e..0c129b623a337fd896cb0dc5c9d884fdfd3a0bfa 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileRawChannelContByteStreamCnv.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileRawChannelContByteStreamCnv.h @@ -1,16 +1,15 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILEBYTESTREAM_TILERAWCHANNELCONTRAWEVENTCNV_H #define TILEBYTESTREAM_TILERAWCHANNELCONTRAWEVENTCNV_H -#include "AthenaBaseComps/AthMessaging.h" +#include "AthenaBaseComps/AthConstConverter.h" #include "TileEvent/TileMutableRawChannelContainer.h" #include "AthenaKernel/RecyclableDataObject.h" #include "ByteStreamCnvSvcBase/IByteStreamEventAccess.h" #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" -#include "GaudiKernel/Converter.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" @@ -40,8 +39,7 @@ template <class TYPE> class CnvFactory; class TileRawChannelContByteStreamCnv - : public Converter - , public ::AthMessaging + : public AthConstConverter { public: TileRawChannelContByteStreamCnv(ISvcLocator* svcloc); @@ -49,8 +47,8 @@ class TileRawChannelContByteStreamCnv typedef TileRawChannelContByteStreamTool BYTESTREAMTOOL ; virtual StatusCode initialize() override; - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override; - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override; + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; virtual StatusCode finalize() override; /// Storage type and class ID @@ -59,9 +57,6 @@ class TileRawChannelContByteStreamCnv static const CLID& classID(); private: - - std::string m_name; - // BYTESTREAMTOOL* m_tool ; ToolHandle<TileRawChannelContByteStreamTool> m_tool; @@ -79,7 +74,7 @@ class TileRawChannelContByteStreamCnv /** Queue of data objects to recycle. */ - Athena::RecyclableDataQueue<TileMutableRawChannelContainer> m_queue; + mutable Athena::RecyclableDataQueue<TileMutableRawChannelContainer> m_queue ATLAS_THREAD_SAFE; }; #endif diff --git a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileRawChannelContByteStreamTool.h b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileRawChannelContByteStreamTool.h index 20c8edb54a6da496323ff39b8a2137eacedc092b..381adc6ac8dc9ab35af3a9097d0c8e3633a5bc6b 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileRawChannelContByteStreamTool.h +++ b/TileCalorimeter/TileSvc/TileByteStream/TileByteStream/TileRawChannelContByteStreamTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILEBYTESTREAM_TILERAWCHANNELCONTRAWEVENTTOOL_H @@ -47,12 +47,12 @@ class TileRawChannelContByteStreamTool: public AthAlgTool { */ static const InterfaceID& interfaceID(); - virtual StatusCode initialize(); - virtual StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; /** Provides conversion from TileRawChannelContainer to BS */ - StatusCode convert(CONTAINER* cont, FullEventAssembler<TileHid2RESrcID> *fea); + StatusCode convert(CONTAINER* cont, FullEventAssembler<TileHid2RESrcID> *fea) const; private: diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileBeamElemContByteStreamCnv.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileBeamElemContByteStreamCnv.cxx index 0ecea833775f5d9b6f9546768165b55e58dbc69d..3941a791c9cc44b007870584ddd20472868812f4 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileBeamElemContByteStreamCnv.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileBeamElemContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Gaudi includes @@ -30,10 +30,8 @@ TileBeamElemContByteStreamCnv::TileBeamElemContByteStreamCnv(ISvcLocator* svcloc) - : Converter(storageType(), classID(), svcloc) - , ::AthMessaging(msgSvc(), "TileBeamElemContByteStreamCnv") - , m_name("TileBeamElemContByteStreamCnv") - , m_robSvc("ROBDataProviderSvc", m_name) + : AthConstConverter(storageType(), classID(), svcloc, "TileBeamElemContByteStreamCnv") + , m_robSvc("ROBDataProviderSvc", name()) , m_decoder("TileROD_Decoder") , m_ROBID() , m_hid2re(nullptr) @@ -64,8 +62,8 @@ StatusCode TileBeamElemContByteStreamCnv::initialize() { } -StatusCode TileBeamElemContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) { - +StatusCode TileBeamElemContByteStreamCnv::createObjConst (IOpaqueAddress* pAddr, DataObject*& pObj) const +{ ATH_MSG_DEBUG( " Executing createObj method" ); ByteStreamAddress* pRE_Addr; @@ -114,7 +112,8 @@ StatusCode TileBeamElemContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataO return StatusCode::SUCCESS; } -StatusCode TileBeamElemContByteStreamCnv::createRep(DataObject* /* pObj */, IOpaqueAddress*& /* pAddr */) { +StatusCode TileBeamElemContByteStreamCnv::createRepConst(DataObject* /* pObj */, IOpaqueAddress*& /* pAddr */) const +{ // No conversion from TileBeamElem to BS ATH_MSG_ERROR( " Can not create BS from TileBeamElem " ); diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamCnv.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamCnv.cxx index d562677d478fa01d08ac17332e69a498a66c65fd..baeb4f3b5754167e72ef37d6b55849e2489175ef 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamCnv.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Gaudi includes @@ -39,13 +39,11 @@ TileDigitsContByteStreamCnv::TileDigitsContByteStreamCnv(ISvcLocator* svcloc) - : Converter(storageType(), classID(), svcloc) - , ::AthMessaging(msgSvc(), "TileDigitsContByteStreamCnv") - , m_name("TileDigitsContByteStreamCnv") + : AthConstConverter(storageType(), classID(), svcloc, "TileDigitsContByteStreamCnv") , m_tool("TileDigitsContByteStreamTool") - , m_byteStreamEventAccess("ByteStreamCnvSvc", m_name) + , m_byteStreamEventAccess("ByteStreamCnvSvc", name()) , m_byteStreamCnvSvc(0) - , m_robSvc("ROBDataProviderSvc", m_name) + , m_robSvc("ROBDataProviderSvc", name()) , m_decoder("TileROD_Decoder") , m_hid2re(0) { @@ -77,8 +75,8 @@ StatusCode TileDigitsContByteStreamCnv::initialize() { return StatusCode::SUCCESS; } -StatusCode TileDigitsContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) { - +StatusCode TileDigitsContByteStreamCnv::createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const +{ ATH_MSG_DEBUG(" Executing createObj method "); ByteStreamAddress *pRE_Addr; @@ -147,7 +145,8 @@ StatusCode TileDigitsContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObj } -StatusCode TileDigitsContByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr) { +StatusCode TileDigitsContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const +{ // convert TileDigitsContainer in the container into ByteStream ATH_MSG_DEBUG(" Executing createRep method "); diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamTool.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamTool.cxx index cd6acf2825967d41de20eb494a92a0776a6f79db..72b8e337ebf30728477cebb76e2500b114d491b4 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamTool.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Gaudi includes @@ -65,8 +65,8 @@ StatusCode TileDigitsContByteStreamTool::finalize() { return StatusCode::SUCCESS; } -StatusCode TileDigitsContByteStreamTool::convert(DIGITS* digitsContainer, FullEventAssembler<TileHid2RESrcID> *fea) { - +StatusCode TileDigitsContByteStreamTool::convert(DIGITS* digitsContainer, FullEventAssembler<TileHid2RESrcID> *fea) const +{ FullEventAssembler<TileHid2RESrcID>::RODDATA* theROD; std::map<uint32_t, TileROD_Encoder> mapEncoder; diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileL2ContByteStreamCnv.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileL2ContByteStreamCnv.cxx index 221419a0f4a78f01c0ebc76670024f8a7541d55a..10da464a3ac2e7f240ba1ee655deef74f0cc7597 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileL2ContByteStreamCnv.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileL2ContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Gaudi includes @@ -59,14 +59,12 @@ void TileRecyclableL2Container::recycle() TileL2ContByteStreamCnv::TileL2ContByteStreamCnv(ISvcLocator* svcloc) - : Converter(storageType(), classID(), svcloc) - , ::AthMessaging(msgSvc(), "TileL2ContByteStreamCnv") - , m_name("TileL2ContByteStreamCnv") + : AthConstConverter(storageType(), classID(), svcloc, "TileL2ContByteStreamCnv") , m_tool("TileL2ContByteStreamTool") - , m_byteStreamEventAccess("ByteStreamCnvSvc", m_name) + , m_byteStreamEventAccess("ByteStreamCnvSvc", name()) , m_byteStreamCnvSvc(0) - , m_storeGate("StoreGateSvc", m_name) - , m_robSvc("ROBDataProviderSvc", m_name) + , m_storeGate("StoreGateSvc", name()) + , m_robSvc("ROBDataProviderSvc", name()) , m_decoder("TileROD_Decoder") { } @@ -98,8 +96,8 @@ StatusCode TileL2ContByteStreamCnv::initialize() { } -StatusCode TileL2ContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) { - +StatusCode TileL2ContByteStreamCnv::createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const +{ ATH_MSG_DEBUG( " Executing createObj method" ); ByteStreamAddress* pRE_Addr; @@ -126,7 +124,8 @@ StatusCode TileL2ContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject* return StatusCode::SUCCESS; } -StatusCode TileL2ContByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr) { +StatusCode TileL2ContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const +{ // convert TileL2s in the container into ByteStream ATH_MSG_DEBUG( " Executing createRep method" ); diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileL2ContByteStreamTool.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileL2ContByteStreamTool.cxx index 3c8cec85fc0f105b49b74ba00f32b1efc6ccf2dc..beb1a48bd5a39f50ff2ac434a561df4a1c1d2031 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileL2ContByteStreamTool.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileL2ContByteStreamTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //**************************************************************************** @@ -81,7 +81,7 @@ StatusCode TileL2ContByteStreamTool::finalize() { } StatusCode TileL2ContByteStreamTool::convert(TileL2Container* cont, - FullEventAssembler<TileHid2RESrcID> *fea) { + FullEventAssembler<TileHid2RESrcID> *fea) const { //fea->clear(); diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileLaserObjByteStreamCnv.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileLaserObjByteStreamCnv.cxx index caed68285a7dcd220e4f75cd45c68f6e46d4d21b..a2dd4d27410bdd76c1075d065558eb5a63b0eb02 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileLaserObjByteStreamCnv.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileLaserObjByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //author Renato Febbraro @@ -36,10 +36,8 @@ TileLaserObjByteStreamCnv::TileLaserObjByteStreamCnv(ISvcLocator* svcloc) - : Converter(storageType(), classID(), svcloc) - , ::AthMessaging(msgSvc(), "TileLaserObjByteStreamCnv") - , m_name("TileLaserObjByteStreamCnv") - , m_robSvc("ROBDataProviderSvc", m_name) + : AthConstConverter(storageType(), classID(), svcloc, "TileLaserObjByteStreamCnv") + , m_robSvc("ROBDataProviderSvc", name()) , m_decoder("TileROD_Decoder") , m_ROBID() , m_hid2re(0) @@ -72,8 +70,8 @@ StatusCode TileLaserObjByteStreamCnv::initialize() { } -StatusCode TileLaserObjByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) { - +StatusCode TileLaserObjByteStreamCnv::createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const +{ ATH_MSG_DEBUG( " Executing createObj method" ); ByteStreamAddress *pRE_Addr; @@ -101,7 +99,8 @@ StatusCode TileLaserObjByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObjec return StatusCode::SUCCESS; } -StatusCode TileLaserObjByteStreamCnv::createRep(DataObject* /* pObj */, IOpaqueAddress*& /* pAddr */) { +StatusCode TileLaserObjByteStreamCnv::createRepConst(DataObject* /* pObj */, IOpaqueAddress*& /* pAddr */) const +{ // No conversion from TileLaserObj to BS ATH_MSG_ERROR( " Can not create BS from TileLaserObject " ); diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamCnv.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamCnv.cxx index 0d850199349c7179bea89b2fb599d94baee56531..569e2f0a1077590364ad7e56dc97141b42932f48 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamCnv.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Gaudi includes @@ -32,14 +32,12 @@ TileMuRcvContByteStreamCnv::TileMuRcvContByteStreamCnv(ISvcLocator* svcloc) - : Converter(storageType(), classID(),svcloc) - , ::AthMessaging(msgSvc(), "TileMuRcvContByteStreamCnv") - , m_name("TileMuRcvContByteStreamCnv") + : AthConstConverter(storageType(), classID(),svcloc, "TileMuRcvContByteStreamCnv") , m_tool("TileMuRcvContByteStreamTool") - , m_byteStreamEventAccess("ByteStreamCnvSvc", m_name) + , m_byteStreamEventAccess("ByteStreamCnvSvc", name()) , m_byteStreamCnvSvc(0) - , m_storeGate("StoreGateSvc", m_name) - , m_robSvc("ROBDataProviderSvc", m_name) + , m_storeGate("StoreGateSvc", name()) + , m_robSvc("ROBDataProviderSvc", name()) , m_decoder("TileROD_Decoder") { } @@ -75,7 +73,7 @@ StatusCode TileMuRcvContByteStreamCnv::initialize() } -StatusCode TileMuRcvContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) +StatusCode TileMuRcvContByteStreamCnv::createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const { ATH_MSG_DEBUG( " Executing createObj method" ); @@ -105,7 +103,7 @@ StatusCode TileMuRcvContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObje return StatusCode::SUCCESS; } -StatusCode TileMuRcvContByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr) +StatusCode TileMuRcvContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const { ATH_MSG_DEBUG( " Executing createRep method" ); diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamTool.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamTool.cxx index ba4e14487d5d48788cdac0a4bd9c7c142847527a..7c17a17b6de0a0eeb17d60fd7a7f9b442dcf5e84 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamTool.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileMuRcvContByteStreamTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //**************************************************************************** @@ -76,8 +76,8 @@ StatusCode TileMuRcvContByteStreamTool::finalize() { return StatusCode::SUCCESS; } -StatusCode TileMuRcvContByteStreamTool::convert(TileMuonReceiverContainer* cont, FullEventAssembler<TileHid2RESrcID> *fea) { - +StatusCode TileMuRcvContByteStreamTool::convert(TileMuonReceiverContainer* cont, FullEventAssembler<TileHid2RESrcID> *fea) const +{ ATH_MSG_INFO ("Executing TileMuRcvContByteStreamTool::convert method"); int n = 0; diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamCnv.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamCnv.cxx index e0a04567247debcd03b7caad0f4d7a69756e4299..90d6d485d053d2b4697369c924257f3dade184e4 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamCnv.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Gaudi includes @@ -35,13 +35,11 @@ #include <stdint.h> TileRawChannelContByteStreamCnv::TileRawChannelContByteStreamCnv(ISvcLocator* svcloc) - : Converter(storageType(), classID(), svcloc) - , ::AthMessaging(msgSvc(), "TileRawChannelContByteStreamCnv") - , m_name("TileRawChannelContByteStreamCnv") + : AthConstConverter(storageType(), classID(), svcloc, "TileRawChannelContByteStreamCnv") , m_tool("TileRawChannelContByteStreamTool") - , m_byteStreamEventAccess("ByteStreamCnvSvc", m_name) + , m_byteStreamEventAccess("ByteStreamCnvSvc", name()) , m_byteStreamCnvSvc(0) - , m_robSvc("ROBDataProviderSvc", m_name) + , m_robSvc("ROBDataProviderSvc", name()) , m_decoder("TileROD_Decoder") , m_hid2re(0) { @@ -72,8 +70,8 @@ StatusCode TileRawChannelContByteStreamCnv::initialize() { return StatusCode::SUCCESS; } -StatusCode TileRawChannelContByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) { - +StatusCode TileRawChannelContByteStreamCnv::createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const +{ ATH_MSG_DEBUG(" Executing createObj method "); ByteStreamAddress *pRE_Addr; @@ -175,7 +173,8 @@ StatusCode TileRawChannelContByteStreamCnv::createObj(IOpaqueAddress* pAddr, Dat return StatusCode::SUCCESS; } -StatusCode TileRawChannelContByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr) { +StatusCode TileRawChannelContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const +{ // convert TileRawChannels in the container into ByteStream ATH_MSG_DEBUG(" Executing createRep method "); diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamTool.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamTool.cxx index d257a1a2cb77c8566dba5f66464970d8f1acb523..76518dc44034038eeab9cc85fc812c5cfbf3fbe6 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamTool.cxx +++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -81,8 +81,8 @@ StatusCode TileRawChannelContByteStreamTool::finalize() { return StatusCode::SUCCESS; } -StatusCode TileRawChannelContByteStreamTool::convert(CONTAINER* rawChannelContainer, FullEventAssembler<TileHid2RESrcID> *fea) { - +StatusCode TileRawChannelContByteStreamTool::convert(CONTAINER* rawChannelContainer, FullEventAssembler<TileHid2RESrcID> *fea) const +{ bool isTMDB = evtStore()->proxy(rawChannelContainer)->name() == "MuRcvRawChCnt"; TileFragHash::TYPE contType = rawChannelContainer->get_type(); diff --git a/Tools/PROCTools/python/RunTier0Tests.py b/Tools/PROCTools/python/RunTier0Tests.py index b433b25b798d227a79919a6ff5e00db21251ac9e..6ef49a3f5c97f93e44404c97ff2843eb90e98188 100755 --- a/Tools/PROCTools/python/RunTier0Tests.py +++ b/Tools/PROCTools/python/RunTier0Tests.py @@ -330,14 +330,14 @@ def RunFrozenTier0PolicyTest(q,inputFormat,maxEvents,CleanRunHeadDir,UniqID,Diff exclusion_list = [] with open(diff_rules_file) as f: for line in f: - exclusion_list.append('"'+line.rstrip()+'"') + exclusion_list.append(r"'{}'".format(line.rstrip())) else: logging.info("No diff rules file exists, using the default list") - exclusion_list = ['"index_ref"', '"(.*)_timings$"', '"(.*)_mems$"'] + exclusion_list = [r"'index_ref'", r"'(.*)_timings\.(.*)'", r"'(.*)_mems\.(.*)'"] exclusion_list = ' '.join(exclusion_list) - comparison_command = "acmd.py diff-root "+clean_dir+"/my"+inputFormat+".pool.root run_"+q+"/my"+inputFormat+".pool.root -v --error-mode resilient --ignore-leaves "+exclusion_list+" --entries "+str(maxEvents)+" > run_"+q+"/diff-root-"+q+"."+inputFormat+".log 2>&1" + comparison_command = "acmd.py diff-root "+clean_dir+"/my"+inputFormat+".pool.root run_"+q+"/my"+inputFormat+".pool.root --error-mode resilient --ignore-leaves "+exclusion_list+" --entries "+str(maxEvents)+" > run_"+q+"/diff-root-"+q+"."+inputFormat+".log 2>&1" output,error = subprocess.Popen(['/bin/bash', '-c', comparison_command], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() output,error = output.decode('utf-8'), error.decode('utf-8') diff --git a/Tools/PyUtils/python/scripts/diff_root_files.py b/Tools/PyUtils/python/scripts/diff_root_files.py index 21b3a867cc8352387809ec95fbc1bcc81199fe71..3d30436014c342a3a597630bf80b43d3c970d6d7 100644 --- a/Tools/PyUtils/python/scripts/diff_root_files.py +++ b/Tools/PyUtils/python/scripts/diff_root_files.py @@ -10,6 +10,8 @@ __author__ = "Sebastien Binet" ### imports ------------------------------------------------------------------- import PyUtils.acmdlib as acmdlib +import re +from PyUtils.Decorators import memoize from math import isnan from numbers import Real @@ -134,37 +136,16 @@ def main(args): fnew = ru.RootFileDumper(args.new, args.tree_name) pass - def build_ignore_list( all_leaves, ignore_leaves ): - """ Here we build the list of leaves that'll be ignored in the diff""" - - import re - result = set() - - # Loop over leaves and patterns, add matches to the results - # The set() is taken elsewhere in the code - for leaf in all_leaves: - for pattern in ignore_leaves: - try: - m = re.match(pattern, leaf) - except TypeError: - continue - if m: - result.add(leaf) - - return result - def tree_infos(tree, args): nentries = tree.GetEntriesFast() # l.GetBranch().GetName() gives the full leaf path name - all_leaves = [ l.GetBranch().GetName() for l in tree.GetListOfLeaves() ] - ignore_leaves = build_ignore_list( all_leaves, args.ignore_leaves ) - leaves = [ leaf for leaf in all_leaves if leaf not in ignore_leaves ] + leaves = [l.GetBranch().GetName() for l in tree.GetListOfLeaves() + if l.GetBranch().GetName() not in args.ignore_leaves] if args.leaves_prefix: leaves = [l.replace(args.leaves_prefix, '') for l in leaves] return { 'entries': nentries, 'leaves': set(leaves), - 'ignored': ignore_leaves } def ordered_indices(tree, reverse_order = False): @@ -242,7 +223,7 @@ def main(args): msg.warning(' - [%s]', l) # need to remove trailing dots as they confuse reach_next() - skip_leaves = [ l.rstrip('.') for l in old_leaves | new_leaves | infos['old']['ignored'].union(infos['new']['ignored']) ] + skip_leaves = [ l.rstrip('.') for l in old_leaves | new_leaves | set(args.ignore_leaves) ] for l in skip_leaves: msg.debug('skipping [%s]', l) @@ -269,6 +250,29 @@ def main(args): def leafname_fromdump(entry): return '.'.join([s for s in entry[2] if not s.isdigit()]) + @memoize + def skip_leaf(name_from_dump, skip_leaves): + """ Here decide if the current leaf should be skipped. + Previously the matching was done based on the full or partial + leaf name. E.g. foo.bar.zzz would be skipped if any of the + following were provided: + * foo + * foo.bar + * foo.bar.zzz + * Any of the foo, bar, or zzz + Now, we make a regex matching such that the user doesn't + need to provide full branch names. + """ + for pattern in skip_leaves: + try: + m = re.match(pattern, name_from_dump) + except TypeError: + continue + if m: + return True + else: + return False + def reach_next(dump_iter, skip_leaves, leaves_prefix=None): keep_reading = True while keep_reading: @@ -279,16 +283,9 @@ def main(args): entry[2][0] = entry[2][0].rstrip('.\0') # clean branch name if leaves_prefix: entry[2][0] = entry[2][0].replace(leaves_prefix, '') - name = [] - skip = False - for n in leafname_fromdump(entry).split('.'): - name.append(n) - if '.'.join(name) in skip_leaves or n in skip_leaves: - skip = True - break - if not skip: + if not skip_leaf(leafname_fromdump(entry), tuple(set(skip_leaves))): return entry - # print('SKIP:', leafname_fromdump(entry)) + msg.debug('SKIP: {}'.format(leafname_fromdump(entry))) pass read_old = True diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Extrapolator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Extrapolator.h index ba1bd19e06b602d9f8df6e874bacb5c9c41118e1..b0939e4acbe74b1c3d9073d17440d52be76e681b 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Extrapolator.h +++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Extrapolator.h @@ -932,49 +932,49 @@ private: bool m_materialEffectsOnTrackValidation; //!< mat effects on track validation // extrapolation counters - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_extrapolateCalls; //!< number of calls: extrapolate() method - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_extrapolateBlindlyCalls; //!< number of calls: extrapolateBlindly() method - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_extrapolateDirectlyCalls; //!< number of calls: extrapolateDirectly() method - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_extrapolateStepwiseCalls; //!< number of calls: extrapolateStepwise() method - mutable Gaudi::Accumulators::Counter<int> m_startThroughAssociation; //!< navigation intialization - mutable Gaudi::Accumulators::Counter<int> m_startThroughRecall; //!< navigation intialization - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_startThroughAssociation; //!< navigation intialization + mutable Gaudi::Accumulators::Counter<> m_startThroughRecall; //!< navigation intialization + mutable Gaudi::Accumulators::Counter<> m_startThroughGlobalSearch; //!< navigation intialization - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_destinationThroughAssociation; //!< navigation intialization - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_destinationThroughRecall; //!< navigation intialization - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_destinationThroughGlobalSearch; //!< navigation intialization - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_layerSwitched; //!< number of layers that have been switched // navigation counters - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_navigationBreakLoop; //!< number of navigation breaks due to loop - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_navigationBreakOscillation; //!< number of navigation breaks due to oscillation - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_navigationBreakNoVolume; //!< number of navigation breaks due no Volume found - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_navigationBreakDistIncrease; //!< number of navigation breaks due to distance increase - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_navigationBreakVolumeSignature; //!< number of navigation breaks due to distance increase - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_overlapSurfaceHit; //!< number of OverlapSurfaces found - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_meotSearchCallsFw; //!< how often the meot search is called: forward - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_meotSearchCallsBw; //!< how often the meot search is called: backward - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_meotSearchSuccessfulFw; //!< how often the meot search was successful: forward - mutable Gaudi::Accumulators::Counter<int> + mutable Gaudi::Accumulators::Counter<> m_meotSearchSuccessfulBw; //!< how often the meot search was successful: backward }; diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Navigator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Navigator.h index fbc3fa6530453558e3e47793c922028691f08be2..80ecaf0e539876b22959bc871acc7df7c80a8004 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Navigator.h +++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/Navigator.h @@ -192,16 +192,16 @@ namespace Trk { // ------ PERFORMANCE STATISTICS -------------------------------- // /* All performance stat counters are atomic (the simplest solution perhaps * not the most performant one)*/ - mutable Gaudi::Accumulators::Counter<int> m_forwardCalls; //!< counter for forward nextBounday calls - mutable Gaudi::Accumulators::Counter<int> m_forwardFirstBoundSwitch; //!< counter for failed first forward nextBounday calls - mutable Gaudi::Accumulators::Counter<int> m_forwardSecondBoundSwitch; //!< counter for failed second forward nextBounday calls - mutable Gaudi::Accumulators::Counter<int> m_forwardThirdBoundSwitch; //!< counter for failed third forward nextBounday calls - mutable Gaudi::Accumulators::Counter<int> m_backwardCalls; //!< counter for backward nextBounday calls - mutable Gaudi::Accumulators::Counter<int> m_backwardFirstBoundSwitch; //!< counter for failed first backward nextBounday calls - mutable Gaudi::Accumulators::Counter<int> m_backwardSecondBoundSwitch; //!< counter for failed second backward nextBounday calls - mutable Gaudi::Accumulators::Counter<int> m_backwardThirdBoundSwitch; //!< counter for failed third backward nextBounday calls - mutable Gaudi::Accumulators::Counter<int> m_outsideVolumeCase; //!< counter for navigation-break in outside volume cases (ovc) - mutable Gaudi::Accumulators::Counter<int> m_sucessfulBackPropagation; //!< counter for sucessful recovery of navigation-break in ovc + mutable Gaudi::Accumulators::Counter<> m_forwardCalls; //!< counter for forward nextBounday calls + mutable Gaudi::Accumulators::Counter<> m_forwardFirstBoundSwitch; //!< counter for failed first forward nextBounday calls + mutable Gaudi::Accumulators::Counter<> m_forwardSecondBoundSwitch; //!< counter for failed second forward nextBounday calls + mutable Gaudi::Accumulators::Counter<> m_forwardThirdBoundSwitch; //!< counter for failed third forward nextBounday calls + mutable Gaudi::Accumulators::Counter<> m_backwardCalls; //!< counter for backward nextBounday calls + mutable Gaudi::Accumulators::Counter<> m_backwardFirstBoundSwitch; //!< counter for failed first backward nextBounday calls + mutable Gaudi::Accumulators::Counter<> m_backwardSecondBoundSwitch; //!< counter for failed second backward nextBounday calls + mutable Gaudi::Accumulators::Counter<> m_backwardThirdBoundSwitch; //!< counter for failed third backward nextBounday calls + mutable Gaudi::Accumulators::Counter<> m_outsideVolumeCase; //!< counter for navigation-break in outside volume cases (ovc) + mutable Gaudi::Accumulators::Counter<> m_sucessfulBackPropagation; //!< counter for sucessful recovery of navigation-break in ovc }; } // end of namespace diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx index 5340f8a854f4de4af46e332b1bae155c9ba9ae13..3e850999ab669c73ed0242f71e2d956a5dfca9e7 100755 --- a/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx +++ b/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx @@ -5560,7 +5560,14 @@ Trk::Extrapolator::extrapolateToVolumeWithPathLimit(const EventContext& ctx, if (currentUpdator) { nextPar = ManagedTrackParmPtr::recapture( nextPar, - currentUpdator->postUpdate(*nextPar, *nextLayer, dir, particle, matupmod).release()); + currentUpdator + ->postUpdate(currentUpdatorCache, + *nextPar, + *nextLayer, + dir, + particle, + matupmod) + .release()); } if (!nextPar) { ATH_MSG_VERBOSE("postUpdate failed for input parameters:" @@ -5577,9 +5584,16 @@ Trk::Extrapolator::extrapolateToVolumeWithPathLimit(const EventContext& ctx, } else { double pIn = nextPar->momentum().mag(); if (currentUpdator) { - nextPar = ManagedTrackParmPtr::recapture( - nextPar, - currentUpdator->update(nextPar.get(), *nextLayer, dir, particle, matupmod).release()); + nextPar = + ManagedTrackParmPtr::recapture(nextPar, + currentUpdator + ->update(currentUpdatorCache, + nextPar.get(), + *nextLayer, + dir, + particle, + matupmod) + .release()); } if (!nextPar) { ATH_MSG_VERBOSE(" [+] Update may have killed track - return."); diff --git a/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx b/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx index 9d99cae54bef9af90d10c9b3d8cfadef7ce139da..10be54b5acbd4b00e307ec0d51bc4a6ac4a0df8e 100755 --- a/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx +++ b/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx @@ -49,9 +49,7 @@ globalToLocalVecHelper(double* ATH_RESTRICT P, { using namespace CxxUtils; using vec2 = CxxUtils::vec<double, 2>; - using vec4 = CxxUtils::vec<double, 4>; - - /* Calculation + /* The calculation (original form) P[ 7]-=(s0*P[ 3]); P[ 8]-=(s0*P[ 4]); P[ 9]-=(s0*P[ 5]); P[10]-=(s0*P[42]); P[11]-=(s0*P[43]); P[12]-=(s0*P[44]); P[14]-=(s1*P[ 3]); P[15]-=(s1*P[ 4]); P[16]-=(s1*P[ 5]); @@ -73,51 +71,74 @@ globalToLocalVecHelper(double* ATH_RESTRICT P, * --> {P[30],P[31]} */ vec2 Pmult1 = { P[3], P[4] }; - vec4 Pmult2 = { P[5], P[42], P[43], P[44] }; + vec2 Pmult2 = { P[5], P[42] }; + vec2 Pmult3 = { P[43], P[44] }; + vec2 dXdL0_dYdL0; vload(dXdL0_dYdL0, &P[7]); - vec4 dZdL0_dAxdL0_dAydL0_dAzdL0; - vload(dZdL0_dAxdL0_dAydL0_dAzdL0, &P[9]); + vec2 dZdL0_dAxdL0; + vload(dZdL0_dAxdL0, &P[9]); + vec2 dAydL0_dAzdL0; + vload(dAydL0_dAzdL0, &P[11]); dXdL0_dYdL0 -= s0 * Pmult1; - dZdL0_dAxdL0_dAydL0_dAzdL0 -= s0 * Pmult2; + dZdL0_dAxdL0 -= s0 * Pmult2; + dAydL0_dAzdL0 -= s0 * Pmult3; vstore(&P[7], dXdL0_dYdL0); - vstore(&P[9], dZdL0_dAxdL0_dAydL0_dAzdL0); + vstore(&P[9], dZdL0_dAxdL0); + vstore(&P[11], dAydL0_dAzdL0); vec2 dXdL1_dYdL1; vload(dXdL1_dYdL1, &P[14]); - vec4 dZdL1_dAxdL1_dAydL1_dAzdL1; - vload(dZdL1_dAxdL1_dAydL1_dAzdL1, &P[16]); + vec2 dZdL1_dAxdL1; + vload(dZdL1_dAxdL1, &P[16]); + vec2 dAydL1_dAzdL1; + vload(dAydL1_dAzdL1, &P[18]); dXdL1_dYdL1 -= s1 * Pmult1; - dZdL1_dAxdL1_dAydL1_dAzdL1 -= s1 * Pmult2; + dZdL1_dAxdL1 -= s1 * Pmult2; + dAydL1_dAzdL1 -= s1 * Pmult3; vstore(&P[14], dXdL1_dYdL1); - vstore(&P[16], dZdL1_dAxdL1_dAydL1_dAzdL1); + vstore(&P[16], dZdL1_dAxdL1); + vstore(&P[18], dAydL1_dAzdL1); vec2 dXdPhi_dYdPhi; vload(dXdPhi_dYdPhi, &P[21]); - vec4 dZdPhi_dAxdPhi_dAydPhi_dAzdPhi; - vload(dZdPhi_dAxdPhi_dAydPhi_dAzdPhi, &P[23]); + vec2 dZdPhi_dAxdPhi; + vload(dZdPhi_dAxdPhi, &P[23]); + vec2 dAydPhi_dAzdPhi; + vload(dAydPhi_dAzdPhi, &P[25]); dXdPhi_dYdPhi -= s2 * Pmult1; - dZdPhi_dAxdPhi_dAydPhi_dAzdPhi -= s2 * Pmult2; + dZdPhi_dAxdPhi -= s2 * Pmult2; + dAydPhi_dAzdPhi -= s2 * Pmult3; vstore(&P[21], dXdPhi_dYdPhi); - vstore(&P[23], dZdPhi_dAxdPhi_dAydPhi_dAzdPhi); + vstore(&P[23], dZdPhi_dAxdPhi); + vstore(&P[25], dAydPhi_dAzdPhi); vec2 dXdTheta_dYdTheta; vload(dXdTheta_dYdTheta, &P[28]); - vec4 dZdTheta_dAxdTheta_dAydTheta_dAzdTheta; - vload(dZdTheta_dAxdTheta_dAydTheta_dAzdTheta, &P[30]); + vec2 dZdTheta_dAxdTheta; + vload(dZdTheta_dAxdTheta, &P[30]); + vec2 dAydTheta_dAzdTheta; + vload(dAydTheta_dAzdTheta, &P[32]); dXdTheta_dYdTheta -= s3 * Pmult1; - dZdTheta_dAxdTheta_dAydTheta_dAzdTheta -= s3 * Pmult2; + dZdTheta_dAxdTheta -= s3 * Pmult2; + dAydTheta_dAzdTheta -= s3 * Pmult3; vstore(&P[28], dXdTheta_dYdTheta); - vstore(&P[30], dZdTheta_dAxdTheta_dAydTheta_dAzdTheta); + vstore(&P[30], dZdTheta_dAxdTheta); + vstore(&P[32], dAydTheta_dAzdTheta); vec2 dXdCM_dYdCM; vload(dXdCM_dYdCM, &P[35]); - vec4 dZdCM_dAxdCM_AydCM_dAzdCM; - vload(dZdCM_dAxdCM_AydCM_dAzdCM, &P[37]); + vec2 dZdCM_dAxdCM; + vload(dZdCM_dAxdCM, &P[37]); + vec2 AydCM_dAzdCM; + vload(AydCM_dAzdCM, &P[39]); dXdCM_dYdCM -= s4 * Pmult1; - dZdCM_dAxdCM_AydCM_dAzdCM -= s4 * Pmult2; + dZdCM_dAxdCM -= s4 * Pmult2; + AydCM_dAzdCM -= s4 * Pmult3; vstore(&P[35], dXdCM_dYdCM); - vstore(&P[37], dZdCM_dAxdCM_AydCM_dAzdCM); + vstore(&P[37], dZdCM_dAxdCM); + vstore(&P[39], AydCM_dAzdCM); + } inline void diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h index 4d1492a70378b11d97c4ddfd5532fda0062709a8..f4f520e8dc5b569f76068f78afb78ce00fb19ff7 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h @@ -196,6 +196,7 @@ private: "state in final trajectory" }; + Gaudi::Property<bool> m_reintegrateOutliers{ this, "ReintegrateOutliers", true, @@ -242,19 +243,19 @@ private: // Counters for fit statistics // Number of Fit PrepRawData Calls - mutable std::atomic<int> m_FitPRD; + mutable std::atomic<unsigned long int> m_FitPRD; // Number of Fit MeasurementBase Calls - mutable std::atomic<int> m_FitMeasurementBase; + mutable std::atomic<unsigned long int> m_FitMeasurementBase; // Number of Foward Fit Failures - mutable std::atomic<int> m_ForwardFailure; + mutable std::atomic<unsigned long int> m_ForwardFailure; // Number of Smoother Failures - mutable std::atomic<int> m_SmootherFailure; + mutable std::atomic<unsigned long int> m_SmootherFailure; // Number of MakePerigee Failures - mutable std::atomic<int> m_PerigeeFailure; + mutable std::atomic<unsigned long int> m_PerigeeFailure; // Number of Tracks that fail fit Quailty test - mutable std::atomic<int> m_fitQualityFailure; + mutable std::atomic<unsigned long int> m_fitQualityFailure; // Number of Tracks that are successfull - mutable std::atomic<int> m_fitSuccess; + mutable std::atomic<unsigned long int> m_fitSuccess; }; } // end Trk namespace diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h index fc6e6283a8ba87e7ab637586f982dc4786fca345..8f41475d80b3a20555d299a752e4698520865b3f 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h @@ -295,30 +295,18 @@ private: Trk::MagneticFieldProperties m_fieldProperties; //!< Statistics: Number of calls to the main extrapolate method - mutable Gaudi::Accumulators::Counter<int, - Gaudi::Accumulators::atomicity::full> - m_extrapolateCalls; + mutable Gaudi::Accumulators::Counter<> m_extrapolateCalls; //!< Statistics: Number of calls to the extrapolate directly method - mutable Gaudi::Accumulators::Counter<int, - Gaudi::Accumulators::atomicity::full> - m_extrapolateDirectlyCalls; + mutable Gaudi::Accumulators::Counter<> m_extrapolateDirectlyCalls; //!< Statistics: Number of calls to the extrapolate directly fallback - mutable Gaudi::Accumulators::Counter<int, - Gaudi::Accumulators::atomicity::full> - m_extrapolateDirectlyFallbacks; + mutable Gaudi::Accumulators::Counter<> m_extrapolateDirectlyFallbacks; //!< Statistics: Number of times navigation stepping fails to go the right //!< way - mutable Gaudi::Accumulators::Counter<int, - Gaudi::Accumulators::atomicity::full> - m_navigationDistanceIncreaseBreaks; + mutable Gaudi::Accumulators::Counter<> m_navigationDistanceIncreaseBreaks; //!< Statistics: Number of times a tracking volume oscillation is detected - mutable Gaudi::Accumulators::Counter<int, - Gaudi::Accumulators::atomicity::full> - m_oscillationBreaks; + mutable Gaudi::Accumulators::Counter<> m_oscillationBreaks; //!< Statistics: Number of times the volume boundary is missed - mutable Gaudi::Accumulators::Counter<int, - Gaudi::Accumulators::atomicity::full> - m_missedVolumeBoundary; + mutable Gaudi::Accumulators::Counter<> m_missedVolumeBoundary; }; } // end namespace Trk diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx index 77bada201f6e21ab29fcce823e56058cfa57c81f..9d0839ba36e162203df2b77fa78228ec7b1c60c5 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx @@ -66,31 +66,32 @@ Trk::GaussianSumFitter::GaussianSumFitter(const std::string& type, StatusCode Trk::GaussianSumFitter::initialize() { - StatusCode sc; + + if (m_maximumNumberOfComponents > 16) { + ATH_MSG_FATAL("Requested MaximumNumberOfComponents > 16"); + return StatusCode::FAILURE; + } + // Request the GSF extrapolator ATH_CHECK(m_extrapolator.retrieve()); + // Request the RIO_OnTrack creator // No need to return if RioOnTrack creator tool, only if PrepRawData is used - if (m_rioOnTrackCreator.retrieve().isFailure()) { - if (!m_refitOnMeasurementBase) { - ATH_MSG_FATAL("Attempting to use PrepRawData with no RIO_OnTrack creator " - "tool provided... Exiting!"); - return StatusCode::FAILURE; - } - ATH_MSG_INFO( - "Request to retrieve the RIO_OnTrack Creator" - << "failed but track is fit at the MeasurementBase level... Continuing!"); + if (!m_refitOnMeasurementBase) { + ATH_MSG_INFO("NOT refitOnMeasurementBase"); + ATH_CHECK(m_rioOnTrackCreator.retrieve()); + } else { + ATH_MSG_INFO("refitOnMeasurementBase"); + m_rioOnTrackCreator.disable(); } + if (m_overideMaterialEffectsSwitch) { - ATH_MSG_INFO("Material effects in forwards fitter have been overiden by " + ATH_MSG_INFO("Material effects in forward fitter have been overiden by " "jobOptions... New " "Trk::ParticleHypothesis: " << m_overideMaterialEffects); } - if (m_maximumNumberOfComponents > 16) { - ATH_MSG_FATAL("Requested MaximumNumberOfComponents > 16"); - return StatusCode::FAILURE; - } + // Initialise the closest track parameters search algorithm Amg::Vector3D referencePosition(m_sortingReferencePoint[0], m_sortingReferencePoint[1], @@ -922,8 +923,14 @@ Trk::GaussianSumFitter::stepForwardFit( { // Protect against undefined Measurement or PrepRawData if (!originalPrepRawData && !originalMeasurement) { + ATH_MSG_WARNING("No measurement base or PrepRawData passed to " + "StepForwardFit... Exiting!"); + return false; + } + + if (!originalMeasurement && m_refitOnMeasurementBase) { ATH_MSG_WARNING( - "No measurement information passed to StepForwardFit... Exiting!"); + "No measurement base information passed to StepForwardFit... Exiting!"); return false; } @@ -932,7 +939,6 @@ Trk::GaussianSumFitter::stepForwardFit( ATH_MSG_WARNING("ForwardTrajectory object is not defined... Exiting!"); return false; } - // Extrapolate multi-component state to the next measurement surface Trk::MultiComponentState extrapolatedState = m_extrapolator->extrapolate(ctx, diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt b/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt index ad18e45b367a80ac8240f488bfad8da3f0b8ab8d..5dd8e5f99c3487842e6372aa02c8ffe180ed4871 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt @@ -35,8 +35,6 @@ atlas_add_component( TrkAmbiguityProcessor src/SimpleAmbiguityProcessorTool.cxx src/TrackScoringTool.cxx src/TrackSelectionProcessorTool.cxx - src/ToolVisitor.cxx - src/RenounceToolInputsVisitor.cxx src/components/*.cxx PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel AthenaBaseComps GaudiKernel InDetRecToolInterfaces InDetPrepRawData TrkEventPrimitives TrkParameters TrkRIO_OnTrack TrkTrack TrkTrackSummary TrkTruthData TrkFitterInterfaces TrkToolInterfaces TrkValInterfaces TrkExInterfaces) diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryHelperTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryHelperTool.h index a719c233e085f1fe3117392f226dd0c86e856e4e..2fd7cec77d5d10f0f218c95046da7f958cd5b6a9 100644 --- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryHelperTool.h +++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryHelperTool.h @@ -1,19 +1,17 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef IEXTENDEDTRACKSUMMARYHELPERTOOL #define IEXTENDEDTRACKSUMMARYHELPERTOOL - +#include "TrkToolInterfaces/ITrackSummaryHelperTool.h" +#include "GaudiKernel/EventContext.h" #include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/ThreadLocalContext.h" #include <vector> #include <bitset> -// @TODO remove once interface without PRDtoTrackMap argument is retired. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Woverloaded-virtual" -#include "TrkToolInterfaces/ITrackSummaryHelperTool.h" class Identifier; @@ -35,43 +33,105 @@ namespace Trk { @author Edward Moyse, Martin Siebel <http://consult.cern.ch/xwho> */ - class IExtendedTrackSummaryHelperTool : virtual public ITrackSummaryHelperTool { + class IExtendedTrackSummaryHelperTool : virtual public ITrackSummaryHelperTool + { public: static const InterfaceID& interfaceID(); - /** fill 'information' and 'hitpattern' using information from 'rot'. Should be overloaded by concrete - TrackSummaryHelperTools. It is mandatory that the RIO_OnTrack* points to exactly the object contained - inside the TrackStateOnSurface. This is to avoid that the RTTI from the TrackSummaryTool is done twice. - */ - virtual void analyse(const Trk::Track& track, - const Trk::PRDtoTrackMap *prd_to_track_map, - const RIO_OnTrack* rot, - const TrackStateOnSurface* tsos, - std::vector<int>& information, - std::bitset<Trk::numberOfDetectorTypes>& hitPattern ) const = 0; - - virtual void analyse(const Trk::Track& track, - const Trk::PRDtoTrackMap *prd_to_track_map, - const CompetingRIOsOnTrack* crot, - const TrackStateOnSurface* tsos, - std::vector<int>& information, - std::bitset<Trk::numberOfDetectorTypes>& hitPattern ) const = 0; - - virtual void updateSharedHitCount(const Trk::Track&, - const Trk::PRDtoTrackMap *prd_to_track_map, - Trk::TrackSummary&) const = 0 ; - - virtual void addDetailedTrackSummary(const Track& track, Trk::TrackSummary& summary ) const = 0; - - - + /** fill 'information' and 'hitpattern' using information from 'rot'. Should + be overloaded by concrete TrackSummaryHelperTools. It is mandatory that + the RIO_OnTrack* points to exactly the object contained inside the + TrackStateOnSurface. This is to avoid that the RTTI from the + TrackSummaryTool is done twice. + */ + using ITrackSummaryHelperTool::analyse; + using ITrackSummaryHelperTool::updateSharedHitCount; + using ITrackSummaryHelperTool::addDetailedTrackSummary; + + /* + * First the context aware methods. + * If this set is not overloaded , it + * will call the methods without EventContext + */ + + virtual void analyse( + const EventContext& ctx, + const Trk::Track& track, + const Trk::PRDtoTrackMap* prd_to_track_map, + const RIO_OnTrack* rot, + const TrackStateOnSurface* tsos, + std::vector<int>& information, + std::bitset<Trk::numberOfDetectorTypes>& hitPattern) const + { + (void)(ctx); + analyse(track, prd_to_track_map, rot, tsos, information, hitPattern); + } + + virtual void analyse( + const EventContext& ctx, + const Trk::Track& track, + const Trk::PRDtoTrackMap* prd_to_track_map, + const CompetingRIOsOnTrack* crot, + const TrackStateOnSurface* tsos, + std::vector<int>& information, + std::bitset<Trk::numberOfDetectorTypes>& hitPattern) const + { + (void)(ctx); + analyse(track, prd_to_track_map, crot, tsos, information, hitPattern); + } + + /* + * The context unaware methods. + * If this set is not overloaded , it + * will call the methods with EventContext + */ + + virtual void analyse( + const Trk::Track& track, + const Trk::PRDtoTrackMap* prd_to_track_map, + const RIO_OnTrack* rot, + const TrackStateOnSurface* tsos, + std::vector<int>& information, + std::bitset<Trk::numberOfDetectorTypes>& hitPattern) const + { + analyse(Gaudi::Hive::currentContext(), + track, + prd_to_track_map, + rot, + tsos, + information, + hitPattern); + } + + virtual void analyse( + const Trk::Track& track, + const Trk::PRDtoTrackMap* prd_to_track_map, + const CompetingRIOsOnTrack* crot, + const TrackStateOnSurface* tsos, + std::vector<int>& information, + std::bitset<Trk::numberOfDetectorTypes>& hitPattern) const + { + analyse(Gaudi::Hive::currentContext(), + track, + prd_to_track_map, + crot, + tsos, + information, + hitPattern); + } + + virtual void updateSharedHitCount( + const Trk::Track&, + const Trk::PRDtoTrackMap* prd_to_track_map, + Trk::TrackSummary&) const = 0; + + virtual void addDetailedTrackSummary(const Track& track, + Trk::TrackSummary& summary) const = 0; }; inline const InterfaceID& Trk::IExtendedTrackSummaryHelperTool::interfaceID() { return IID_ITrackSummaryHelperTool; } - } -#pragma GCC diagnostic pop #endif diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h index 9014d072681fbc27415650e88125137a5e25ac55..405062de0b3912b34cd1b4476ddf14d710fe2c5a 100755 --- a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h +++ b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h @@ -6,8 +6,8 @@ #define TRKTRACKSUMMARYTOOL_H #include "AthenaBaseComps/AthAlgTool.h" -#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/EventContext.h" #include "TrkParameters/TrackParameters.h" #include "TrkTrack/Track.h" #include "TrkTrackSummary/TrackSummary.h" @@ -277,7 +277,8 @@ private: /**loops over TrackStatesOnSurface and uses this to produce the summary information Fills 'information', 'eProbability', and 'hitPattern'*/ - void processTrackStates(const Track& track, + void processTrackStates(const EventContext& ctx, + const Track& track, const Trk::PRDtoTrackMap* prd_to_track_map, const DataVector<const TrackStateOnSurface>* tsos, std::vector<int>& information, @@ -285,7 +286,8 @@ private: bool doHolesInDet, bool doHolesMuon) const; - void processMeasurement(const Track& track, + void processMeasurement(const EventContext& ctx, + const Track& track, const Trk::PRDtoTrackMap* prd_to_track_map, const Trk::MeasurementBase* meas, const Trk::TrackStateOnSurface* tsos, diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx index 3b081fddc069fdf13312167a890a80ff53d15ab3..7b4ae59a39dd9ff7245b252ca1cb3c58f3f6182f 100755 --- a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx +++ b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx @@ -19,6 +19,7 @@ #include "TrkGeometry/TrackingVolume.h" #include "TrkParameters/TrackParameters.h" + #include <cassert> #include <vector> #include <algorithm> @@ -282,12 +283,20 @@ std::vector<float> eProbability(numberOfeProbabilityTypes, 0.5); ATH_MSG_DEBUG ("Produce summary for: "<<track.info().dumpInfo()); + + const EventContext& ctx= Gaudi::Hive::currentContext(); if (track.trackStateOnSurfaces()!=nullptr) { information[Trk::numberOfOutliersOnTrack] = 0; - processTrackStates(track,prd_to_track_map, track.trackStateOnSurfaces(), information, hitPattern, - doHolesInDet, doHolesMuon); - }else{ + processTrackStates(ctx, + track, + prd_to_track_map, + track.trackStateOnSurfaces(), + information, + hitPattern, + doHolesInDet, + doHolesMuon); + } else { ATH_MSG_WARNING ("Null pointer to TSoS found on Track (author = " <<track.info().dumpInfo()<<"). This should never happen! "); } @@ -400,16 +409,20 @@ void Trk::TrackSummaryTool::updateAdditionalInfo(const Track& track, const Trk:: * Then the internal helpers */ -void Trk::TrackSummaryTool::processTrackStates(const Track& track, - const Trk::PRDtoTrackMap *prd_to_track_map, - const DataVector<const TrackStateOnSurface>* tsos, - std::vector<int>& information, - std::bitset<numberOfDetectorTypes>& hitPattern, - bool doHolesInDet, - bool doHolesMuon) const +void +Trk::TrackSummaryTool::processTrackStates( + const EventContext& ctx, + const Track& track, + const Trk::PRDtoTrackMap* prd_to_track_map, + const DataVector<const TrackStateOnSurface>* tsos, + std::vector<int>& information, + std::bitset<numberOfDetectorTypes>& hitPattern, + bool doHolesInDet, + bool doHolesMuon) const { ATH_MSG_DEBUG ("Starting to process " << tsos->size() << " track states"); + int measCounter = 0; int cntAddChi2 = 0; float chi2Sum = 0; @@ -426,7 +439,7 @@ void Trk::TrackSummaryTool::processTrackStates(const Track& track, } else { if ((*it)->type(Trk::TrackStateOnSurface::Outlier)) ++information[Trk::numberOfOutliersOnTrack]; // increment outlier counter ATH_MSG_VERBOSE ("analysing TSoS " << measCounter << " of type " << (*it)->dumpType() ); - processMeasurement(track, prd_to_track_map, measurement, *it, information, hitPattern); + processMeasurement(ctx,track, prd_to_track_map, measurement, *it, information, hitPattern); } // if have measurement pointer } // if type measurement, scatterer or outlier @@ -464,12 +477,13 @@ void Trk::TrackSummaryTool::processTrackStates(const Track& track, if (varChi2>0 && varChi2<1.e13) information[Trk::standardDeviationOfChi2OS] = int(sqrt(varChi2)*100); } -void Trk::TrackSummaryTool::processMeasurement(const Track& track, +void Trk::TrackSummaryTool::processMeasurement(const EventContext& ctx, + const Track& track, const Trk::PRDtoTrackMap *prd_to_track_map, - const Trk::MeasurementBase* meas, - const Trk::TrackStateOnSurface* tsos, - std::vector<int>& information, - std::bitset<numberOfDetectorTypes>& hitPattern) const + const Trk::MeasurementBase* meas, + const Trk::TrackStateOnSurface* tsos, + std::vector<int>& information, + std::bitset<numberOfDetectorTypes>& hitPattern) const { // Check if the measurement type is RIO on Track (ROT) @@ -484,7 +498,7 @@ void Trk::TrackSummaryTool::processMeasurement(const Track& track, if (tool==nullptr){ ATH_MSG_WARNING("Cannot find tool to match ROT. Skipping."); } else { - tool->analyse(track,prd_to_track_map, rot,tsos,information, hitPattern); + tool->analyse(ctx,track,prd_to_track_map, rot,tsos,information, hitPattern); } } else { //check if the measurement type is CompetingRIOsOnTrack @@ -501,7 +515,7 @@ void Trk::TrackSummaryTool::processMeasurement(const Track& track, if (tool==nullptr){ ATH_MSG_WARNING("Cannot find tool to match cROT. Skipping."); } else { - tool->analyse(track,prd_to_track_map, compROT,tsos,information, hitPattern); + tool->analyse(ctx,track,prd_to_track_map, compROT,tsos,information, hitPattern); } } } diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py index b60697b17d69ae8aa4a71bde92b952a985c81c79..2db8347a2972c3f71998215c10a8e089c8c8af23 100755 --- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py +++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py @@ -377,7 +377,18 @@ def TMEF_MuonCreatorTool(name="TMEF_MuonCreatorTool",**kwargs): def TMEF_MuonCandidateTrackBuilderTool(name="TMEF_MuonCandidateTrackBuilderTool",**kwargs): kwargs.setdefault('MuonTrackBuilder', 'TMEF_CombinedMuonTrackBuilder') - kwargs.setdefault('MuonSegmentTrackBuilder', CfgGetter.getPublicTool("MooMuonTrackBuilder")) + from MuonRecExample.MuonRecUtils import ExtraFlags + extraFlags = ExtraFlags() + extraFlags.setFlagDefault("doSegmentPhiMatching", True) + from MuonRecExample.MuonStandaloneFlags import muonStandaloneFlags + extraFlags.setFlagDefault(muonStandaloneFlags.optimiseMomentumResolutionUsingChi2) # take name & value from JobProperty + extraFlags.setFlagDefault(muonStandaloneFlags.strategy) + extraFlags.setFlagDefault(muonStandaloneFlags.trackBuilder) + extraFlags.setFlagDefault(muonStandaloneFlags.printSummary) + extraFlags.setFlagDefault(muonStandaloneFlags.refinementTool) + if "TrackBuilderTool" not in kwargs: + extraFlags.setFlagDefault('UseTrackingHistory',True) + kwargs.setdefault('MuonSegmentTrackBuilder', CfgGetter.getPublicToolClone("MooMuonTrackBuilder","MooTrackBuilderTemplate",extraFlags=extraFlags)) return CfgMgr.Muon__MuonCandidateTrackBuilderTool(name,**kwargs) def TMEF_MuonPRDSelectionTool(name="TMEF_MuonPRDSelectionTool",**kwargs): diff --git a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/python/TrigPartialEventBuildingConfig.py b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/python/TrigPartialEventBuildingConfig.py index c09b919ba7edcd7155d39f78df99a267e7e1687d..a47d8e6ae65b6b521ae909fe94efb452c429143f 100644 --- a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/python/TrigPartialEventBuildingConfig.py +++ b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/python/TrigPartialEventBuildingConfig.py @@ -5,6 +5,7 @@ from TrigPartialEventBuilding.TrigPartialEventBuildingConf import StaticPEBInfoWriterTool, RoIPEBInfoWriterTool from TrigEDMConfig.DataScoutingInfo import getFullHLTResultID from libpyeformat_helper import SourceIdentifier, SubDetector +from RegionSelector import RegSelToolConfig class StaticPEBInfoWriterToolCfg(StaticPEBInfoWriterTool): @@ -24,10 +25,32 @@ class StaticPEBInfoWriterToolCfg(StaticPEBInfoWriterTool): class RoIPEBInfoWriterToolCfg(RoIPEBInfoWriterTool): + def addRegSelDets(self, detNames): + ''' + Add RegionSelector tools for given detector look-up tables to build PEB list of ROBs + in these detectors that intersect with the RoI. Special value 'All' can be also given + in the detNames list to include all detectors available in RegionSelector. + ''' + if 'All' in detNames: + detNames = [ + 'Pixel', 'SCT', 'TRT', # ID + 'MDT', 'RPC', 'TGC', 'CSC', 'MM', 'sTGC', # Muon + 'TTEM', 'TTHEC', 'FCALEM', 'FCALHAD', 'TILE'] # Calo + for det in detNames: + funcName = 'makeRegSelTool_' + det + if not hasattr(RegSelToolConfig, funcName): + raise RuntimeError('Cannot add detector "' + det + '", RegSelToolConfig does not have a function ' + funcName) + func = getattr(RegSelToolConfig, funcName) + if not callable(func): + raise RuntimeError('Cannot add detector "' + det + '", RegSelToolConfig.' + funcName + ' is not callable') + self.RegionSelectorTools += [func()] + def addROBs(self, robs): + '''Add extra fixed list of ROBs independent of RoI''' self.ExtraROBs.extend(robs) def addSubDets(self, dets): + '''Add extra fixed list of SubDets independent of RoI''' self.ExtraSubDets.extend(dets) def addHLTResultToROBList(self, moduleId=getFullHLTResultID()): diff --git a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/RoIPEBInfoWriterTool.cxx b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/RoIPEBInfoWriterTool.cxx index 5a5b19a347d7cde6caa00881195a9d472195b155..d07bd48c1469fe7b917ede690daecbe3b868d920 100644 --- a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/RoIPEBInfoWriterTool.cxx +++ b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/RoIPEBInfoWriterTool.cxx @@ -18,60 +18,12 @@ RoIPEBInfoWriterTool::RoIPEBInfoWriterTool(const std::string& type, const std::s StatusCode RoIPEBInfoWriterTool::initialize() { ATH_MSG_DEBUG("Initialising RoIPEBInfoWriterTool/" << name()); - ATH_CHECK(m_regionSelector.retrieve()); + ATH_CHECK(m_regionSelectorTools.retrieve()); m_extraPebInfo.robs.insert(m_extraROBs.begin(), m_extraROBs.end()); m_extraPebInfo.subdets.insert(m_extraSubDets.begin(), m_extraSubDets.end()); ATH_MSG_DEBUG("Extra PEBInfo attached to every passed event: " << m_extraPebInfo); - // Ugly solution - need to translate strings into enums. Wouldn't be needed if DETID enum was accessible from python. - - const std::unordered_map<std::string_view,DETID> detNameDict = { - {"LAR", DETID::LAR}, - {"TTEM", DETID::TTEM}, - {"TTHEC", DETID::TTHEC}, - {"TILE", DETID::TILE}, - {"MDT", DETID::MDT}, - {"RPC", DETID::RPC}, - {"TGC", DETID::TGC}, - {"CSC", DETID::CSC}, - {"FCALEM", DETID::FCALEM}, - {"FCALHAD", DETID::FCALHAD}, - {"FTK", DETID::FTK}, - {"MM", DETID::MM}, - {"STGC", DETID::STGC}, - }; - - const std::unordered_map< std::string_view, ToolHandle<IRegSelTool> > detTools = { - { "PIXEL", m_regionSelector_pix }, - { "SCT", m_regionSelector_sct }, - { "TRT", m_regionSelector_trt } - }; - - for (std::string_view name : m_detNames) { - if (name=="All") { - for (const auto& p : detNameDict) m_dets.insert(p.second); - for (const auto& p : detTools) m_tools.insert(p.second); - break; - } - - const auto itt = detTools.find(name); - if ( itt!=detTools.cend() ) { - ATH_MSG_DEBUG("The detector name " << name << " being inserted from the RegSelTools database"); - m_tools.insert(itt->second); - } - else { - ATH_MSG_DEBUG("The detector name " << name << " not in the RegSelTools database - trying RegSelEnum database"); - const auto it = detNameDict.find(name); - if (it==detNameDict.cend()) { - ATH_MSG_ERROR("The detector name " << name << " cannot be translated into RegSelEnum DETID"); - return StatusCode::FAILURE; - } - ATH_MSG_DEBUG("Adding " << name << "=" << it->second << " to detector list"); - m_dets.insert(it->second); - } - } - return StatusCode::SUCCESS; } @@ -101,15 +53,9 @@ PEBInfoWriterToolBase::PEBInfo RoIPEBInfoWriterTool::createPEBInfo(const PEBInfo TrigRoiDescriptor roiForPEB(eta, etaMin, etaMax, phi, phiMin, phiMax); - for ( auto tool : m_tools ) { - std::vector<uint32_t> detROBs; - tool->ROBIDList( roiForPEB, detROBs); - pebi.robs.insert(detROBs.begin(),detROBs.end()); - } - - for (const DETID detid : m_dets) { + for (const auto& tool : m_regionSelectorTools) { std::vector<uint32_t> detROBs; - m_regionSelector->DetROBIDListUint(detid, roiForPEB, detROBs); + tool->ROBIDList(roiForPEB, detROBs); pebi.robs.insert(detROBs.begin(),detROBs.end()); } diff --git a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/RoIPEBInfoWriterTool.h b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/RoIPEBInfoWriterTool.h index f1f893825978b832843fea07cc663b44ccd89666..66ed0062b6c5d307a14cbdde3dcde3aa0107df36 100644 --- a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/RoIPEBInfoWriterTool.h +++ b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/RoIPEBInfoWriterTool.h @@ -27,25 +27,11 @@ protected: virtual PEBInfoWriterToolBase::PEBInfo createPEBInfo(const PEBInfoWriterToolBase::Input& input) const override; private: - // ------------------------- Service handles --------------------------------- - ServiceHandle<IRegSelSvc> m_regionSelector { - this, "RegionSelector", "RegSelSvc/RegSelSvc", "Region Selector service" + // ------------------------- Tool handles ------------------------------------ + ToolHandleArray<IRegSelTool> m_regionSelectorTools { + this, "RegionSelectorTools", {}, "Region Selector tools" }; - ToolHandle<IRegSelTool> m_regionSelector_pix { - this, "RegSelTool_Pixel", "RegSelTool/RegSelTool_Pixel", "Region Selector Tool" - }; - - ToolHandle<IRegSelTool> m_regionSelector_sct { - this, "RegSelTool_SCT", "RegSelTool/RegSelTool_SCT", "Region Selector Tool" - }; - - ToolHandle<IRegSelTool> m_regionSelector_trt { - this, "RegSelTool_TRT", "RegSelTool/RegSelTool_TRT", "Region Selector Tool" - }; - - - // ------------------------- Properties -------------------------------------- Gaudi::Property<float> m_etaEdge { this, "EtaEdge", 5.0, "Upper limit of |eta| range" @@ -56,11 +42,6 @@ private: Gaudi::Property<float> m_phiWidth { this, "PhiWidth", 0.1, "Half-width of the RoI in phi (Phi-PhiWidth; Phi+PhiWidth)" }; - Gaudi::Property<std::vector<std::string> > m_detNames { - this, "DetNames", {}, - "List of detectors from which ROBs in RoI will be included. Naming follows RegSelEnums DETID. " - "\"All\" is also a possible value." - }; // No string parsing would be needed if DETID wasn't a global enum and was available in python Gaudi::Property<std::vector<uint32_t> > m_extraROBs { this, "ExtraROBs", {}, "Static list of additional ROBs to add for partial event building in each event where the chain passes" diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTPrescaleCondAlg.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTPrescaleCondAlg.cxx index fc1faa470485412f09d08c1714427360179c64d0..f6b6947c9566fb8f6ef6766ce3679b0eae251de9 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTPrescaleCondAlg.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTPrescaleCondAlg.cxx @@ -27,7 +27,6 @@ TrigConf::HLTPrescaleCondAlg::createFromFile( const std::string & filename ) con if( psLoader.loadFile( filename, *pss) ) { ATH_MSG_INFO( "HLT prescales set successfully loaded from file " << filename ); } else { - ATH_MSG_WARNING( "Failed loading HLT prescales set from file " << filename ); // will be made an error later pss = nullptr; } return pss; @@ -71,15 +70,17 @@ TrigConf::HLTPrescaleCondAlg::initialize() { ATH_CHECK(m_hltPrescalesSetOutputKey.initialize()); - if( m_configSource == "COOL" && m_dbConnection == "JOSVC" ) { - if( auto joSvc = serviceLocator()->service<TrigConf::IJobOptionsSvc>( "JobOptionsSvc" ) ) { - if( joSvc->hltPrescaleKey()>0 ) { - m_psk = joSvc->hltPrescaleKey(); - m_dbConnection = joSvc->server(); - ATH_MSG_INFO("Set psk to " << m_psk << " and db connection to " << m_dbConnection ); + if( m_dbConnection == "JOSVC" ) { + if( m_configSource == "COOL" || m_configSource == "DB" ) { + if( auto joSvc = serviceLocator()->service<TrigConf::IJobOptionsSvc>( "JobOptionsSvc" ) ) { + if( joSvc->hltPrescaleKey()>0 ) { + m_psk = joSvc->hltPrescaleKey(); + m_dbConnection = joSvc->server(); + ATH_MSG_INFO("Set psk to " << m_psk << " and db connection to " << m_dbConnection ); + } + } else { + ATH_MSG_DEBUG("Did not locate TrigConf::IJobOptionsSvc"); } - } else { - ATH_MSG_DEBUG("Did not locate TrigConf::IJobOptionsSvc"); } } @@ -92,15 +93,24 @@ TrigConf::HLTPrescaleCondAlg::initialize() { // index 0 indicates that the configuration is from a file, a DB // PSK is greater than 0 - m_pssMap[0] = createFromFile( m_filename ); + std::shared_ptr<HLTPrescalesSet> pss = createFromFile( m_filename ); + if( pss == nullptr ) { + ATH_MSG_ERROR( "Failed loading HLT prescales set from the file " << m_filename ); + return StatusCode::FAILURE; + } + m_pssMap[0] = pss; } else if( m_psk != 0u ) { // this is for the case where the reading from the DB was // configured and also when we read from COOL online and get a // PSK through the JobOptionsSvc - m_pssMap[m_psk] = createFromDB( m_psk, true ); - + std::shared_ptr<HLTPrescalesSet> pss = createFromDB( m_psk, true ); + if( pss == nullptr ) { + ATH_MSG_ERROR( "Failed loading HLT prescales set " << m_psk << " from the database" ); + return StatusCode::FAILURE; + } + m_pssMap[m_psk] = pss; } return StatusCode::SUCCESS; @@ -156,11 +166,16 @@ TrigConf::HLTPrescaleCondAlg::execute(const EventContext& ctx) const { auto pssi = m_pssMap.find( hltPsk ); if( pssi == m_pssMap.end()) { - + bool isRun3 = range.start().run_number()>350000; pss = m_pssMap[hltPsk] = createFromDB( hltPsk, isRun3 ); + if( pss == nullptr ) { + ATH_MSG_ERROR( "Failed loading HLT prescales set from the database" ); + return StatusCode::FAILURE; + } + } else { pss = pssi->second; @@ -181,7 +196,7 @@ TrigConf::HLTPrescaleCondAlg::execute(const EventContext& ctx) const { ATH_MSG_INFO("Recording empty HLT prescales set with range " << range); ATH_CHECK( writeCondHandle.record( range, new HLTPrescalesSet ) ); } else { - ATH_MSG_INFO("Recording HLT prescales set with range " << range); + ATH_MSG_INFO("Recording HLT prescales set with range " << range << " (key = " << hltPsk << ")"); ATH_CHECK( writeCondHandle.record( range, new HLTPrescalesSet(*pss) ) ); } diff --git a/Trigger/TrigCost/TrigCostAnalysis/CMakeLists.txt b/Trigger/TrigCost/TrigCostAnalysis/CMakeLists.txt index 6b9b7a8e7d2a5669c21d23748b781326c4d7031e..72339d0aa2bb808e1ff0ee04ee9defcc4c96002f 100644 --- a/Trigger/TrigCost/TrigCostAnalysis/CMakeLists.txt +++ b/Trigger/TrigCost/TrigCostAnalysis/CMakeLists.txt @@ -24,4 +24,4 @@ atlas_add_executable( trigCostHistToCSV LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AthenaBaseComps TrigCostAnalysisLib ) atlas_install_joboptions( share/TrigCostAnalysis_JobOptions.py ) -atlas_install_scripts( share/TrigCostAnalysis.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) +atlas_install_scripts( share/RunTrigCostAnalysis.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Trigger/TrigCost/TrigCostAnalysis/share/TrigCostAnalysis.py b/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py similarity index 100% rename from Trigger/TrigCost/TrigCostAnalysis/share/TrigCostAnalysis.py rename to Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py diff --git a/Trigger/TrigDataAccess/TrigSerializeResult/python/StreamerInfoGenerator.py b/Trigger/TrigDataAccess/TrigSerializeResult/python/StreamerInfoGenerator.py index 341888dfc829b733546d250ec95bc6888df2429b..f9094a2a94566c9a65a88bba8b2c1403250ffc92 100755 --- a/Trigger/TrigDataAccess/TrigSerializeResult/python/StreamerInfoGenerator.py +++ b/Trigger/TrigDataAccess/TrigSerializeResult/python/StreamerInfoGenerator.py @@ -6,7 +6,7 @@ import cppyy class StreamerInfoGenerator: def __init__(self): self.debug = True - print "StreamerInfoGenerator v1.0.0" + print("StreamerInfoGenerator v1.0.0") self.classlist = [] self.problemclasses = [] #MN: ROOT6 strips std:: from types, so we need to check the names @@ -19,25 +19,25 @@ class StreamerInfoGenerator: def inspect(self, typename): - if self.debug: print 'inspecting ', typename + if self.debug: print('inspecting ', typename) dontAdd = False for b in self.blacklist: if typename.find(b) == 0: - if self.debug: print 'blacklisted ', typename + if self.debug: print('blacklisted ', typename) dontAdd = True # print self.classlist if typename in self.classlist: - if self.debug: print 'seen before ', typename + if self.debug: print('seen before ', typename) dontAdd = True try: t = self.type.ByName(typename) - print t + print(t) if t.IsFundamental(): - if self.debug: print typename, ' is fundamental' + if self.debug: print(typename, ' is fundamental') return if t.IsAbstract(): dontAdd = True @@ -48,28 +48,28 @@ class StreamerInfoGenerator: cl = cppyy.makeClass(typename) if not dontAdd: self.classlist.append(typename) except: - print 'Cannot create class of ', typename + print('Cannot create class of ', typename) t = self.type.ByName(typename) if t.IsComplete(): - if self.debug: print typename, 'is complete' + if self.debug: print(typename, 'is complete') else: - print typename, ' isn\'t complete' + print(typename, ' isn\'t complete') if t.IsPointer(): - if self.debug: print typename, ' is a pointer' + if self.debug: print(typename, ' is a pointer') elif t.IsTypedef(): - if self.debug: print typename, ' is typedef' + if self.debug: print(typename, ' is typedef') underlying = t.ToType() if (underlying): self.inspect(underlying.Name(7)) elif t.IsArray(): - print typename,' is an array' + print(typename,' is an array') elif t.IsTemplateInstance(): - print typename, ' is template' + print(typename, ' is template') if typename.find('std::')==0: - print 'std::business removed' + print('std::business removed') try: self.classlist.remove(typename) except: @@ -81,28 +81,28 @@ class StreamerInfoGenerator: ttname = tt.ToType().Name(7) self.inspect(ttname) elif t.IsClass(): - if self.debug: print typename, ' is a class' + if self.debug: print(typename, ' is a class') cname = t.Name(7) - if self.debug: print cname + if self.debug: print(cname) for i in range(t.DataMemberSize()): d = t.DataMemberAt(i) dname = d.Name() dtype = d.TypeOf().Name(7) if self.debug: - print 'DataMember: ', dname, ' ', dtype, ' transient=', d.IsTransient() + print('DataMember: ', dname, ' ', dtype, ' transient=', d.IsTransient()) if not d.IsTransient(): self.inspect(dtype) else: - print 'what to do about ', typename,'?' + print('what to do about ', typename,'?') self.problemclasses.append( typename ) return def streamers(self): - print self.classlist + print(self.classlist) if __name__ == '__main__': @@ -110,4 +110,4 @@ if __name__ == '__main__': a = StreamerInfoGenerator() a.inspect('TrigTauClusterContainer_tlp1') - print a.classlist + print(a.classlist) diff --git a/Trigger/TrigDataAccess/TrigSerializeResult/python/dictwrite.py b/Trigger/TrigDataAccess/TrigSerializeResult/python/dictwrite.py index faecef007d1e37694934fdbcf5d41605d4e57af0..6a170cc87a0dc12df529ed34f0d40a57a894ae16 100755 --- a/Trigger/TrigDataAccess/TrigSerializeResult/python/dictwrite.py +++ b/Trigger/TrigDataAccess/TrigSerializeResult/python/dictwrite.py @@ -135,7 +135,7 @@ objects = [ from collections import defaultdict streamerChecksums = defaultdict(set) -print "Reading streamerinfos from", bs_filename +print("Reading streamerinfos from", bs_filename) file = TFile(bs_filename, 'UPDATE') streamer_n = 0 if file.GetStreamerInfoList(): @@ -144,8 +144,8 @@ if file.GetStreamerInfoList(): # print i.GetName(), "%x" % i.GetCheckSum() streamerChecksums[i.GetName()].add( i.GetCheckSum() ) streamer_n += 1 -print "Read", streamer_n, 'streamers for', len(streamerChecksums), 'types' -print +print("Read", streamer_n, 'streamers for', len(streamerChecksums), 'types') +print("") if doEDM: from TrigEDMConfig.TriggerEDM import EDMDetails @@ -155,10 +155,10 @@ if doEDM: for pers in objects: SIG.inspect(pers) - print + print("") fulllist = SIG.classlist -print fulllist -print '*******************************' +print(fulllist) +print('*******************************') from CLIDComps.clidGenerator import clidGenerator @@ -170,46 +170,46 @@ types_bad = 0 fulllist = list(set(fulllist)) for item in fulllist: if doxAODonly and not 'xAOD' in item: continue # current issues seen because of missing xAOD libs not being loaded - print "Trying to fill item", item, "to root file" + print("Trying to fill item", item, "to root file") c_clid = cgen.genClidFromName(item) c_typeinfo = cgen.getTidFromClid(c_clid) - print "CLID", c_clid - print "TypeInfo", c_typeinfo + print("CLID", c_clid) + print("TypeInfo", c_typeinfo) try: cls = ROOT.gROOT.GetClass(item) except: cls = ROOT.gROOT.GetClass(c_typeinfo) - print cls + print(cls) if cls!=None: streamerinfo = cls.GetStreamerInfo() if streamerinfo.GetCheckSum() == 0: # try to patch missing checksum in DataVectors - print 'Warning: no checksum in streamerinfo for type: ', cls.GetName() - print 'Attempting to fix with 0x%x' % cls.GetCheckSum() + print('Warning: no checksum in streamerinfo for type: ', cls.GetName()) + print('Attempting to fix with 0x%x' % cls.GetCheckSum()) streamerinfo.SetCheckSum( cls.GetCheckSum() ) chksum = streamerinfo.GetCheckSum() if chksum not in streamerChecksums[cls.GetName()]: - print 'Writing: %s streamer size=%d, checksum=0x%x' %(cls.GetName(), streamerinfo.Sizeof(), chksum) + print('Writing: %s streamer size=%d, checksum=0x%x' %(cls.GetName(), streamerinfo.Sizeof(), chksum)) obj = cls.New() file.WriteObjectAny(obj, cls, cls.GetName()) types_new += 1 else: - print 'Skipping', cls.GetName(), 'streamer checksum', chksum, ' - already in the file' + print('Skipping', cls.GetName(), 'streamer checksum', chksum, ' - already in the file') types_exist += 1 else: - print 'skipping ', item + print('skipping ', item) types_bad += 1 #sys.exit() - print '----' + print('----') -print 'Wrote', types_new, 'types' -print 'Skipped', types_exist, ' existing types' -print 'Problems with', types_bad + len(SIG.problemclasses), ' types' +print('Wrote', types_new, 'types') +print('Skipped', types_exist, ' existing types') +print('Problems with', types_bad + len(SIG.problemclasses), ' types') for t in SIG.problemclasses: - print ' ', t + print(' ', t) diff --git a/Trigger/TrigDataAccess/TrigSerializeResult/share/listchecksums.py b/Trigger/TrigDataAccess/TrigSerializeResult/share/listchecksums.py index 5fb504154fadb9117b8c2ad1787515aafe9d4166..f496c5ba3ba0c321352d6f1738b39973a78cd385 100644 --- a/Trigger/TrigDataAccess/TrigSerializeResult/share/listchecksums.py +++ b/Trigger/TrigDataAccess/TrigSerializeResult/share/listchecksums.py @@ -6,8 +6,8 @@ if len(sys.argv) == 1: fname = 'bs-streamerinfos.root' else: fname = sys.argv[1] -print "Opening " + fname +print("Opening " + fname) for i in ROOT.TFile.Open(fname).GetStreamerInfoList(): if i.GetName() != 'listOfRules': - print i.GetName(), "%x" % i.GetCheckSum() + print(i.GetName(), "%x" % i.GetCheckSum()) diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx index 1ea900de788822c2a9dd9e1719bc6f1fd22dca8d..44ff7dbcb3e39471d861301a1429fd6c3aec65e5 100644 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx @@ -368,8 +368,9 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c NameH = "DL1_mv_tr_"+trigName; ATH_MSG_DEBUG( " NameH: " << NameH ); auto DL1_mv = Monitored::Scalar<double>(NameH,0.0); - if ( LLR (DL1_pu, DL1_pc, DL1_pb, DL1_mv) ) fill("TrigBjetMonitor",DL1_mv); - ATH_MSG_DEBUG(" DL1_mv: " << DL1_mv << " LLR: " << LLR); + bool theLLR = LLR (DL1_pu, DL1_pc, DL1_pb, DL1_mv); + if ( theLLR ) fill("TrigBjetMonitor",DL1_mv); + ATH_MSG_DEBUG(" DL1_mv: " << DL1_mv << " LLR: " << theLLR); NameH = "DL1r_pu_tr_"+trigName; @@ -396,8 +397,9 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c NameH = "DL1r_mv_tr_"+trigName; ATH_MSG_DEBUG( " NameH: " << NameH ); auto DL1r_mv = Monitored::Scalar<double>(NameH,0.0); - if ( LLR (DL1r_pu, DL1r_pc, DL1r_pb, DL1r_mv) ) fill("TrigBjetMonitor",DL1r_mv); - ATH_MSG_DEBUG(" DL1r_mv: " << DL1r_mv << " LLR: " << LLR); + theLLR = LLR (DL1r_pu, DL1r_pc, DL1r_pb, DL1r_mv); + if ( theLLR ) fill("TrigBjetMonitor",DL1r_mv); + ATH_MSG_DEBUG(" DL1r_mv: " << DL1r_mv << " LLR: " << theLLR); } // if (ijet == 0) diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..8fdcdae93fc93257b211b1c8156df1f60f12376a --- /dev/null +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py @@ -0,0 +1,45 @@ +# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# + +from AthenaCommon.Logging import logging +logging.getLogger().info("Importing %s",__name__) +log = logging.getLogger("TrigEgammaMonitoring.egammaMonitorPrecisionConfig") + +def egammaMonitorPrecisionCfg(name): + + from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram + monTool = GenericMonitoringTool("MonTool_"+name) + monTool.Histograms = [ + #track variables monitoring + defineHistogram('deltaEta0',title='PrecisionElectron#Delta#eta0', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaEta1',title='PrecisionElectron#Delta#eta1', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaEta2',title='PrecisionElectron#Delta#eta2', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaEta3',title='PrecisionElectron#Delta#eta3', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaPhi0',title='PrecisionElectron#Delta#eta0', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaPhi1',title='PrecisionElectron#Delta#phi1', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaPhi2',title='PrecisionElectron#Delta#phi2', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaPhi3',title='PrecisionElectron#Delta#phi3', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + + #Shower Shapes variables monitoring + defineHistogram('e237',type='TH1F', path='EXPERT',title="Electron Precision Reconstruction uncor energy in 3x7 cells in em sampling 2; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('e277', type='TH1F', path='EXPERT',title="Electron Precision Reconstruction uncor energy in 7x7 cells in em sampling 2;E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('Rhad', type='TH1F', path='EXPERT',title="Rhad",xbins=50, xmin=-1, xmax=1 ), + defineHistogram('Rhad1', type='TH1F', path='EXPERT',title="Rhad",xbins=50, xmin=-1, xmax=1 ), + defineHistogram('ethad', type='TH1F', path='EXPERT',title="Transverse energy in the first sampling of the hadronic calorimeters behind the cluster calculated from ehad1 ; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('ethad1', type='TH1F', path='EXPERT',title="ET leakage into hadronic calorimeter with exclusion of energy in CaloSampling; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('weta1', type='TH1F', path='EXPERT',title="Electron Precision Reconstruction corrected width in 3 strips in the 1st samp. ; Width",xbins=20, xmin=0, xmax=1 ), + defineHistogram('weta2', type='TH1F', path='EXPERT',title="Electron Precision Reconstruction corrected width in 3 strips in the 2st samp. ; Width",xbins=20, xmin=0, xmax=0.05 ), + defineHistogram('wtots1', type='TH1F', path='EXPERT',title="Electron Precision Reconstruction total width in em sampling 1 in 20 strips; Width",xbins=20, xmin=0, xmax=20 ), + defineHistogram('f1', type='TH1F', path='EXPERT',title="Fraction of energy found in 1st em sampling;Fraction",xbins=50, xmin=-0.1, xmax=1.1 ), + defineHistogram('f3', type='TH1F', path='EXPERT',title="Fraction of energy reconstructed in 3rd sampling ;Fraction",xbins=50, xmin=-0.1, xmax=1.1 ), + defineHistogram('eratio', type='TH1F', path='EXPERT',title="Eratio ;Count",xbins=50, xmin=0, xmax=2 ), + defineHistogram('fracs1', type='TH1F', path='EXPERT', title="Reconstruction energy outside core (E(+-7)-E(+-3))/E(+-7); E [MeV]",xbins=50, xmin=-5000, xmax=10000 ), + + #Isolation variables monitoring + defineHistogram('ptcone20', type='TH1F', path='EXPERT',title="count;ptcone20",xbins=50, xmin=0, xmax=10 ), + defineHistogram('ptcone30', type='TH1F', path='EXPERT',title="count;ptcone30",xbins=50, xmin=0, xmax=10 ), + defineHistogram('ptcone40', type='TH1F', path='EXPERT', title="count;ptcone40",xbins=50, xmin=0, xmax=10 ), + defineHistogram('topoetcone20', type='TH1F', path='EXPERT',title="count;topoetcone20[GeV]",xbins=50, xmin=-10, xmax=50 )] + + return monTool diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx index cae19181bf9b7c37976842b1db6accba9e6b3a7d..7dac9b5096cc790a63658da5ba85b9bccaed935c 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx @@ -3,12 +3,13 @@ #include "../TrigEgammaMonitorElectronAlgorithm.h" #include "../TrigEgammaMonitorPhotonAlgorithm.h" #include "../TrigEgammaMonitorTagAndProbeAlgorithm.h" +#include "../egammaMonitorElectronAlgorithm.h" DECLARE_COMPONENT(TrigEgammaMonitorBaseAlgorithm) DECLARE_COMPONENT(TrigEgammaMonitorAnalysisAlgorithm) DECLARE_COMPONENT(TrigEgammaMonitorElectronAlgorithm) DECLARE_COMPONENT(TrigEgammaMonitorPhotonAlgorithm) DECLARE_COMPONENT(TrigEgammaMonitorTagAndProbeAlgorithm) - +DECLARE_COMPONENT(egammaMonitorElectronAlgorithm) diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorElectronAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorElectronAlgorithm.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f673ba2dfb9d07a12204a0c5208b670bdd17e414 --- /dev/null +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorElectronAlgorithm.cxx @@ -0,0 +1,156 @@ +#include "egammaMonitorElectronAlgorithm.h" +#include "xAODEgamma/EgammaContainer.h" +#include "xAODEgamma/Electron.h" +#include "xAODEgamma/ElectronAuxContainer.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODCaloEvent/CaloClusterContainer.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTracking/VertexContainer.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" +#include "xAODPrimitives/IsolationType.h" +#include "StoreGate/ReadCondHandleKey.h" + + +egammaMonitorElectronAlgorithm::egammaMonitorElectronAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ): + AthAlgorithm( name, pSvcLocator ) + +{} + +StatusCode egammaMonitorElectronAlgorithm::initialize() +{ + + ATH_CHECK(m_electronsKey.initialize()); + if (!m_monTool.empty()) CHECK(m_monTool.retrieve()); + return StatusCode::SUCCESS; +} + +StatusCode egammaMonitorElectronAlgorithm::execute_r(const EventContext& ctx) const +{ + + filltopoElectronTrackCaloMatch(ctx); + filltopoElectronShowerShapes(ctx); + filltopoElectronIsolation(ctx); + return StatusCode::SUCCESS; +} + +void egammaMonitorElectronAlgorithm::filltopoElectronTrackCaloMatch( const EventContext& ctx) const{ + + SG::ReadHandle<xAOD::ElectronContainer> electrons(m_electronsKey, ctx); + + //std::vector<Delta> deltas_var0; + auto deltaEta0 = Monitored::Scalar<float>("deltaEta0",0.0); + auto deltaEta1 = Monitored::Scalar<float>("deltaEta1",0.0); + auto deltaEta2 = Monitored::Scalar<float>("deltaEta2",0.0); + auto deltaEta3 = Monitored::Scalar<float>("deltaEta3",0.0); + auto deltaPhi0 = Monitored::Scalar<float>("deltaPhi0",0.0); + auto deltaPhi1 = Monitored::Scalar<float>("deltaPhi1",0.0); + auto deltaPhi2 = Monitored::Scalar<float>("deltaPhi2",0.0); + auto deltaPhi3 = Monitored::Scalar<float>("deltaPhi3",0.0); + + + for (const auto& electron : *electrons){ + electron->trackCaloMatchValue(deltaEta0,xAOD::EgammaParameters::deltaEta0); + electron->trackCaloMatchValue(deltaEta1,xAOD::EgammaParameters::deltaEta1); + electron->trackCaloMatchValue(deltaEta2,xAOD::EgammaParameters::deltaEta2); + electron->trackCaloMatchValue(deltaEta3,xAOD::EgammaParameters::deltaEta3); + electron->trackCaloMatchValue(deltaPhi0,xAOD::EgammaParameters::deltaPhi0); + electron->trackCaloMatchValue(deltaPhi1,xAOD::EgammaParameters::deltaPhi1); + electron->trackCaloMatchValue(deltaPhi2,xAOD::EgammaParameters::deltaPhi2); + electron->trackCaloMatchValue(deltaPhi3,xAOD::EgammaParameters::deltaPhi3); + + } + + auto mon = Monitored::Group(m_monTool, deltaEta0,deltaEta1,deltaEta2,deltaEta3,deltaPhi0,deltaPhi1,deltaPhi2,deltaPhi3); + ATH_MSG_DEBUG("Electron - Track Online Monitoring in Reconstruction ..."); + + + } + +void egammaMonitorElectronAlgorithm::filltopoElectronShowerShapes( const EventContext& ctx) const{ + + SG::ReadHandle<xAOD::ElectronContainer> electrons(m_electronsKey, ctx); + ATH_MSG_DEBUG("Fill SS Reco Electron distributions: "); + + std::vector<float> e237_vec, e277_vec, ethad_vec, ethad1_vec, Rhad_vec, Rhad1_vec, Reta_vec, Rphi_vec, weta1_vec, weta2_vec, wtots1_vec, + f1_vec, f3_vec,f3core_vec, fracs1_vec, eratio_vec, DeltaE_vec, et_vec, highet_vec , eta_vec, phi_vec; + float val{-99}; + + auto e237_col = Monitored::Collection("e237" , e237_vec ); + auto e277_col = Monitored::Collection("e277" , e277_vec ); + auto ethad_col = Monitored::Collection("ethad" , ethad_vec ); + auto ethad1_col = Monitored::Collection("ethad1" , ethad1_vec ); + auto Rhad_col = Monitored::Collection("Rhad" , Rhad_vec ); + auto Rhad1_col = Monitored::Collection("Rhad1" , Rhad1_vec ); + auto Reta_col = Monitored::Collection("Reta" , Reta_vec ); + auto Rphi_col = Monitored::Collection("Rphi" , Rphi_vec ); + auto weta1_col = Monitored::Collection("weta1" , weta1_vec ); + auto weta2_col = Monitored::Collection("weta2" , weta2_vec ); + auto wtots1_col = Monitored::Collection("wtots1" , wtots1_vec ); + auto f1_col = Monitored::Collection("f1" , f1_vec ); + auto f3_col = Monitored::Collection("f3" , f3_vec ); + auto f3core_col = Monitored::Collection("f3core" , f3core_vec ); + auto fracs1_col = Monitored::Collection("fracs1" , fracs1_vec ); + auto eratio_col = Monitored::Collection("eratio" , eratio_vec ); + auto DeltaE_col = Monitored::Collection("deltaE" , DeltaE_vec ); + + for (const auto& electron : *electrons) { + + e237_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::e237)); + e277_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::e237)); + ethad_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::ethad)); + ethad1_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::ethad1)); + Rhad_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::Rhad)); + Rhad1_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::Rhad1)); + Reta_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::Reta)); + Rphi_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::Rphi)); + weta1_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::weta1)); + weta2_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::weta2)); + wtots1_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::wtots1)); + f1_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::f1)); + f3_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::f3)); + f3core_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::f3core)); + fracs1_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::fracs1)); + eratio_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::Eratio)); + DeltaE_vec.push_back(electron->showerShapeValue(val,xAOD::EgammaParameters::DeltaE)); + + + } + auto mon = Monitored::Group(m_monTool, e237_col, e277_col,ethad_col, ethad1_col, Rhad_col, Rhad1_col,Reta_col,Rphi_col,weta1_col,weta2_col,wtots1_col,f1_col,f3_col,f3core_col,fracs1_col,eratio_col,DeltaE_col); + ATH_MSG_DEBUG("Electron - ShowerShapes Online Monitoring in Reconstruction ..."); + + } + +void egammaMonitorElectronAlgorithm::filltopoElectronIsolation( const EventContext& ctx) const{ + + + SG::ReadHandle<xAOD::ElectronContainer> electrons(m_electronsKey, ctx); + std::vector<float> topoetcone20_vec, topoetcone40_shift_vec, topoetcone20_rel_vec, topoetcone40_shift_rel_vec, ptcone20_vec, ptcone30_vec, ptcone40_vec; + float val{-99}; + + auto topoetcone20_col = Monitored::Collection("topoetcone20", topoetcone20_vec); + auto ptcone20_col = Monitored::Collection("ptcone20", ptcone20_vec); + auto ptcone30_col = Monitored::Collection("ptcone30", ptcone30_vec); + auto ptcone40_col = Monitored::Collection("ptcone40", ptcone40_vec); + + + for (const auto& electron : *electrons) { + + topoetcone20_vec.push_back( electron->isolationValue(val,xAOD::Iso::topoetcone20)/Gaudi::Units::GeV); + ptcone20_vec.push_back(electron->isolationValue(val,xAOD::Iso::ptcone20)); + ptcone30_vec.push_back(electron->isolationValue(val,xAOD::Iso::ptcone30)); + ptcone40_vec.push_back(electron->isolationValue(val,xAOD::Iso::ptcone40)); + + + } + + auto mon = Monitored::Group(m_monTool,ptcone20_col, ptcone30_col, ptcone40_col, topoetcone20_col); + + ATH_MSG_DEBUG("Electron - Isolation Online Monitoring in Reconstruction ..."); + + + } + + + + diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorElectronAlgorithm.h b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorElectronAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..28b3255bec6effe51d13943ef2402012bac4cf77 --- /dev/null +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorElectronAlgorithm.h @@ -0,0 +1,57 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef egammaMonitorElectronAlgorithm_H +#define egammaMonitorElectronAlgorithm_H + + +#include "egammaMonitorElectronAlgorithm.h" +#include "AthenaMonitoringKernel/GenericMonitoringTool.h" +#include "xAODEventInfo/EventInfo.h" +#include "xAODTruth/TruthParticleContainer.h" +#include "xAODEgamma/Egamma.h" +#include "xAODEgamma/EgammaxAODHelpers.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/PhotonContainer.h" +#include "xAODTrigEgamma/TrigElectronContainer.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTrigCalo/TrigEMClusterContainer.h" +#include "xAODMissingET/MissingETContainer.h" +#include "xAODTrigger/EmTauRoIContainer.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/DataHandle.h" +#include "AthenaMonitoringKernel/Monitored.h" + + +class egammaMonitorElectronAlgorithm: public AthAlgorithm +{ + + public: + + egammaMonitorElectronAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ); + StatusCode initialize(); + virtual StatusCode execute() override final { + + return execute_r(Algorithm::getContext()); + } + + StatusCode execute_r(const EventContext& ctx) const; + + protected: + + void filltopoElectronTrackCaloMatch(const EventContext& ctx) const; + void filltopoElectronShowerShapes(const EventContext& ctx) const; + void filltopoElectronIsolation(const EventContext& ctx) const; + + + private: + SG::ReadHandleKey<xAOD::ElectronContainer> m_electronsKey{ this, "ElectronKey", "Electrons", ""}; + ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"}; +}; + + + +#endif diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/HLTMonTriggerList.py b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/HLTMonTriggerList.py index 68544140eb08d2db70f4d4bf0fbc89b7b3ac15e2..80f5e3779c49a58095627be1b7645c1ead3e4ce0 100644 --- a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/HLTMonTriggerList.py +++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/HLTMonTriggerList.py @@ -1,5 +1,5 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - + from __future__ import print_function import TrigBjetMonitoring.TrigBjetMonitCategory as bjet @@ -12,238 +12,242 @@ import TrigMuonMonitoring.TrigMuonMonitCategory as muon import TrigTauMonitoring.TrigTauMonitCategory as tau if 'DQMonFlags' not in dir(): - from AthenaMonitoring.DQMonFlags import DQMonFlags + from AthenaMonitoring.DQMonFlags import DQMonFlags class HLTMonTriggerList: - - # HLTMonTriggerList config - _configured = False - - # running mode config - _get_monitoring_mode_success = False - mc_mode = False - pp_mode = False - HI_mode = False - cosmic_mode = False - - # trigger lists - monitoring_mujet = [] - monitoring_bjet = [] - monitoring_bphys = [] - primary_bphys = [] - monitoring_egamma = [] - primary_single_ele = [] - primary_single_ele_iso = [] - primary_single_ele_cutbased = [] - primary_single_ele_cutbased_iso = [] - primary_double_ele = [] - primary_double_ele_cutbased = [] - monitoring_ele_idperf = [] - monitoring_ele_idperf_cutbased = [] - monitoring_Zee = [] - monitoring_Jpsiee = [] - primary_single_pho = [] - primary_double_pho = [] - monitoring_l1jet = [] - monitoring_jet = [] - primary_l1jet = [] - primary_jet = [] - monitoring_met_shifter = [] - monitoring_met_expert = [] - monitoring_minbias = [] - monitoring_muonNonIso = [] - monitoring_muonIso = [] - monitoring_MSonly = [] - monitoring_muonEFFS = [] - monitoring_muonLowpt = [] - monitoring_muon_Support = [] - monitoring_tau = [] - monitoring_singleTau = [] - - - def __init__(self): - if not self._configured: - self.config() - - def config(self): - - self.set_HLTMonTrigList_default() - - self._get_monitoring_mode_success = self.get_monitoring_mode() - - if self._get_monitoring_mode_success is False: - # what should be done in this case? - print ("HLTMonTriggerList: Error getting monitoring mode, default monitoring lists will be used.") - - elif self.pp_mode is True: - print ("HLTMonTriggerList: Setting up pp monitoring.") - self.set_HLTMonTrigList_pp() - - elif self.mc_mode is True: - print ("HLTMonTriggerList: Setting up MC monitoring.") - self.set_HLTMonTrigList_mc() - - elif self.HI_mode is True: - print ("HLTMonTriggerList: Setting up HI monitoring.") - self.set_HLTMonTrigList_HI() - - elif self.cosmic_mode is True: - print ("HLTMonTriggerList: Setting up cosmic monitoring.") - self.set_HLTMonTrigList_cosmic() - - self._configured = True - - - # Implementation of https://its.cern.ch/jira/browse/ATR-13200 - def get_monitoring_mode(self): - # Set monitoring mode - self.data_type = DQMonFlags.monManDataType() - - if self.data_type == 'monteCarlo': - self.mc_mode = True - return True - - elif self.data_type == 'collisions': - #singlebeam is included in collisions - self.pp_mode = True - return True - - elif self.data_type == 'heavyioncollisions': - #heavy ion is pPb or PbPb - self.HI_mode = True - return True - - elif self.data_type == 'cosmics': - self.cosmic_mode = True - return True - - else: - return False - - - # Config of default/running mode independent monitoring lists - def set_HLTMonTrigList_default(self): - # Monitoring lists (defaults) which are independent of running mode: - # These are the trigger lists that will be used unless they are overwritten based on the running mode. In this way the trigger lists can be updated based on running mode with no risk of a signature being left unmonitored - - # set the bjet and mujet triggers to the default values - self.monitoring_bjet = bjet.monitoring_bjet - self.monitoring_mujet = bjet.monitoring_mujet - - # set the bphys triggers to the default values - self.monitoring_bphys = bphys.monitoring_bphys - self.primary_bphys = bphys.primary_bphys - - # set the egamma triggers to the default values - self.monitoring_egamma = egamma.monitoring_egamma - self.primary_single_ele = egamma.primary_single_ele - self.primary_single_ele_iso = egamma.primary_single_ele_iso - self.primary_single_ele_cutbased = egamma.primary_single_ele_cutbased - self.primary_single_ele_cutbased_iso = egamma.primary_single_ele_cutbased_iso - self.primary_double_ele = egamma.primary_double_ele - self.primary_double_ele_cutbased = egamma.primary_double_ele_cutbased - self.monitoring_ele_idperf = egamma.monitoring_ele_idperf - self.monitoring_ele_idperf_cutbased = egamma.monitoring_ele_idperf_cutbased - self.monitoring_Zee = egamma.monitoring_Zee - self.monitoring_Jpsiee = egamma.monitoring_Jpsiee - self.primary_single_pho = egamma.primary_single_pho - self.primary_double_pho = egamma.primary_double_pho - - # set the jet triggers to the default values - self.monitoring_l1jet = jets.monitoring_l1jet - self.monitoring_jet = jets.monitoring_jet - self.primary_l1jet = jets.primary_l1jet - self.primary_jet = jets.primary_jet - - # set the met triggers to the default values - self.monitoring_met_shifter = met.monitoring_met_shifter - self.monitoring_met_expert = met.monitoring_met_expert - - # set the minbias triggers to the default values - self.monitoring_minbias = minbias.monitoring_minbias - - # set the muon triggers to the default values - self.monitoring_muonNonIso = muon.monitoring_muonNonIso - self.monitoring_muonIso = muon.monitoring_muonIso - self.monitoring_MSonly = muon.monitoring_MSonly - self.monitoring_muonEFFS = muon.monitoring_muonEFFS - self.monitoring_muonLowpt = muon.monitoring_muonLowpt - self.monitoring_muon_Support = muon.monitoring_muon_Support - - # set the tau triggers to the default values - self.monitoring_tau = tau.monitoring_tau - self.monitoring_singleTau = tau.monitoring_singleTau - - - # Config of monitoring lists which are dependent on running mode - def set_HLTMonTrigList_pp(self): - self.monitoring_bjet = bjet.monitoring_bjet_pp - self.monitoring_mujet = bjet.monitoring_mujet_pp - - self.primary_bphys = bphys.primary_bphys_pp - - self.monitoring_l1jet = jets.monitoring_l1jet_pp - self.monitoring_jet = jets.monitoring_jet_pp - self.primary_l1jet = jets.primary_l1jet_pp - self.primary_jet = jets.primary_jet_pp - - self.monitoring_met_shifter = met.monitoring_met_shifter_pp - self.monitoring_met_expert = met.monitoring_met_expert_pp - - self.monitoring_muonNonIso = muon.monitoring_muonNonIso_pp - self.monitoring_muonIso = muon.monitoring_muonIso_pp - self.monitoring_MSonly = muon.monitoring_MSonly_pp - self.monitoring_muonEFFS = muon.monitoring_muonEFFS_pp - self.monitoring_muonLowpt = muon.monitoring_muonLowpt - self.monitoring_muon_Support = muon.monitoring_muon_Support_pp - - self.monitoring_tau = tau.monitoring_tau_pp - - def set_HLTMonTrigList_HI(self): - self.monitoring_bjet = bjet.monitoring_bjet_hi - self.monitoring_mujet = bjet.monitoring_mujet_hi - - self.primary_bphys = bphys.primary_bphys_hi - - self.monitoring_l1jet = jets.monitoring_l1jet_hi - self.monitoring_jet = jets.monitoring_jet_hi - self.primary_l1jet = jets.primary_l1jet_hi - self.primary_jet = jets.primary_jet_hi - - self.monitoring_met_shifter = [] - self.monitoring_met_expert = [] - - self.monitoring_muonNonIso = muon.monitoring_muonNonIso_HI - self.monitoring_muonIso = muon.monitoring_muonIso_HI - self.monitoring_MSonly = muon.monitoring_MSonly_HI - self.monitoring_muonEFFS = muon.monitoring_muonEFFS_HI - self.monitoring_muonLowpt = muon.monitoring_muonLowpt - self.monitoring_muon_Support = muon.monitoring_muon_Support_HI - - def set_HLTMonTrigList_cosmic (self): - self.monitoring_bjet = bjet.monitoring_bjet_cosmic - - self.monitoring_l1jet = jets.monitoring_l1jet_cosmic - self.monitoring_jet = jets.monitoring_jet_cosmic - self.primary_l1jet = jets.primary_l1jet_cosmic - self.primary_jet = jets.primary_jet_cosmic - - self.monitoring_met_shifter = met.monitoring_met_shifter_cosmic - self.monitoring_met_expert = met.monitoring_met_expert_cosmic - - self.monitoring_tau = tau.monitoring_tau_cosmic - self.monitoring_singleTau = tau.monitoring_singleTau_cosmic - - def set_HLTMonTrigList_mc(self): - self.monitoring_bjet = bjet.monitoring_bjet_validation - self.monitoring_mujet = bjet.monitoring_mujet_validation - - self.monitoring_l1jet = jets.monitoring_l1jet_validation - self.monitoring_jet = jets.monitoring_jet_validation - self.primary_l1jet = jets.primary_l1jet_validation - self.primary_jet = jets.primary_jet_validation - - self.monitoring_tau = tau.monitoring_tau_validation - - + + # HLTMonTriggerList config + _configured = False + + # running mode config + _get_monitoring_mode_success = False + mc_mode = False + pp_mode = False + HI_mode = False + cosmic_mode = False + + # trigger lists + monitoring_mujet = [] + monitoring_bjet = [] + monitoring_bphys = [] + primary_bphys = [] + monitoring_egamma = [] + primary_single_ele = [] + primary_single_ele_iso = [] + primary_single_ele_cutbased = [] + primary_single_ele_cutbased_iso = [] + primary_double_ele = [] + primary_double_ele_cutbased = [] + monitoring_ele_idperf = [] + monitoring_ele_idperf_cutbased = [] + monitoring_Zee = [] + monitoring_Jpsiee = [] + primary_single_pho = [] + primary_double_pho = [] + monitoring_l1jet = [] + monitoring_jet = [] + primary_l1jet = [] + primary_jet = [] + monitoring_met_shifter = [] + monitoring_met_expert = [] + monitoring_minbias = [] + monitoring_muonNonIso = [] + monitoring_muonIso = [] + monitoring_MSonly = [] + monitoring_muonEFFS = [] + monitoring_muonLowpt = [] + monitoring_muon_Support = [] + monitoring_tau = [] + monitoring_singleTau = [] + + + def __init__(self): + if not self._configured: + self.config() + + def config(self): + + self.set_HLTMonTrigList_default() + + self._get_monitoring_mode_success = self.get_monitoring_mode() + + if self._get_monitoring_mode_success is False: + # what should be done in this case? + print ("HLTMonTriggerList: Error getting monitoring mode, default monitoring lists will be used.") + + elif self.pp_mode is True: + print ("HLTMonTriggerList: Setting up pp monitoring.") + self.set_HLTMonTrigList_pp() + + elif self.mc_mode is True: + print ("HLTMonTriggerList: Setting up MC monitoring.") + self.set_HLTMonTrigList_mc() + + elif self.HI_mode is True: + print ("HLTMonTriggerList: Setting up HI monitoring.") + self.set_HLTMonTrigList_HI() + + elif self.cosmic_mode is True: + print ("HLTMonTriggerList: Setting up cosmic monitoring.") + self.set_HLTMonTrigList_cosmic() + + self._configured = True + + + # Implementation of https://its.cern.ch/jira/browse/ATR-13200 + def get_monitoring_mode(self): + # Set monitoring mode + self.data_type = DQMonFlags.monManDataType() + + if self.data_type == 'monteCarlo': + self.mc_mode = True + return True + + elif self.data_type == 'collisions': + #singlebeam is included in collisions + self.pp_mode = True + return True + + elif self.data_type == 'heavyioncollisions': + #heavy ion is pPb or PbPb + self.HI_mode = True + return True + + elif self.data_type == 'cosmics': + self.cosmic_mode = True + return True + + else: + return False + + + # Config of default/running mode independent monitoring lists + def set_HLTMonTrigList_default(self): + # Monitoring lists (defaults) which are independent of running mode: + # These are the trigger lists that will be used unless they are overwritten based on the running mode. In this way the trigger lists can be updated based on running mode with no risk of a signature being left unmonitored + + # set the bjet and mujet triggers to the default values + self.monitoring_bjet = bjet.monitoring_bjet + self.monitoring_mujet = bjet.monitoring_mujet + + # set the bphys triggers to the default values + self.monitoring_bphys = bphys.monitoring_bphys + self.primary_bphys = bphys.primary_bphys + + # set the egamma triggers to the default values + self.monitoring_egamma = egamma.monitoring_egamma + self.primary_single_ele = egamma.primary_single_ele + self.primary_single_ele_iso = egamma.primary_single_ele_iso + self.primary_single_ele_cutbased = egamma.primary_single_ele_cutbased + self.primary_single_ele_cutbased_iso = egamma.primary_single_ele_cutbased_iso + self.primary_double_ele = egamma.primary_double_ele + self.primary_double_ele_cutbased = egamma.primary_double_ele_cutbased + self.monitoring_ele_idperf = egamma.monitoring_ele_idperf + self.monitoring_ele_idperf_cutbased = egamma.monitoring_ele_idperf_cutbased + self.monitoring_Zee = egamma.monitoring_Zee + self.monitoring_Jpsiee = egamma.monitoring_Jpsiee + self.primary_single_pho = egamma.primary_single_pho + self.primary_double_pho = egamma.primary_double_pho + + # set the jet triggers to the default values + self.monitoring_l1jet = jets.monitoring_l1jet + self.monitoring_jet = jets.monitoring_jet + self.primary_l1jet = jets.primary_l1jet + self.primary_jet = jets.primary_jet + + # set the met triggers to the default values + self.monitoring_met_shifter = met.monitoring_met_shifter + self.monitoring_met_expert = met.monitoring_met_expert + + # set the minbias triggers to the default values + self.monitoring_minbias = minbias.monitoring_minbias + + # set the muon triggers to the default values + self.monitoring_muonNonIso = muon.monitoring_muonNonIso + self.monitoring_muonIso = muon.monitoring_muonIso + self.monitoring_MSonly = muon.monitoring_MSonly + self.monitoring_muonEFFS = muon.monitoring_muonEFFS + self.monitoring_muonLowpt = muon.monitoring_muonLowpt + self.monitoring_muon_Support = muon.monitoring_muon_Support + + # set the tau triggers to the default values + self.monitoring_tau = tau.monitoring_tau + self.monitoring_singleTau = tau.monitoring_singleTau + + + # Config of monitoring lists which are dependent on running mode + def set_HLTMonTrigList_pp(self): + self.monitoring_bjet = bjet.monitoring_bjet_pp + self.monitoring_mujet = bjet.monitoring_mujet_pp + + self.primary_bphys = bphys.primary_bphys_pp + + self.monitoring_l1jet = jets.monitoring_l1jet_pp + self.monitoring_jet = jets.monitoring_jet_pp + self.primary_l1jet = jets.primary_l1jet_pp + self.primary_jet = jets.primary_jet_pp + + self.monitoring_met_shifter = met.monitoring_met_shifter_pp + self.monitoring_met_expert = met.monitoring_met_expert_pp + + self.monitoring_muonNonIso = muon.monitoring_muonNonIso_pp + self.monitoring_muonIso = muon.monitoring_muonIso_pp + self.monitoring_MSonly = muon.monitoring_MSonly_pp + self.monitoring_muonEFFS = muon.monitoring_muonEFFS_pp + self.monitoring_muonLowpt = muon.monitoring_muonLowpt + self.monitoring_muon_Support = muon.monitoring_muon_Support_pp + + self.monitoring_tau = tau.monitoring_tau_pp + + #override if both pp and MC are true + if DQMonFlags.monManDataType()=='monteCarlo': + self.monitoring_tau = tau.monitoring_tau_validation + + def set_HLTMonTrigList_HI(self): + self.monitoring_bjet = bjet.monitoring_bjet_hi + self.monitoring_mujet = bjet.monitoring_mujet_hi + + self.primary_bphys = bphys.primary_bphys_hi + + self.monitoring_l1jet = jets.monitoring_l1jet_hi + self.monitoring_jet = jets.monitoring_jet_hi + self.primary_l1jet = jets.primary_l1jet_hi + self.primary_jet = jets.primary_jet_hi + + self.monitoring_met_shifter = [] + self.monitoring_met_expert = [] + + self.monitoring_muonNonIso = muon.monitoring_muonNonIso_HI + self.monitoring_muonIso = muon.monitoring_muonIso_HI + self.monitoring_MSonly = muon.monitoring_MSonly_HI + self.monitoring_muonEFFS = muon.monitoring_muonEFFS_HI + self.monitoring_muonLowpt = muon.monitoring_muonLowpt + self.monitoring_muon_Support = muon.monitoring_muon_Support_HI + + def set_HLTMonTrigList_cosmic (self): + self.monitoring_bjet = bjet.monitoring_bjet_cosmic + + self.monitoring_l1jet = jets.monitoring_l1jet_cosmic + self.monitoring_jet = jets.monitoring_jet_cosmic + self.primary_l1jet = jets.primary_l1jet_cosmic + self.primary_jet = jets.primary_jet_cosmic + + self.monitoring_met_shifter = met.monitoring_met_shifter_cosmic + self.monitoring_met_expert = met.monitoring_met_expert_cosmic + + self.monitoring_tau = tau.monitoring_tau_cosmic + self.monitoring_singleTau = tau.monitoring_singleTau_cosmic + + def set_HLTMonTrigList_mc(self): + self.monitoring_bjet = bjet.monitoring_bjet_validation + self.monitoring_mujet = bjet.monitoring_mujet_validation + + self.monitoring_l1jet = jets.monitoring_l1jet_validation + self.monitoring_jet = jets.monitoring_jet_validation + self.primary_l1jet = jets.primary_l1jet_validation + self.primary_jet = jets.primary_jet_validation + + self.monitoring_tau = tau.monitoring_tau_validation + + hltmonList = HLTMonTriggerList() diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py index aa18add7adfcf44313f1a3f52bd660b87e5debad..1533991b8e8f0a0a11faa5bdccea729641f10b5e 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py @@ -10,7 +10,7 @@ def EFMuonMonConfig(helper): monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT') # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20'] + monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_2mu14_L12MU10'] monAlg.Group = GroupName # configuration of etaphi2D and Ratio plots for non-specific chain @@ -37,7 +37,6 @@ def EFMuonMonConfig(helper): for chain in monAlg.MonitoredChains: histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/EFMuon/'+chain) - # basic EDM variables # EFSA diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py index c28dd2979f506cafd178f7aa536b3834271f20f5..bf6f3fff3c88ca29a94d22901cb1e5be1519d905 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py @@ -10,7 +10,7 @@ def L2MuonSAMonConfig(helper): monAlg = helper.addAlgorithm(CompFactory.L2MuonSAMonMT,'L2MuonSAMonMT') # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20'] + monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_2mu14_L12MU10'] monAlg.Group = GroupName # configuration of etaphi2D and Ratio plots for non-specific chain diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py index d76221f436dd48ab321dee9da0321921ef06fc1c..27742b57f752ffd486bbb871170325922f187316 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py @@ -10,7 +10,7 @@ def L2muCombMonConfig(helper): monAlg = helper.addAlgorithm(CompFactory.L2muCombMonMT,'L2muCombMonMT') # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20'] + monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_2mu14_L12MU10'] monAlg.Group = GroupName # configuration of etaphi2D and Ratio plots for non-specific chain diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py index b5267dbe59889f01de992b3045e9215172b9fc17..eeae591308ee1767a0b9f018e127dd5d0e674db2 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py @@ -22,8 +22,8 @@ def TrigMuonEfficiencyMonTTbarConfig(helper): from AthenaConfiguration.ComponentFactory import CompFactory # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - # To do: add multi-muon chain and msonly chain - Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20'] + # To do: add noL1 chain + Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_mu14_L1MU10'] for chain in Chains: monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ttbar_'+chain) @@ -31,7 +31,6 @@ def TrigMuonEfficiencyMonTTbarConfig(helper): monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.Method = 'TTbarTagAndProbe' - monAlg.MuonType = ROOT.xAOD.Muon_v1.Combined monAlg.MonitoredChains = [chain] threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups() monAlg.L1Seeds = [regex('L1MU').sub('L1_MU', level1)] @@ -41,9 +40,7 @@ def TrigMuonEfficiencyMonTTbarConfig(helper): GroupName = 'Eff_ttbar_'+chain histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/Efficiency/ttbar/'+chain) - if "ivar" not in chain: - monAlg.doEFIso = False - + PlotConfig(monAlg, chain) defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain) return @@ -54,8 +51,8 @@ def TrigMuonEfficiencyMonZTPConfig(helper): from AthenaConfiguration.ComponentFactory import CompFactory # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - # To do: add multi-muon chain and msonly chain - Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20'] + # To do: add noL1 chain + Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_mu14_L1MU10'] for chain in Chains: monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ZTP_'+chain) @@ -63,7 +60,6 @@ def TrigMuonEfficiencyMonZTPConfig(helper): monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.Method = 'ZTagAndProbe' - monAlg.MuonType = ROOT.xAOD.Muon_v1.Combined monAlg.MonitoredChains = [chain] threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups() monAlg.L1Seeds = [regex('L1MU').sub('L1_MU', level1)] @@ -73,15 +69,30 @@ def TrigMuonEfficiencyMonZTPConfig(helper): GroupName = 'Eff_ZTP_'+chain histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/Efficiency/ZTP/'+chain) - if "ivar" not in chain: - monAlg.doEFIso = False - + PlotConfig(monAlg, chain) defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain) return +def PlotConfig(monAlg, chain): + + if "msonly" in chain: + monAlg.MuonType = ROOT.xAOD.Muon_v1.MuonStandAlone + else: + monAlg.MuonType = ROOT.xAOD.Muon_v1.Combined + + if "msonly" in chain: + monAlg.doL2CB = False + monAlg.doEFCB = False + if "ivar" not in chain: + monAlg.doEFIso = False + + if "0eta105" in chain: + monAlg.BarrelOnly = True + + def defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain): def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax): @@ -93,51 +104,55 @@ def defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain): title='L1MU Efficiency '+chain+';'+xlabel+';Efficiency', type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_Upstream', - title='L2MuonSA Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', - cutmask=GroupName+'_L1pass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - - histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_offlineCB', - title='L2MuonSA Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - - histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_Upstream', - title='L2muComb Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', - cutmask=GroupName+'_L2SApass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + if monAlg.doL2SA: + histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_Upstream', + title='L2MuonSA Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', + cutmask=GroupName+'_L1pass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + + histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_offlineCB', + title='L2MuonSA Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + + if monAlg.doL2CB: + histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_Upstream', + title='L2muComb Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', + cutmask=GroupName+'_L2SApass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_offlineCB', - title='L2muComb Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_offlineCB', + title='L2muComb Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_Upstream', - title='EFSA Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', - cutmask=GroupName+'_L2CBpass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + if monAlg.doEFSA: + histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_Upstream', + title='EFSA Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', + cutmask=GroupName+'_L2CBpass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB', - title='EFSA Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB', + title='EFSA Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB_passedL2SA', - title='EFSA Muon Efficiency passed L2SA '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - cutmask=GroupName+'_L2SApass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB_passedL2SA', + title='EFSA Muon Efficiency passed L2SA '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + cutmask=GroupName+'_L2SApass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_Upstream', - title='EFCB Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', - cutmask=GroupName+'_EFSApass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + if monAlg.doEFCB: + histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_Upstream', + title='EFCB Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', + cutmask=GroupName+'_EFSApass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB', - title='EFCB Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB', + title='EFCB Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB_passedL2CB', - title='EFCB Muon Efficiency passed L2CB '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - cutmask=GroupName+'_L2CBpass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB_passedL2CB', + title='EFCB Muon Efficiency passed L2CB '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + cutmask=GroupName+'_L2CBpass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) if monAlg.doEFIso: diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx index b97e9f985b752bfe0b003815aa4c9defb5076aad..92b072e62eeebd8235578fc725969b1efc1a48f8 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx @@ -20,6 +20,17 @@ StatusCode EFMuonMonMT :: initialize(){ ATH_CHECK( m_MStrackContainerKey.initialize() ); ATH_CHECK( m_CBtrackContainerKey.initialize() ); ATH_CHECK( m_muonIso30Key.initialize() ); + + for( std::string chain : m_monitored_chains ){ + m_doEFSA[chain] = true; + + if( chain.find("msonly") != std::string::npos ) m_doEFCB[chain] = false; + else m_doEFCB[chain] = true; + + if( chain.find("ivar") != std::string::npos ) m_doEFIso[chain] = true; + else m_doEFIso[chain] = false; + } + return sc; } @@ -31,65 +42,71 @@ StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext &ctx, const s const float ZERO_LIMIT = 0.00001; // EFSA - std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContSA = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_Muons_.*"); - - for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muSALinkInfo : featureContSA) { - ATH_CHECK( muSALinkInfo.isValid() ); - const ElementLink<xAOD::MuonContainer> muSAEL = muSALinkInfo.link; - if ( (*muSAEL)->muonType() != xAOD::Muon::MuonType::MuonStandAlone ) continue; - - auto EFSAPt = Monitored::Scalar<float>(chain+"_EFSA_Pt", -999.); - auto EFSAEta = Monitored::Scalar<float>(chain+"_EFSA_Eta", -999.); - auto EFSAPhi = Monitored::Scalar<float>(chain+"_EFSA_Phi", -999.); - - EFSAPt = (*muSAEL)->pt()/1e3 * (*muSAEL)->charge(); - EFSAEta = (*muSAEL)->eta(); - EFSAPhi = (*muSAEL)->phi(); - - fill(m_group+"_"+chain, EFSAPt, EFSAEta, EFSAPhi); + if( m_doEFSA.at(chain) ){ + std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContSA = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_Muons_.*"); + + for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muSALinkInfo : featureContSA) { + ATH_CHECK( muSALinkInfo.isValid() ); + const ElementLink<xAOD::MuonContainer> muSAEL = muSALinkInfo.link; + if ( (*muSAEL)->muonType() != xAOD::Muon::MuonType::MuonStandAlone ) continue; + + auto EFSAPt = Monitored::Scalar<float>(chain+"_EFSA_Pt", -999.); + auto EFSAEta = Monitored::Scalar<float>(chain+"_EFSA_Eta", -999.); + auto EFSAPhi = Monitored::Scalar<float>(chain+"_EFSA_Phi", -999.); + + EFSAPt = (*muSAEL)->pt()/1e3 * (*muSAEL)->charge(); + EFSAEta = (*muSAEL)->eta(); + EFSAPhi = (*muSAEL)->phi(); + + fill(m_group+"_"+chain, EFSAPt, EFSAEta, EFSAPhi); + } } // EFCB - std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContCB = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsCB.*"); - - for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muCBLinkInfo : featureContCB) { - ATH_CHECK( muCBLinkInfo.isValid() ); - const ElementLink<xAOD::MuonContainer> muCBEL = muCBLinkInfo.link; - if ( (*muCBEL)->muonType() != xAOD::Muon::MuonType::Combined ) continue; - - auto EFCBPt = Monitored::Scalar<float>(chain+"_EFCB_Pt", -999.); - auto EFCBEta = Monitored::Scalar<float>(chain+"_EFCB_Eta", -999.); - auto EFCBPhi = Monitored::Scalar<float>(chain+"_EFCB_Phi", -999.); - - EFCBPt = (*muCBEL)->pt()/1e3 * (*muCBEL)->charge(); - EFCBEta = (*muCBEL)->eta(); - EFCBPhi = (*muCBEL)->phi(); - - fill(m_group+"_"+chain, EFCBPt, EFCBEta, EFCBPhi); + if( m_doEFCB.at(chain) ){ + std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContCB = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsCB.*"); + + for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muCBLinkInfo : featureContCB) { + ATH_CHECK( muCBLinkInfo.isValid() ); + const ElementLink<xAOD::MuonContainer> muCBEL = muCBLinkInfo.link; + if ( (*muCBEL)->muonType() != xAOD::Muon::MuonType::Combined ) continue; + + auto EFCBPt = Monitored::Scalar<float>(chain+"_EFCB_Pt", -999.); + auto EFCBEta = Monitored::Scalar<float>(chain+"_EFCB_Eta", -999.); + auto EFCBPhi = Monitored::Scalar<float>(chain+"_EFCB_Phi", -999.); + + EFCBPt = (*muCBEL)->pt()/1e3 * (*muCBEL)->charge(); + EFCBEta = (*muCBEL)->eta(); + EFCBPhi = (*muCBEL)->phi(); + + fill(m_group+"_"+chain, EFCBPt, EFCBEta, EFCBPhi); + } } // EFIso - std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContIso = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsIso"); - for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muIsoLinkInfo : featureContIso) { - ATH_CHECK( muIsoLinkInfo.isValid() ); - const ElementLink<xAOD::MuonContainer> muIsoEL = muIsoLinkInfo.link; - if ( (*muIsoEL)->muonType() != xAOD::Muon::MuonType::Combined ) continue; - - // basic variables used decision - auto PtCone03 = Monitored::Scalar<float>(chain+"_PtCone03",-999.); - auto PtCone03overMuonPt = Monitored::Scalar<float>(chain+"_PtCone03overMuonPt",-999.); - - SG::ReadDecorHandle<xAOD::MuonContainer, double> muonIso30 ( m_muonIso30Key, ctx ); - float ptcone30 = muonIso30(*(*muIsoEL)); - - if (ptcone30 > ZERO_LIMIT ){ - PtCone03 = ptcone30/1e3; - PtCone03overMuonPt = ptcone30 / (*muIsoEL)->pt(); + if( m_doEFIso.at(chain) ){ + std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContIso = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsIso"); + for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muIsoLinkInfo : featureContIso) { + ATH_CHECK( muIsoLinkInfo.isValid() ); + const ElementLink<xAOD::MuonContainer> muIsoEL = muIsoLinkInfo.link; + if ( (*muIsoEL)->muonType() != xAOD::Muon::MuonType::Combined ) continue; + + // basic variables used decision + auto PtCone03 = Monitored::Scalar<float>(chain+"_PtCone03",-999.); + auto PtCone03overMuonPt = Monitored::Scalar<float>(chain+"_PtCone03overMuonPt",-999.); + + SG::ReadDecorHandle<xAOD::MuonContainer, double> muonIso30 ( m_muonIso30Key, ctx ); + float ptcone30 = muonIso30(*(*muIsoEL)); + + if (ptcone30 > ZERO_LIMIT ){ + PtCone03 = ptcone30/1e3; + PtCone03overMuonPt = ptcone30 / (*muIsoEL)->pt(); + } + + fill(m_group+"_"+chain, PtCone03, PtCone03overMuonPt); } - - fill(m_group+"_"+chain, PtCone03, PtCone03overMuonPt); } return StatusCode::SUCCESS; @@ -107,7 +124,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext // OfflineSA - if( OfflineSATrack ){ + if( m_doEFSA.at(chain) && OfflineSATrack ){ auto OfflineSAPt = Monitored::Scalar<float>(chain+"_OfflineSA_Pt",-999.); auto OfflineSAEta = Monitored::Scalar<float>(chain+"_OfflineSA_Eta",-999.); auto OfflineSAPhi = Monitored::Scalar<float>(chain+"_OfflineSA_Phi",-999.); @@ -177,7 +194,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext // OfflineCB - if( OfflineCBTrack ){ + if( m_doEFCB.at(chain) && OfflineCBTrack ){ auto OfflineCBPt = Monitored::Scalar<float>(chain+"_OfflineCB_Pt",-999.); auto OfflineCBEta = Monitored::Scalar<float>(chain+"_OfflineCB_Eta",-999.); auto OfflineCBPhi = Monitored::Scalar<float>(chain+"_OfflineCB_Phi",-999.); @@ -249,7 +266,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext // offoine isolation variable float OfflineIsoptcone30=-1.; mu->isolation(OfflineIsoptcone30, xAOD::Iso::IsolationType::ptvarcone30); - if ( OfflineIsoptcone30 > ZERO_LIMIT ){ + if ( m_doEFIso.at(chain) && OfflineIsoptcone30 > ZERO_LIMIT ){ auto OfflineIsoPtCone03 = Monitored::Scalar<float>(chain+"_OfflineIsoPtCone03",-999.); auto OfflineIsoPtCone03overMuonPt = Monitored::Scalar<float>(chain+"_OfflineIsoPtCone03overMuonPt",-999.); diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h index 59bca7ce2fd103a52945fb36a6fc0a6138d536e4..e0248264e289f2cbf60e37100a3194a7a8246a34 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h @@ -31,7 +31,9 @@ class EFMuonMonMT : public TrigMuonMonitorAlgorithm{ SG::ReadHandleKey<xAOD::TrackParticleContainer> m_CBtrackContainerKey {this, "CBtrackContainerName", "HLT_CBCombinedMuon_RoITrackParticles", "EFCBMuon container"}; SG::ReadDecorHandleKey<xAOD::MuonContainer> m_muonIso30Key {this, "MuonIso03Name", "HLT_MuonsIso.ptcone03", "Isolation in ptcone03" }; - + std::map<std::string, bool> m_doEFSA {}; + std::map<std::string, bool> m_doEFCB {}; + std::map<std::string, bool> m_doEFIso {}; }; #endif //TRIGMUONMONITORINGMT_EFMUONMONMT_H diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.cxx index 363ad0adcdaa68a75067520f764960afbe95adf7..4fb627e73ca965f30187fbbc683a1ec39fd0642b 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.cxx @@ -211,17 +211,23 @@ StatusCode TrigMuonEfficiencyMonMT :: selectMuonsTagAndProbe(SG::ReadHandle<xAOD bool pass1 = false; bool pass2 = false; - m_matchTool->matchEFCB(dimu.first, m_tag_trig, pass1); - m_matchTool->matchEFCB(dimu.second, m_tag_trig, pass2); + m_matchTool->matchEFIso(dimu.first, m_tag_trig, pass1); + m_matchTool->matchEFIso(dimu.second, m_tag_trig, pass2); if(pass1){ if(std::find(probes.begin(), probes.end(), dimu.second)==probes.end()){ - probes.push_back(dimu.second); + if(m_BarrelOnly){ + if( std::abs( dimu.second->eta() ) > 0. && std::abs( dimu.second->eta() ) < 1.05 ) probes.push_back(dimu.second); + } + else probes.push_back(dimu.second); } } if(pass2){ if(std::find(probes.begin(), probes.end(), dimu.first)==probes.end()){ - probes.push_back(dimu.first); + if(m_BarrelOnly){ + if( std::abs( dimu.first->eta() ) > 0. && std::abs( dimu.first->eta() ) < 1.05 ) probes.push_back(dimu.first); + } + else probes.push_back(dimu.first); } } } diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.h index 7210665c5e7f1688b37c740049ffad9da51bd874..7850fc077746d3430b0108bdf95d290d14af0d20 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.h +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.h @@ -42,6 +42,7 @@ class TrigMuonEfficiencyMonMT : public TrigMuonMonitorAlgorithm{ Gaudi::Property<bool> m_doEFSA {this, "doEFSA", true, "Flag to analyze EFSA"}; Gaudi::Property<bool> m_doEFCB {this, "doEFCB", true, "Flag to analyze EFCB"}; Gaudi::Property<bool> m_doEFIso {this, "doEFIso", true, "Flag to analyze EFIso"}; + Gaudi::Property<bool> m_BarrelOnly {this, "BarrelOnly", false, "Flag to BarrelOnly"}; Gaudi::Property<bool> m_use_extrapolator {this, "UseExtrapolator", false, "Flag to activate the track extrapolator"}; Gaudi::Property<double> m_mass_lowlim {this, "MassLowLim", 81., "Lower mass limit for the tag and probe method"}; Gaudi::Property<double> m_mass_highlim {this, "MassHighLim", 101., "Higher mass limit for the tag and probe method"}; diff --git a/Trigger/TrigSteer/L1Decoder/python/L1DecoderMonitoring.py b/Trigger/TrigSteer/L1Decoder/python/L1DecoderMonitoring.py index e4a21e28fd2ec5b3c8ae00c28f7e07c4b6f820a5..0b42e6ceb78d65d53b39af6fef190c58593167d6 100644 --- a/Trigger/TrigSteer/L1Decoder/python/L1DecoderMonitoring.py +++ b/Trigger/TrigSteer/L1Decoder/python/L1DecoderMonitoring.py @@ -34,4 +34,7 @@ def PrescalingMonitoring(): tool.defineHistogram('LB,HLTPSK', path='EXPERT', type='TH2I', opt='kAddBinsDynamically', title='HLT prescale key used in LB;Lumiblock;HLTPSK', xbins=100, xmin=0, xmax=100, ybins=5, ymin=0, ymax=5) + tool.defineHistogram('Random', path='EXPERT', type='TH1F', + title='Random number distribution;random number', + xbins=100, xmin=0, xmax=1) return tool diff --git a/Trigger/TrigSteer/L1Decoder/src/PrescalingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/PrescalingTool.cxx index 458ba6cb56d746418bfbe21591063ed662acc00b..4632db4a014fc56be8aaab34384a4390b52146b3 100644 --- a/Trigger/TrigSteer/L1Decoder/src/PrescalingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/PrescalingTool.cxx @@ -91,7 +91,12 @@ StatusCode PrescalingTool::prescaleChains( const EventContext& ctx, try { const auto & prescale = hltPrescaleSet->prescale( ch.numeric() ); if( prescale.enabled ) { - decisionToKeep = engine->flat() < 1./prescale.prescale; + auto flat = engine->flat(); + if(ch.numeric() == 843341480) { // this is to explicitly monitor the chain HLT_costmonitor_CostMonDS_L1All (hash 843341480) + auto mon_rndm = Monitored::Scalar<double>("Random", flat); + Monitored::Group(m_monTool, mon_rndm); + } + decisionToKeep = flat < 1./prescale.prescale; ATH_MSG_DEBUG("Prescaling decision for chain " << ch << " " << decisionToKeep ); } else { decisionToKeep = false; diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx index e5f4ed71f450743b658560d647ab847daaa45a3a..a39aa0c19116dbf36635b1810af01a9b4b0a2aea 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx +++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx @@ -178,15 +178,19 @@ StatusCode TriggerEDMDeserialiserAlg::deserialise( const Payload* dataptr ) c } if ( isxAODInterfaceContainer ) { + static const RootType vbase = RootType::ByNameNoQuiet( "SG::AuxVectorBase" ); currentAuxStore = nullptr; // the store will be following, setting it to nullptr assure we catch issue with of missing Aux - xAODInterfaceContainer = reinterpret_cast<SG::AuxVectorBase*>(dataBucket->object()); + xAODInterfaceContainer = + reinterpret_cast<SG::AuxVectorBase*>(classDesc.Cast (vbase, dataBucket->object(), true)); } else if ( isxAODAuxContainer ) { ATH_CHECK( key.back() == '.' ); ATH_CHECK( std::count( key.begin(), key.end(), '.') == 1 ); ATH_CHECK( currentAuxStore == nullptr ); ATH_CHECK( xAODInterfaceContainer != nullptr ); - - xAOD::AuxContainerBase* auxHolder = reinterpret_cast<xAOD::AuxContainerBase*>(dataBucket->object()); + + static const RootType auxinterface = RootType::ByNameNoQuiet( "SG::IAuxStore" ); + xAOD::AuxContainerBase* auxHolder = + reinterpret_cast<xAOD::AuxContainerBase*>(classDesc.Cast (auxinterface, dataBucket->object(), true)); ATH_CHECK( auxHolder != nullptr ); xAODInterfaceContainer->setStore( auxHolder ); currentAuxStore = new WritableAuxStore(); diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx index 18ad4deb0c4323522037068150c7f0fb1b9de440..18a291418dd1da63c072fe9c0af52feb97c1e513 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx +++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx @@ -11,6 +11,7 @@ #include "AthenaKernel/StorableConversions.h" #include "AthContainersInterfaces/IAuxStoreIO.h" #include "AthContainers/AuxTypeRegistry.h" +#include "AthContainers/tools/copyAuxStoreThinned.h" #include "AthContainers/debug.h" #include "xAODCore/AuxContainerBase.h" #include "xAODTrigger/TrigCompositeAuxContainer.h" @@ -297,7 +298,28 @@ StatusCode TriggerEDMSerialiserTool::serialisexAODAuxContainer( void* data, SGImplSvc* evtStore) const { ATH_MSG_DEBUG("xAOD Aux Container"); - ATH_CHECK( serialiseContainer( data, address, buffer ) ); + + void* copy = data; + RootType classDesc = RootType::ByNameNoQuiet( address.persType ); + static const RootType interface = RootType::ByNameNoQuiet( "SG::IAuxStore" ); + static const RootType interface_c = RootType::ByNameNoQuiet( "xAOD::AuxContainerBase" ); + + void* data_interface = classDesc.Cast (interface_c, data, true); + if (data_interface) { + const xAOD::AuxContainerBase* store = reinterpret_cast<const xAOD::AuxContainerBase*> (data_interface); + copy = classDesc.Construct(); + void* copy_interface = classDesc.Cast (interface, copy, true); + SG::copyAuxStoreThinned (*store, + *reinterpret_cast<SG::IAuxStore*> (copy_interface), + nullptr); + } + + ATH_CHECK( serialiseContainer( copy, address, buffer ) ); + + if (copy != data) { + classDesc.Destruct (copy); + } + size_t baseSize = buffer.size(); if ( not m_saveDynamic ) return StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py index 7451e62b3f6ed6c0b96e082e2a715322347800d6..c5ad2d9d396943a14e2597f57433a6d091a6719b 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py @@ -47,7 +47,7 @@ from AthenaCommon.AppMgr import ToolSvc as toolSvc from TrigT1CTMonitoring.TrigT1CTMonitoringConf import TrigT1CTMonitoring__BSMonitoring as BSMon #-----------ONLINE CODE--------------------- -if isOnline and jp.ConcurrencyFlags.NumThreads() == 0: +if athenaCommonFlags.isOnline() and jp.ConcurrencyFlags.NumThreads() == 0: #from TrigServices.TrigServicesConf import TrigMonTHistSvc #THistSvc = TrigMonTHistSvc("THistSvc") #svcMgr += THistSvc @@ -173,7 +173,7 @@ if isOnline and jp.ConcurrencyFlags.NumThreads() == 0: #-----------OFFLINE CODE--------------------- -if not isOnline and jp.ConcurrencyFlags.NumThreads() == 0: +if not athenaCommonFlags.isOnline() and jp.ConcurrencyFlags.NumThreads() == 0: from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter cfg = TriggerConfigGetter() diff --git a/Trigger/TrigValidation/TrigAnalysisTest/bin/checkFileTrigSize_RTT.py b/Trigger/TrigValidation/TrigAnalysisTest/bin/checkFileTrigSize_RTT.py index 7239ea8d82859e8bfb8e7a738e092f777e35192c..b1e4cef9b6cca0418ba482927fc4d9be36b1d243 100755 --- a/Trigger/TrigValidation/TrigAnalysisTest/bin/checkFileTrigSize_RTT.py +++ b/Trigger/TrigValidation/TrigAnalysisTest/bin/checkFileTrigSize_RTT.py @@ -1095,7 +1095,7 @@ class checkFileTrigSize_RTT: #for new xAOD if re.search("Total",line): - if (unicode(splitline[4])).isnumeric(): + if (str(splitline[4])).isnumeric(): self.total = float(splitline[4]) #only count the good lines (ie. not "=====", etc.) @@ -1203,8 +1203,8 @@ class checkFileTrigSize_RTT: print() - print("Summary of catagories:") - fout.write( "\n Summary of catagories:\n") + print("Summary of categories:") + fout.write( "\n Summary of categories:\n") #print the size of each counter (and calculate the sum) for counter in listofCounters: diff --git a/Trigger/TrigValidation/TrigAnalysisTest/python/TrigAnalysisSteps.py b/Trigger/TrigValidation/TrigAnalysisTest/python/TrigAnalysisSteps.py index 1d0eede3af941e6bb77083bd52eef70cc07d5055..cfa617aa119a55fdca1820a2f95b029a0625537a 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/python/TrigAnalysisSteps.py +++ b/Trigger/TrigValidation/TrigAnalysisTest/python/TrigAnalysisSteps.py @@ -164,7 +164,9 @@ def trig_analysis_exec_steps(input_file='AOD.pool.root'): return [ TrigDecChecker(in_file=input_file), TrigEDMChecker(in_file=input_file), - TrigEDMAuxChecker(in_file=input_file)] + # to be fixed and enabled + #TrigEDMAuxChecker(in_file=input_file) + ] def trig_analysis_check_steps(): return [CheckFileTrigSizeStep()] diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref index 2060d7418e7358f86c29c77b89bf4ac6c007ff84..ac3964f7c33d5cfe86fe51f2ca758ee905a55d15 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref @@ -24,7 +24,7 @@ TrigSignatureMoniMT INFO -- #1796849979 Events TrigSignatureMoniMT INFO -- #1796849979 Features 2 0 0 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_2e3_etcut_L12EM3 #2613484113 TrigSignatureMoniMT INFO -- #2613484113 Events 20 20 20 20 20 - - - - - - - - - - 20 -TrigSignatureMoniMT INFO -- #2613484113 Features 342 3676 780 - - - - - - - - - - +TrigSignatureMoniMT INFO -- #2613484113 Features 342 3676 738 - - - - - - - - - - TrigSignatureMoniMT INFO HLT_2g10_loose_mu20_L1MU20 #3765708828 TrigSignatureMoniMT INFO -- #3765708828 Events 8 8 1 1 1 0 0 0 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #3765708828 Features 2 2 6 0 0 0 0 0 - - - - - @@ -258,34 +258,34 @@ TrigSignatureMoniMT INFO -- #1745513164 Events TrigSignatureMoniMT INFO -- #1745513164 Features 55 55 55 - - - - - - - - - - TrigSignatureMoniMT INFO HLT_e3_etcut_L1EM3 #683953566 TrigSignatureMoniMT INFO -- #683953566 Events 20 20 20 20 20 - - - - - - - - - - 20 -TrigSignatureMoniMT INFO -- #683953566 Features 171 1838 390 - - - - - - - - - - +TrigSignatureMoniMT INFO -- #683953566 Features 171 1838 369 - - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_etcut_L1EM3 #324908483 TrigSignatureMoniMT INFO -- #324908483 Events 20 20 20 20 20 - - - - - - - - - - 20 TrigSignatureMoniMT INFO -- #324908483 Features 137 1652 190 - - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhloose_L1EM3 #736648247 TrigSignatureMoniMT INFO -- #736648247 Events 20 20 18 18 18 4 - - - - - - - - - 4 -TrigSignatureMoniMT INFO -- #736648247 Features 54 585 109 5 - - - - - - - - - +TrigSignatureMoniMT INFO -- #736648247 Features 54 585 105 5 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhloose_noringer_L1EM3 #1053337356 TrigSignatureMoniMT INFO -- #1053337356 Events 20 20 17 17 17 4 - - - - - - - - - 4 -TrigSignatureMoniMT INFO -- #1053337356 Features 56 650 116 5 - - - - - - - - - +TrigSignatureMoniMT INFO -- #1053337356 Features 56 650 113 5 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhmedium_L1EM3 #2713915187 TrigSignatureMoniMT INFO -- #2713915187 Events 20 20 18 18 18 4 - - - - - - - - - 4 -TrigSignatureMoniMT INFO -- #2713915187 Features 53 580 106 5 - - - - - - - - - +TrigSignatureMoniMT INFO -- #2713915187 Features 53 580 102 5 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhmedium_noringer_L1EM3 #176627878 TrigSignatureMoniMT INFO -- #176627878 Events 20 20 16 16 16 4 - - - - - - - - - 4 -TrigSignatureMoniMT INFO -- #176627878 Features 48 531 93 5 - - - - - - - - - +TrigSignatureMoniMT INFO -- #176627878 Features 48 531 91 5 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhtight_L1EM3 #2070133824 TrigSignatureMoniMT INFO -- #2070133824 Events 20 20 18 18 18 4 - - - - - - - - - 4 -TrigSignatureMoniMT INFO -- #2070133824 Features 51 561 101 5 - - - - - - - - - +TrigSignatureMoniMT INFO -- #2070133824 Features 51 561 97 5 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhtight_nod0_L1EM3 #3303895627 TrigSignatureMoniMT INFO -- #3303895627 Events 20 20 18 18 18 4 - - - - - - - - - 4 -TrigSignatureMoniMT INFO -- #3303895627 Features 51 561 101 5 - - - - - - - - - +TrigSignatureMoniMT INFO -- #3303895627 Features 51 561 97 5 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhtight_noringer_L1EM3 #2758326765 TrigSignatureMoniMT INFO -- #2758326765 Events 20 20 16 16 16 4 - - - - - - - - - 4 -TrigSignatureMoniMT INFO -- #2758326765 Features 45 513 84 5 - - - - - - - - - +TrigSignatureMoniMT INFO -- #2758326765 Features 45 513 82 5 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhtight_noringer_nod0_L1EM3 #1690619419 TrigSignatureMoniMT INFO -- #1690619419 Events 20 20 16 16 16 4 - - - - - - - - - 4 -TrigSignatureMoniMT INFO -- #1690619419 Features 45 513 84 5 - - - - - - - - - +TrigSignatureMoniMT INFO -- #1690619419 Features 45 513 82 5 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e60_lhmedium_L1EM22VHI #298591874 TrigSignatureMoniMT INFO -- #298591874 Events 6 6 2 2 2 2 - - - - - - - - - 2 TrigSignatureMoniMT INFO -- #298591874 Features 2 33 4 2 - - - - - - - - - @@ -354,19 +354,25 @@ TrigSignatureMoniMT INFO -- #3486231698 Events TrigSignatureMoniMT INFO -- #3486231698 Features 137 137 190 118 - - - - - - - - - TrigSignatureMoniMT INFO HLT_g5_loose_L1EM3 #3230088967 TrigSignatureMoniMT INFO -- #3230088967 Events 20 20 17 17 17 9 - - - - - - - - - 9 -TrigSignatureMoniMT INFO -- #3230088967 Features 56 56 116 12 - - - - - - - - - +TrigSignatureMoniMT INFO -- #3230088967 Features 56 56 113 12 - - - - - - - - - TrigSignatureMoniMT INFO HLT_g5_medium_L1EM3 #385248610 TrigSignatureMoniMT INFO -- #385248610 Events 20 20 16 16 16 9 - - - - - - - - - 9 -TrigSignatureMoniMT INFO -- #385248610 Features 48 48 93 12 - - - - - - - - - +TrigSignatureMoniMT INFO -- #385248610 Features 48 48 91 12 - - - - - - - - - TrigSignatureMoniMT INFO HLT_g5_tight_L1EM3 #3280865118 TrigSignatureMoniMT INFO -- #3280865118 Events 20 20 16 16 16 9 - - - - - - - - - 9 -TrigSignatureMoniMT INFO -- #3280865118 Features 45 45 84 9 - - - - - - - - - +TrigSignatureMoniMT INFO -- #3280865118 Features 45 45 82 9 - - - - - - - - - TrigSignatureMoniMT INFO HLT_j0_perf_L1J12_EMPTY #1341875780 TrigSignatureMoniMT INFO -- #1341875780 Events 0 0 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #1341875780 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151 TrigSignatureMoniMT INFO -- #4034799151 Events 19 19 0 0 0 0 0 0 0 0 0 15 - - - 15 TrigSignatureMoniMT INFO -- #4034799151 Features 0 0 0 0 0 0 0 0 0 402 - - - +TrigSignatureMoniMT INFO HLT_j225_pf_subjesgscIS_ftf_bdl1r40_split_L1J100 #286306583 +TrigSignatureMoniMT INFO -- #286306583 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #286306583 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j225_subjesgscIS_ftf_bdl1r40_split_L1J100 #2394235810 +TrigSignatureMoniMT INFO -- #2394235810 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2394235810 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j225_subjesgscIS_ftf_bmv2c1040_split_L1J100 #219711753 TrigSignatureMoniMT INFO -- #219711753 Events 3 3 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #219711753 Features 0 0 0 0 0 0 0 0 0 0 0 - - @@ -376,15 +382,36 @@ TrigSignatureMoniMT INFO -- #3084792704 Features TrigSignatureMoniMT INFO HLT_j260_320eta490_L1J75_31ETA49 #3769257182 TrigSignatureMoniMT INFO -- #3769257182 Events 2 2 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #3769257182 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j275_pf_subjesgscIS_ftf_bdl1r60_split_L1J100 #2912155644 +TrigSignatureMoniMT INFO -- #2912155644 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2912155644 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j275_pf_subjesgscIS_ftf_boffperf_split_L1J100 #9543810 +TrigSignatureMoniMT INFO -- #9543810 Events 3 3 0 0 0 0 0 0 0 0 0 0 0 - - 0 +TrigSignatureMoniMT INFO -- #9543810 Features 0 0 0 0 0 0 0 0 0 0 0 - - +TrigSignatureMoniMT INFO HLT_j275_subjesgscIS_ftf_bdl1r60_split_L1J100 #2807668578 +TrigSignatureMoniMT INFO -- #2807668578 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2807668578 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j275_subjesgscIS_ftf_bmv2c1060_split_L1J100 #710546402 TrigSignatureMoniMT INFO -- #710546402 Events 3 3 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #710546402 Features 0 0 0 0 0 0 0 0 0 0 0 - - TrigSignatureMoniMT INFO HLT_j275_subjesgscIS_ftf_boffperf_split_L1J100 #540369970 TrigSignatureMoniMT INFO -- #540369970 Events 3 3 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #540369970 Features 0 0 0 0 0 0 0 0 0 0 0 - - +TrigSignatureMoniMT INFO HLT_j300_pf_subjesgscIS_ftf_bdl1r70_split_L1J100 #2576796343 +TrigSignatureMoniMT INFO -- #2576796343 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2576796343 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j300_subjesgscIS_ftf_bdl1r70_split_L1J100 #2952175162 +TrigSignatureMoniMT INFO -- #2952175162 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2952175162 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j300_subjesgscIS_ftf_bmv2c1070_split_L1J100 #2074989613 TrigSignatureMoniMT INFO -- #2074989613 Events 3 3 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #2074989613 Features 0 0 0 0 0 0 0 0 0 0 0 - - +TrigSignatureMoniMT INFO HLT_j360_pf_subjesgscIS_ftf_bdl1r77_split_L1J100 #3049708671 +TrigSignatureMoniMT INFO -- #3049708671 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3049708671 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j360_subjesgscIS_ftf_bdl1r77_split_L1J100 #1563453863 +TrigSignatureMoniMT INFO -- #1563453863 Events 3 3 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1563453863 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j360_subjesgscIS_ftf_bmv2c1077_split_L1J100 #4176355792 TrigSignatureMoniMT INFO -- #4176355792 Events 3 3 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #4176355792 Features 0 0 0 0 0 0 0 0 0 0 0 - - @@ -421,6 +448,12 @@ TrigSignatureMoniMT INFO -- #4202219904 Features TrigSignatureMoniMT INFO HLT_j45_pf_subjesgscIS_ftf_L1J20 #2187173741 TrigSignatureMoniMT INFO -- #2187173741 Events 19 19 0 0 0 0 0 0 0 0 0 18 - - - 18 TrigSignatureMoniMT INFO -- #2187173741 Features 0 0 0 0 0 0 0 0 0 39 - - - +TrigSignatureMoniMT INFO HLT_j45_pf_subjesgscIS_ftf_bdl1r70_split_L1J20 #4239752847 +TrigSignatureMoniMT INFO -- #4239752847 Events 19 19 0 0 0 0 0 0 0 0 0 18 - - - 18 +TrigSignatureMoniMT INFO -- #4239752847 Features 0 0 0 0 0 0 0 0 0 39 - - - +TrigSignatureMoniMT INFO HLT_j45_pf_subjesgscIS_ftf_boffperf_split_L1J20 #2546763674 +TrigSignatureMoniMT INFO -- #2546763674 Events 19 19 0 0 0 0 0 0 0 0 0 18 18 - - 18 +TrigSignatureMoniMT INFO -- #2546763674 Features 0 0 0 0 0 0 0 0 0 39 39 - - TrigSignatureMoniMT INFO HLT_j45_pf_subresjesgscIS_ftf_L1J20 #3567642453 TrigSignatureMoniMT INFO -- #3567642453 Events 19 19 0 0 0 0 0 0 0 0 0 18 - - - 18 TrigSignatureMoniMT INFO -- #3567642453 Features 0 0 0 0 0 0 0 0 0 39 - - - @@ -439,6 +472,9 @@ TrigSignatureMoniMT INFO -- #2237035634 Features TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_L1J15 #1960278431 TrigSignatureMoniMT INFO -- #1960278431 Events 20 20 0 0 0 0 0 0 0 0 0 19 - - - 19 TrigSignatureMoniMT INFO -- #1960278431 Features 0 0 0 0 0 0 0 0 0 50 - - - +TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_bdl1r70_split_L1J20 #2947439578 +TrigSignatureMoniMT INFO -- #2947439578 Events 19 19 0 0 0 0 0 0 0 0 0 19 - - - 19 +TrigSignatureMoniMT INFO -- #2947439578 Features 0 0 0 0 0 0 0 0 0 50 - - - TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20 #980453000 TrigSignatureMoniMT INFO -- #980453000 Events 19 19 0 0 0 0 0 0 0 0 0 19 11 - - 11 TrigSignatureMoniMT INFO -- #980453000 Features 0 0 0 0 0 0 0 0 0 49 20 - - @@ -632,8 +668,8 @@ TrigSignatureMoniMT INFO HLT_mu6_mu4_L12MU4 #171 TrigSignatureMoniMT INFO -- #1713982776 Events 4 4 0 0 0 0 3 3 2 2 - - - - - 2 TrigSignatureMoniMT INFO -- #1713982776 Features 0 0 0 0 6 6 4 4 - - - - - TrigSignatureMoniMT INFO HLT_mu6_mu6noL1_L1MU6 #451489897 -TrigSignatureMoniMT INFO -- #451489897 Events 10 10 0 0 0 0 10 10 10 10 0 0 0 5 3 3 -TrigSignatureMoniMT INFO -- #451489897 Features 0 0 0 0 13 12 13 13 0 0 0 7 5 +TrigSignatureMoniMT INFO -- #451489897 Events 10 10 0 0 0 0 10 10 10 10 0 0 0 5 4 4 +TrigSignatureMoniMT INFO -- #451489897 Features 0 0 0 0 13 12 13 13 0 0 0 7 6 TrigSignatureMoniMT INFO HLT_mu6fast_L1MU6 #3518031697 TrigSignatureMoniMT INFO -- #3518031697 Events 10 10 0 0 0 0 10 - - - - - - - - 10 TrigSignatureMoniMT INFO -- #3518031697 Features 0 0 0 0 13 - - - - - - - - diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigAOD_TrigEDMCheck.py b/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigAOD_TrigEDMCheck.py index a1525c75c57ae67dc2e34cd80e7d570f959431a5..bfd009be21215f35dfa38fb7cbd51b3611370a20 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigAOD_TrigEDMCheck.py +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigAOD_TrigEDMCheck.py @@ -98,7 +98,7 @@ ToolSvc.TrigDecisionTool.Navigation.Dlls = EDMLibraries from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence += TrigEDMChecker -TrigEDMChecker.doDumpAll = True +TrigEDMChecker.doDumpAll = False diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py index 378b33fe83296344319c5088d87e8b9f9dd75303..55be636e80d10d74400fdfa3902a382ca02bcb58 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py @@ -56,7 +56,7 @@ for opt,arg in opts: rdo2aod = TrigInDetReco() rdo2aod.slices = ['muon','electron','tau','bjet'] rdo2aod.max_events = 2000 -rdo2aod.threads = 1 # TODO: change to 4 +rdo2aod.threads = 4 rdo2aod.concurrent_events = 4 rdo2aod.perfmon = False rdo2aod.timeout = 18*3600 diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py index 7ef225f72347a76ccc36e5ea971f1aebf563490e..85e21cdfe4ffced924678ef3ee8a0e94ee1a690e 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py @@ -4,7 +4,7 @@ # art-type: grid # art-include: master/Athena # art-input-nfiles: 3 -# art-athena-mt: 4 +# art-athena-mt: 8 # art-memory: 4096 # art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir= # art-output: *.txt @@ -56,8 +56,8 @@ for opt,arg in opts: rdo2aod = TrigInDetReco() rdo2aod.slices = ['muon','electron','tau','bjet'] rdo2aod.max_events = 2000 -rdo2aod.threads = 4 -rdo2aod.concurrent_events = 4 +rdo2aod.threads = 8 +rdo2aod.concurrent_events = 8 rdo2aod.perfmon = False rdo2aod.timeout = 18*3600 rdo2aod.input = 'ttbar_pu80' # defined in TrigValTools/share/TrigValInputs.json diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py index 9ff4e7edcc96e7defeaed0cf00b19db58c68016e..5f9a6159994865cadd647cf5a877572de6fd8684 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt3.py @@ -4,7 +4,7 @@ # art-type: grid # art-include: master/Athena # art-input-nfiles: 3 -# art-athena-mt: 4 +# art-athena-mt: 12 # art-memory: 4096 # art-output: *.txt # art-output: *.log @@ -55,8 +55,8 @@ for opt,arg in opts: rdo2aod = TrigInDetReco() rdo2aod.slices = ['muon','electron','tau','bjet'] rdo2aod.max_events = 2000 -rdo2aod.threads = 4 -rdo2aod.concurrent_events = 1 +rdo2aod.threads = 12 +rdo2aod.concurrent_events = 12 rdo2aod.perfmon = False rdo2aod.timeout = 18*3600 rdo2aod.input = 'ttbar_pu80' # defined in TrigValTools/share/TrigValInputs.json diff --git a/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py b/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py index 2fcbff183e6c26ed3f06962df6b1fc2daab601b2..c854c7076985dbb3a0fff61daa36a142811268e9 100644 --- a/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py +++ b/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py @@ -86,13 +86,7 @@ def myPebInfoWriterTool(name, eventBuildType): tool.EtaEdge = 5.0 tool.EtaWidth = 0.1 tool.PhiWidth = 0.1 - tool.DetNames = ['All'] - - from RegionSelector.RegSelToolConfig import makeRegSelTool_Pixel, makeRegSelTool_SCT, makeRegSelTool_TRT - tool.RegSelTool_Pixel = makeRegSelTool_Pixel() - tool.RegSelTool_SCT = makeRegSelTool_SCT() - tool.RegSelTool_TRT = makeRegSelTool_TRT() - + tool.addRegSelDets(['All']) tool.ExtraROBs = [] tool.ExtraSubDets = [] tool.addHLTResultToROBList() # add the main (full) HLT result to the list @@ -102,14 +96,8 @@ def myPebInfoWriterTool(name, eventBuildType): tool = RoIPEBInfoWriterToolCfg(name) tool.EtaWidth = 0.5 tool.PhiWidth = 0.5 - tool.DetNames = ['MDT', 'CSC', 'RPC', 'TGC', 'MM', 'STGC'] # all muon detectors + tool.addRegSelDets(['MDT', 'CSC', 'RPC', 'TGC', 'MM', 'sTGC']) # all muon detectors tool.ExtraROBs = [] - - from RegionSelector.RegSelToolConfig import makeRegSelTool_Pixel, makeRegSelTool_SCT, makeRegSelTool_TRT - tool.RegSelTool_Pixel = makeRegSelTool_Pixel() - tool.RegSelTool_SCT = makeRegSelTool_SCT() - tool.RegSelTool_TRT = makeRegSelTool_TRT() - elif 'ElectronDSTest' in eventBuildType: # ElectronDSTest is an example of pure Data Scouting, # where only the special HLT result is saved and nothing else @@ -121,13 +109,7 @@ def myPebInfoWriterTool(name, eventBuildType): tool = RoIPEBInfoWriterToolCfg(name) tool.EtaWidth = 0.3 tool.PhiWidth = 0.3 - tool.DetNames = ['PIXEL', 'SCT', 'TRT', 'TTEM', 'TTHEC', 'FCALEM', 'FCALHAD'] - - from RegionSelector.RegSelToolConfig import makeRegSelTool_Pixel, makeRegSelTool_SCT, makeRegSelTool_TRT - tool.RegSelTool_Pixel = makeRegSelTool_Pixel() - tool.RegSelTool_SCT = makeRegSelTool_SCT() - tool.RegSelTool_TRT = makeRegSelTool_TRT() - + tool.addRegSelDets(['Pixel', 'SCT', 'TRT', 'TTEM', 'TTHEC', 'FCALEM', 'FCALHAD']) tool.ExtraROBs = [] tool.ExtraSubDets = [] diff --git a/Trigger/TrigValidation/TrigValAlgs/python/TrigValAlgsConfig.py b/Trigger/TrigValidation/TrigValAlgs/python/TrigValAlgsConfig.py index 96600fad8d35bb6f43580560faeb628b17abc2ac..524de6923fae628c22614f2a066a690885c28dff 100755 --- a/Trigger/TrigValidation/TrigValAlgs/python/TrigValAlgsConfig.py +++ b/Trigger/TrigValidation/TrigValAlgs/python/TrigValAlgsConfig.py @@ -64,8 +64,9 @@ class TrigEDMChecker ( TrigEDMChecker ): def getEDMAuxList(): - from TrigEDMConfig.TriggerEDM import getTriggerObjList,TriggerHLTList - tlist=getTriggerObjList('AODFULL',[TriggerHLTList]) + from TrigEDMConfig.TriggerEDM import getTriggerEDMList + #from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags + tlist=getTriggerEDMList('AODFULL',3) objlist=[] for t,kset in six.iteritems(tlist): for k in kset: diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref index 673cb5fc606571ef59d1424b6b4fa5b31f253441..b9de0aa08ad96df680bc61ef71851246457ab0c9 100644 --- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref +++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref @@ -24,7 +24,7 @@ TrigSignatureMoniMT INFO -- #1796849979 Events TrigSignatureMoniMT INFO -- #1796849979 Features 0 0 0 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_2e3_etcut_L12EM3 #2613484113 TrigSignatureMoniMT INFO -- #2613484113 Events 20 20 15 13 13 - - - - - - - - - - 13 -TrigSignatureMoniMT INFO -- #2613484113 Features 94 324 178 - - - - - - - - - - +TrigSignatureMoniMT INFO -- #2613484113 Features 94 324 172 - - - - - - - - - - TrigSignatureMoniMT INFO HLT_2g10_loose_mu20_L1MU20 #3765708828 TrigSignatureMoniMT INFO -- #3765708828 Events 20 20 0 0 0 0 0 0 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #3765708828 Features 0 0 0 0 0 0 0 0 - - - - - @@ -258,34 +258,34 @@ TrigSignatureMoniMT INFO -- #1745513164 Events TrigSignatureMoniMT INFO -- #1745513164 Features 23 23 23 - - - - - - - - - - TrigSignatureMoniMT INFO HLT_e3_etcut_L1EM3 #683953566 TrigSignatureMoniMT INFO -- #683953566 Events 20 20 15 14 14 - - - - - - - - - - 14 -TrigSignatureMoniMT INFO -- #683953566 Features 48 163 90 - - - - - - - - - - +TrigSignatureMoniMT INFO -- #683953566 Features 48 163 87 - - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_etcut_L1EM3 #324908483 TrigSignatureMoniMT INFO -- #324908483 Events 20 20 13 13 13 - - - - - - - - - - 13 TrigSignatureMoniMT INFO -- #324908483 Features 41 148 49 - - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhloose_L1EM3 #736648247 TrigSignatureMoniMT INFO -- #736648247 Events 20 20 9 9 9 0 - - - - - - - - - 0 -TrigSignatureMoniMT INFO -- #736648247 Features 18 52 28 0 - - - - - - - - - +TrigSignatureMoniMT INFO -- #736648247 Features 18 52 27 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhloose_noringer_L1EM3 #1053337356 TrigSignatureMoniMT INFO -- #1053337356 Events 20 20 10 10 10 0 - - - - - - - - - 0 -TrigSignatureMoniMT INFO -- #1053337356 Features 15 48 31 0 - - - - - - - - - +TrigSignatureMoniMT INFO -- #1053337356 Features 15 48 29 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhmedium_L1EM3 #2713915187 TrigSignatureMoniMT INFO -- #2713915187 Events 20 20 9 9 9 0 - - - - - - - - - 0 -TrigSignatureMoniMT INFO -- #2713915187 Features 19 55 28 0 - - - - - - - - - +TrigSignatureMoniMT INFO -- #2713915187 Features 19 55 27 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhmedium_noringer_L1EM3 #176627878 TrigSignatureMoniMT INFO -- #176627878 Events 20 20 9 9 9 0 - - - - - - - - - 0 -TrigSignatureMoniMT INFO -- #176627878 Features 13 51 30 0 - - - - - - - - - +TrigSignatureMoniMT INFO -- #176627878 Features 13 51 29 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhtight_L1EM3 #2070133824 TrigSignatureMoniMT INFO -- #2070133824 Events 20 20 8 8 8 0 - - - - - - - - - 0 -TrigSignatureMoniMT INFO -- #2070133824 Features 16 43 25 0 - - - - - - - - - +TrigSignatureMoniMT INFO -- #2070133824 Features 16 43 24 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhtight_nod0_L1EM3 #3303895627 TrigSignatureMoniMT INFO -- #3303895627 Events 20 20 8 8 8 0 - - - - - - - - - 0 -TrigSignatureMoniMT INFO -- #3303895627 Features 16 43 25 0 - - - - - - - - - +TrigSignatureMoniMT INFO -- #3303895627 Features 16 43 24 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhtight_noringer_L1EM3 #2758326765 TrigSignatureMoniMT INFO -- #2758326765 Events 20 20 9 9 9 0 - - - - - - - - - 0 -TrigSignatureMoniMT INFO -- #2758326765 Features 13 51 30 0 - - - - - - - - - +TrigSignatureMoniMT INFO -- #2758326765 Features 13 51 29 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e5_lhtight_noringer_nod0_L1EM3 #1690619419 TrigSignatureMoniMT INFO -- #1690619419 Events 20 20 9 9 9 0 - - - - - - - - - 0 -TrigSignatureMoniMT INFO -- #1690619419 Features 13 51 30 0 - - - - - - - - - +TrigSignatureMoniMT INFO -- #1690619419 Features 13 51 29 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_e60_lhmedium_L1EM22VHI #298591874 TrigSignatureMoniMT INFO -- #298591874 Events 20 20 0 0 0 0 - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #298591874 Features 0 0 0 0 - - - - - - - - - @@ -327,7 +327,7 @@ TrigSignatureMoniMT INFO -- #1417839619 Events TrigSignatureMoniMT INFO -- #1417839619 Features 3 3 2 - - - - - - - - - - TrigSignatureMoniMT INFO HLT_g25_loose_L1EM20VH #3476696431 TrigSignatureMoniMT INFO -- #3476696431 Events 20 20 2 2 2 0 - - - - - - - - - 0 -TrigSignatureMoniMT INFO -- #3476696431 Features 2 2 6 0 - - - - - - - - - +TrigSignatureMoniMT INFO -- #3476696431 Features 2 2 5 0 - - - - - - - - - TrigSignatureMoniMT INFO HLT_g25_medium_L1EM20VH #1519793981 TrigSignatureMoniMT INFO -- #1519793981 Events 20 20 0 0 0 0 - - - - - - - - - 0 TrigSignatureMoniMT INFO -- #1519793981 Features 0 0 0 0 - - - - - - - - - @@ -354,19 +354,25 @@ TrigSignatureMoniMT INFO -- #3486231698 Events TrigSignatureMoniMT INFO -- #3486231698 Features 41 41 50 36 - - - - - - - - - TrigSignatureMoniMT INFO HLT_g5_loose_L1EM3 #3230088967 TrigSignatureMoniMT INFO -- #3230088967 Events 20 20 10 10 10 2 - - - - - - - - - 2 -TrigSignatureMoniMT INFO -- #3230088967 Features 15 15 31 2 - - - - - - - - - +TrigSignatureMoniMT INFO -- #3230088967 Features 15 15 29 2 - - - - - - - - - TrigSignatureMoniMT INFO HLT_g5_medium_L1EM3 #385248610 TrigSignatureMoniMT INFO -- #385248610 Events 20 20 9 9 9 2 - - - - - - - - - 2 -TrigSignatureMoniMT INFO -- #385248610 Features 13 13 30 2 - - - - - - - - - +TrigSignatureMoniMT INFO -- #385248610 Features 13 13 29 2 - - - - - - - - - TrigSignatureMoniMT INFO HLT_g5_tight_L1EM3 #3280865118 TrigSignatureMoniMT INFO -- #3280865118 Events 20 20 9 9 9 1 - - - - - - - - - 1 -TrigSignatureMoniMT INFO -- #3280865118 Features 13 13 30 1 - - - - - - - - - +TrigSignatureMoniMT INFO -- #3280865118 Features 13 13 29 1 - - - - - - - - - TrigSignatureMoniMT INFO HLT_j0_perf_L1J12_EMPTY #1341875780 TrigSignatureMoniMT INFO -- #1341875780 Events 20 20 0 0 0 0 0 0 0 0 0 8 - - - 8 TrigSignatureMoniMT INFO -- #1341875780 Features 0 0 0 0 0 0 0 0 0 117 - - - TrigSignatureMoniMT INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151 TrigSignatureMoniMT INFO -- #4034799151 Events 20 20 0 0 0 0 0 0 0 0 0 2 - - - 2 TrigSignatureMoniMT INFO -- #4034799151 Features 0 0 0 0 0 0 0 0 0 24 - - - +TrigSignatureMoniMT INFO HLT_j225_pf_subjesgscIS_ftf_bdl1r40_split_L1J100 #286306583 +TrigSignatureMoniMT INFO -- #286306583 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #286306583 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j225_subjesgscIS_ftf_bdl1r40_split_L1J100 #2394235810 +TrigSignatureMoniMT INFO -- #2394235810 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2394235810 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j225_subjesgscIS_ftf_bmv2c1040_split_L1J100 #219711753 TrigSignatureMoniMT INFO -- #219711753 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #219711753 Features 0 0 0 0 0 0 0 0 0 0 0 - - @@ -376,15 +382,36 @@ TrigSignatureMoniMT INFO -- #3084792704 Features TrigSignatureMoniMT INFO HLT_j260_320eta490_L1J75_31ETA49 #3769257182 TrigSignatureMoniMT INFO -- #3769257182 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 TrigSignatureMoniMT INFO -- #3769257182 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j275_pf_subjesgscIS_ftf_bdl1r60_split_L1J100 #2912155644 +TrigSignatureMoniMT INFO -- #2912155644 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2912155644 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j275_pf_subjesgscIS_ftf_boffperf_split_L1J100 #9543810 +TrigSignatureMoniMT INFO -- #9543810 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 - - 0 +TrigSignatureMoniMT INFO -- #9543810 Features 0 0 0 0 0 0 0 0 0 0 0 - - +TrigSignatureMoniMT INFO HLT_j275_subjesgscIS_ftf_bdl1r60_split_L1J100 #2807668578 +TrigSignatureMoniMT INFO -- #2807668578 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2807668578 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j275_subjesgscIS_ftf_bmv2c1060_split_L1J100 #710546402 TrigSignatureMoniMT INFO -- #710546402 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #710546402 Features 0 0 0 0 0 0 0 0 0 0 0 - - TrigSignatureMoniMT INFO HLT_j275_subjesgscIS_ftf_boffperf_split_L1J100 #540369970 TrigSignatureMoniMT INFO -- #540369970 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #540369970 Features 0 0 0 0 0 0 0 0 0 0 0 - - +TrigSignatureMoniMT INFO HLT_j300_pf_subjesgscIS_ftf_bdl1r70_split_L1J100 #2576796343 +TrigSignatureMoniMT INFO -- #2576796343 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2576796343 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j300_subjesgscIS_ftf_bdl1r70_split_L1J100 #2952175162 +TrigSignatureMoniMT INFO -- #2952175162 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2952175162 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j300_subjesgscIS_ftf_bmv2c1070_split_L1J100 #2074989613 TrigSignatureMoniMT INFO -- #2074989613 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #2074989613 Features 0 0 0 0 0 0 0 0 0 0 0 - - +TrigSignatureMoniMT INFO HLT_j360_pf_subjesgscIS_ftf_bdl1r77_split_L1J100 #3049708671 +TrigSignatureMoniMT INFO -- #3049708671 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3049708671 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO HLT_j360_subjesgscIS_ftf_bdl1r77_split_L1J100 #1563453863 +TrigSignatureMoniMT INFO -- #1563453863 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #1563453863 Features 0 0 0 0 0 0 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_j360_subjesgscIS_ftf_bmv2c1077_split_L1J100 #4176355792 TrigSignatureMoniMT INFO -- #4176355792 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 - - 0 TrigSignatureMoniMT INFO -- #4176355792 Features 0 0 0 0 0 0 0 0 0 0 0 - - @@ -421,6 +448,12 @@ TrigSignatureMoniMT INFO -- #4202219904 Features TrigSignatureMoniMT INFO HLT_j45_pf_subjesgscIS_ftf_L1J20 #2187173741 TrigSignatureMoniMT INFO -- #2187173741 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 TrigSignatureMoniMT INFO -- #2187173741 Features 0 0 0 0 0 0 0 0 0 3 - - - +TrigSignatureMoniMT INFO HLT_j45_pf_subjesgscIS_ftf_bdl1r70_split_L1J20 #4239752847 +TrigSignatureMoniMT INFO -- #4239752847 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 +TrigSignatureMoniMT INFO -- #4239752847 Features 0 0 0 0 0 0 0 0 0 3 - - - +TrigSignatureMoniMT INFO HLT_j45_pf_subjesgscIS_ftf_boffperf_split_L1J20 #2546763674 +TrigSignatureMoniMT INFO -- #2546763674 Events 20 20 0 0 0 0 0 0 0 0 0 3 3 - - 3 +TrigSignatureMoniMT INFO -- #2546763674 Features 0 0 0 0 0 0 0 0 0 3 3 - - TrigSignatureMoniMT INFO HLT_j45_pf_subresjesgscIS_ftf_L1J20 #3567642453 TrigSignatureMoniMT INFO -- #3567642453 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 TrigSignatureMoniMT INFO -- #3567642453 Features 0 0 0 0 0 0 0 0 0 3 - - - @@ -439,6 +472,9 @@ TrigSignatureMoniMT INFO -- #2237035634 Features TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_L1J15 #1960278431 TrigSignatureMoniMT INFO -- #1960278431 Events 20 20 0 0 0 0 0 0 0 0 0 7 - - - 7 TrigSignatureMoniMT INFO -- #1960278431 Features 0 0 0 0 0 0 0 0 0 7 - - - +TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_bdl1r70_split_L1J20 #2947439578 +TrigSignatureMoniMT INFO -- #2947439578 Events 20 20 0 0 0 0 0 0 0 0 0 5 - - - 5 +TrigSignatureMoniMT INFO -- #2947439578 Features 0 0 0 0 0 0 0 0 0 5 - - - TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20 #980453000 TrigSignatureMoniMT INFO -- #980453000 Events 20 20 0 0 0 0 0 0 0 0 0 5 0 - - 0 TrigSignatureMoniMT INFO -- #980453000 Features 0 0 0 0 0 0 0 0 0 5 0 - - diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py index 62cecf49b001a81011d80be1c72b2ebffb2bad8a..f2b85f1ceb34e3f359fb3bd07f2b698da447306c 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py @@ -60,13 +60,7 @@ def pebInfoWriterTool(name, eventBuildType): ]) elif 'LArPEB' in eventBuildType: tool = RoIPEBInfoWriterToolCfg(name) - tool.DetNames = ['PIXEL', 'SCT', 'TRT', 'TTEM', 'TTHEC', 'FCALEM', 'FCALHAD'] - - from RegionSelector.RegSelToolConfig import makeRegSelTool_Pixel, makeRegSelTool_SCT, makeRegSelTool_TRT - tool.RegSelTool_Pixel = makeRegSelTool_Pixel() - tool.RegSelTool_SCT = makeRegSelTool_SCT() - tool.RegSelTool_TRT = makeRegSelTool_TRT() - + tool.addRegSelDets(['Pixel', 'SCT', 'TRT', 'TTEM', 'TTHEC', 'FCALEM', 'FCALHAD']) tool.MaxRoIs = 5 tool.addHLTResultToROBList() # add the main (full) HLT result to the list tool.addCTPResultToROBList() # add the CTP result to the list diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py index 19d57e3ca5c3df140da1660ff810787c78a281ec..eb8980e28dd4adec6584bec15be0ccdad3deef6a 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py @@ -101,4 +101,10 @@ def precisionElectronRecoSequence(RoIs): isoBuilder = TrigElectronIsoBuilderCfg() thesequence += isoBuilder + #online monitoring for topoEgammaBuilder + from TriggerMenuMT.HLTMenuConfig.Electron.TrigElectronFactories import PrecisionElectronTopoMonitorCfg + PrecisionElectronRecoMonAlgo = PrecisionElectronTopoMonitorCfg() + PrecisionElectronRecoMonAlgo.ElectronKey = trigTopoEgammaAlgo.ElectronOutputName + thesequence += PrecisionElectronRecoMonAlgo + return (thesequence, electronPrecisionTrack, collectionOut) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py index 070bf34f9fad34f3c32b3cd2242be9bb1c6fd5f6..9e30a0ab3c534a5ab5ff93a4e50a3e4361730720 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py @@ -71,3 +71,18 @@ def TrigTopoEgammaElectronCfg(name='topoEgammaBuilder_TrigElectrons'): #MonTool = monTool ) return TrigTopoEgammaElectron() + +def PrecisionElectronTopoMonitorCfg(name = 'PrecisionElectronTopoEgammaBuilder'): + + from TrigEgammaMonitoring import TrigEgammaMonitoringConf + from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorPrecisionCfg + monTool = egammaMonitorPrecisionCfg(name) + + PrecisionElectronTopoMonitor = AlgFactory( TrigEgammaMonitoringConf.egammaMonitorElectronAlgorithm, + name = name, + doAdd = False, + ElectronKey = TrigEgammaKeys.outputElectronKey, + MonTool = monTool + ) + + return PrecisionElectronTopoMonitor() \ No newline at end of file diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py index a58dbadc1d15893af824fafedc10d7a3fb2244b9..9e390776d6b9bcd2a32290f50bb702aba7f60ced 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py @@ -282,9 +282,24 @@ def setupMenu(): ] TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [ - ChainProp(name="HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20", groups=SingleBjetGroup), + # ATR-22165 + ChainProp(name='HLT_j225_subjesgscIS_ftf_bdl1r40_split_L1J100', groups=SingleBjetGroup), + ChainProp(name='HLT_j275_subjesgscIS_ftf_bdl1r60_split_L1J100', groups=SingleBjetGroup), + ChainProp(name='HLT_j300_subjesgscIS_ftf_bdl1r70_split_L1J100', groups=SingleBjetGroup), + ChainProp(name='HLT_j360_subjesgscIS_ftf_bdl1r77_split_L1J100', groups=SingleBjetGroup), + ChainProp(name='HLT_j45_subjesgscIS_ftf_bdl1r70_split_L1J20', groups=SingleBjetGroup), + # pflow options + ChainProp(name='HLT_j225_pf_subjesgscIS_ftf_bdl1r40_split_L1J100', groups=SingleBjetGroup), + ChainProp(name='HLT_j275_pf_subjesgscIS_ftf_bdl1r60_split_L1J100', groups=SingleBjetGroup), + ChainProp(name='HLT_j275_pf_subjesgscIS_ftf_boffperf_split_L1J100', groups=SingleBjetGroup), + ChainProp(name='HLT_j300_pf_subjesgscIS_ftf_bdl1r70_split_L1J100', groups=SingleBjetGroup), + ChainProp(name='HLT_j360_pf_subjesgscIS_ftf_bdl1r77_split_L1J100', groups=SingleBjetGroup), + ChainProp(name='HLT_j45_pf_subjesgscIS_ftf_bdl1r70_split_L1J20', groups=SingleBjetGroup), + ChainProp(name='HLT_j45_pf_subjesgscIS_ftf_boffperf_split_L1J20', groups=SingleBjetGroup), + + ChainProp(name="HLT_j45_subjesgscIS_ftf_boffperf_split_L1J20", groups=SingleBjetGroup), ChainProp(name="HLT_j275_subjesgscIS_ftf_boffperf_split_L1J100", groups=SingleBjetGroup), - ChainProp(name="HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20", groups=SingleBjetGroup), + ChainProp(name="HLT_j45_subjesgscIS_ftf_bmv2c1070_split_L1J20", groups=SingleBjetGroup), ] TriggerFlags.TauSlice.signatures = TriggerFlags.TauSlice.signatures() + [ diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py index c3a100c8171684b178d6146380fce23c79210901..c638bde29a222f6c80bc037f731f279c0bf3d3e3 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py @@ -737,8 +737,8 @@ def muEFCBRecoSequence( RoIs, name ): trackParticles = PTTrackParticles[-1] #Make InDetCandidates - theIndetCandidateAlg = MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg_"+name,TrackParticleLocation = [trackParticles],ForwardParticleLocation=trackParticles, - InDetCandidateLocation="InDetCandidates_"+name) + theIndetCandidateAlg = MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg_"+name,TrackParticleLocation = [trackParticles], + InDetCandidateLocation="InDetCandidates_"+name, TrackSelector="") #No easy way to access AtlasHoleSearchTool in theIndetCandidateAlg from AthenaCommon.AppMgr import ToolSvc from InDetTrigRecExample.InDetTrigConditionsAccess import SCT_ConditionsSetup