diff --git a/Control/AthenaMonitoring/python/DQMonFlags.py b/Control/AthenaMonitoring/python/DQMonFlags.py index 36d5a8abe1f46b1c9547e7848dab44b591a64ecb..04c51698a4a2f93e5457b59113421e283bb8c6ac 100644 --- a/Control/AthenaMonitoring/python/DQMonFlags.py +++ b/Control/AthenaMonitoring/python/DQMonFlags.py @@ -421,6 +421,13 @@ class doNewMonitoring(JobProperty): StoredValue=True list+=[doNewMonitoring] +class triggerMixedMode(JobProperty): + """ Enable R21 HLT/L1 trigger monitoring on Run 2 data """ + statusOn=True + allowedTypes=['bool'] + StoredValue=True +list+=[triggerMixedMode] + ##----------------------------------------------------------------------------- ## 2nd step ## Definition of the DQMon flag container diff --git a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py index a86b0539f64b890edb4d7511e93f529416b50c7e..b8a63d093c90a1ec64a51eccb0ee4cb6024ffef8 100644 --- a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py +++ b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py @@ -111,6 +111,17 @@ if not DQMonFlags.doMonitoring(): else: local_logger.info("monitoring environment set to %s", DQMonFlags.monManEnvironment()) + # while we're in mixed mode for the following packages, drive these even if in new-style monitoring + # AOD monitoring + if DQMonFlags.monManEnvironment == 'AOD': + DQMonFlags.histogramFile='MonitorAOD.root' + DQMonFlags.doCTPMon=False + DQMonFlags.doLVL1CaloMon=False + # ESD monitoring: switch off DQ monitoring packages which are not yet migrated: + elif DQMonFlags.monManEnvironment == 'tier0ESD': + DQMonFlags.histogramFile='MonitorESD.root' + DQMonFlags.doCTPMon=False + # new-style monitoring drives this internally so skip this section if not DQMonFlags.doNewMonitoring: @@ -130,7 +141,6 @@ else: DQMonFlags.doGlobalMon=False DQMonFlags.doLVL1CaloMon=False - DQMonFlags.doHLTMon=False DQMonFlags.doEgammaMon=False DQMonFlags.doMuonRawMon=False DQMonFlags.doLucidMon=False diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py index 87650e4d19e4c0ae7dce624c56135255651e68c1..9304c87ca57ac0290bb53e9e0a54ae06391c1b3d 100644 --- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py +++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py @@ -13,6 +13,24 @@ TRTELEMON=False local_logger = logging.getLogger('DataQualitySteering_jobOptions') if DQMonFlags.doMonitoring(): + def doOldStylePreSetup(): + # don't set up lumi access if in MC or enableLumiAccess == False + if globalflags.DataSource.get_Value() != 'geant4' and DQMonFlags.enableLumiAccess(): + if athenaCommonFlags.isOnline: + local_logger.debug("luminosity tool not found, importing online version") + from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgOnlineDefault + LuminosityCondAlgOnlineDefault() + else: + local_logger.debug("luminosity tool not found, importing offline version") + from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgDefault + LuminosityCondAlgDefault() + + from LumiBlockComps.LBDurationCondAlgDefault import LBDurationCondAlgDefault + LBDurationCondAlgDefault() + + from LumiBlockComps.TrigLiveFractionCondAlgDefault import TrigLiveFractionCondAlgDefault + TrigLiveFractionCondAlgDefault() + def doOldStylePostSetup(): #------------------------# # Trigger chain steering # @@ -56,6 +74,7 @@ if DQMonFlags.doMonitoring(): _.ManualRunLBSetup = DQMonFlags.monManManualRunLBSetup() _.Run = DQMonFlags.monManRun() _.LumiBlock = DQMonFlags.monManLumiBlock() + _.ROOTBackend = (jobproperties.ConcurrencyFlags.NumThreads()>0) for tool in toolset: # stop lumi access if we're in MC or enableLumiAccess == False @@ -108,23 +127,7 @@ if DQMonFlags.doMonitoring(): local_logger.debug("trigger decision tool not found, including it now") include("AthenaMonitoring/TrigDecTool_jobOptions.py") - - # don't set up lumi access if in MC or enableLumiAccess == False - if globalflags.DataSource.get_Value() != 'geant4' and DQMonFlags.enableLumiAccess(): - if athenaCommonFlags.isOnline: - local_logger.debug("luminosity tool not found, importing online version") - from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgOnlineDefault - LuminosityCondAlgOnlineDefault() - else: - local_logger.debug("luminosity tool not found, importing offline version") - from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgDefault - LuminosityCondAlgDefault() - - from LumiBlockComps.LBDurationCondAlgDefault import LBDurationCondAlgDefault - LBDurationCondAlgDefault() - - from LumiBlockComps.TrigLiveFractionCondAlgDefault import TrigLiveFractionCondAlgDefault - TrigLiveFractionCondAlgDefault() + doOldStylePreSetup() #---------------------------# # Inner detector monitoring # @@ -148,12 +151,6 @@ if DQMonFlags.doMonitoring(): #--------------------# # Trigger monitoring # #--------------------# - if DQMonFlags.doLVL1CaloMon(): - try: - include("TrigT1CaloMonitoring/TrigT1CaloMonitoring_forRecExCommission.py") - include("TrigT1Monitoring/TrigT1Monitoring_forRecExCommission.py") - except Exception: - treatException("DataQualitySteering_jobOptions.py: exception when setting up L1 Calo monitoring") if DQMonFlags.doCTPMon(): try: @@ -161,6 +158,13 @@ if DQMonFlags.doMonitoring(): except Exception: treatException("DataQualitySteering_jobOptions.py: exception when setting up central trigger monitoring") + if DQMonFlags.doLVL1CaloMon(): + try: + include("TrigT1CaloMonitoring/TrigT1CaloMonitoring_forRecExCommission.py") + include("TrigT1Monitoring/TrigT1Monitoring_forRecExCommission.py") + except Exception: + treatException("DataQualitySteering_jobOptions.py: exception when setting up L1 Calo monitoring") + if DQMonFlags.doHLTMon(): try: include("TrigHLTMonitoring/HLTMonitoring_topOptions.py") @@ -352,10 +356,11 @@ if DQMonFlags.doMonitoring(): Steering = ConfigFlags.DQ.Steering Steering.doGlobalMon=DQMonFlags.doGlobalMon() - Steering.doLVL1CaloMon=DQMonFlags.doLVL1CaloMon() - Steering.doCTPMon=DQMonFlags.doCTPMon() - # do not enable new HLT monitoring if we are not in Run 3 EDM - Steering.doHLTMon=DQMonFlags.doHLTMon() and ConfigFlags.Trigger.EDMVersion == 3 + # do not enable new trigger monitoring in mixed mode if we are not in Run 3 EDM + mixedModeFlag = (DQMonFlags.triggerMixedMode() and ConfigFlags.Trigger.EDMVersion == 2) + Steering.doHLTMon=DQMonFlags.doHLTMon() and not mixedModeFlag + Steering.doLVL1CaloMon=DQMonFlags.doLVL1CaloMon() and not mixedModeFlag + Steering.doCTPMon=DQMonFlags.doCTPMon() and not mixedModeFlag Steering.doPixelMon=DQMonFlags.doPixelMon() Steering.doSCTMon=DQMonFlags.doSCTMon() Steering.doTRTMon=DQMonFlags.doTRTMon() @@ -375,15 +380,31 @@ if DQMonFlags.doMonitoring(): Steering.doTauMon=DQMonFlags.doTauMon() Steering.doJetTagMon=DQMonFlags.doJetTagMon() - # schedule legacy HLT monitoring if Run 2 EDM - if DQMonFlags.doHLTMon() and ConfigFlags.Trigger.EDMVersion == 2: - try: - include("AthenaMonitoring/TrigDecTool_jobOptions.py") - include("TrigHLTMonitoring/HLTMonitoring_topOptions.py") - HLTMonMan = topSequence.HLTMonManager - doOldStylePostSetup() - except Exception: - treatException("DataQualitySteering_jobOptions.py: exception when setting up HLT monitoring") + # schedule legacy HLT and L1 monitoring if Run 2 EDM + if mixedModeFlag and (DQMonFlags.doHLTMon() + or DQMonFlags.doLVL1CaloMon() + or DQMonFlags.doCTPMon()): + local_logger.info('Using mixed mode monitoring') + include("AthenaMonitoring/TrigDecTool_jobOptions.py") + doOldStylePreSetup() + + if DQMonFlags.doHLTMon(): + try: + include("TrigHLTMonitoring/HLTMonitoring_topOptions.py") + except Exception: + treatException("DataQualitySteering_jobOptions.py: exception when setting up HLT monitoring") + if DQMonFlags.doLVL1CaloMon(): + try: + include("TrigT1CaloMonitoring/TrigT1CaloMonitoring_forRecExCommission.py") + include("TrigT1Monitoring/TrigT1Monitoring_forRecExCommission.py") + except Exception: + treatException("DataQualitySteering_jobOptions.py: exception when setting up L1 Calo monitoring") + if DQMonFlags.doCTPMon(): + try: + include("TrigT1CTMonitoring/TrigT1CTMonitoringJobOptions_forRecExCommission.py") + except Exception: + treatException("DataQualitySteering_jobOptions.py: exception when setting up central trigger monitoring") + doOldStylePostSetup() ConfigFlags.dump() ComponentAccumulator.CAtoGlobalWrapper(AthenaMonitoringCfg, ConfigFlags) diff --git a/Control/AthenaMonitoring/src/AthenaMonManager.cxx b/Control/AthenaMonitoring/src/AthenaMonManager.cxx index a91ae0e5922785322a01cabe53fa4370222a549a..17d36df738186ececee131105100f2d3a0be0631 100644 --- a/Control/AthenaMonitoring/src/AthenaMonManager.cxx +++ b/Control/AthenaMonitoring/src/AthenaMonManager.cxx @@ -59,6 +59,7 @@ public: m_nActiveLWHists(0), m_forkedProcess(false), m_lastPID(0), + m_rootBackend(false), m_doResourceMon(false) {} @@ -106,6 +107,8 @@ public: bool m_forkedProcess; pid_t m_lastPID; + bool m_rootBackend; + //NB: The LW hist leak checker is now also looking for //inappropriate usage of MonGroup copy constructors (temporary //until we outlaw copy/assignment of MonGroups): @@ -236,6 +239,7 @@ AthenaMonManager( const std::string& name, ISvcLocator* pSvcLocator ) declareProperty( "ManualRunLBSetup", m_d->m_manualRunLBProp ); declareProperty( "Run", m_d->m_runProp ); declareProperty( "LumiBlock", m_d->m_lumiBlockProp ); + declareProperty( "ROOTBackend", m_d->m_rootBackend ); if( Imp::s_svcLocator==0 ) Imp::s_svcLocator = pSvcLocator; @@ -484,12 +488,8 @@ initialize() joSvc->set( client + ".DataType", m_d->m_dataTypeProp ); joSvc->set( client + ".Environment", m_d->m_environmentProp ); - //Determine (globally for now), whether or not LW histograms use a - //ROOT backend (necessary for online monitoring, and perhaps for - //debugging): - bool root_backend_for_lwhists = (environment()==AthenaMonManager::online); - if( root_backend_for_lwhists != LWHistControls::hasROOTBackend() ) - LWHistControls::setROOTBackend(root_backend_for_lwhists); + // LWHists not thread-safe. Use alg property to use ROOT backend in MT mode. + LWHistControls::setROOTBackend(m_d->m_rootBackend); if( m_monTools.size() > 0 ) { sc = m_monTools.retrieve(); diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py index 0f54b5dd30e401258b1b43b0077f080cfda940b3..0f5133b45664f681b84e72175d2ed8ffaeed94f7 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py @@ -48,234 +48,237 @@ from TrigT1CTMonitoring.TrigT1CTMonitoringConfig import * ## get a handle on the ToolSvc from AthenaCommon.AppMgr import ToolSvc as toolSvc from TrigT1CTMonitoring.TrigT1CTMonitoringConf import TrigT1CTMonitoring__BSMonitoring as BSMon +from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager + +#-----------ONLINE CODE--------------------- +if athenaCommonFlags.isOnline(): + ctpmonlog.info("Setting up CTP/MUCTPI BS monitoring for online") + #from TrigServices.TrigServicesConf import TrigMonTHistSvc + #THistSvc = TrigMonTHistSvc("THistSvc") + #svcMgr += THistSvc + doHist=True + InputDir = "." + OutputDir="." + FilePreFix = [ "MonTest"] + RootHistFileName = 'HistFile.root' + + ## add an AthenaMonManager algorithm to the list of algorithms to be ran + if not hasattr(topSequence,"PrimaryManager"): + topSequence += AthenaMonManager( "PrimaryManager" ) + ## AthenaMonManager is the Algorithm that manages many classes inheriting + ## from ManagedMonitorToolBase + CTmonMan = topSequence.PrimaryManager + + theApp.Dlls += [ "TrigT1CTMonitoring" ] + + CTmonMan.AthenaMonTools += [ "TrigT1CTMonitoring__BSMonitoring/BSMon" ] -if jp.ConcurrencyFlags.NumThreads() == 0: #no monitoring for multithreaded code yet - - #-----------ONLINE CODE--------------------- - if athenaCommonFlags.isOnline(): - ctpmonlog.info("Setting up CTP/MUCTPI BS monitoring for online") - #from TrigServices.TrigServicesConf import TrigMonTHistSvc - #THistSvc = TrigMonTHistSvc("THistSvc") - #svcMgr += THistSvc - doHist=True - InputDir = "." - OutputDir="." - FilePreFix = [ "MonTest"] - RootHistFileName = 'HistFile.root' - - ## add an AthenaMonManager algorithm to the list of algorithms to be ran - if not hasattr(topSequence,"PrimaryManager"): - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - topSequence += AthenaMonManager( "PrimaryManager" ) - ## AthenaMonManager is the Algorithm that manages many classes inheriting - ## from ManagedMonitorToolBase - CTmonMan = topSequence.PrimaryManager - - theApp.Dlls += [ "TrigT1CTMonitoring" ] - - CTmonMan.AthenaMonTools += [ "TrigT1CTMonitoring__BSMonitoring/BSMon" ] - - ## FILEKEY must match that given to THistSvc - CTmonMan.FileKey = "GLOBAL" - - DetDescrVersion="ATLAS-DC3-05" # 11.0.42 files - AllAlgs = False # if false, all algorithms are switched off by defaults - - - from AthenaCommon.GlobalFlags import GlobalFlags - GlobalFlags.DataSource.set_data() - GlobalFlags.InputFormat.set_bytestream() - GlobalFlags.DetGeo.set_atlas() - - from AthenaCommon.DetFlags import DetFlags - - DetFlags.detdescr.all_setOn() - DetFlags.geometry.all_setOn() - DetFlags.ID_setOff() - DetFlags.Calo_setOff() - DetFlags.Truth_setOff() - #switch on/off detectors - - DetFlags.Muon_setOn() - #DetFlags.Muon_setOff() - - DetFlags.LVL1_setOn() - DetFlags.pileup.all_setOff() - DetFlags.simulate.all_setOff() - DetFlags.digitize.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() - DetFlags.writeRDOPool.all_setOff() - DetFlags.readRDOBS.LVL1_setOn() - DetFlags.readRIOBS.LVL1_setOn() - DetFlags.Print() - GlobalFlags.Print() - - #-------------------------------------------------------------- - # GeoModel stuff: - #-------------------------------------------------------------- - include( "AtlasGeoModel/SetGeometryVersion.py" ) - include( "AtlasGeoModel/GeoModelInit.py" ) - - #-------------------------------------------------------------- - # - #-------------------------------------------------------------- - include( "AmdcAth/AmdcAth_jobOptions.py" ) - include( "AtlasGeoModel/MuonGeoModel.py" ) - - # Cabling and geometry of muon detectors - from RPCgeometry.RPCgeometryConfig import RPCgeometryConfig - from RPCcabling.RPCcablingConfig import RPCcablingConfig - RPCcablingSvc = RPCcablingConfig() - RPCcablingSvc.ConfFileName = "LVL1conf.data" - RPCcablingSvc.CorrFileName = "LVL1corr.data" - - from MDTcabling.MDTcablingConfig import MDTcablingConfig - MDTcablingSvc = MDTcablingConfig() - MDTcablingSvc.RODfile = "RODmap.data" - from TGCcabling.TGCcablingConfig import TGCcablingConfig - - CTmonMan.Environment = "online" - CTmonMan.ManualDataTypeSetup = False - CTmonMan.DataType = "cosmics" - CTmonMan.ManualRunLBSetup = False - CTmonMan.Run = 1 - CTmonMan.LumiBlock = 1 - - #--------------------------------------------------------------- - # LVL1 configuration - #--------------------------------------------------------------- - ctpmonlog.info("will setup LVL1ConfigSvc and add instance to ServiceMgr") - from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc - LVL1ConfigSvc = LVL1ConfigSvc('LVL1ConfigSvc') - LVL1ConfigSvc.ConfigSource = "XML" - LVL1ConfigSvc.XMLFile = "L1MenuM5.xml" - LVL1ConfigSvc.CreateLegacyObjects = True - LVL1ConfigSvc.DumpTTVmap = False - svcMgr += LVL1ConfigSvc - theApp.CreateSvc += [ "TrigConf::LVL1ConfigSvc/LVL1ConfigSvc" ] + ## FILEKEY must match that given to THistSvc + CTmonMan.FileKey = "GLOBAL" + + DetDescrVersion="ATLAS-DC3-05" # 11.0.42 files + AllAlgs = False # if false, all algorithms are switched off by defaults - from AthenaConfiguration.AllConfigFlags import ConfigFlags - svcMgr.ToolSvc += BSMon( ProcessMuctpiData=True, - ProcessMuctpiDataRIO=True, - ProcessCTPData=True, - ProcessRoIBResult=True, - InclusiveTriggerThresholds=True, - FillStateCoolFolderName=UsedFillStateCoolFolderName, - UseNewConfig = ConfigFlags.Trigger.readLVL1FromJSON ) - - printfunc (topSequence) - printfunc (svcMgr) + from AthenaCommon.GlobalFlags import GlobalFlags + GlobalFlags.DataSource.set_data() + GlobalFlags.InputFormat.set_bytestream() + GlobalFlags.DetGeo.set_atlas() - #-----------OFFLINE CODE--------------------- - else: - from PyUtils.MetaReaderPeeker import metadata - isMC = 'IS_SIMULATION' in metadata['eventTypes'] - ctpmonlog.info("Setting up CTP/MUCTPI BS monitoring for offline (MC=%s)", isMC) + from AthenaCommon.DetFlags import DetFlags + + DetFlags.detdescr.all_setOn() + DetFlags.geometry.all_setOn() + DetFlags.ID_setOff() + DetFlags.Calo_setOff() + DetFlags.Truth_setOff() + #switch on/off detectors + + DetFlags.Muon_setOn() + #DetFlags.Muon_setOff() + + DetFlags.LVL1_setOn() + DetFlags.pileup.all_setOff() + DetFlags.simulate.all_setOff() + DetFlags.digitize.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() + DetFlags.writeRDOPool.all_setOff() + DetFlags.readRDOBS.LVL1_setOn() + DetFlags.readRIOBS.LVL1_setOn() + DetFlags.Print() + GlobalFlags.Print() + + #-------------------------------------------------------------- + # GeoModel stuff: + #-------------------------------------------------------------- + include( "AtlasGeoModel/SetGeometryVersion.py" ) + include( "AtlasGeoModel/GeoModelInit.py" ) + + #-------------------------------------------------------------- + # + #-------------------------------------------------------------- + include( "AmdcAth/AmdcAth_jobOptions.py" ) + include( "AtlasGeoModel/MuonGeoModel.py" ) + + # Cabling and geometry of muon detectors + from RPCgeometry.RPCgeometryConfig import RPCgeometryConfig + from RPCcabling.RPCcablingConfig import RPCcablingConfig + RPCcablingSvc = RPCcablingConfig() + RPCcablingSvc.ConfFileName = "LVL1conf.data" + RPCcablingSvc.CorrFileName = "LVL1corr.data" + + from MDTcabling.MDTcablingConfig import MDTcablingConfig + MDTcablingSvc = MDTcablingConfig() + MDTcablingSvc.RODfile = "RODmap.data" + from TGCcabling.TGCcablingConfig import TGCcablingConfig + + CTmonMan.Environment = "online" + CTmonMan.ManualDataTypeSetup = False + CTmonMan.DataType = "cosmics" + CTmonMan.ManualRunLBSetup = False + CTmonMan.Run = 1 + CTmonMan.LumiBlock = 1 + + #--------------------------------------------------------------- + # LVL1 configuration + #--------------------------------------------------------------- + ctpmonlog.info("will setup LVL1ConfigSvc and add instance to ServiceMgr") + from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc + LVL1ConfigSvc = LVL1ConfigSvc('LVL1ConfigSvc') + LVL1ConfigSvc.ConfigSource = "XML" + LVL1ConfigSvc.XMLFile = "L1MenuM5.xml" + LVL1ConfigSvc.CreateLegacyObjects = True + LVL1ConfigSvc.DumpTTVmap = False + svcMgr += LVL1ConfigSvc + theApp.CreateSvc += [ "TrigConf::LVL1ConfigSvc/LVL1ConfigSvc" ] + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + svcMgr.ToolSvc += BSMon( ProcessMuctpiData=True, + ProcessMuctpiDataRIO=True, + ProcessCTPData=True, + ProcessRoIBResult=True, + InclusiveTriggerThresholds=True, + FillStateCoolFolderName=UsedFillStateCoolFolderName, + UseNewConfig = ConfigFlags.Trigger.readLVL1FromJSON ) + + printfunc (topSequence) + printfunc (svcMgr) - from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter - cfg = TriggerConfigGetter() - ## add pre algorithms for rerunning CTP simulation - if 'IS_SIMULATION' not in metadata['eventTypes']: - #svcMgr.DSConfigSvc.readLVL1Thr=True - #svcMgr.DSConfigSvc.readLVL1BG=True - - from AthenaConfiguration.AllConfigFlags import ConfigFlags - if ConfigFlags.Trigger.enableL1MuonPhase1: - from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1_on_Data - topSequence += L1MuctpiPhase1_on_Data() - else: - from TrigT1Muctpi.TrigT1MuctpiConfig import L1Muctpi_on_Data - topSequence += L1Muctpi_on_Data() - - from TrigT1CTMonitoring.TrigT1CTMonitoringConf import TrigT1CTMonitoring__DeriveSimulationInputs as DeriveSimulationInputs - topSequence += DeriveSimulationInputs(do_MuCTPI_input=True, - do_L1Calo_sim=False) - - from TrigT1CTP.TrigT1CTPConfig import CTPSimulationOnData - topSequence += CTPSimulationOnData("CTPSimulation") - - # configure simulation histogram output directory - from AthenaMonitoring.DQMonFlags import DQMonFlags - histbase = "/" + DQMonFlags.monManFileKey() + "/" - if DQMonFlags.monManRun(): - from RecExConfig.AutoConfiguration import GetRunNumber - histbase += "run_%i/L1" % GetRunNumber() - else: - histbase += "L1Simulation" - try: - topSequence.CTPSimulation.HistPath = histbase - except AttributeError as ex: - printfunc (ex," ignore for now") - import traceback - traceback.print_exc() - - ## add an AthenaMonManager algorithm to the list of algorithms to be run - monMan = AthenaMonManager( name="CTMonManager", - FileKey = DQMonFlags.monManFileKey(), - Environment = DQMonFlags.monManEnvironment(), - ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), - DataType = DQMonFlags.monManDataType() ) - topSequence += monMan - - theApp.Dlls += [ "TrigT1CTMonitoring" ] - - # check if global muons are on - if not rec.doMuon: - if 'IS_SIMULATION' not in metadata['eventTypes']: - CTBSMonTool = BSMon(ProcessRoIBResult = False, - InclusiveTriggerThresholds = False, - ProcessMuctpiData = False, - ProcessMuctpiDataRIO = False, - CompareRerun = True, - FillStateCoolFolderName=UsedFillStateCoolFolderName) - else: - CTBSMonTool = BSMon(ProcessRoIBResult = False, - InclusiveTriggerThresholds = False, - ProcessMuctpiData = False, - ProcessMuctpiDataRIO = False, - RunOnESD = True, - CompareRerun = False, - FillStateCoolFolderName=UsedFillStateCoolFolderName) - else: - if 'IS_SIMULATION' not in metadata['eventTypes']: - CTBSMonTool = BSMon(ProcessRoIBResult = True, - ProcessMuctpiData = True, - ProcessMuctpiDataRIO = True, - CompareRerun = True) - else: - CTBSMonTool = BSMon(ProcessRoIBResult = True, - ProcessMuctpiData = True, - ProcessMuctpiDataRIO = False, - RunOnESD = True, - CompareRerun = False, - FillStateCoolFolderName=UsedFillStateCoolFolderName) +#-----------OFFLINE CODE--------------------- +else: + from PyUtils.MetaReaderPeeker import metadata + isMC = 'IS_SIMULATION' in metadata['eventTypes'] + ctpmonlog.info("Setting up CTP/MUCTPI BS monitoring for offline (MC=%s)", isMC) + + from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter + cfg = TriggerConfigGetter() + + ## add pre algorithms for rerunning CTP simulation + if 'IS_SIMULATION' not in metadata['eventTypes']: + #svcMgr.DSConfigSvc.readLVL1Thr=True + #svcMgr.DSConfigSvc.readLVL1BG=True from AthenaConfiguration.AllConfigFlags import ConfigFlags - CTBSMonTool.UseNewConfig = ConfigFlags.Trigger.readLVL1FromJSON + # Wrap everything in a sequence which will force algs to execute in order, even in MT mode + from AthenaCommon.AlgSequence import AthSequencer + CTPMonSeq=CfgMgr.AthSequencer('CTPMonSeq') + + if ConfigFlags.Trigger.enableL1MuonPhase1: + from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1_on_Data + CTPMonSeq += L1MuctpiPhase1_on_Data() + else: + from TrigT1Muctpi.TrigT1MuctpiConfig import L1Muctpi_on_Data + CTPMonSeq += L1Muctpi_on_Data() + + from TrigT1CTMonitoring.TrigT1CTMonitoringConf import TrigT1CTMonitoring__DeriveSimulationInputs as DeriveSimulationInputs + CTPMonSeq += DeriveSimulationInputs(do_MuCTPI_input=True, + do_L1Calo_sim=False) + + from TrigT1CTP.TrigT1CTPConfig import CTPSimulationOnData + CTPMonSeq += CTPSimulationOnData("CTPSimulation") + + # configure simulation histogram output directory + from AthenaMonitoring.DQMonFlags import DQMonFlags + histbase = "/" + DQMonFlags.monManFileKey() + "/" + if DQMonFlags.monManRun(): + from RecExConfig.AutoConfiguration import GetRunNumber + histbase += "run_%i/L1" % GetRunNumber() + else: + histbase += "L1Simulation" + try: + CTPMonSeq.CTPSimulation.HistPath = histbase + except AttributeError as ex: + printfunc (ex," ignore for now") + import traceback + traceback.print_exc() + + ## add an AthenaMonManager algorithm to the list of algorithms to be run + monMan = AthenaMonManager( name="CTMonManager", + FileKey = DQMonFlags.monManFileKey(), + Environment = DQMonFlags.monManEnvironment(), + ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), + DataType = DQMonFlags.monManDataType() ) + CTPMonSeq += monMan + + theApp.Dlls += [ "TrigT1CTMonitoring" ] + + # check if global muons are on + if not rec.doMuon: + if 'IS_SIMULATION' not in metadata['eventTypes']: + CTBSMonTool = BSMon(ProcessRoIBResult = False, + InclusiveTriggerThresholds = False, + ProcessMuctpiData = False, + ProcessMuctpiDataRIO = False, + CompareRerun = True, + FillStateCoolFolderName=UsedFillStateCoolFolderName) + else: + CTBSMonTool = BSMon(ProcessRoIBResult = False, + InclusiveTriggerThresholds = False, + ProcessMuctpiData = False, + ProcessMuctpiDataRIO = False, + RunOnESD = True, + CompareRerun = False, + FillStateCoolFolderName=UsedFillStateCoolFolderName) + else: + if 'IS_SIMULATION' not in metadata['eventTypes']: + CTBSMonTool = BSMon(ProcessRoIBResult = True, + ProcessMuctpiData = True, + ProcessMuctpiDataRIO = True, + CompareRerun = True) + else: + CTBSMonTool = BSMon(ProcessRoIBResult = True, + ProcessMuctpiData = True, + ProcessMuctpiDataRIO = False, + RunOnESD = True, + CompareRerun = False, + FillStateCoolFolderName=UsedFillStateCoolFolderName) + from AthenaConfiguration.AllConfigFlags import ConfigFlags + CTBSMonTool.UseNewConfig = ConfigFlags.Trigger.readLVL1FromJSON - processByteStream = True + processByteStream = True - if 'IS_SIMULATION' not in metadata['eventTypes']: - from IOVDbSvc.CondDB import conddb - conddb.addFolder('TRIGGER', '/TRIGGER/LUMI/LBLB') - if LHCFillStateAvailable: - conddb.addFolder('DCS_OFL', "/LHC/DCS/FILLSTATE") - conddb.addFolder('TDAQ', '/TDAQ/RunCtrl/DataTakingMode', className='AthenaAttributeList') - conddb.addFolder('TRIGGER', "/TRIGGER/LVL1/RFPhase") - conddb.addFolder('TRIGGER', '/TRIGGER/LVL1/CTPCoreInputMapping') - monMan.AthenaMonTools += [ CTBSMonTool ] + if 'IS_SIMULATION' not in metadata['eventTypes']: + from IOVDbSvc.CondDB import conddb + conddb.addFolder('TRIGGER', '/TRIGGER/LUMI/LBLB') + if LHCFillStateAvailable: + conddb.addFolder('DCS_OFL', "/LHC/DCS/FILLSTATE") + conddb.addFolder('TDAQ', '/TDAQ/RunCtrl/DataTakingMode', className='AthenaAttributeList') + conddb.addFolder('TRIGGER', "/TRIGGER/LVL1/RFPhase") + conddb.addFolder('TRIGGER', '/TRIGGER/LVL1/CTPCoreInputMapping') + monMan.AthenaMonTools += [ CTBSMonTool ] + CTPMonSeq.Sequential=True + topSequence += CTPMonSeq del ctpmonlog diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/src/BSMonitoring.cxx b/Trigger/TrigT1/TrigT1CTMonitoring/src/BSMonitoring.cxx index e198fc1aa61619f2e5aad4a29e0353bd44eee11f..ecec3ad912440ba325ec7cda0559c24b5eee0809 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/src/BSMonitoring.cxx +++ b/Trigger/TrigT1/TrigT1CTMonitoring/src/BSMonitoring.cxx @@ -9,12 +9,7 @@ #include "BSMonitoring.h" #include "TrigT1Result/MuCTPI_DataWord_Decoder.h" #include "TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h" -#include "TrigT1Result/MuCTPI_RDO.h" -#include "TrigT1Result/MuCTPI_RIO.h" -#include "TrigT1Result/CTP_RDO.h" -#include "TrigT1Result/CTP_RIO.h" #include "TrigT1Result/CTP_Decoder.h" -#include "TrigT1Result/RoIBResult.h" // TrigConf includes #include "TrigConfL1Data/CTPConfig.h" @@ -50,8 +45,6 @@ #include "LWHists/TProfile_LW.h" #include "AthenaMonitoring/AthenaMonManager.h" //for environment -#include "EventInfo/EventInfo.h" -#include "EventInfo/EventID.h" #include <cmath> #include "boost/lexical_cast.hpp" @@ -79,6 +72,16 @@ TrigT1CTMonitoring::BSMonitoring::initialize() ATH_CHECK( m_tgcRoiTool.retrieve() ); } + ATH_CHECK( m_MuCTPI_RDOKey.initialize(m_processMuctpi) ); + ATH_CHECK( m_MuCTPI_RIOKey.initialize(m_processMuctpi && m_processMuctpiRIO && ! m_runOnESD) ); + ATH_CHECK( m_CTP_RDOKey.initialize(m_processCTP) ); + ATH_CHECK( m_CTP_RIOKey.initialize(m_processCTP && ! m_runOnESD) ); + ATH_CHECK( m_CTP_RDO_RerunKey.initialize(m_processCTP && m_compareRerun) ); + ATH_CHECK( m_RoIBResultKey.initialize(m_processRoIB && m_processMuctpiRIO) ); + ATH_CHECK( m_RPCContainerKey.initialize(m_processMuctpi) ); + ATH_CHECK( m_TGCContainerKey.initialize(m_processMuctpi) ); + ATH_CHECK( m_EventInfoKey.initialize() ); + return StatusCode::SUCCESS; } @@ -116,8 +119,8 @@ TrigT1CTMonitoring::BSMonitoring::bookHistograms() m_lbStartFreqMeasurements.clear(); m_freqMeasurements.clear(); m_beamMode.clear(); - const DataHandle<CTP_RIO> theCTP_RIO = 0; - if (!(evtStore()->retrieve(theCTP_RIO, "CTP_RIO").isFailure())) { + const CTP_RIO* theCTP_RIO = SG::get(m_CTP_RIOKey); + if (! theCTP_RIO) { getCoolData(theCTP_RIO->getRunNumber()); ATH_MSG_DEBUG( m_lumiBlocks.size() << " lumi blocks found"); for ( std::vector<uint32_t>::const_iterator lbIt = m_lumiBlocks.begin(); @@ -155,14 +158,14 @@ TrigT1CTMonitoring::BSMonitoring::fillHistograms() ATH_MSG_DEBUG( "begin fillHistograms()"); // Now see what exists in StoreGate... - const DataHandle<MuCTPI_RDO> theMuCTPI_RDO = 0; - const DataHandle<MuCTPI_RIO> theMuCTPI_RIO = 0; - const DataHandle<CTP_RDO> theCTP_RDO = 0; - const DataHandle<CTP_RIO> theCTP_RIO = 0; - const DataHandle<ROIB::RoIBResult> roIBResult = 0; - const DataHandle <Muon::TgcCoinDataContainer> theTGCContainer = 0; - const DataHandle <RpcSectorLogicContainer> theRPCContainer = 0; - const EventInfo* eventInfo = 0; + const MuCTPI_RDO* theMuCTPI_RDO = 0; + const MuCTPI_RIO* theMuCTPI_RIO = 0; + const CTP_RDO* theCTP_RDO = 0; + const CTP_RIO* theCTP_RIO = 0; + const ROIB::RoIBResult* roIBResult = 0; + const Muon::TgcCoinDataContainer* theTGCContainer = 0; + const RpcSectorLogicContainer* theRPCContainer = 0; + const xAOD::EventInfo* eventInfo = 0; bool validMuCTPI_RIO = true; bool validMuCTPI_RDO = true; @@ -182,31 +185,29 @@ TrigT1CTMonitoring::BSMonitoring::fillHistograms() ATH_MSG_FATAL("Problems finding error histograms!"); return StatusCode::FAILURE; } - - StatusCode sc = StatusCode::SUCCESS; if (m_processMuctpi) { - sc = evtStore()->retrieve(theMuCTPI_RDO, "MUCTPI_RDO"); - if (sc.isFailure()) { - ATH_MSG_WARNING( "Could not find \"MUCTPI_RDO\" in StoreGate"); + theMuCTPI_RDO = SG::get(m_MuCTPI_RDOKey); + if (!theMuCTPI_RDO) { + ATH_MSG_WARNING( "Could not find \"" << m_MuCTPI_RDOKey.key() << "\" in StoreGate"); validMuCTPI_RDO = false; ++numberOfInvalidFragments; } - // now try to get RPC and TGC SL output for comparisons - sc = evtStore()->retrieve(theRPCContainer, "RPC_SECTORLOGIC"); - if (sc.isFailure()) { + // now try to get RPC and TGC SL output for comparisons + theRPCContainer = SG::get(m_RPCContainerKey); + if (!theRPCContainer) { ATH_MSG_WARNING( "Could not find RPC container in StoreGate"); validRPCContainer = false; } - sc = evtStore()->retrieve(theTGCContainer, "TrigT1CoinDataCollection"); - if (sc.isFailure()) { + theTGCContainer = SG::get(m_TGCContainerKey); + if (!theTGCContainer) { ATH_MSG_WARNING( "Could not find TGC container in StoreGate"); validTGCContainer = false; } if (m_processMuctpiRIO && !m_runOnESD) { - sc = evtStore()->retrieve(theMuCTPI_RIO, "MUCTPI_RIO"); - if (sc.isFailure()) { - ATH_MSG_WARNING( "Could not find \"MUCTPI_RIO\" in StoreGate"); + theMuCTPI_RIO = SG::get(m_MuCTPI_RIOKey); + if (!theMuCTPI_RIO) { + ATH_MSG_WARNING( "Could not find \"" << m_MuCTPI_RIOKey.key() << "\" in StoreGate"); validMuCTPI_RIO = false; ++numberOfInvalidFragments; } @@ -214,38 +215,38 @@ TrigT1CTMonitoring::BSMonitoring::fillHistograms() } if (m_processCTP) { - sc = evtStore()->retrieve(theCTP_RDO, "CTP_RDO"); - if (sc.isFailure()) { - ATH_MSG_WARNING( "Could not find \"CTP_RDO\" in StoreGate"); + theCTP_RDO = SG::get(m_CTP_RDOKey); + if (!theCTP_RDO) { + ATH_MSG_WARNING( "Could not find \"" << m_CTP_RDOKey.key() << "\" in StoreGate"); validCTP_RDO = false; ++numberOfInvalidFragments; } if (!m_runOnESD) { - sc = evtStore()->retrieve(theCTP_RIO, "CTP_RIO"); - if (sc.isFailure()) { - ATH_MSG_WARNING( "Could not find \"CTP_RIO\" in StoreGate"); + theCTP_RIO = SG::get(m_CTP_RIOKey); + if (!theCTP_RIO) { + ATH_MSG_WARNING( "Could not find \"" << m_CTP_RIOKey.key() << "\" in StoreGate"); validCTP_RIO = false; ++numberOfInvalidFragments; } } } if (m_processRoIB && m_processMuctpiRIO) { - sc = evtStore()->retrieve(roIBResult, "RoIBResult"); - if (sc.isFailure()) { - ATH_MSG_WARNING( "Could not find \"RoIBResult\" in StoreGate"); + roIBResult = SG::get(m_RoIBResultKey); + if (!roIBResult) { + ATH_MSG_WARNING( "Could not find \"" << m_RoIBResultKey.key() << "\" in StoreGate"); validRoIBResult = false; ++numberOfInvalidFragments; } } bool incompleteEvent = false; - sc = evtStore()->retrieve(eventInfo); - if (sc.isSuccess()) { - m_runNumber = eventInfo->event_ID()->run_number(); - m_eventNumber = eventInfo->event_ID()->event_number(); + eventInfo = SG::get(m_EventInfoKey); + if (eventInfo) { + m_runNumber = eventInfo->runNumber(); + m_eventNumber = eventInfo->eventNumber(); m_lumiBlockOfPreviousEvent = m_currentLumiBlock; - m_currentLumiBlock = eventInfo->event_ID()->lumi_block(); - incompleteEvent = eventInfo->eventFlags(EventInfo::Core) & 0x40000; + m_currentLumiBlock = eventInfo->lumiBlock(); + incompleteEvent = eventInfo->eventFlags(xAOD::EventInfo::Core) & 0x40000; ATH_MSG_DEBUG( "Successfully retrieved EventInfo (run: " << m_runNumber << ", event: " << m_eventNumber << ")"); } else { @@ -311,8 +312,8 @@ TrigT1CTMonitoring::BSMonitoring::fillHistograms() << ", BCID: " << theCTP_RIO->getBCID()); } else if (eventInfo) { - ATH_MSG_WARNING( "CTP_RIO missing, EventInfo says LB: " << eventInfo->event_ID()->lumi_block() - << ", BCID: " << eventInfo->event_ID()->bunch_crossing_id()); // no L1ID available + ATH_MSG_WARNING( "CTP_RIO missing, EventInfo says LB: " << eventInfo->lumiBlock() + << ", BCID: " << eventInfo->bcid()); // no L1ID available } else { ATH_MSG_WARNING( "Not printing event details since both CTP_RIO and EventInfo objects are missing"); @@ -615,9 +616,9 @@ TrigT1CTMonitoring::BSMonitoring::initRoIHistograms() } void -TrigT1CTMonitoring::BSMonitoring::doMuctpi(const DataHandle<MuCTPI_RDO> theMuCTPI_RDO, const DataHandle<MuCTPI_RIO> theMuCTPI_RIO, - const DataHandle <RpcSectorLogicContainer> theRPCContainer, - const DataHandle <Muon::TgcCoinDataContainer> theTGCContainer) +TrigT1CTMonitoring::BSMonitoring::doMuctpi(const MuCTPI_RDO* theMuCTPI_RDO, const MuCTPI_RIO* theMuCTPI_RIO, + const RpcSectorLogicContainer* theRPCContainer, + const Muon::TgcCoinDataContainer* theTGCContainer) { TProfile_LW* errorSummary = getTProfile("errorSummary"); @@ -927,10 +928,8 @@ TrigT1CTMonitoring::BSMonitoring::doMuctpi(const DataHandle<MuCTPI_RDO> theMuCTP } } - const EventInfo* eventInfo = 0; - StatusCode sc = StatusCode::SUCCESS; - sc = evtStore()->retrieve(eventInfo); - if (!sc.isSuccess()) { + const xAOD::EventInfo* eventInfo = SG::get(m_EventInfoKey); + if (!eventInfo) { ATH_MSG_WARNING( "Could not retrieve EventInfo from StoreGate"); } @@ -1093,7 +1092,7 @@ TrigT1CTMonitoring::BSMonitoring::doMuctpi(const DataHandle<MuCTPI_RDO> theMuCTP } void -TrigT1CTMonitoring::BSMonitoring::doCtp(const DataHandle<CTP_RDO> theCTP_RDO,const DataHandle<CTP_RIO> theCTP_RIO) +TrigT1CTMonitoring::BSMonitoring::doCtp(const CTP_RDO* theCTP_RDO,const CTP_RIO* theCTP_RIO) { TProfile_LW *errorSummary = getTProfile("errorSummary"); TH1F_LW *errorPerLumiBlock = getTH1("errorPerLumiBlock"); @@ -1463,8 +1462,8 @@ TrigT1CTMonitoring::BSMonitoring::updateRangeUser() } void -TrigT1CTMonitoring::BSMonitoring::doCtpMuctpi( const DataHandle<CTP_RDO> theCTP_RDO, const DataHandle<CTP_RIO> theCTP_RIO, - const DataHandle<MuCTPI_RDO> theMuCTPI_RDO, const DataHandle<MuCTPI_RIO> theMuCTPI_RIO) +TrigT1CTMonitoring::BSMonitoring::doCtpMuctpi( const CTP_RDO* theCTP_RDO, const CTP_RIO* theCTP_RIO, + const MuCTPI_RDO* theMuCTPI_RDO, const MuCTPI_RIO* theMuCTPI_RIO) { TProfile_LW *errorSummary = getTProfile("errorSummary"); TH2F_LW* errorSummaryPerLumiBlock = getTH2("errorSummaryPerLumiBlock"); @@ -1518,8 +1517,8 @@ TrigT1CTMonitoring::BSMonitoring::doCtpMuctpi( const DataHandle<CTP_RDO> theCTP_ } void -TrigT1CTMonitoring::BSMonitoring::doMuonRoI( const DataHandle<MuCTPI_RDO> theMuCTPI_RDO, const DataHandle<MuCTPI_RIO> theMuCTPI_RIO, - const DataHandle<ROIB::RoIBResult> roib) +TrigT1CTMonitoring::BSMonitoring::doMuonRoI( const MuCTPI_RDO* theMuCTPI_RDO, const MuCTPI_RIO* theMuCTPI_RIO, + const ROIB::RoIBResult* roib) { TProfile_LW *errorSummary = getTProfile("errorSummary"); TH2F_LW* errorSummaryPerLumiBlock = getTH2("errorSummaryPerLumiBlock"); @@ -1680,9 +1679,9 @@ TrigT1CTMonitoring::BSMonitoring::compareRerun(const CTP_BC &bunchCrossing) TH1F_LW* l1ItemsBPSimMismatch = getTH1("l1ItemsBPSimMismatch"); TH1F_LW* l1ItemsBPSimMismatchItems = getTH1("l1ItemsBPSimMismatchItems"); - const CTP_RDO* theCTP_RDO_Rerun = 0; + const CTP_RDO* theCTP_RDO_Rerun = nullptr; ATH_MSG_DEBUG( "Retrieving CTP_RDO from SG with key CTP_RDO_Rerun"); - CHECK( evtStore()->retrieve(theCTP_RDO_Rerun, "CTP_RDO_Rerun") ); + CHECK( (theCTP_RDO_Rerun = SG::get(m_CTP_RDO_RerunKey)) != nullptr ); CTP_Decoder ctp_rerun; ctp_rerun.setRDO(theCTP_RDO_Rerun); @@ -1772,9 +1771,9 @@ TrigT1CTMonitoring::BSMonitoring::compareRerun(const CTP_BC &bunchCrossing) } void -TrigT1CTMonitoring::BSMonitoring::dumpData( const DataHandle<CTP_RDO> theCTP_RDO, const DataHandle<CTP_RIO> theCTP_RIO, - const DataHandle<MuCTPI_RDO> theMuCTPI_RDO, const DataHandle<MuCTPI_RIO> theMuCTPI_RIO, - const DataHandle<ROIB::RoIBResult> roib) +TrigT1CTMonitoring::BSMonitoring::dumpData( const CTP_RDO* theCTP_RDO, const CTP_RIO* theCTP_RIO, + const MuCTPI_RDO* theMuCTPI_RDO, const MuCTPI_RIO* theMuCTPI_RIO, + const ROIB::RoIBResult* roib) { if ( !msgLvl(MSG::DEBUG) ) return; diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/src/BSMonitoring.h b/Trigger/TrigT1/TrigT1CTMonitoring/src/BSMonitoring.h index 1023d73d527cff56f1273c9f80c306e663cb8d78..1aff15cc6216ef1dd582068ecec5f5bf9ff79f2b 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/src/BSMonitoring.h +++ b/Trigger/TrigT1/TrigT1CTMonitoring/src/BSMonitoring.h @@ -22,6 +22,13 @@ #include "CoolKernel/IObject.h" #include "TrigT1Interfaces/ITrigT1MuonRecRoiTool.h" +#include "TrigT1Result/MuCTPI_RDO.h" +#include "TrigT1Result/MuCTPI_RIO.h" +#include "TrigT1Result/CTP_RDO.h" +#include "TrigT1Result/CTP_RIO.h" +#include "TrigT1Result/RoIBResult.h" +#include "xAODEventInfo/EventInfo.h" + // RPC and TGC includes for access to SL data #include "MuonTrigCoinData/TgcCoinDataContainer.h" #include "MuonRDO/RpcSectorLogicContainer.h" @@ -125,28 +132,28 @@ namespace TrigT1CTMonitoring { void getCoolData(unsigned int runNumber); - void doMuonRoI( const DataHandle < MuCTPI_RDO > theMuCTPI_RDO, - const DataHandle < MuCTPI_RIO > theMuCTPI_RIO, - const DataHandle < ROIB::RoIBResult > roib); + void doMuonRoI( const MuCTPI_RDO* theMuCTPI_RDO, + const MuCTPI_RIO* theMuCTPI_RIO, + const ROIB::RoIBResult* roib); - void doCtp( const DataHandle < CTP_RDO > theCTP_RDO, - const DataHandle < CTP_RIO > theCTP_RIO); + void doCtp( const CTP_RDO* theCTP_RDO, + const CTP_RIO* theCTP_RIO); - void doMuctpi(const DataHandle < MuCTPI_RDO > theMuCTPI_RDO, - const DataHandle < MuCTPI_RIO > theMuCTPI_RIO, - const DataHandle < RpcSectorLogicContainer > theRPCContainer, - const DataHandle < Muon::TgcCoinDataContainer > theTGCContainer); + void doMuctpi(const MuCTPI_RDO* theMuCTPI_RDO, + const MuCTPI_RIO* theMuCTPI_RIO, + const RpcSectorLogicContainer* theRPCContainer, + const Muon::TgcCoinDataContainer* theTGCContainer); - void doCtpMuctpi( const DataHandle < CTP_RDO > theCTP_RDO, - const DataHandle < CTP_RIO > theCTP_RIO, - const DataHandle < MuCTPI_RDO > theMuCTPI_RDO, - const DataHandle < MuCTPI_RIO > theMuCTPI_RIO); + void doCtpMuctpi( const CTP_RDO* theCTP_RDO, + const CTP_RIO* theCTP_RIO, + const MuCTPI_RDO* theMuCTPI_RDO, + const MuCTPI_RIO* theMuCTPI_RIO); - void dumpData(const DataHandle < CTP_RDO > theCTP_RDO, - const DataHandle < CTP_RIO > theCTP_RIO, - const DataHandle < MuCTPI_RDO > theMuCTPI_RDO, - const DataHandle < MuCTPI_RIO > theMuCTPI_RIO, - const DataHandle < ROIB::RoIBResult > roib); + void dumpData(const CTP_RDO* theCTP_RDO, + const CTP_RIO* theCTP_RIO, + const MuCTPI_RDO* theMuCTPI_RDO, + const MuCTPI_RIO* theMuCTPI_RIO, + const ROIB::RoIBResult* roib); StatusCode compareRerun(const CTP_BC &bunchCrossing); @@ -166,6 +173,16 @@ namespace TrigT1CTMonitoring { ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_rpcRoiTool{ this, "RPCRecRoiTool", "LVL1::TrigT1RPCRecRoiTool/TrigT1RPCRecRoiTool", "RPC Rec Roi Tool"}; ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_tgcRoiTool{ this, "TGCRecRoiTool", "LVL1::TrigT1TGCRecRoiTool/TrigT1TGCRecRoiTool", "TGC Rec Roi Tool"}; + SG::ReadHandleKey<MuCTPI_RDO> m_MuCTPI_RDOKey{ this, "MuCTPI_RDOKey", "MUCTPI_RDO" }; + SG::ReadHandleKey<MuCTPI_RIO> m_MuCTPI_RIOKey{ this, "MuCTPI_RIOKey", "MUCTPI_RIO" }; + SG::ReadHandleKey<CTP_RDO> m_CTP_RDOKey{ this, "CTP_RDOKey", "CTP_RDO" }; + SG::ReadHandleKey<CTP_RIO> m_CTP_RIOKey{ this, "CTP_RIOKey", "CTP_RIO" }; + SG::ReadHandleKey<CTP_RDO> m_CTP_RDO_RerunKey{ this, "CTP_RDO_RerunKey", "CTP_RDO_Rerun" }; + SG::ReadHandleKey<ROIB::RoIBResult> m_RoIBResultKey{ this, "RoIBResultKey", "RoIBResult" }; + SG::ReadHandleKey<RpcSectorLogicContainer> m_RPCContainerKey{ this, "RPCContainerKey", "RPC_SECTORLOGIC" }; + SG::ReadHandleKey<Muon::TgcCoinDataContainer> m_TGCContainerKey{ this, "TGCContainerKey", "TrigT1CoinDataCollection" }; + SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKey{ this,"EventInfoKey", "EventInfo" }; + Gaudi::Property<bool> m_useNewConfig { this, "UseNewConfig", false, "When true, read the menu from detector store, when false use the L1ConfigSvc" }; Gaudi::Property<std::string> m_baseDirName{ this, "DirectoryName", "CT/", "Directory in output root file where the histograms will be stored." }; diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/src/DeriveSimulationInputs.cxx b/Trigger/TrigT1/TrigT1CTMonitoring/src/DeriveSimulationInputs.cxx index f10b986974f54ad4c5bd9ec516b24774d5f4e440..5c337916a08169b3aba8076651b0b0f534db56fe 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/src/DeriveSimulationInputs.cxx +++ b/Trigger/TrigT1/TrigT1CTMonitoring/src/DeriveSimulationInputs.cxx @@ -19,7 +19,6 @@ #include "TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h" #include "TrigT1Result/MuCTPI_RDO.h" #include "TrigT1Result/MuCTPI_RIO.h" -#include "TrigT1Result/CTP_RDO.h" #include "TrigT1Result/CTP_RIO.h" #include "TrigT1Result/CTP_Decoder.h" #include "TrigT1Result/RoIBResult.h" @@ -101,6 +100,8 @@ TrigT1CTMonitoring::DeriveSimulationInputs::initialize() { ATH_CHECK( detStore()->regFcn( &TrigT1CTMonitoring::DeriveSimulationInputs::ReadInputMappingFromCool, this, m_ctpCoreMapping, "/TRIGGER/LVL1/CTPCoreInputMapping" ) ); + + ATH_CHECK( m_CTP_RDOKey.initialize() ); return StatusCode::SUCCESS; } @@ -139,8 +140,8 @@ TrigT1CTMonitoring::DeriveSimulationInputs::execute() { // get CTP RDO from storegate - const CTP_RDO* theCTP_RDO = nullptr; - CHECK( evtStore()->retrieve(theCTP_RDO, "CTP_RDO") ); + const CTP_RDO* theCTP_RDO = SG::get(m_CTP_RDOKey); + CHECK( theCTP_RDO != nullptr ); // we should not use the ctpVersion from the menu to guaranty consistency diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/src/DeriveSimulationInputs.h b/Trigger/TrigT1/TrigT1CTMonitoring/src/DeriveSimulationInputs.h index 8d03e7cd48f7c0f8faab9504ce37fb652e28b921..5bfa65908694503d7d95d5176c65e5b56cdcd44a 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/src/DeriveSimulationInputs.h +++ b/Trigger/TrigT1/TrigT1CTMonitoring/src/DeriveSimulationInputs.h @@ -13,6 +13,7 @@ #include "Gaudi/Property.h" #include "TrigConfInterfaces/ITrigConfigSvc.h" #include "TrigConfInterfaces/ILVL1ConfigSvc.h" +#include "TrigT1Result/CTP_RDO.h" // Forward includes: class IAtRndmGenSvc; @@ -90,6 +91,8 @@ namespace TrigT1CTMonitoring { std::vector<std::string> m_par_atrlist; std::vector<std::string> m_par_atrcollist; const DataHandle<CondAttrListCollection> m_ctpCoreMapping; + + SG::ReadHandleKey<CTP_RDO> m_CTP_RDOKey{ this, "CTP_RDOKey", "CTP_RDO" }; }; } #endif // diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py index f0c78923b0e1da3672dc6a868781aa5a3ad1a401..5494e764ca3bcc89eb077b3af9c0f1f0215da8e1 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run1.py @@ -30,6 +30,7 @@ if l1caloRawMon: triggerConfigService = "TrigConf::TrigConfigSvc/TrigConfigSvc" #================================= Monitoring configuration ====================== + from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() L1CaloMan = AthenaMonManager( "L1CaloMonManager" ) diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run2.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run2.py index 070fa9d67867f2d8d7df09f2f48c2cdccff0137a..a417d51f2be59b14465688ebae696e4a08f79e3e 100755 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run2.py +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/TrigT1CaloMonitoring_forRecExCommission_Run2.py @@ -29,6 +29,7 @@ if l1caloRawMon: triggerConfigService = "TrigConf::TrigConfigSvc/TrigConfigSvc" #================================= Monitoring configuration ============== + from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() L1CaloMan = AthenaMonManager("L1CaloMonManager") diff --git a/Trigger/TrigT1/TrigT1Monitoring/src/L1CaloL1TopoMon.cxx b/Trigger/TrigT1/TrigT1Monitoring/src/L1CaloL1TopoMon.cxx index 83d10ecc64dd09a57407eb42d134d7246eb718f8..a92f5fa6919afd81a626c6fabe85786af2964928 100644 --- a/Trigger/TrigT1/TrigT1Monitoring/src/L1CaloL1TopoMon.cxx +++ b/Trigger/TrigT1/TrigT1Monitoring/src/L1CaloL1TopoMon.cxx @@ -26,8 +26,6 @@ #include "TrigT1CaloMonitoringTools/ITrigT1CaloMonErrorTool.h" #include "TrigT1CaloMonitoringTools/TrigT1CaloLWHistogramTool.h" #include "TrigT1Interfaces/TrigT1CaloDefs.h" -#include "TrigT1Interfaces/FrontPanelCTP.h" -#include "TrigT1Interfaces/TrigT1StoreGateKeys.h" #include "TrigT1Interfaces/CoordinateRange.h" #include "TrigT1Interfaces/CPRoIDecoder.h" #include "TrigT1Interfaces/JEPRoIDecoder.h" @@ -117,9 +115,6 @@ L1CaloL1TopoMon::L1CaloL1TopoMon( const std::string & type, = LVL1::TrigT1CaloDefs::CMXJetTobLocation); declareProperty( "CMXCPTobLocation", m_CMXCPTobLocation = LVL1::TrigT1CaloDefs::CMXCPTobLocation); - declareProperty( "TopoCTPLocation", m_topoCTPLoc - = LVL1::DEFAULT_L1TopoCTPLocation, - "StoreGate location of topo inputs" ); } /*---------------------------------------------------------*/ @@ -161,6 +156,8 @@ StatusCode L1CaloL1TopoMon::initialize() return sc; } + ATH_CHECK( m_topoCTPLoc.initialize( SG::AllowEmpty ) ); + return StatusCode::SUCCESS; } @@ -515,13 +512,12 @@ StatusCode L1CaloL1TopoMon::fillHistograms() } // Retrieve L1Topo CTP simulted decision if present - if (!evtStore()->contains<LVL1::FrontPanelCTP>(m_topoCTPLoc.value())){ + if (!evtStore()->contains<LVL1::FrontPanelCTP>(m_topoCTPLoc.key())){ ATH_MSG_DEBUG("Could not retrieve LVL1::FrontPanelCTP with key " - << m_topoCTPLoc.value()); + << m_topoCTPLoc.key()); } else { - const LVL1::FrontPanelCTP* topoCTP = nullptr; - CHECK_RECOVERABLE(evtStore()->retrieve(topoCTP,m_topoCTPLoc.value())); + const LVL1::FrontPanelCTP* topoCTP = SG::get(m_topoCTPLoc); if (!topoCTP){ ATH_MSG_INFO( "Retrieve of LVL1::FrontPanelCTP failed." ); } diff --git a/Trigger/TrigT1/TrigT1Monitoring/src/L1CaloL1TopoMon.h b/Trigger/TrigT1/TrigT1Monitoring/src/L1CaloL1TopoMon.h index 6c9a32461b560200f913ea37c8ca999183818569..464e7634d46b729ae13874d4c0259b674fd24019 100755 --- a/Trigger/TrigT1/TrigT1Monitoring/src/L1CaloL1TopoMon.h +++ b/Trigger/TrigT1/TrigT1Monitoring/src/L1CaloL1TopoMon.h @@ -25,6 +25,9 @@ #include "AthContainers/DataVector.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "TrigT1Interfaces/FrontPanelCTP.h" +#include "TrigT1Interfaces/TrigT1StoreGateKeys.h" + class LWHist; class TH1F_LW; class TH2F_LW; @@ -86,7 +89,7 @@ class TrigT1CaloLWHistogramTool; //const DataHandle< LVL1::FrontPanelCTP > m_topoCTP; StringProperty m_CMXJetTobLocation; StringProperty m_CMXCPTobLocation; - StringProperty m_topoCTPLoc; + SG::ReadHandleKey<LVL1::FrontPanelCTP> m_topoCTPLoc { this, "TopoCTPLocation", LVL1::DEFAULT_L1TopoCTPLocation, "StoreGate location of topo inputs" }; /// Root directory std::string m_PathInRootFile;