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..89d6edef896f4cf5bd2eda8ac1118422f0deb3a7 --- /dev/null +++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCTSiLorentzAngleTestAlgConfig.py @@ -0,0 +1,46 @@ +"""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 SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg + cfg.merge(SCT_GeometryCfg(ConfigFlags)) + + from McEventSelector.McEventSelectorConfig import McEventSelectorCfg + cfg.merge(McEventSelectorCfg(ConfigFlags)) + + cfg.merge(SCTSiLorentzAngleTestAlgCfg(ConfigFlags)) + + cfg.run(maxEvents=20) +