diff --git a/Generators/McEventSelector/CMakeLists.txt b/Generators/McEventSelector/CMakeLists.txt index 1e541ef2c5b9c172a6e142cf6ce44f4755860209..e449260af0eec27b69e6b57c8c2a61ee1fd98e05 100644 --- a/Generators/McEventSelector/CMakeLists.txt +++ b/Generators/McEventSelector/CMakeLists.txt @@ -25,4 +25,4 @@ atlas_add_component( McEventSelector # Install files from the package: atlas_install_headers( McEventSelector ) - +atlas_install_python_modules( python/*.py ) diff --git a/Generators/McEventSelector/python/McEventSelectorConfig.py b/Generators/McEventSelector/python/McEventSelectorConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..31bc0b299c899b26bbb91161d2c45fadf3a535fd --- /dev/null +++ b/Generators/McEventSelector/python/McEventSelectorConfig.py @@ -0,0 +1,25 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/AthenaJobConfigRun3 + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +def McEventSelectorCfg(configFlags): + cfg=ComponentAccumulator() + + from AthenaCommon import AtlasUnixStandardJob + + from McEventSelector.McEventSelectorConf import McCnvSvc + mcCnvSvc = McCnvSvc() + cfg.addService(mcCnvSvc) + from GaudiSvc.GaudiSvcConf import EvtPersistencySvc + cfg.addService(EvtPersistencySvc("EventPersistencySvc",CnvServices=[mcCnvSvc.getFullJobOptName(),])) + + from McEventSelector.McEventSelectorConf import McEventSelector + evSel=McEventSelector("EventSelector") + evSel.RunNumber = configFlags.Input.RunNumber + evSel.InitialTimeStamp = configFlags.Input.InitialTimeStamp + cfg.addService(evSel) + cfg.setAppProperty("EvtSel",evSel.getFullJobOptName()) + + return cfg diff --git a/Generators/McEventSelector/python/__init__.py b/Generators/McEventSelector/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt b/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt index 3d0bec07ecbed30c7d6ddbf51189ba3a35eacd1e..ffbfc52ab5c40e52dad9cce09f440c0725fc7160 100644 --- a/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt @@ -36,6 +36,10 @@ atlas_add_component( SCT_Cabling INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps Identifier GaudiKernel StoreGateLib SGtests AthenaPoolUtilities CoraCool EventInfo InDetIdentifier PathResolver SCT_CablingLib ) +atlas_add_test( TestSCT_CablingCfg + SCRIPT share/TestSCT_CablingCfg.sh + ENVIRONMENT THREADS=2 ) + # Install files from the package: atlas_install_joboptions( share/*.py ) atlas_install_runtime( share/*.dat ) diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/python/SCT_CablingConfig.py b/InnerDetector/InDetDetDescr/SCT_Cabling/python/SCT_CablingConfig.py index 7b287d3402455b42e5c466cb7de1f8634adfb39d..20978477038e5a22c1a92ae8549f49c862963755 100644 --- a/InnerDetector/InDetDetDescr/SCT_Cabling/python/SCT_CablingConfig.py +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/python/SCT_CablingConfig.py @@ -71,3 +71,30 @@ def getSCT_FillCablingFromCoraCool(name="SCT_FillCablingFromCoraCool", **kwargs) from SCT_Cabling.SCT_CablingConf import SCT_FillCablingFromCoraCool return CfgMgr.SCT_FillCablingFromCoraCool(name, **kwargs) + +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/AthenaJobConfigRun3 + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +def SCT_CablingFoldersCfg(configFlags): + cfg=ComponentAccumulator() + path="/SCT/DAQ/Config/" + if configFlags.IOVDb.DatabaseInstance == "COMP200": + path="/SCT/DAQ/Configuration/" + instance="SCT" + if configFlags.Input.isMC: + instance="SCT_OFL" + from IOVDbSvc.IOVDbSvcConfig import addFolders, IOVDbSvcCfg + cfg.merge(addFolders(configFlags, [path+"ROD", path+"RODMUR", path+"MUR", path+"Geog"], instance, className="CondAttrListVec")[0]) + return cfg, path + +def SCT_CablingCondAlgCfg(configFlags): + cfg=ComponentAccumulator() + foldersCfg,path=SCT_CablingFoldersCfg(configFlags) + cfg.merge(foldersCfg) + from SCT_Cabling.SCT_CablingConf import SCT_CablingCondAlgFromCoraCool + cfg.addCondAlgo(SCT_CablingCondAlgFromCoraCool(ReadKeyRod=path+"ROD", + ReadKeyRodMur=path+"RODMUR", + ReadKeyMur=path+"MUR", + ReadKeyGeo=path+"Geog")) + return cfg diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.py b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.py index ced7a83dfd74955ab1f02abdbec7c017e5161f1c..ef158360aa29b32c3bd43bcd54af371f95a8019b 100644 --- a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.py +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.py @@ -1,64 +1,14 @@ # Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - - -def McEventSelectorCfg(configFlags): - cfg=ComponentAccumulator() - - from AthenaCommon import AtlasUnixStandardJob - - from McEventSelector.McEventSelectorConf import McCnvSvc - mcCnvSvc = McCnvSvc() - cfg.addService(mcCnvSvc) - from GaudiSvc.GaudiSvcConf import EvtPersistencySvc - cfg.addService(EvtPersistencySvc("EventPersistencySvc",CnvServices=[mcCnvSvc.getFullJobOptName(),])) - - from McEventSelector.McEventSelectorConf import McEventSelector - evSel=McEventSelector("EventSelector") - evSel.RunNumber = configFlags.Input.RunNumber - evSel.InitialTimeStamp = configFlags.Input.InitialTimeStamp - cfg.addService(evSel) - cfg.setAppProperty("EvtSel",evSel.getFullJobOptName()) - - return cfg - - -def SCT_CablingFoldersCfg(configFlags): - cfg=ComponentAccumulator() - - path="/SCT/DAQ/Config/" - if configFlags.IOVDb.DatabaseInstance == "COMP200": - path="/SCT/DAQ/Configuration/" +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/AthenaJobConfigRun3 - instance="SCT" - if ConfigFlags.Input.isMC: - instance="SCT_OFL" - - from IOVDbSvc.IOVDbSvcConfig import addFolders, IOVDbSvcCfg - cfg.merge(addFolders(configFlags, [path+"ROD", path+"RODMUR", path+"MUR", path+"Geog"], instance, className="CondAttrListVec")[0]) - - return cfg, path - - -def SCT_CablingCondAlgCfg(configFlags): - cfg=ComponentAccumulator() - - foldersCfg,path=SCT_CablingFoldersCfg(configFlags) - cfg.merge(foldersCfg) - - from SCT_Cabling.SCT_CablingConf import SCT_CablingCondAlgFromCoraCool - cfg.addCondAlgo(SCT_CablingCondAlgFromCoraCool(ReadKeyRod=path+"ROD", - ReadKeyRodMur=path+"RODMUR", - ReadKeyMur=path+"MUR", - ReadKeyGeo=path+"Geog")) - - return cfg +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator def SCT_TestCablingAlgCfg(configFlags): cfg=ComponentAccumulator() + from SCT_Cabling.SCT_CablingConfig import SCT_CablingCondAlgCfg cfg.merge(SCT_CablingCondAlgCfg(configFlags)) from AtlasGeoModel.GeoModelConfig import GeoModelCfg @@ -97,7 +47,10 @@ if __name__=="__main__": ConfigFlags.lock() cfg=ComponentAccumulator() + + from McEventSelector.McEventSelectorConfig import McEventSelectorCfg cfg.merge(McEventSelectorCfg(ConfigFlags)) + cfg.merge(SCT_TestCablingAlgCfg(ConfigFlags)) f=open("TestSCT_CablingCfg.pkl","w") diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.sh b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.sh old mode 100644 new mode 100755 index 88f32dd6140baf22497cc84561b50b3a4be3c431..64a170078fbdd0ab5eda1d403b6d0ce77cea4a3d --- a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.sh +++ b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingCfg.sh @@ -1,6 +1,6 @@ #!/bin/sh -rm -rf newJOtest.py bootstrap.pkl bootstrap.py +rm -rf TestSCT_CablingCfg.py bootstrap.pkl bootstrap.py # this is a hack to pre-confgure scheduler and other MT services, #will be taken away once NEW system has better means to influence the bootstrap content @@ -10,7 +10,7 @@ svcMgr.AvalancheSchedulerSvc.ShowControlFlow=True svcMgr.AvalancheSchedulerSvc.ShowDataDependencies=True EOF -athena --threads=1 --config-only=bootstrap.pkl bootstrap.py +athena --threads=2 --config-only=bootstrap.pkl bootstrap.py get_files -jo SCT_Cabling/TestSCT_CablingCfg.py