def configure(self): log = logging.getLogger("ByteStreamUnpackGetterRun2") from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() #if TriggerFlags.readBS(): log.info("TriggerFlags.dataTakingConditions: %s", TriggerFlags.dataTakingConditions()) # in MC this is always FullTrigger hasHLT = TriggerFlags.dataTakingConditions( ) == 'HltOnly' or TriggerFlags.dataTakingConditions() == 'FullTrigger' if hasHLT: # Decide based on the run number whether to assume a merged, or a # split HLT: if not TriggerFlags.doMergedHLTResult(): ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/HLTResult_L2", "HLT::HLTResult/HLTResult_EF" ] else: ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/HLTResult_HLT" ] pass pass # BS unpacking from TrigBSExtraction.TrigBSExtractionConf import TrigBSExtraction extr = TrigBSExtraction() # Add fictional output to ensure data dependency in AthenaMT extr.ExtraOutputs += [("TrigBSExtractionOutput", "StoreGateSvc+TrigBSExtractionOutput")] if hasHLT: from TrigNavigation.TrigNavigationConfig import HLTNavigationOffline extr.Navigation = HLTNavigationOffline() from TrigEDMConfig.TriggerEDM import getEDMLibraries extr.Navigation.Dlls = getEDMLibraries() from TrigEDMConfig.TriggerEDM import getPreregistrationList extr.Navigation.ClassesToPreregister = getPreregistrationList( TriggerFlags.EDMDecodingVersion()) if TriggerFlags.doMergedHLTResult(): extr.L2ResultKey = "" extr.EFResultKey = "" else: extr.HLTResultKey = "" # # Configure DataScouting # from PyUtils.MetaReaderPeeker import metadata if 'stream' in metadata: stream_local = metadata['stream'] if stream_local.startswith( 'calibration_DataScouting_' ) or TriggerFlags.doAlwaysUnpackDSResult(): if 'calibration' in stream_local and 'DataScouting_' in stream_local: ds_tag = stream_local[12:27] ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/" + ds_tag ] extr.DSResultKeys += [ds_tag] else: #if data doesn't have HLT info set HLTResult keys as empty strings to avoid warnings # but the extr alg must run extr.L2ResultKey = "" extr.EFResultKey = "" extr.HLTResultKey = "" extr.DSResultKeys = [] topSequence += extr from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool TrigSerToolTP = TrigSerTPTool('TrigSerTPTool') from AthenaCommon.AppMgr import ToolSvc ToolSvc += TrigSerToolTP from TrigEDMConfig.TriggerEDM import getTPList TrigSerToolTP.TPMap = getTPList((TriggerFlags.EDMDecodingVersion())) from TrigSerializeCnvSvc.TrigSerializeCnvSvcConf import TrigSerializeConvHelper TrigSerializeConvHelper = TrigSerializeConvHelper(doTP=True) ToolSvc += TrigSerializeConvHelper # # Configure L1Topo validation data algorithm # if hasHLT and TriggerFlags.doMergedHLTResult( ) and TriggerFlags.writeL1TopoValData(): # make sure that CTP_RDO is known (see also ATR-14683) ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "CTP_RDO/CTP_RDO" ] from L1TopoValDataCnv.L1TopoValDataCnvConf import xAODMaker__L1TopoValDataCnvAlg L1TopoValDataCvnAlg = xAODMaker__L1TopoValDataCnvAlg() topSequence += L1TopoValDataCvnAlg return True
def configure(self): log = logging.getLogger("ByteStreamUnpackGetter.py") from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() #if TriggerFlags.readBS(): log.info( "TriggerFlags.dataTakingConditions: %s" % TriggerFlags.dataTakingConditions() ) # in MC this is always FullTrigger hasHLT = TriggerFlags.dataTakingConditions()=='HltOnly' or TriggerFlags.dataTakingConditions()=='FullTrigger' if hasHLT: from AthenaCommon.AppMgr import ServiceMgr # Decide based on the run number whether to assume a merged, or a # split HLT: if not TriggerFlags.doMergedHLTResult(): ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/HLTResult_L2", "HLT::HLTResult/HLTResult_EF" ] else: ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/HLTResult_HLT" ] pass pass # BS unpacking from TrigBSExtraction.TrigBSExtractionConf import TrigBSExtraction extr = TrigBSExtraction() if hasHLT: from TrigNavigation.TrigNavigationConfig import HLTNavigationOffline extr.Navigation = HLTNavigationOffline() from TrigEDMConfig.TriggerEDM import getEDMLibraries extr.Navigation.Dlls = getEDMLibraries() from TrigEDMConfig.TriggerEDM import getPreregistrationList extr.Navigation.ClassesToPreregister = getPreregistrationList(TriggerFlags.EDMDecodingVersion()) if TriggerFlags.doMergedHLTResult(): extr.L2ResultKey="" extr.EFResultKey="" else: extr.HLTResultKey="" # # Configure DataScouting # from RecExConfig.InputFilePeeker import inputFileSummary if inputFileSummary['bs_metadata']['Stream'].startswith('calibration_DataScouting_') or TriggerFlags.doAlwaysUnpackDSResult(): for stag in inputFileSummary['stream_tags']: if (stag['stream_type'] == 'calibration') and (stag['stream_name'].startswith('DataScouting_')): ds_tag = stag['stream_name'][0:15] ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/"+ds_tag ] extr.DSResultKeys += [ ds_tag ] else: #if data doesn't have HLT info set HLTResult keys as empty strings to avoid warnings # but the extr alg must run extr.L2ResultKey="" extr.EFResultKey="" extr.HLTResultKey="" extr.DSResultKeys=[] topSequence += extr from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool TrigSerToolTP = TrigSerTPTool('TrigSerTPTool') from AthenaCommon.AppMgr import ToolSvc ToolSvc += TrigSerToolTP from TrigEDMConfig.TriggerEDM import getTPList TrigSerToolTP.TPMap = getTPList((TriggerFlags.EDMDecodingVersion())) from TrigSerializeCnvSvc.TrigSerializeCnvSvcConf import TrigSerializeConvHelper TrigSerializeConvHelper = TrigSerializeConvHelper(doTP = True) ToolSvc += TrigSerializeConvHelper # # Configure L1Topo validation data algorithm # if hasHLT and TriggerFlags.doMergedHLTResult() and TriggerFlags.writeL1TopoValData() : # make sure that CTP_RDO is known (see also ATR-14683) ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "CTP_RDO/CTP_RDO" ] from L1TopoValDataCnv.L1TopoValDataCnvConf import xAODMaker__L1TopoValDataCnvAlg L1TopoValDataCvnAlg = xAODMaker__L1TopoValDataCnvAlg() topSequence += L1TopoValDataCvnAlg return True