Commit aa2bda04 authored by Rafal Bielski's avatar Rafal Bielski 👋 Committed by Edward Moyse
Browse files

Data scouting for cost monitoring

parent 4fcb12c6
......@@ -8,16 +8,13 @@ atlas_subdir( TrigPartialEventBuilding )
# Declare the package's dependencies
atlas_depends_on_subdirs( PUBLIC
Trigger/TrigSteer/DecisionHandling
Trigger/TrigEvent/TrigSteeringEvent
PRIVATE
Control/AthViews )
Trigger/TrigEvent/TrigSteeringEvent )
# Component(s) in the package
atlas_add_library( TrigPartialEventBuildingLib
src/*.cxx
PUBLIC_HEADERS TrigPartialEventBuilding
LINK_LIBRARIES DecisionHandlingLib TrigSteeringEvent
PRIVATE_LINK_LIBRARIES AthViews )
LINK_LIBRARIES DecisionHandlingLib TrigSteeringEvent )
atlas_add_component( TrigPartialEventBuilding
src/components/*.cxx
......
......@@ -6,9 +6,6 @@
#include "PEBInfoWriterAlg.h"
#include "DecisionHandling/TrigCompositeUtils.h"
// Athena includes
#include "AthViews/View.h"
// TrigCompositeUtils types used here
using TrigCompositeUtils::Decision;
using TrigCompositeUtils::DecisionContainer;
......@@ -21,9 +18,9 @@ using TrigCompositeUtils::createAndStore;
using TrigCompositeUtils::decisionIDs;
using TrigCompositeUtils::linkToPrevious;
using TrigCompositeUtils::newDecisionIn;
using TrigCompositeUtils::viewString;
using TrigCompositeUtils::initialRoIString;
using TrigCompositeUtils::featureString;
using TrigCompositeUtils::roiString;
using TrigCompositeUtils::findLink;
// =============================================================================
......@@ -82,11 +79,6 @@ StatusCode PEBInfoWriterAlg::execute(const EventContext& eventContext) const {
ATH_CHECK(roiEL.isValid());
const TrigRoiDescriptor* roi = *roiEL;
// Get View
auto viewELInfo = TrigCompositeUtils::findLink<ViewContainer>(previousDecision, viewString(), /*suppressMultipleLinksWarning*/ true );
ATH_CHECK(viewELInfo.isValid());
auto viewEL = viewELInfo.link;
// Create new decision
Decision* newd = newDecisionIn(decisions);
......@@ -99,11 +91,10 @@ StatusCode PEBInfoWriterAlg::execute(const EventContext& eventContext) const {
// Link to feature. Dummy link here
ElementLink<DecisionContainer> dummyLink(*decisions, decisions->size()-1, eventContext);
newd->setObjectLink(featureString(), dummyLink);
ATH_MSG_DEBUG("REGTEST: View = " << (*viewEL));
ATH_MSG_DEBUG("REGTEST: RoI = eta/phi = " << (*roiEL)->eta() << "/" << (*roiEL)->phi());
ATH_MSG_DEBUG("Added view, roi, previous decision to new decision " << counter
<< " for view " << (*viewEL)->name());
newd->setObjectLink(roiString(), roiEL);
ATH_MSG_DEBUG("RoI eta/phi = " << (*roiEL)->eta() << "/" << (*roiEL)->phi());
ATH_MSG_DEBUG("Added RoI, previous decision and dummy feature to new decision " << counter);
++counter;
}
......
......@@ -309,6 +309,7 @@ HLTConfigSvc::initialize() {
dummyChains["HLT_tau25_idperf_tracktwo_L1TAU12IM"] = "L1_TAU12IM";
dummyChains["HLT_tau25_idperf_tracktwoEF_L1TAU12IM"] = "L1_TAU12IM";
dummyChains["HLT_tau25_idperf_tracktwoMVA_L1TAU12IM"] = "L1_TAU12IM";
dummyChains["HLT_costmonitor_CostMonDS_L1TE5"] = "L1_TE5";
m_HLTFrame.setMergedHLT( m_setMergedHLT );
for (const auto& mapPair : dummyChains) {
......
......@@ -25,9 +25,6 @@ EventBuildingInfo.PartialEventBuildingIdentifiers.append('TestPEBThree')
EventBuildingInfo.PartialEventBuildingIdentifiers.append('TestPEBFour')
EventBuildingInfo.DataScoutingIdentifiers['ElectronDSTest'] = 3
EventBuildingInfo.DataScoutingIdentifiers['ElectronDSPEBTest'] = 3
EventBuildingInfo.AllowedEventBuildingIdentifiers = []
EventBuildingInfo.AllowedEventBuildingIdentifiers.extend(EventBuildingInfo.PartialEventBuildingIdentifiers)
EventBuildingInfo.AllowedEventBuildingIdentifiers.extend(EventBuildingInfo.DataScoutingIdentifiers.keys())
# Override the setupMenu function from LS2_v1
def myMenu():
......
......@@ -8,9 +8,67 @@ __log = logging.getLogger('full_menu')
from TriggerJobOpts.TriggerFlags import TriggerFlags
TriggerFlags.triggerMenuSetup = "LS2_v1"
include("TrigUpgradeTest/testHLT_MT.py")
##################################################################
# Functions creating EDM list for output writing
# TODO: Move to TriggerJobOpts
##################################################################
def getEDMListForPOOL(key, decObj):
# Get the list from TriggerEDM
from TrigEDMConfig.TriggerEDM import getTriggerEDMList
from TrigEDMConfig.TriggerEDMRun3 import persistent
TriggerFlags.EDMDecodingVersion = 3
TriggerFlags.ESDEDMSet = key
edmList = getTriggerEDMList(TriggerFlags.ESDEDMSet(), TriggerFlags.EDMDecodingVersion())
# Build the output ItemList
ItemList = []
for edmType, edmKeys in edmList.iteritems():
ItemList.extend([edmType+'#'+collKey for collKey in edmKeys])
# Add decision containers (navigation)
for item in decObj:
ItemList.append( 'xAOD::TrigCompositeContainer#{:s}'.format(item) )
ItemList.append( 'xAOD::TrigCompositeAuxContainer#{:s}Aux.-'.format(item) )
return list(set(ItemList))
def getEDMDictForBS(decObj):
from TriggerMenuMT.HLTMenuConfig.Menu import EventBuildingInfo
from TrigEDMConfig.TriggerEDM import getTriggerEDMList
from TrigEDMConfig.TriggerEDMRun3 import persistent
TriggerFlags.EDMDecodingVersion = 3
TriggerFlags.ESDEDMSet = 'BS'
ItemListDict = {}
ItemModuleDict = {}
for key in ['BS'] + EventBuildingInfo.getAllDataScoutingIdentifiers():
edmList = getTriggerEDMList(key, TriggerFlags.EDMDecodingVersion())
moduleId = EventBuildingInfo.getFullHLTResultID() if key=='BS' else EventBuildingInfo.getDataScoutingResultID(key)
for edmType, edmKeys in edmList.iteritems():
for collKey in edmKeys:
item = persistent(edmType)+'#'+collKey
if item not in ItemModuleDict.keys():
ItemModuleDict[item] = [moduleId]
else:
ItemModuleDict[item].append(moduleId)
# Add decision containers (navigation)
for item in decObj:
typeName = 'xAOD::TrigCompositeContainer#{:s}'.format(item)
typeNameAux = 'xAOD::TrigCompositeAuxContainer#{:s}Aux.-'.format(item)
if typeName not in ItemModuleDict.keys():
ItemModuleDict[typeName] = [EventBuildingInfo.getFullHLTResultID()]
if typeNameAux not in ItemModuleDict.keys():
ItemModuleDict[typeNameAux] = [EventBuildingInfo.getFullHLTResultID()]
return ItemModuleDict
##################################################################
# Include the common configuration
##################################################################
include("TrigUpgradeTest/testHLT_MT.py")
##################################################################
# Generate the menu
......@@ -82,42 +140,12 @@ else:
__log.warning("Failed to find L1Decoder, cannot determine Decision names for output configuration")
decObj = []
# Get the EDM list
from TrigEDMConfig.TriggerEDM import getTriggerEDMList
from TrigEDMConfig.TriggerEDMRun3 import persistent
TriggerFlags.EDMDecodingVersion = 3
TriggerFlags.ESDEDMSet = 'BS' if configureBSResult else 'ESD'
edmList = getTriggerEDMList(TriggerFlags.ESDEDMSet(), TriggerFlags.EDMDecodingVersion())
# Build the output ItemList
ItemList = []
for edmType, edmKeys in edmList.iteritems():
edmType = persistent(edmType) if configureBSResult else edmType
for key in edmKeys:
ItemList.append(edmType+'#'+key)
if not configureBSResult:
# Do not serialise EventInfo into BS, as it is already represented by the BS event header
ItemList.append("xAOD::EventInfo#EventInfo")
ItemList.append("xAOD::EventAuxInfo#EventInfoAux.")
for item in decObj:
typeName = 'xAOD::TrigCompositeContainer#{}'.format(item)
typeNameAux = 'xAOD::TrigCompositeAuxContainer#{}Aux.'.format(item)
ItemList.append(typeName)
# Temporary workaround for the case when item from decObj is explicitly in TriggerEDM list
# to avoid adding it twice - with and without dynamic variables
if typeNameAux+'-' not in ItemList:
ItemList.append(typeNameAux)
ItemList = list(set(ItemList))
# Configure ESD writing
if opt.doWriteESD:
import AthenaPoolCnvSvc.WriteAthenaPool
from OutputStreamAthenaPool.OutputStreamAthenaPool import createOutputStream
StreamESD=createOutputStream("StreamESD","myESD.pool.root",True)
StreamESD.ItemList = ItemList
StreamESD.ItemList = getEDMListForPOOL('ESD', decObj)
##########################################
# HLT result configuration
......@@ -130,9 +158,10 @@ if configureBSResult:
# Tool serialising EDM objects to fill the HLT result
serialiser = TriggerEDMSerialiserToolCfg('Serialiser')
for item in ItemList:
__log.debug('adding to serialiser list: %s' % item)
serialiser.addCollectionToMainResult(item)
ItemDict = getEDMDictForBS(decObj)
for item, modules in ItemDict.iteritems():
__log.debug('adding to serialiser list: %s, modules: %s', item, modules)
serialiser.addCollection(item, modules)
# Tool adding stream tags to HLT result
stmaker = StreamTagMakerTool()
......
......@@ -14,6 +14,7 @@
from AthenaCommon.Logging import logging
__log = logging.getLogger('TriggerEDMRun3Config')
from TriggerMenuMT.HLTMenuConfig.Menu import EventBuildingInfo
def recordable( name ):
"""
......@@ -51,6 +52,7 @@ def recordable( name ):
# be stored in the specified format as well as the category
# ------------------------------------------------------------
AllowedOutputFormats = ['BS', 'ESD', 'AODFULL', 'AODSLIM', 'AODVERYSLIM', 'AODBLSSLIM', 'AODLARGE', 'AODSMALL', ]
AllowedOutputFormats.extend(EventBuildingInfo.getAllDataScoutingIdentifiers())
JetVarsToKeep = ['ActiveArea', 'ActiveArea4vec_eta', 'ActiveArea4vec_m', 'ActiveArea4vec_phi', 'ActiveArea4vec_pt', 'AlgorithmType',
'DetectorEta', 'DetectorPhi', 'EMFrac', 'EnergyPerSampling', 'GhostTrack', 'HECFrac', 'InputType',
......@@ -84,8 +86,8 @@ TriggerHLTListRun3 = [
('xAOD::TrigCompositeContainer#L1J', 'BS ESD AODFULL AODSLIM', 'Steer'),
('xAOD::TrigCompositeAuxContainer#L1JAux.', 'BS ESD AODFULL AODSLIM', 'Steer'),
('xAOD::TrigCompositeContainer#HLT_TrigCostContainer', 'BS ESD', 'Steer'),
('xAOD::TrigCompositeAuxContainer#HLT_TrigCostContainerAux.alg.store.view.thread.slot.roi.start.stop.', 'BS ESD', 'Steer'),
('xAOD::TrigCompositeContainer#HLT_TrigCostContainer', 'CostMonDS ESD', 'Steer'),
('xAOD::TrigCompositeAuxContainer#HLT_TrigCostContainerAux.alg.store.view.thread.slot.roi.start.stop.', 'CostMonDS ESD', 'Steer'),
# Run-2 L1 (temporary)
('xAOD::MuonRoIContainer#LVL1MuonRoIs' , 'ESD AODFULL AODSLIM AODVERYSLIM AODBLSSLIM', 'L1'),
......@@ -290,7 +292,6 @@ TriggerHLTListRun3 = [
('xAOD::TrackParticleContainer#HLT_xAODTracks', 'BS ESD AODFULL', 'ID'),
('xAOD::TrackParticleAuxContainer#HLT_xAODTracksAux.', 'BS ESD AODFULL', 'ID'),
('EventInfo#ByteStreamEventInfo', 'ESD', 'Misc'),
('ROIB::RoIBResult#*', 'ESD', 'Misc'),
('xAOD::TrigCompositeContainer#HLT_SpacePointCounts', 'BS ESD AODFULL AODSLIM', 'MinBias'),
......
#!/usr/bin/env python
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from TriggerEDMRun3 import TriggerHLTListRun3, EDMDetailsRun3
from TriggerEDMRun3 import TriggerHLTListRun3, EDMDetailsRun3, AllowedOutputFormats
from AthenaCommon.Logging import logging
log = logging.getLogger('testEDMRun3')
......@@ -35,10 +35,8 @@ def main():
file_types = TriggerSerializable[1].split(" ")
allowed_file_types = ("", "BS", "DS", "ESD", "AODFULL", "AODSLIM", "AODVERYSLIM", "AODBLSSLIM")
for file_type in file_types:
if file_type not in allowed_file_types:
if file_type not in AllowedOutputFormats:
log.error("unknown file type " + file_type + " for " + serializable_name)
return 1
......
......@@ -14,7 +14,7 @@ log.info("Importing %s",__name__)
def generateChainConfigs( chainDict ):
listOfChainDicts = splitChainDict(chainDict)
log.debug("Will generate Config for streamer: ",chainDict['chainName'])
log.debug("Will generate Config for streamer: %s", chainDict['chainName'])
listOfChainDefs = []
......
......@@ -52,17 +52,17 @@ def pebInfoWriterTool(name, eventBuildType):
elif 'RPCPEBSecondaryReadout' in eventBuildType:
tool = StaticPEBInfoWriterToolCfg(name)
tool.ROBList = [0x610080, 0x620080]
elif eventBuildType in EventBuildingInfo.getAllDataScoutingIdentifiers():
# Pure DataScouting configuration
tool = StaticPEBInfoWriterToolCfg(name)
moduleId = EventBuildingInfo.getDataScoutingResultID(eventBuildType)
tool.addHLTResultToROBList(moduleId)
# Name not matched
if not tool:
log.error('PEBInfoWriterTool configuration is missing for event building identifier \'%s\'', eventBuildType)
return None
# Add Data Scouting HLT result ROB
if eventBuildType in EventBuildingInfo.getAllDataScoutingResultIDs():
moduleId = EventBuildingInfo.getAllDataScoutingResultIDs()[eventBuildType]
tool.addHLTResultToROBList(moduleId)
return tool
......
......@@ -77,8 +77,8 @@ def getEBPartFromParts( chainName, chainParts ):
Checks if there is only one identifier
"""
# ---- event building identifier ----
from EventBuildingInfo import AllowedEventBuildingIdentifiers
eventBuildTypes = set( AllowedEventBuildingIdentifiers ).intersection( chainParts )
from EventBuildingInfo import getAllEventBuildingIdentifiers
eventBuildTypes = set( getAllEventBuildingIdentifiers() ).intersection( chainParts )
assert len(eventBuildTypes) <= 1, 'Chain {} has more than one Event Building identifier: {}, that is not supported'.format( chainName, eventBuildTypes)
if eventBuildTypes:
return eventBuildTypes.pop()
......
......@@ -22,16 +22,12 @@ PartialEventBuildingIdentifiers = [
# Data scouting identifiers and the corresponding HLT result ROBFragment module IDs
# WARNING: Never change the module IDs during data taking!
# WARNING: ID=0 is reserved for full HLT result
DataScoutingIdentifiers = {
'JetDS': 5,
'PhotonDS': 6
'CostMonDS': 1,
'JetDS': 5
}
# Add DS identifiers to the allowed names
AllowedEventBuildingIdentifiers = []
AllowedEventBuildingIdentifiers.extend(PartialEventBuildingIdentifiers)
AllowedEventBuildingIdentifiers.extend(DataScoutingIdentifiers.keys())
def getDataScoutingResultID(name):
if name in DataScoutingIdentifiers:
......@@ -50,9 +46,13 @@ def getFullHLTResultID():
return 0
def getAllDataScoutingIdentifiers():
return DataScoutingIdentifiers.keys()
def getAllPartialEventBuildingIdentifiers():
return DataScoutingIdentifiers.values()
return PartialEventBuildingIdentifiers
def getAllEventBuildingIdentifiers():
return AllowedEventBuildingIdentifiers
return PartialEventBuildingIdentifiers + DataScoutingIdentifiers.keys()
......@@ -203,7 +203,7 @@ def setupMenu():
ChainProp(name='HLT_noalg_L1EM3', l1SeedThresholds=[''], stream=[PhysicsStream], groups=EgammaStreamersGroup),
]
TriggerFlags.MonitorSlice.signatures = [
ChainProp(name='HLT_costmonitor_L1TE5', l1SeedThresholds=[''], stream=['CostMonitoring'], groups=['RATE:Monitoring','BW:Other']),
ChainProp(name='HLT_costmonitor_CostMonDS_L1TE5', l1SeedThresholds=[''], stream=['CostMonitoring'], groups=['RATE:Monitoring','BW:Other']),
]
# Random Seeded EB chains which select at the HLT based on L1 TBP bits
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment