Skip to content
Snippets Groups Projects
Commit 930de435 authored by Susumu Oda's avatar Susumu Oda Committed by Walter Lampl
Browse files

Add test job option and shell scrip using component accumulator for SCT_Cabling

parent 11f76314
No related branches found
No related tags found
No related merge requests found
......@@ -92,8 +92,12 @@ def addFolders(configFlags,folderstrings,detDb=None,className=None):
loadFolders.append((className, _extractFolder(fs)));
result.getCondAlgo("CondInputLoader").Load+=loadFolders
#result.addCondAlgo(CondInputLoader(Load=loadFolders))
from AthenaPoolCnvSvc.AthenaPoolCnvSvcConf import AthenaPoolCnvSvc
apcs=AthenaPoolCnvSvc()
result.addService(apcs)
from GaudiSvc.GaudiSvcConf import EvtPersistencySvc
result.addService(EvtPersistencySvc("EventPersistencySvc",CnvServices=[apcs.getFullJobOptName(),]))
if detDb is not None:
......
......@@ -39,4 +39,5 @@ atlas_add_component( SCT_Cabling
# Install files from the package:
atlas_install_joboptions( share/*.py )
atlas_install_runtime( share/*.dat )
atlas_install_scripts( share/*.sh )
atlas_install_python_modules( python/*.py )
# 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/"
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
def SCT_TestCablingAlgCfg(configFlags):
cfg=ComponentAccumulator()
cfg.merge(SCT_CablingCondAlgCfg(configFlags))
from AtlasGeoModel.GeoModelConfig import GeoModelCfg
geoCfg,gms=GeoModelCfg(configFlags)
cfg.merge(geoCfg)
from AthenaCommon.Constants import INFO
from AthenaCommon.CfgGetter import getPrivateTool
SCT_CablingTool = getPrivateTool("SCT_CablingTool")
SCT_CablingTool.DataSource = "COOLVECTOR"
SCT_CablingTool.OutputLevel = INFO
from SCT_Cabling.SCT_CablingConf import SCT_TestCablingAlg
testAlg = SCT_TestCablingAlg(SCT_CablingTool = SCT_CablingTool,
OutputLevel = INFO)
cfg.addEventAlgo(testAlg)
return cfg
if __name__=="__main__":
from AthenaCommon.Logging import log
from AthenaCommon.Constants import DEBUG
log.setLevel(DEBUG)
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior=1
from AthenaConfiguration.AllConfigFlags import ConfigFlags
ConfigFlags.Input.isMC = True
ConfigFlags.Input.RunNumber = 300000
ConfigFlags.addFlag("Input.InitialTimeStamp", 1500000000)
# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/ConditionsRun1RunNumbers
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-RUN12-SDR-25"
ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2015-03-01-00"
ConfigFlags.lock()
cfg=ComponentAccumulator()
cfg.merge(McEventSelectorCfg(ConfigFlags))
cfg.merge(SCT_TestCablingAlgCfg(ConfigFlags))
f=open("TestSCT_CablingCfg.pkl","w")
cfg.store(f)
f.close()
#!/bin/sh
rm -rf newJOtest.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
cat <<EOF >> bootstrap.py
from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
svcMgr.AvalancheSchedulerSvc.ShowControlFlow=True
svcMgr.AvalancheSchedulerSvc.ShowDataDependencies=True
EOF
athena --threads=1 --config-only=bootstrap.pkl bootstrap.py
get_files -jo SCT_Cabling/TestSCT_CablingCfg.py
python TestSCT_CablingCfg.py # generate pickle
status=$?
if [ ${status} -ne 0 ]
then
echo "ERROR in configuration generation stage, stopping"
exit -1
else
echo
echo "JOs reading stage finished, launching Athena from pickle file"
echo
athena --evtMax=2 TestSCT_CablingCfg.pkl
fi
################################################################################
# Job options file to test the Cabling
################################################################################
from AthenaCommon.AppMgr import theApp
theApp.EvtMax = 1
theApp.AuditAlgorithms = True
from AthenaCommon.AppMgr import ServiceMgr
#--------------------------------------------------------------
# Set output lvl (VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL)
#--------------------------------------------------------------
ServiceMgr.MessageSvc.OutputLevel = INFO
ServiceMgr.MessageSvc.infoLimit = 100000
#--------------------------------------------------------------
# Event selector settings. Use McEventSelector
#--------------------------------------------------------------
import AthenaCommon.AtlasUnixGeneratorJob
ServiceMgr.EventSelector.RunNumber = 310809
# initial time stamp - this is number of seconds since 1st Jan 1970 GMT
# run 310809 Recording start/end 2016-Oct-17 21:39:18 / 2016-Oct-18 16:45:23 UTC
ServiceMgr.EventSelector.InitialTimeStamp = 1476741326 # LB 18 of run 310809, 10/17/2016 @ 9:55pm (UTC)
#--------------------------------------------------------------
# Load IOVDbSvc
#--------------------------------------------------------------
from IOVDbSvc.CondDB import conddb
ServiceMgr.IOVDbSvc.GlobalTag = "OFLCOND-RUN12-SDR-25"
ServiceMgr.IOVDbSvc.OutputLevel = DEBUG
#--------------------------------------------------------------
# use auditors
#--------------------------------------------------------------
from GaudiSvc.GaudiSvcConf import AuditorSvc
ServiceMgr += AuditorSvc()
ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"]
ServiceMgr.AuditorSvc.Auditors += [ "MemStatAuditor" ]
#--------------------------------------------------------------
# Load Geometry
#--------------------------------------------------------------
from AthenaCommon.GlobalFlags import globalflags
globalflags.DetDescrVersion = "ATLAS-R2-2015-03-01-00"
globalflags.DetGeo="atlas"
globalflags.InputFormat="pool"
globalflags.DataSource="geant4"
#--------------------------------------------------------------
# Set Detector setup
#--------------------------------------------------------------
# --- switch on InnerDetector
from AthenaCommon.DetFlags import DetFlags
DetFlags.ID_setOn()
DetFlags.Calo_setOff()
DetFlags.Muon_setOff()
DetFlags.Truth_setOff()
DetFlags.LVL1_setOff()
DetFlags.SCT_setOn()
DetFlags.pixel_setOff()
DetFlags.TRT_setOff()
# ---- switch parts of ID off/on as follows
#switch off tasks
DetFlags.pileup.all_setOff()
DetFlags.simulate.all_setOff()
DetFlags.makeRIO.all_setOff()
DetFlags.writeBS.all_setOff()
DetFlags.readRDOBS.all_setOff()
DetFlags.readRIOBS.all_setOff()
DetFlags.readRIOPool.all_setOff()
DetFlags.writeRIOPool.all_setOff()
import AtlasGeoModel.SetGeometryVersion
import AtlasGeoModel.GeoModelInit
#--------------------------------------------------------------
# Load CondAlg, Tool and TestAlg
#--------------------------------------------------------------
from AthenaCommon.AlgSequence import AthSequencer
condSeq = AthSequencer("AthCondSeq")
condAlgName = "SCT_CablingCondAlgFromCoraCool"
if not hasattr(condSeq, condAlgName):
from AthenaCommon.CfgGetter import getAlgorithm
SCT_CablingCondAlgFromCoraCool = getAlgorithm(condAlgName)
condSeq += SCT_CablingCondAlgFromCoraCool
from AthenaCommon.CfgGetter import getPrivateTool
SCT_CablingTool = getPrivateTool("SCT_CablingTool")
SCT_CablingTool.DataSource = "COOLVECTOR"
SCT_CablingTool.OutputLevel = INFO
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
from SCT_Cabling.SCT_CablingConf import SCT_TestCablingAlg
topSequence += SCT_TestCablingAlg(SCT_CablingTool=SCT_CablingTool,
OutputLevel = INFO)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment