Skip to content
Snippets Groups Projects
Commit c3f88b26 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Configuration cleanup for athenaHLT

- Move all configuration of athenaHLT services to TriggerUnixStandardSetup.py.
  Remove the use of includes as much as possible (apart from user job options).
- Replace the OfflineTHistSvc.py include with a simple flag
- Add error in case the offline THistSvc is used with more than one child
- Move the configuration of HLTResultMTMaker to its own module
parent d7bdbeb7
No related branches found
No related tags found
No related merge requests found
Showing
with 175 additions and 627 deletions
......@@ -77,9 +77,6 @@ def update_pcommands(args, cdict):
cdict['trigger']['precommand'].append('_run_number=%d' % args.run_number)
if not args.oh_monitoring:
cdict['trigger']['precommand'].append("include('TrigServices/OfflineTHistSvc.py')")
if args.perfmon:
cdict['trigger']['precommand'].insert(0, "include('TrigCommon/PerfMon.py')")
......@@ -340,6 +337,9 @@ def main():
if not args.concurrent_events:
args.concurrent_events = args.threads
if args.nprocs > 1 and not args.oh_monitoring:
parser.error('You have to run with -M/--oh-monitoring in case of multiple child processes')
# Update args and set athena flags
update_run_params(args)
set_athena_flags(args)
......@@ -357,6 +357,10 @@ def main():
import TrigPSC.PscConfig
TrigPSC.PscConfig.interactive = args.interactive
# Select the correct THistSvc
from TrigServices.TriggerUnixStandardSetup import _Conf
_Conf.useOnlineTHistSvc = args.oh_monitoring
# Run HLTMPPU
from HLTMPPy.runner import runHLTMPPy
runHLTMPPy(cdict)
......
......@@ -15,11 +15,6 @@ if joPath[-4:] == '.pkl':
else:
### basic setup files and definitions ----------------------------------------
pscBootstrapFile = "TrigServices/TrigServicesBootstrap.py" # PSC bootstrap
pscServiceSetupBegin = "TrigServices/TrigServicesCommonBegin.py" # Service definitions
pscServiceSetupEnd = "TrigServices/TrigServicesCommonEnd.py" # Service definitions
import sys
import os
import string
......@@ -56,9 +51,10 @@ else:
## These properties have alread been set on the C++ ApplicationMgr in the Psc
## but the configurable needs to have them set as well
theApp.EventLoop = "HltEventLoopMgr"
theApp.MessageSvcType = PscConfig.optmap["MESSAGESVCTYPE"]
theApp.JobOptionsSvcType = PscConfig.optmap["JOBOPTIONSSVCTYPE"]
## add the MessageSvc and the JobOptionsSvc to the ServiceMgr
from AthenaCommon.ConfigurableDb import getConfigurable
ServiceMgr += getConfigurable(theApp.JobOptionsSvcType)("JobOptionsSvc")
......@@ -79,16 +75,6 @@ else:
## file inclusion and tracing
from AthenaCommon.Include import Include, IncludeError, include
## set the default values
try:
include( pscBootstrapFile )
except Exception, e:
if isinstance( e, IncludeError ):
print sys.exc_type, e
theApp._exitstate = ExitCodes.INCLUDE_ERROR
sys.exit( ExitCodes.INCLUDE_ERROR )
raise
## properties of the application manager
theApp.StatusCodeCheck = False # enabled via TriggerFlags.Online.doValidation (see below)
......@@ -134,15 +120,8 @@ else:
print "\n"
### basic job configuration before user configuration ------------------------
try:
include( pscServiceSetupBegin )
include.block( pscServiceSetupBegin )
except Exception, e:
print sys.exc_type, e
if isinstance( e, IncludeError ):
theApp._exitstate = ExitCodes.INCLUDE_ERROR
sys.exit( theApp._exitstate )
raise
from TrigServices.TriggerUnixStandardSetup import setupCommonServices
setupCommonServices()
### run user jobOptions file -------------------------------------------------
try:
......@@ -179,17 +158,10 @@ else:
raise
### basic job configuration after user configuration -------------------------
try:
include( pscServiceSetupEnd )
include.block( pscServiceSetupEnd )
except Exception, e:
if isinstance( e, IncludeError ):
print sys.exc_type, e
theApp._exitstate = ExitCodes.INCLUDE_ERROR
sys.exit( ExitCodes.INCLUDE_ERROR )
raise
from TrigServices.TriggerUnixStandardSetup import setupCommonServicesEnd
setupCommonServicesEnd()
### run optional command after user job options script -----------------------
### run optional command after user job options script -----------------------
if PscConfig.optmap['POSTCOMMAND']:
print "\n"
print " +------------------------------------------------+ "
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
# @file: TrigServicesConfig.py
# @purpose: customized configurables
......@@ -25,3 +25,47 @@ class TrigCOOLUpdateHelper(_TrigCOOLUpdateHelper):
else:
conddb.addFolderWithTag('TRIGGER',self.coolFolder,tag)
def setupMessageSvc():
from AthenaCommon.AppMgr import theApp
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, WARNING
svcMgr.MessageSvc = theApp.service( "MessageSvc" ) # already instantiated
MessageSvc = svcMgr.MessageSvc
MessageSvc.OutputLevel = theApp.OutputLevel
MessageSvc.Format = "%t % F%35W%S%7W%R%T %0W%M"
# Message suppression
MessageSvc.enableSuppression = False
MessageSvc.suppressRunningOnly = True
MessageSvc.resetStatsAtBeginRun = True
# 0 = no suppression, negative = log-suppression, positive = normal suppression
# Do not rely on the defaultLimit property, always set each limit separately
MessageSvc.defaultLimit = -100
MessageSvc.verboseLimit = MessageSvc.defaultLimit
MessageSvc.debugLimit = MessageSvc.defaultLimit
MessageSvc.infoLimit = MessageSvc.defaultLimit
MessageSvc.warningLimit = MessageSvc.defaultLimit
MessageSvc.errorLimit = 0
MessageSvc.fatalLimit = 0
# set message limit to unlimited when general DEBUG is requested
if MessageSvc.OutputLevel<=DEBUG :
MessageSvc.defaultLimit = 0
MessageSvc.enableSuppression = False
# publish message counts during RUNNING in histogram
MessageSvc.publishStats = True
MessageSvc.publishLevel = INFO
# show summary statistics of messages in finalize
MessageSvc.showStats = True
MessageSvc.statLevel = WARNING
MessageSvc.statLevelRun = VERBOSE
# publish message counts during RUNNING in histogram
MessageSvc.publishStats = True
MessageSvc.publishLevel = INFO
......@@ -7,42 +7,60 @@
class _Conf:
"""Some configuration flags for this module with defaults"""
useOnlineTHistSvc = True # set via TrigServices/OfflineTHistSvc.py
athenaXT = False # set below in _setupCommonServices
useOnlineTHistSvc = True # set in athenaHLT.py
def _eventLoopMgr(svcMgr):
if hasattr(svcMgr, 'HltEventLoopMgr'): return svcMgr.HltEventLoopMgr
return None
def _setupCommonServices():
from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, ERROR
# Add timestamp to python logger
def setupCommonServices():
from AthenaCommon import CfgMgr
from AthenaCommon.Logging import logging
from AthenaCommon.Constants import INFO
from AthenaCommon.AppMgr import ServiceMgr as svcMgr, theApp
from AthenaCommon.ConcurrencyFlags import jobproperties as jps
# Setup messaging for Python and C++
from AthenaCommon.Logging import log
log.setFormat("%(asctime)s Py:%(name)-31s %(levelname)7s %(message)s")
from AthenaCommon.Logging import logging
# Create our own logger
log = logging.getLogger( 'TriggerUnixStandardSetup::setupCommonServices:' )
from TrigServices.TrigServicesConfig import setupMessageSvc
setupMessageSvc()
# Do the default Atlas job configuration first
import AthenaCommon.AtlasUnixStandardJob
import AthenaCommon.AtlasUnixStandardJob # noqa: F401
# Now do HLT/thread specific configuration (see e.g. AtlasThreadedJob.py)
from StoreGate.StoreGateConf import SG__HiveMgrSvc
svcMgr += SG__HiveMgrSvc("EventDataSvc",
NSlots = jps.ConcurrencyFlags.NumConcurrentEvents())
import StoreGate.StoreGateConf as StoreGateConf
svcMgr += StoreGateConf.StoreGateSvc("ConditionStore")
# ThreadPoolService thread local initialization
from GaudiHive.GaudiHiveConf import ThreadPoolSvc
svcMgr += ThreadPoolSvc("ThreadPoolSvc")
svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"]
from GaudiHive.GaudiHiveConf import AlgResourcePool
svcMgr += AlgResourcePool( OutputLevel = INFO,
TopAlg=["AthMasterSeq"]) # this should enable control flow
from AthenaCommon.AlgSequence import AlgSequence
from SGComps.SGCompsConf import SGInputLoader
topSequence = AlgSequence()
topSequence += SGInputLoader(FailIfNoProxy = False) # change to True eventually
from AthenaCommon.AlgScheduler import AlgScheduler
AlgScheduler.ShowDataDependencies(False)
AlgScheduler.ShowControlFlow(False)
AlgScheduler.setDataLoaderAlg ('SGInputLoader' )
# Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute
theApp.AuditAlgorithms = True
from SGComps.SGCompsConf import SGCommitAuditor
svcMgr.AuditorSvc += SGCommitAuditor()
# Now do HLT specific configuration
from AthenaCommon import CfgMgr
from AthenaCommon.AppMgr import theApp
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.AppMgr import ToolSvc
# Check whether we are running in athenaXT
# Only a minimal set of properties should depend on this
import sys
if sys.modules.has_key('HLTTestApps'):
_Conf.athenaXT = True
log.debug("Configuration for athenaXT running")
else:
_Conf.athenaXT = False
log.debug("Configuration for online running")
# setup ROOT6
from PyUtils.Helpers import ROOT6Setup
ROOT6Setup()
......@@ -61,27 +79,40 @@ def _setupCommonServices():
# Initialization of DetDescrCnvSvc
svcMgr += CfgMgr.DetDescrCnvSvc(
# specify primary Identifier dictionary to be used
IdDictName = "IdDictParser/ATLAS_IDS.xml"
)
IdDictName = "IdDictParser/ATLAS_IDS.xml")
theApp.CreateSvc += [ svcMgr.DetDescrCnvSvc.getFullName() ]
svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ]
# --- ByteStreamCnvSvc configuration
svcMgr += CfgMgr.ByteStreamCnvSvc("ByteStreamCnvSvc")
# ByteStreamCnvSvc configuration
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamCnvSvc
svcMgr += ByteStreamCnvSvc("ByteStreamCnvSvc")
svcMgr.EventPersistencySvc.CnvServices += [ "ByteStreamCnvSvc" ]
# Disable history
svcMgr += CfgMgr.HistorySvc()
svcMgr.HistorySvc.Activate = False
from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamInputSvc
svcMgr += TrigByteStreamInputSvc("ByteStreamInputSvc")
from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigEventSelectorByteStream
svcMgr += TrigEventSelectorByteStream("EventSelector",
ByteStreamInputSvc = svcMgr.ByteStreamInputSvc)
theApp.EvtSel = "EventSelector"
from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamCnvSvc
svcMgr += TrigByteStreamCnvSvc("TrigByteStreamCnvSvc")
# make the HltEventLoopMgr service available
svcMgr.HltEventLoopMgr = theApp.service( "HltEventLoopMgr" ) # already instantiated
svcMgr.HltEventLoopMgr.WhiteboardSvc = "EventDataSvc"
svcMgr.HltEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler().getName()
svcMgr.HltEventLoopMgr.EvtSel = svcMgr.EventSelector
svcMgr.HltEventLoopMgr.OutputCnvSvc = svcMgr.TrigByteStreamCnvSvc
from TrigOutputHandling.TrigOutputHandlingConfig import HLTResultMTMakerCfg
svcMgr.HltEventLoopMgr.ResultMaker = HLTResultMTMakerCfg()
# Configuration of Interval of Validity Service
svcMgr += CfgMgr.IOVSvc()
# Configure CoreDumpSvc
if not hasattr(svcMgr,"CoreDumpSvc"):
from AthenaServices.Configurables import CoreDumpSvc
svcMgr += CoreDumpSvc()
# Configure COOL update helper tool
# from TrigServices.TrigServicesConfig import TrigCOOLUpdateHelper
# _eventLoopMgr(svcMgr).CoolUpdateTool = TrigCOOLUpdateHelper()
......@@ -109,17 +140,16 @@ def _setupCommonServices():
return
def _setupCommonServicesEnd():
from AthenaCommon.AppMgr import theApp
def setupCommonServicesEnd():
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.Logging import logging
from TriggerJobOpts.TriggerFlags import TriggerFlags
log = logging.getLogger( 'TriggerUnixStandardSetup::setupCommonServicesEnd:' )
# --- create the ByteStreamCnvSvc after the Detector Description otherwise
# --- the initialization of converters fails
theApp.CreateSvc += [ svcMgr.ByteStreamCnvSvc.getFullName() ]
#from AthenaCommon.AppMgr import theApp
#theApp.CreateSvc += [ svcMgr.ByteStreamCnvSvc.getFullName() ]
# Make sure no THistSvc output/input stream is defined for online running
if _Conf.useOnlineTHistSvc:
......@@ -154,70 +184,5 @@ def _setupCommonServicesEnd():
svcMgr.IOVDbSvc.CacheAlign = 0 # VERY IMPORTANT to get unique queries for folder udpates (see Savannah #81092)
svcMgr.IOVDbSvc.CacheRun = 0
svcMgr.IOVDbSvc.CacheTime = 0
# Flag to extract trigger configuration
if TriggerFlags.Online.doDBConfig():
from TrigConfigSvc import DoDBConfig
# --- print out configuration details
_printConfiguration(log.name)
return
def _printConfiguration(loggerName):
from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, ERROR
from AthenaCommon.Logging import logging
if loggerName == '':
loggerName = 'TriggerUnixStandardSetup::_printConfiguration'
log = logging.getLogger( loggerName )
# --- print out configuration details
# ---
from AthenaCommon.AppMgr import theApp
log.debug("---> Application Manager")
log.debug(theApp)
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
log.debug("---> Service Manager")
log.debug(svcMgr)
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
log.debug("---> Algorithm Sequence")
log.debug(topSequence)
return
def setupHLTServicesBegin():
from AthenaCommon import CfgMgr
from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, ERROR
from AthenaCommon.AppMgr import theApp
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.Logging import logging
log = logging.getLogger( 'TriggerUnixStandardSetup::setupHLTServicesBegin:' )
log.debug( "---> Start" )
# --- setup the standard services
_setupCommonServices()
# --- Hlt ROBDataProvider configuration
svcMgr += CfgMgr.HltROBDataProviderSvc("ROBDataProviderSvc")
theApp.CreateSvc += [ svcMgr.ROBDataProviderSvc.getFullName() ]
log.debug( "---> End" )
return
def setupHLTServicesEnd():
from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, ERROR
from AthenaCommon.Logging import logging
log = logging.getLogger( 'TriggerUnixStandardSetup::setupHLTServicesEnd:' )
log.debug( "---> Start" )
# --- final modifications to standard services
_setupCommonServicesEnd()
log.debug( "---> End" )
return
#**************************************************************
#
# MessageSvc configuration file
#
#==============================================================
from AthenaCommon.AppMgr import theApp
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.Constants import *
# make the message service available
svcMgr.MessageSvc = theApp.service( "MessageSvc" ) # already instantiated
MessageSvc = svcMgr.MessageSvc
MessageSvc.OutputLevel = theApp.OutputLevel
# Use color for different message levels
# --------------------------------------
MessageSvc.useColors = False
# Format string for all messages
# ------------------------------
MessageSvc.Format = "%t % F%35W%S%7W%R%T %0W%M"
# Message suppression
# -------------------
MessageSvc.enableSuppression = False
MessageSvc.suppressRunningOnly = True
MessageSvc.resetStatsAtBeginRun = True
# 0 = no suppression, negative = log-suppression, positive = normal suppression
# Do not rely on the defaultLimit property, always set each limit separately
MessageSvc.defaultLimit = -100
MessageSvc.verboseLimit = MessageSvc.defaultLimit
MessageSvc.debugLimit = MessageSvc.defaultLimit
MessageSvc.infoLimit = MessageSvc.defaultLimit
MessageSvc.warningLimit = MessageSvc.defaultLimit
MessageSvc.errorLimit = 0
MessageSvc.fatalLimit = 0
# set message limit to unlimited when general DEBUG is requested
if MessageSvc.OutputLevel<=DEBUG :
MessageSvc.defaultLimit = 0
MessageSvc.enableSuppression = False
# show summary statistics of messages in finalize
# -----------------------------------------------
MessageSvc.showStats = True
MessageSvc.statLevel = WARNING
MessageSvc.statLevelRun = VERBOSE
# publish message counts during RUNNING in histogram
# --------------------------------------------------
MessageSvc.publishStats = True
MessageSvc.publishLevel = INFO
# report messages via ERS
# -----------------------
# report given message severities via ERS
# MessageSvc.useErsVerbose = ['*']
# MessageSvc.useErsDebug = ['*']
# MessageSvc.useErsInfo = ['*']
# MessageSvc.useErsWarning = ['*']
# MessageSvc.useErsError = ['*']
# MessageSvc.useErsFatal = ['*']
# Set to True, if ERS messages should be duplicated to the MsgStream
# MessageSvc.alwaysUseMsgStream = True
# Only forward message during RUNNING
# MessageSvc.useErsRunningOnly = True
#==============================================================
#
# End of MessageSvc configuration file
#
#**************************************************************
## @file OfflineTHistSvc.py
## @brief Configure the offline THistSvc
## @author Frank Winklmeier <fwinkl@cern.ch>
##
## This fragment will be included by athenaHLT if we are
## running withtout the OH monitoring. Otherwise, the default
## is to use the online histogramming service (TrigMonTHistSvc)
###################################################################
from TrigServices.TriggerUnixStandardSetup import _Conf
_Conf.useOnlineTHistSvc = False
del _Conf
#**************************************************************
#
# HLT bootstrap options file
#
#==============================================================
#--------------------------------------------------------------
# HLT specific event loop and output stream
#--------------------------------------------------------------
theApp.EventLoop = "HltEventLoopMgr"
#theApp.OutStreamType = "AthenaOutputStream"
#--------------------------------------------------------------
# in Hlt the EventLoop is controlled by the HLT Processing Unit
# so the default is no Event Selector
#--------------------------------------------------------------
theApp.EvtSel = "NONE"
#--------------------------------------------------------------
# take care of job options legacy
#--------------------------------------------------------------
theApp.JobOptionsPath = ""
theApp.JobOptionsType = "NONE"
#==============================================================
#
# End of HLT bootstrap options file
#
#**************************************************************
#**************************************************************
#
# HLT common configuration file: TrigServicesCommonBegin.py
#
#==============================================================
include( "TrigServices/MessageSvc.py" )
include( "TrigServices/TrigServicesEventLoopMgr.py" )
## HLT standard service configuration
# from TrigServices.TriggerUnixStandardSetup import setupHLTServicesBegin
# setupHLTServicesBegin()
## clean-up: avoid running multiple times this method
# del setupHLTServicesBegin
#==============================================================
#
# End of HLT common configuration file: TrigServicesCommonBegin.py
#
#**************************************************************
#**************************************************************
#
# HLT common configuration file: TrigServicesCommonEnd.py
#
#==============================================================
## get a handle on the ServiceMgr
# from AthenaCommon.AppMgr import ServiceMgr as svcMgr
## HLT standard service configuration
# from TrigServices.TriggerUnixStandardSetup import setupHLTServicesEnd
# setupHLTServicesEnd()
## clean-up: avoid running multiple times this method
# del setupHLTServicesEnd
#==============================================================
#
# End of HLT common configuration file: TrigServicesCommonEnd.py
#
#**************************************************************
#**************************************************************
#
# TrigServicesEventLoopMgr configuration file
#
#==============================================================
from AthenaCommon import CfgMgr
from AthenaCommon.AppMgr import theApp
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.AppMgr import ToolSvc
# from AthenaCommon.Constants import *
# ==============================================================================
# Set up from StoreGateHiveExample.py and AthExHiveOpts.py and AtlasThreadedJob.py
# ==============================================================================
#nThreads = 1
#numStores = 1
#numAlgsInFlight = nThreads
#from AthenaCommon.ConcurrencyFlags import jobproperties as jps
#jps.ConcurrencyFlags.NumThreads = nThreads
#jps.ConcurrencyFlags.NumConcurrentEvents = numStores
# from GaudiCommonSvc.GaudiCommonSvcConf import AlgContextSvc
# svcMgr += AlgContextSvc("AlgContextSvc")
# svcMgr.AlgContextSvc.Check = True
from StoreGate.StoreGateConf import SG__HiveMgrSvc
svcMgr += SG__HiveMgrSvc("EventDataSvc")
#svcMgr.EventDataSvc.NSlots = numStores
#svcMgr.EventDataSvc.OutputLevel = VERBOSE
from GaudiHive.GaudiHiveConf import AlgResourcePool
arp=AlgResourcePool()
arp.TopAlg=["AthMasterSeq"] #this should enable control flow
svcMgr += arp
from AthenaCommon.AlgScheduler import AlgScheduler
#AlgScheduler.setThreadPoolSize(nThreads)
AlgScheduler.ShowDataDependencies(True)
AlgScheduler.ShowControlFlow(True)
from StoreGate.StoreGateConf import StoreGateSvc
svcMgr += StoreGateSvc()
from StoreGate.StoreGateConf import SGImplSvc
svcMgr += SGImplSvc("SGImplSvc")
# ThreadPoolService thread local initialization
from GaudiHive.GaudiHiveConf import ThreadPoolSvc
svcMgr += ThreadPoolSvc("ThreadPoolSvc")
svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"]
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
#algCardinality = nThreads
# if (algCardinality != 1):
# for alg in topSequence:
# name = alg.name()
# alg.Cardinality = algCardinality
from SGComps.SGCompsConf import SGInputLoader
topSequence += SGInputLoader( FailIfNoProxy=False )
theAuditorSvc = svcMgr.AuditorSvc
theApp.AuditAlgorithms=True
from SGComps.SGCompsConf import SGCommitAuditor
theAuditorSvc += SGCommitAuditor()
# ==============================================================================
# Event selector and input service
# ==============================================================================
from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamInputSvc
inputSvc = TrigByteStreamInputSvc("ByteStreamInputSvc")
svcMgr += inputSvc
from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigEventSelectorByteStream
evtSel = TrigEventSelectorByteStream("EventSelector")
evtSel.ByteStreamInputSvc = inputSvc
svcMgr += evtSel
theApp.EvtSel = "EventSelector"
# ==============================================================================
# Output conversion service
# ==============================================================================
from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamCnvSvc
outputCnvSvc = TrigByteStreamCnvSvc("TrigByteStreamCnvSvc")
svcMgr += outputCnvSvc
# ==============================================================================
# Some extra services
# ==============================================================================
## basic Gaudi services from AtlasUnixStandardJob.py
import GaudiSvc.GaudiSvcConf as GaudiSvcConf
svcMgr += GaudiSvcConf.IncidentSvc()
svcMgr += GaudiSvcConf.EvtPersistencySvc( "EventPersistencySvc" )
svcMgr += GaudiSvcConf.HistogramSvc( "HistogramDataSvc" )
svcMgr += GaudiSvcConf.NTupleSvc()
svcMgr += GaudiSvcConf.ToolSvc()
svcMgr += GaudiSvcConf.RndmGenSvc()
svcMgr += GaudiSvcConf.ChronoStatSvc()
#####
from StoreGate.StoreGateConf import StoreGateSvc
svcMgr += StoreGateSvc("DetectorStore")
# ProxyProviderSvc services configuration
svcMgr += CfgMgr.ProxyProviderSvc()
# --- ByteStreamAddressProviderSvc configuration
svcMgr += CfgMgr.ByteStreamAddressProviderSvc()
svcMgr.ProxyProviderSvc.ProviderNames += [ "ByteStreamAddressProviderSvc" ]
#theApp.CreateSvc += [ svcMgr.ByteStreamAddressProviderSvc.getFullName() ]
# Initialization of DetDescrCnvSvc
svcMgr += CfgMgr.DetDescrCnvSvc(
# specify primary Identifier dictionary to be used
IdDictName = "IdDictParser/ATLAS_IDS.xml"
)
theApp.CreateSvc += [ svcMgr.DetDescrCnvSvc.getFullName() ]
svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ]
# --- ByteStreamCnvSvc configuration
svcMgr += CfgMgr.ByteStreamCnvSvc("ByteStreamCnvSvc")
svcMgr.EventPersistencySvc.CnvServices += [ "ByteStreamCnvSvc" ]
# dictionary services from AtlasUnixStandardJob.py
# the dict loader
import AthenaServices.AthenaServicesConf as AthenaServicesConf
if not hasattr(svcMgr, 'AthDictLoaderSvc'):
svcMgr += AthenaServicesConf.AthDictLoaderSvc()
theApp.CreateSvc += [svcMgr.AthDictLoaderSvc.getFullJobOptName()]
# the dict checker
if not hasattr(svcMgr, 'AthenaSealSvc'):
svcMgr += AthenaServicesConf.AthenaSealSvc()
theApp.CreateSvc += [svcMgr.AthenaSealSvc.getFullJobOptName()]
# ==============================================================================
# HLT result monitoring
# ==============================================================================
from TrigOutputHandling.TrigOutputHandlingConf import HLTResultMTMaker
hltResultMaker = HLTResultMTMaker()
from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
hltResultMaker.MonTool = GenericMonitoringTool("MonOfHLTResultMTtest")
hltResultMaker.MonTool.HistPath = "OutputMonitoring"
hltResultMaker.MonTool.Histograms = [ defineHistogram( 'TIME_build', path='EXPERT', type='TH1F', title='Time of result construction in;[micro seccond]',
xbins=100, xmin=0, xmax=1000 ),
defineHistogram( 'nstreams', path='EXPERT', type='TH1F', title='number of streams',
xbins=60, xmin=0, xmax=60 ),
defineHistogram( 'nfrags', path='EXPERT', type='TH1F', title='number of HLT results',
xbins=10, xmin=0, xmax=10 ),
defineHistogram( 'sizeMain', path='EXPERT', type='TH1F', title='Main (physics) HLT Result size;4B words',
xbins=100, xmin=-1, xmax=999 ) ] # 1000 k span
# ==============================================================================
# Message format
# ==============================================================================
msgFmt = "% F%40W%S %4W%e%s %7W%R %T %0W%M"
svcMgr.MessageSvc.Format = msgFmt
# ==============================================================================
# General setup
# ==============================================================================
# make the HltEventLoopMgr service available
svcMgr.HltEventLoopMgr = theApp.service( "HltEventLoopMgr" ) # already instantiated
HltEventLoopMgr = svcMgr.HltEventLoopMgr
HltEventLoopMgr.WhiteboardSvc = "EventDataSvc"
HltEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler().getName()
HltEventLoopMgr.EvtSel = evtSel
HltEventLoopMgr.OutputCnvSvc = outputCnvSvc
HltEventLoopMgr.ResultMaker = hltResultMaker
# configure here Level-1 CTP ROB identifier which is used in HLT
# HltEventLoopMgr.Lvl1CTPROBid = 0x770001
# request that events with invalid or missing CTP ROBs are skipped by the HltEventLoopMgr
# (default: don't skip these events)
# HltEventLoopMgr.Lvl1CTPROBcheck = TRUE
#
# name of the HLT Result object in StoreGate
#
# HltEventLoopMgr.HltResultName = "HLTResult_HLT"
#
# handling of truncated HLT Results
#
# switch on saving of events with truncated HLT results to DEBUG stream (default FALSE)
#HltEventLoopMgr.WriteTruncatedHLTtoDebug = FALSE
# name of DEBUG Stream (default "TruncatedHLTResult")
#HltEventLoopMgr.HltTruncationDebugStreamName = "TruncatedHLTResult"
# list of stream names which should not be send to the truncation DEBUG stream (default ["CostMonitoring"])
# HltEventLoopMgr.ExcludeFromHltTruncationDebugStream = ["CostMonitoring"]
#
# properties for the HLT result size histograms
# --> set upper edge of histogram to maximum allowed number of words in HLT
#
# HltEventLoopMgr.histHltResultSize=("HltResultSize",0,125000,100)
#
# Configuration of EDM size monitoring plots
#
# try:
# from TrigEDMConfig.TriggerEDM import EDMDetails,getTypeAndKey,keyToLabel
# from TrigEDMConfig.TriggerEDM import TriggerHLTList
#
# # TODO update to use import TriggerHLTList directly
# #from TrigEDMConfig.TriggerEDM import TriggerL2List,TriggerEFList
# #TriggerHLTList = list(set(TriggerL2List).union(TriggerEFList))
#
# l = []
# for item in TriggerHLTList:
# if ('BS' in item[1].split()) or ('DS' in item[1].split()):
# t,k = getTypeAndKey(item[0])
# ctype = t
# if EDMDetails[t].has_key('collection'):
# ctype = EDMDetails[t]['collection']
# l += [ctype+'__'+keyToLabel(k)]
# # add a bin for not accounted collections
# l += ['not__configured']
#
# HltEventLoopMgr.HltEDMCollectionNames = l
# number_of_collections=len( HltEventLoopMgr.HltEDMCollectionNames )
# HltEventLoopMgr.histHltEdmSizes=("HltEDMSizes",0., 15000., number_of_collections)
# except ImportError,e:
# print " +----------------------------------------------------------------------+ "
# print " | No initial configuration for EDM monitoring plots will be available! | "
# print " +----------------------------------------------------------------------+ "
# print e
#==============================================================
#
# End of TrigServicesEventLoopMgr configuration file
#
#**************************************************************
#**************************************************************
#
# TrigServicesTHistSvc configuration file
#
#==============================================================
# loading of this library (not a problem if done twice)
theApp.Dlls += [ "TrigServices" ]
# service creation
theApp.ExtSvc += [ "HltTHistSvc/THistSvc" ]
theApp.MultiThreadExtSvc += [ "HltTHistSvc/THistSvc" ]
# just a helper function
def defineTHistSvcOutputFile(dir, name, opt='NEW', service='THistSvc'):
if numberOfThreads.value() == 0:
THistSvc = Service(service)
THistSvc.Output += [dir+" DATAFILE=\'"+name+"' OPT=\'"+opt+"\'" ]
return
for n in range(0,numberOfThreads.value()):
threadID = '__%(#)d' % { '#': n}
THistSvc = Service ( service+threadID )
THistSvc.Output += [dir+" DATAFILE=\'"+name+threadID+"' OPT=\'"+opt+"\'" ]
# default settings
defineTHistSvcOutputFile("SHIFT", "monitoring-shift.root")
defineTHistSvcOutputFile("EXPERT", "monitoring-expert.root")
defineTHistSvcOutputFile("DEBUG", "monitoring-debug.root")
defineTHistSvcOutputFile("RUNSTAT", "monitoring-runstat.root")
# user can also specify REGEX used to check Histograms Naming Convention
# THistSvc = Service("THistSvc")
#
# all sort of regex can be given
# THistSvc.ExcludeName = ".+LAr.+" # no LAr histograms any more
# THistSvc.IncludeName = "/SHIFT/.+" # only monitoring allowed
#
# the default is (implementation of the naming convention):
# see: https://edms.cern.ch/document/710911/1
# see: https://twiki.cern.ch/twiki/bin/view/Atlas/AthenaMTHistogramming
#
# THistSvc.ExcludeName = ".*\..*"
# THistSvc.IncludeName = "^/((SHIFT)|(EXPERT)|(DEBUG)|(RUNSTAT))/.+/.+"
#
# Similar can be specified for histogram types (name of the ROOT class)
# example below can be used to exclude 2dim histograms from being registered
# THistSvc.ExcludeType = ".+2.+"
# example below accepts only 1 dimensional integer histogram
# THistSvc.ExcludeType = ".+"
# THistSvc.IncludeType = "TH1I"
#==============================================================
#
# End of TrigServicesTHistSvc configuration file
#
#**************************************************************
......@@ -9,41 +9,45 @@ atlas_subdir( TrigOutputHandling )
atlas_depends_on_subdirs( PUBLIC
GaudiKernel
PRIVATE
Control/AthContainers
Control/AthLinks
Control/AthContainers
Control/AthLinks
Control/AthenaBaseComps
Control/AthViews
Trigger/TrigEvent/TrigSteeringEvent
Event/xAOD/xAODTrigCalo
Event/xAOD/xAODTrigEgamma
Event/xAOD/xAODTrigger
Event/xAOD/xAODTracking
Trigger/TrigDataAccess/TrigSerializeResult
Event/xAOD/xAODTrigMuon
Event/xAOD/xAODMuon
Trigger/TrigSteer/DecisionHandling
Control/AthenaMonitoring
)
Trigger/TrigEvent/TrigSteeringEvent
Event/xAOD/xAODTrigCalo
Event/xAOD/xAODTrigEgamma
Event/xAOD/xAODTrigger
Event/xAOD/xAODTracking
Trigger/TrigDataAccess/TrigSerializeResult
Event/xAOD/xAODTrigMuon
Event/xAOD/xAODMuon
Trigger/TrigSteer/DecisionHandling
Control/AthenaMonitoring
)
find_package( tdaq-common )
# Component(s) in the package:
atlas_add_library( TrigOutputHandlingLib
src/*.cxx
PUBLIC_HEADERS TrigOutputHandling
INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} GaudiKernel AthViews AthenaBaseComps TrigSteeringEvent TrigSerializeResultLib
xAODTrigCalo xAODTrigEgamma xAODTrigger xAODTracking xAODTrigMuon xAODMuon DecisionHandlingLib AthenaMonitoringLib )
xAODTrigCalo xAODTrigEgamma xAODTrigger xAODTracking xAODTrigMuon xAODMuon DecisionHandlingLib AthenaMonitoringLib )
atlas_add_component( TrigOutputHandling
src/components/*.cxx
src/components/*.cxx
LINK_LIBRARIES TrigOutputHandlingLib )
# Install files from the package:
atlas_install_python_modules( python/*.py )
# Tests:
atlas_add_test( void_record_test
SOURCES test/void_record_test.cxx
INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
LINK_LIBRARIES ${Boost_LIBRARIES} xAODTrigger
AthLinks AthenaKernel StoreGateLib GaudiKernel TestTools xAODCore
AthLinks AthenaKernel StoreGateLib GaudiKernel TestTools xAODCore
ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share"
POST_EXEC_SCRIPT nopost.sh
POST_EXEC_SCRIPT nopost.sh
PROPERTIES TIMEOUT 300
)
)
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
def HLTResultMTMakerCfg():
from TrigOutputHandlingConf import HLTResultMTMaker
from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
m = HLTResultMTMaker()
m.MonTool = GenericMonitoringTool('MonTool', HistPath='HLTResultMTMaker')
m.MonTool.Histograms = [ defineHistogram( 'TIME_build', path='EXPERT', type='TH1F', title='Time of result construction in;[micro seccond]',
xbins=100, xmin=0, xmax=1000 ),
defineHistogram( 'nstreams', path='EXPERT', type='TH1F', title='number of streams',
xbins=60, xmin=0, xmax=60 ),
defineHistogram( 'nfrags', path='EXPERT', type='TH1F', title='number of HLT results',
xbins=10, xmin=0, xmax=10 ),
defineHistogram( 'sizeMain', path='EXPERT', type='TH1F', title='Main (physics) HLT Result size;4B words',
xbins=100, xmin=-1, xmax=999 ) ] # 1000 k span
return m
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