diff --git a/Control/AthenaMonitoring/share/AtlasReadyFilterTool_jobOptions.py b/Control/AthenaMonitoring/share/AtlasReadyFilterTool_jobOptions.py deleted file mode 100644 index 0d421197b145279dd063f1192db6921fa1bafd17..0000000000000000000000000000000000000000 --- a/Control/AthenaMonitoring/share/AtlasReadyFilterTool_jobOptions.py +++ /dev/null @@ -1,27 +0,0 @@ -include.block('AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py') - -# Set up the ATLAS Ready filter tool -from AthenaCommon.Logging import logging - -arft_local_logger = logging.getLogger('AtlasReadyFilterTool_jobOptions') - -if not 'DQMonFlags' in dir(): - arft_local_logger.debug("AtlasReadyFilterTool_jobOptions.py: DQMonFlags not yet imported - I import them now") - from AthenaMonitoring.DQMonFlags import DQMonFlags - -if not 'monAtlasReadyFilterTool' in dir(): - if globalflags.DataSource.get_Value() != 'geant4': - from IOVDbSvc.CondDB import conddb - conddb.addFolder('TDAQ', '/TDAQ/RunCtrl/DataTakingMode', - className='AthenaAttributeList') - - from AthenaMonitoring.AthenaMonitoringConf import DQAtlasReadyFilterTool - monAtlasReadyFilterTool = DQAtlasReadyFilterTool() - if (DQMonFlags.monManEnvironment == 'online' - or globalflags.DataSource.get_Value() == 'geant4' - or 'collisions' not in DQMonFlags.monManDataType.get_Value() - or DQMonFlags.disableAtlasReadyFilter.get_Value()): - arft_local_logger.info("Disabling ATLAS Ready monitoring filter") - monAtlasReadyFilterTool.alwaysReturnTrue = True - -del arft_local_logger diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py index d5533d0a5df3236ce1c25b4400d102955a5c3f7e..474115ae55f06e7fd5243a4ca2c79f3d125ed7a6 100644 --- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py +++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py @@ -13,6 +13,95 @@ TRTELEMON=False local_logger = logging.getLogger('DataQualitySteering_jobOptions') if DQMonFlags.doMonitoring(): + def doOldStylePostSetup(): + #------------------------# + # Trigger chain steering # + #------------------------# + trigMap = DQMonFlags.triggerChainMap.get_Value() + for toolName, trigChain in six.iteritems(trigMap): + local_logger.debug("Applying trigger %s to %s", trigChain, toolName) + if hasattr(ToolSvc,toolName): + tool = getattr(ToolSvc,toolName) + tool.TriggerChain = trigChain + else: + local_logger.debug("%s is not found in ToolSvc. Cannot set trigger chain!", toolName) + + # force conditions update because the converter can't do it + if DQMonFlags.monManEnvironment in ('tier0ESD', 'AOD'): + from AthenaCommon.AlgSequence import AthSequencer + from AthenaMonitoring.AthenaMonitoringConf import ForceIDConditionsAlg + asq = AthSequencer("AthBeginSeq") + asq += [ForceIDConditionsAlg()] + + local_logger.debug('DQ Post-Setup Configuration') + import re + from AthenaMonitoring.EventFlagFilterTool import GetEventFlagFilterTool + from AthenaMonitoring.AtlasReadyFilterTool import GetAtlasReadyFilterTool + + # now the DQ tools are private, extract them from the set of monitoring algorithms + toolset = set() + from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager + for _ in topSequence: + if isinstance(_, AthenaMonManager): + toolset.update(_.AthenaMonTools) + + # in MT the initialization can be in random order ... force all managers to have common setup + _.FileKey = DQMonFlags.monManFileKey() + _.ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup() + _.DataType = DQMonFlags.monManDataType() + _.Environment = DQMonFlags.monManEnvironment() + _.LBsInLowStatInterval = DQMonFlags.monManLBsInLowStatInterval() + _.LBsInMediumStatInterval = DQMonFlags.monManLBsInMediumStatInterval() + _.LBsInHighStatInterval = DQMonFlags.monManLBsInHighStatInterval() + _.ManualRunLBSetup = DQMonFlags.monManManualRunLBSetup() + _.Run = DQMonFlags.monManRun() + _.LumiBlock = DQMonFlags.monManLumiBlock() + + for tool in toolset: + # stop lumi access if we're in MC or enableLumiAccess == False + if 'EnableLumi' in dir(tool): + if globalflags.DataSource.get_Value() == 'geant4' or not DQMonFlags.enableLumiAccess(): + tool.EnableLumi = False + else: + tool.EnableLumi = True + # if we have the FilterTools attribute, assume this is in fact a + # monitoring tool + if hasattr(tool, 'FilterTools'): + # if express: use ATLAS Ready filter + local_logger.debug('Setting up filters for tool %s', tool) + if rec.triggerStream()=='express': + local_logger.info('Stream is express and we will add ready tool for %s', tool) + tool.FilterTools += [GetAtlasReadyFilterTool()] + # if requested: configure a generic event cleaning tool + if not athenaCommonFlags.isOnline() and any(re.match(_, tool.name()) for _ in DQMonFlags.includeInCleaning()): + if tool.name() in DQMonFlags.specialCleaningConfiguration(): + config_ = DQMonFlags.specialCleaningConfiguration()[tool.name()].copy() + for _ in config_: + try: + config_[_] = bool(config_[_]) + except: + local_logger.error('Unable to enact special event cleaning configuration for tool %s; cannot cast %s=%s to bool', tool.name(), _, config_[_]) + config_['name'] = 'DQEventFlagFilterTool_%s' % tool.name() + tool.FilterTools += [GetEventFlagFilterTool(**config_)] + del config_ + local_logger.info('Configurating special event cleaning for tool %s', tool) + else: + local_logger.info('Configuring generic event cleaning for tool %s', tool) + tool.FilterTools += [GetEventFlagFilterTool('DQEventFlagFilterTool')] + else: + local_logger.info('NOT configuring event cleaning for tool %s', tool) + + # give all the tools the trigger translator + if DQMonFlags.useTrigger(): + tool.TrigDecisionTool = getattr(ToolSvc, DQMonFlags.nameTrigDecTool()) + tool.TriggerTranslatorTool = getattr(ToolSvc, DQMonFlags.nameTrigTransTool()) + + if DQMonFlags.monToolPostExec(): + postprocfunc = eval(DQMonFlags.monToolPostExec()) + local_logger.debug('Applying postexec transform to ===> %s', tool) + postprocfunc(tool) + del postprocfunc + if not DQMonFlags.doNewMonitoring(): if DQMonFlags.useTrigger(): if not hasattr(ToolSvc, DQMonFlags.nameTrigDecTool()): @@ -37,9 +126,6 @@ if DQMonFlags.doMonitoring(): from LumiBlockComps.TrigLiveFractionCondAlgDefault import TrigLiveFractionCondAlgDefault TrigLiveFractionCondAlgDefault() - from AthenaMonitoring.AtlasReadyFilterTool import GetAtlasReadyFilterTool - from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool - #---------------------------# # Inner detector monitoring # #---------------------------# @@ -236,97 +322,10 @@ if DQMonFlags.doMonitoring(): except Exception: treatException("DataQualitySteering_jobOptions.py: exception when setting up HI monitoring") - #------------------------# - # Trigger chain steering # - #------------------------# - trigMap = DQMonFlags.triggerChainMap.get_Value() - for toolName, trigChain in six.iteritems(trigMap): - local_logger.debug("Applying trigger %s to %s", trigChain, toolName) - if hasattr(ToolSvc,toolName): - tool = getattr(ToolSvc,toolName) - tool.TriggerChain = trigChain - else: - local_logger.debug("%s is not found in ToolSvc. Cannot set trigger chain!", toolName) - #--------------------------# # Post-setup configuration # #--------------------------# - # force conditions update because the converter can't do it - if DQMonFlags.monManEnvironment in ('tier0ESD', 'AOD'): - from AthenaCommon.AlgSequence import AthSequencer - from AthenaMonitoring.AthenaMonitoringConf import ForceIDConditionsAlg - asq = AthSequencer("AthBeginSeq") - asq += [ForceIDConditionsAlg()] - - if rec.triggerStream()=='express': - include("AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py") - local_logger.debug('DQ Post-Setup Configuration') - import re - from AthenaMonitoring.EventFlagFilterTool import GetEventFlagFilterTool - - # now the DQ tools are private, extract them from the set of monitoring algorithms - toolset = set() - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - for _ in topSequence: - if isinstance(_, AthenaMonManager): - toolset.update(_.AthenaMonTools) - - # in MT the initialization can be in random order ... force all managers to have common setup - _.FileKey = DQMonFlags.monManFileKey() - _.ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup() - _.DataType = DQMonFlags.monManDataType() - _.Environment = DQMonFlags.monManEnvironment() - _.LBsInLowStatInterval = DQMonFlags.monManLBsInLowStatInterval() - _.LBsInMediumStatInterval = DQMonFlags.monManLBsInMediumStatInterval() - _.LBsInHighStatInterval = DQMonFlags.monManLBsInHighStatInterval() - _.ManualRunLBSetup = DQMonFlags.monManManualRunLBSetup() - _.Run = DQMonFlags.monManRun() - _.LumiBlock = DQMonFlags.monManLumiBlock() - - for tool in toolset: - # stop lumi access if we're in MC or enableLumiAccess == False - if 'EnableLumi' in dir(tool): - if globalflags.DataSource.get_Value() == 'geant4' or not DQMonFlags.enableLumiAccess(): - tool.EnableLumi = False - else: - tool.EnableLumi = True - # if we have the FilterTools attribute, assume this is in fact a - # monitoring tool - if hasattr(tool, 'FilterTools'): - # if express: use ATLAS Ready filter - local_logger.debug('Setting up filters for tool %s', tool) - if rec.triggerStream()=='express': - local_logger.info('Stream is express and we will add ready tool for %s', tool) - tool.FilterTools += [GetAtlasReadyFilterTool()] - # if requested: configure a generic event cleaning tool - if not athenaCommonFlags.isOnline() and any(re.match(_, tool.name()) for _ in DQMonFlags.includeInCleaning()): - if tool.name() in DQMonFlags.specialCleaningConfiguration(): - config_ = DQMonFlags.specialCleaningConfiguration()[tool.name()].copy() - for _ in config_: - try: - config_[_] = bool(config_[_]) - except: - local_logger.error('Unable to enact special event cleaning configuration for tool %s; cannot cast %s=%s to bool', tool.name(), _, config_[_]) - config_['name'] = 'DQEventFlagFilterTool_%s' % tool.name() - tool.FilterTools += [GetEventFlagFilterTool(**config_)] - del config_ - local_logger.info('Configurating special event cleaning for tool %s', tool) - else: - local_logger.info('Configuring generic event cleaning for tool %s', tool) - tool.FilterTools += [GetEventFlagFilterTool('DQEventFlagFilterTool')] - else: - local_logger.info('NOT configuring event cleaning for tool %s', tool) - - # give all the tools the trigger translator - if DQMonFlags.useTrigger(): - tool.TrigDecisionTool = monTrigDecTool - tool.TriggerTranslatorTool = monTrigTransTool - - if DQMonFlags.monToolPostExec(): - postprocfunc = eval(DQMonFlags.monToolPostExec()) - local_logger.debug('Applying postexec transform to ===> %s', tool) - postprocfunc(tool) - del postprocfunc + doOldStylePostSetup() else: local_logger.info("DQ: setting up ConfigFlags") @@ -385,9 +384,10 @@ if DQMonFlags.doMonitoring(): # 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 - HLTMonMan.FileKey = DQMonFlags.monManFileKey() + doOldStylePostSetup() except Exception: treatException("DataQualitySteering_jobOptions.py: exception when setting up HLT monitoring") diff --git a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPSiLayerMonitor.cxx b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPSiLayerMonitor.cxx index 715781614cbb4912f2f3d906f44e37efaa8cf6b7..b58c84ae8b789e9774ac1d5a2030bebb6b362ee9 100644 --- a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPSiLayerMonitor.cxx +++ b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPSiLayerMonitor.cxx @@ -96,7 +96,7 @@ void AFPSiLayerMonitor::bookHistograms(ManagedMonitorToolBase* toolToStoreHistog m_hitMultiplicity = new TH1F(hitMultiplicityName.data(), hitMultiplicityTitle.data(), 40, -0.5, 39.5); - m_hitMultiplicity->StatOverflows(); // need to use overflows for calculation of mean + m_hitMultiplicity->SetStatOverflows(TH1::EStatOverflows::kConsider); // need to use overflows for calculation of mean m_hitMultiplicity->SetXTitle("number of hits in an event"); m_hitMultiplicity->SetYTitle("events"); @@ -110,7 +110,7 @@ void AFPSiLayerMonitor::bookHistograms(ManagedMonitorToolBase* toolToStoreHistog m_hitMultiplicityHotSpot = new TH1F(hitMultiplicityNameHotSpot.data(), hitMultiplicityTitleHotSpot.data(), 40, -0.5, 39.5); - m_hitMultiplicityHotSpot->StatOverflows(); // need to use overflows for calculation of mean + m_hitMultiplicityHotSpot->SetStatOverflows(TH1::EStatOverflows::kConsider); // need to use overflows for calculation of mean m_hitMultiplicityHotSpot->SetXTitle("number of hits in hotspot in an event"); m_hitMultiplicityHotSpot->SetYTitle("events"); @@ -125,7 +125,7 @@ void AFPSiLayerMonitor::bookHistograms(ManagedMonitorToolBase* toolToStoreHistog m_timeOverThreshold = new TH1F(timeOverThresholdName.data(), timeOverThresholdTitle.data(), 16, -0.5, 15.5); - m_timeOverThreshold->StatOverflows(); // need to use overflows for calculation of mean + m_timeOverThreshold->SetStatOverflows(TH1::EStatOverflows::kConsider); // need to use overflows for calculation of mean m_timeOverThreshold->SetXTitle("time-over-threshold"); m_timeOverThreshold->SetYTitle("number of hits"); diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx index 19ae99c7146b115548ebec0c47a7c407f4a18fa0..3e78af57084e6ba3da8647ca403a4bb88fbaf74d 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx @@ -66,6 +66,8 @@ StatusCode TrigEgammaEventSelection::childInitialize(){ ATH_MSG_ERROR( "Could not retrieve HLT IsEM Selector Tool! Can't work"); return StatusCode::FAILURE; } + + ATH_CHECK( m_eleIsoKey.initialize() ); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaEventSelection.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaEventSelection.h index eb112b0d1a4a571e8d52a7f94788e6d52eee4ea7..27e2ae7f9a1fe0200d32dede06adee4ecde60f3c 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaEventSelection.h +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaEventSelection.h @@ -85,6 +85,8 @@ class TrigEgammaEventSelection : public TrigEgammaNavTPBaseTool, public TrigEgam ToolHandleArray<IAsgElectronLikelihoodTool> m_HLTElectronLHSelectors; ToolHandle<IAsgElectronLikelihoodTool> m_electronLHVLooseTool; + SG::ReadDecorHandleKey<xAOD::ElectronContainer> m_eleIsoKey{this, "EleIsoKey", "Electrons.etcone20"}; + std::vector<std::string> m_supportingTrigList; int m_detailedDataLevel; bool m_selectionZ; diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/TrigMETMonitoring/HLTMETMonTool.h b/Trigger/TrigMonitoring/TrigMETMonitoring/TrigMETMonitoring/HLTMETMonTool.h index e4314e98c612acb98da1c641fe168b447dd2c5ea..10c87d8f552b4d08399cc54f415aeeea4704fbef 100755 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/TrigMETMonitoring/HLTMETMonTool.h +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/TrigMETMonitoring/HLTMETMonTool.h @@ -148,7 +148,7 @@ private: std::string m_hlt_topocl_PUC_met_key; std::string m_hlt_FEB_met_key; std::string m_hlt_Fex_met_key; - std::string m_off_met_key; + SG::ReadHandleKey<xAOD::MissingETContainer> m_off_met_key{this, "off_key", "MET_Reference_AntiKt4LCTopo"}; std::string m_muon_key; std::string m_muon_run3_key; std::string m_muon_base_trigger; diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/HLTMETMonTool.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/HLTMETMonTool.cxx index b2335a0c2d76e5d60b226e8587c0d5caa77a9524..fc2ee230f033de2a958fc7660c2245ce4538b484 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/HLTMETMonTool.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/HLTMETMonTool.cxx @@ -74,7 +74,6 @@ HLTMETMonTool::HLTMETMonTool(const std::string & type, const std::string & name, declareProperty("hlt_topocl_PUC_key", m_hlt_topocl_PUC_met_key="HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC"); declareProperty("hlt_FEB_key", m_hlt_FEB_met_key="HLT_xAOD__TrigMissingETContainer_TrigL2MissingET_FEB"); declareProperty("hlt_Fex_key", m_hlt_Fex_met_key="HLT_xAOD__TrigMissingETContainer_EFMissingET_Fex_2sidednoiseSupp_PUC"); - declareProperty("off_key", m_off_met_key="MET_Reference_AntiKt4LCTopo"); // Muons keys declareProperty("muon_run3_key", m_muon_run3_key="HLT_MuonsCB_RoI"); @@ -181,7 +180,7 @@ StatusCode HLTMETMonTool::init() { m_met_triggers_hlt_expert.push_back(*it); } - + ATH_CHECK( m_off_met_key.initialize() ); return StatusCode::SUCCESS; } @@ -715,9 +714,8 @@ StatusCode HLTMETMonTool::fillMETHist() { ATH_MSG_DEBUG("Accessing EF electrons container with " << hlt_electronEFcontainer->size() << " elements"); // Get Offline MET container - const xAOD::MissingETContainer *off_met_cont = 0; - sc = evtStore()->retrieve(off_met_cont, m_off_met_key); - if (sc.isFailure() || !off_met_cont) { + const xAOD::MissingETContainer *off_met_cont = SG::get(m_off_met_key); + if (!off_met_cont) { ATH_MSG_DEBUG("Could not retrieve Reconstructed MET term with Key " << m_off_met_key << " : off_met_cont = 0"); } else { ATH_MSG_DEBUG("Got Reconstructed MET term with key " << m_off_met_key); diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoring/TrigMuonMonitoring/HLTMuonMonTool.h b/Trigger/TrigMonitoring/TrigMuonMonitoring/TrigMuonMonitoring/HLTMuonMonTool.h index 47f19f23a52408daa83279fb6abe8486efbabc22..89f5a390ff8e4e82276173f3fd1c135014f7a287 100755 --- a/Trigger/TrigMonitoring/TrigMuonMonitoring/TrigMuonMonitoring/HLTMuonMonTool.h +++ b/Trigger/TrigMonitoring/TrigMuonMonitoring/TrigMuonMonitoring/HLTMuonMonTool.h @@ -423,6 +423,7 @@ class HLTMuonMonTool : public IHLTMonTool // isolation cut for ztp double m_ztp_ptcone30rel_cut; double m_ztp_EF_ptcone30rel_cut; + SG::ReadDecorHandleKey<xAOD::MuonContainer> m_muonIsoKey{this, "MuonIsoKey", "Muons.ptcone30"}; //2d histos parameter diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoring/src/MuZTPMon.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoring/src/MuZTPMon.cxx index e403c29b8345f0849763aee2468dbed66d5b3be7..0e5551526b2fcfdfc2d51121f6af8be7f9e704a3 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoring/src/MuZTPMon.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoring/src/MuZTPMon.cxx @@ -106,6 +106,8 @@ StatusCode HLTMuonMonTool::initMuZTPDQA() } }//map loop + ATH_CHECK( m_muonIsoKey.initialize() ); + return StatusCode::SUCCESS; }