Skip to content
Snippets Groups Projects
Commit 6416687e authored by Frank Winklmeier's avatar Frank Winklmeier Committed by Melissa Yexley
Browse files

ByteStreamEmonSvc: remove legacy job options

parent a8d505a9
No related branches found
No related tags found
No related merge requests found
################################################################################
# Package: ByteStreamEmonSvc
################################################################################
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( ByteStreamEmonSvc )
......@@ -16,7 +14,6 @@ atlas_add_component( ByteStreamEmonSvc
LINK_LIBRARIES ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${TDAQ_LIBRARIES} ByteStreamCnvSvcLib ByteStreamData GaudiKernel StoreGateLib PersistentDataModel ByteStreamCnvSvcBaseLib xAODEventInfo TrigConfData )
# Install files from the package:
atlas_install_joboptions( share/*.py )
atlas_install_python_modules( python/*.py )
atlas_add_test(
......
#
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
#
'''
This is a trivial old-JO (RecEx-style) wrapper around the new (ComponentAccumulator) config
of ByteStream reading from EMon. It can be deleted once the clients are adapted to new config.
'''
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
from ByteStreamEmonSvc.EmonByteStreamConfig import EmonByteStreamCfg
CAtoGlobalWrapper(EmonByteStreamCfg, ConfigFlags)
#########################################
#
# Example setup for ByteStreamEmonSvc
#
#########################################
# Common part, copy from here
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.Constants import *
include("ByteStreamEmonSvc/ByteStreamEmonInputSvc_jobOptions.py")
# #####################################################
# If using the ERSBootstrap.py file, enable the output
# via ERS
# ####################################################
#MessageSvc.useErs = True
# Define the input
ByteStreamEmonInputSvc = svcMgr.ByteStreamInputSvc
# ############################################################
# The name of the partition you want to connect to is taken
# from 'TDAQ_PARTITION' if it this parameter is empty, otherwise from here.
# ############################################################
ByteStreamEmonInputSvc.Partition = "rhauser_hlt"
# #########################################
# The source of events, SFI for full events
# #########################################
ByteStreamEmonInputSvc.Key = "SFI"
# ############################################################
# A list of of key values, e.g. a list of SFIs to contact.
# If not defined, all event providers of this type (e.g. all SFIs)
# ############################################################
# ByteStreamEmonInputSvc.KeyValue = ["SFI-1", "SFI-2" ]
# ###########################################################
# Preferred way: just indicate the number of SFIs you
# want to connect to.
# ###########################################################
ByteStreamEmonInputSvc.KeyCount = 3
# ############################################################
# GroupName: Monitors with the same group name and selection
# criteria will never receive same events.
# ############################################################
# ByteStreamEmonInputSvc.GroupName = ""
# ############################################################
# Number of internally buffered events. Keep small for
# full events.
# ############################################################
# ByteStreamEmonInputSvc.BufferSize = 2
# #######################################
# Set this to the IS server where you want
# to publish histograms, too. If unset, no
# histograms are published.
# #######################################
#ByteStreamEmonInputSvc.ISServer = 'Histogramming'
# ########################################
# The provider name under which your histograms
# appear in OH.
# ########################################
#ByteStreamEmonInputSvc.PublishName = 'HelloWorld'
# ###################################################
# Should histograms be cleared at new run ? default: yes
# ###################################################
# ByteStreamEmonInputSvc.ClearHistograms = True
# ####################################################
# A regular expression to restrict which histograms are published.
# ####################################################
# ByteStreamEmonInputSvc.Include = '.*'
# ByteStreamEmonInputSvc.Exclude = ''
# ###############################################
# Frequency of updates (in number of events, not secs...)
# ###############################################
# ByteStreamEmonInputSvc.Frequency = 5
# ##############################
# one of 'Ignore', 'Or', 'And'
# ##############################
ByteStreamEmonInputSvc.LVL1Logic = "Ignore"
# ###########################################################
# A LVL1 bit pattern to select events on.
#
# From 1 to 4 64bit values, first entry = Bit 0..63 in CTP
# ###########################################################
#ByteStreamEmonInputSvc.LVL1Bits = [ 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff]
# ###########################################################
# A list of L1 bit names to select on. This requires the
# L1CT.TrigConfL1Items to be published in IS.
#
# This can be used instead of or in addition to LVL1Bits.
# ###########################################################
#ByteStreamEmonInputSvc.LVL1Names = ['L1_MU2', 'L1_MU3', 'L1_EM10' ]
# #################################################
# Shall athena exit if the partition is shutdown ?
# For offline athena tasks mainly.
# #################################################
#ByteStreamEmonInputSvc.ExitOnPartitionShutdown = False
ByteStreamCnvSvc = Service( "ByteStreamCnvSvc" )
theApp.ExtSvc += [ "ByteStreamCnvSvc"]
# It looks as if one needs this now online ?
if False:
from AthenaServices.AthenaServicesConf import MetaDataSvc
svcMgr += MetaDataSvc( "MetaDataSvc" )
# Add in MetaData Stores
from StoreGate.StoreGateConf import StoreGateSvc
svcMgr += StoreGateSvc( "MetaDataStore" )
svcMgr += StoreGateSvc( "InputMetaDataStore" )
# Make MetaDataSvc an AddressProvider
svcMgr.ProxyProviderSvc.ProviderNames += [ "MetaDataSvc" ]
# enable IOVDbSvc to read metadata
#svcMgr.MetaDataSvc.MetaDataContainer = "MetaDataHdr"
#svcMgr.MetaDataSvc.MetaDataTools += [ "IOVDbMetaDataTool" ]
MetaDataStore=svcMgr.MetaDataStore
#--------------------------------------------------------------
# Private Application Configuration options, replace with
# your configuration.
#--------------------------------------------------------------
from AthExHelloWorld.AthExHelloWorldConf import HelloAlg
HelloWorld = HelloAlg("HelloWorld")
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += HelloWorld
#--------------------------------------------------------------
# Algorithms Private Options
#--------------------------------------------------------------
# For the genuine HelloWorld algorithm
HelloWorld.MyInt = 42
HelloWorld.MyBool = TRUE
HelloWorld.MyDouble = 3.14159
HelloWorld.MyStringVec = [ "Welcome", "to", "Athena", "Framework", "Tutorial" ]
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
theApp.MessageSvcType='TrigMessageSvc'
svcMgr += CfgMgr.TrigMessageSvc('MessageSvc')
#########################################
#
# Example setup for ByteStreamEmonSvc
#
#########################################
# Common part, copy from here
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.Constants import *
include("ByteStreamEmonSvc/ByteStreamEmonInputSvc_jobOptions.py")
# #####################################################
# If using the ERSBootstrap.py file, enable the output
# via ERS
# ####################################################
#MessageSvc.useErs = True
# Define the input
ByteStreamEmonInputSvc = svcMgr.ByteStreamInputSvc
# ############################################################
# The name of the partition you want to connect to is taken
# from 'TDAQ_PARTITION' if it exists, otherwise from here.
# ############################################################
ByteStreamEmonInputSvc.Partition = "rhauser_hlt"
# #########################################
# The source of events, SFI for full events
# #########################################
ByteStreamEmonInputSvc.Key = "SFI"
# ############################################################
# A list of of key values, e.g. a list of SFIs to contact.
# If not defined, one event providers of this type.
# ############################################################
ByteStreamEmonInputSvc.KeyCount = 2
# ##############################
# one of 'Ignore', 'Or', 'And'
# ##############################
ByteStreamEmonInputSvc.LVL1Logic = "Ignore"
# ###########################################################
# A LVL1 bit pattern to select events on.
#
# From 1 to 4 64bit values, first entry = Bit 0..63 in CTP
# ###########################################################
#ByteStreamEmonInputSvc.LVL1Bits = [ 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff]
# ###########################################################
# A list of L1 bit names to select on. This requires the
# L1CT.TrigConfL1Items to be published in IS.
#
# This can be used instead of or in addition to LVL1Bits
# and LVL1Items.
# ###########################################################
#ByteStreamEmonInputSvc.LVL1Names = ['L1_MU2', 'L1_MU3', 'L1_EM10' ]
# ###########################################################
# A list of numerical L1 items to select on.
#
# This can be used instead of or in addition to LVL1Bits and
# LVL1Names
# ###########################################################
#ByteStreamEmonInputSvc.LVL1Items = [ 1, 20, 45 ] + range(22,28)
# #################################################
# Shall athena exit if the partition is shutdown ?
# For offline athena tasks mainly.
# #################################################
#ByteStreamEmonInputSvc.ExitOnPartitionShutdown = False
ByteStreamCnvSvc = Service( "ByteStreamCnvSvc" )
theApp.ExtSvc += [ "ByteStreamCnvSvc"]
# -----------------------------------------------------
# An example algorithm in Python
# -----------------------------------------------------
import AthenaPython.PyAthena as PyAthena
from GaudiPython.Bindings import gbl,InterfaceCast
class ShowLVL1(PyAthena.Alg):
"""
An athena algorithm written in python.
"""
def __init__(self, name="ShowLVL1", **kw):
kw['name'] = name
super(ShowLVL1,self).__init__(name=name)
# How to access properties
self.SomeProperty = kw.get('SomeProperty', 'DefaultValue')
def initialize(self):
self.msg.info("initializing [%s]", self.name())
self.sg = PyAthena.py_svc("StoreGateSvc")
if not self.sg:
self.msg.error("Could not get StoreGateSvc")
return PyAthena.StatusCode.Failure
return PyAthena.StatusCode.Success
def execute(self):
self.msg.debug("executing [%s]", self.name())
# Get EventInfo
ev = self.sg.retrieve('EventInfo')
# Print some LVL1 information
print "Run:",ev.event_ID().run_number(),"Event:",ev.event_ID().event_number()
for x in ev.trigger_info().level1TriggerInfo():
print "0x%08x" % x
return PyAthena.StatusCode.Success
def finalize(self):
self.msg.debug("finalizing [%s]", self.name())
return PyAthena.StatusCode.Success
ShowLVL1Algo = ShowLVL1("ShowMyLVL1")
#--------------------------------------------------------------
# Private Application Configuration options, replace with
# your configuration.
#--------------------------------------------------------------
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += ShowLVL1Algo
#--------------------------------------------------------------
# Algorithms Private Options
#--------------------------------------------------------------
ShowLVL1Algo.SomeProperty = 'Some Value'
#!/usr/bin/env python
import sys
def l1bits(bits):
result = 0L
for i in bits:
result |= 1L << i
print "Full: 0x%x" % result
mask = (2**64-1)
print '[',"0x%x" % (result & mask),',',
print "0x%x" % ((result >> 64) & mask),',',
print "0x%x" % ((result >> 128) & mask),',',
print "0x%x" % ((result >> 192) & mask),']'
if __name__ == '__main__':
l1bits(map(int,sys.argv[1:]))
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