diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h index 40f08ee25db471962e41d1d1bfc3bcc69fd2b2a8..5b4f8dbc91caa2edbba54e01da7b8b49b698da14 100644 --- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h +++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetMonitoringAlg.h @@ -41,6 +41,7 @@ private: bool m_failureOnMissingContainer; bool m_onlyPassingJets; bool m_eventFiresAnyJetChain; + bool m_isExpressStreamJob{false}; }; #endif diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py index f892ef988b8e3730feac17c12c931c86dbef4a7d..4a9795854d86336fb61e855e203bed1314c409b7 100644 --- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py +++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py @@ -529,6 +529,7 @@ class JetMonAlgSpec(ConfigDict): args.setdefault('failureOnMissingContainer', True) args.setdefault('onlyPassingJets', True) args.setdefault('eventFiresAnyJetChain',False) + args.setdefault('isExpressStreamJob', False) ConfigDict.__init__(self, defaultPath=defaultPath, TriggerChain=TriggerChain, **args) tmpL = self.FillerTools self.FillerTools = [] @@ -546,6 +547,7 @@ class JetMonAlgSpec(ConfigDict): alg.FailureOnMissingContainer = self.failureOnMissingContainer alg.OnlyPassingJets = self.onlyPassingJets alg.EventFiresAnyJetChain = self.eventFiresAnyJetChain + alg.isExpressStreamJob = self.isExpressStreamJob path = self.defaultPath tools = [] diff --git a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx index 4dbf3e80535a0a5ad0ce604b7bdd87003d27835f..5abf1dc4281d35e9457c17d8b76f88ee6b383c6d 100644 --- a/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx +++ b/Reconstruction/Jet/JetMonitoring/src/JetMonitoringAlg.cxx @@ -15,6 +15,7 @@ JetMonitoringAlg::JetMonitoringAlg( const std::string& name, ISvcLocator* pSvcLo declareProperty("FailureOnMissingContainer", m_failureOnMissingContainer); declareProperty("OnlyPassingJets", m_onlyPassingJets); declareProperty("EventFiresAnyJetChain", m_eventFiresAnyJetChain); + declareProperty("isExpressStreamJob", m_isExpressStreamJob); } @@ -32,7 +33,12 @@ StatusCode JetMonitoringAlg::initialize() { for(const auto& t: m_jetFillerTools){ ATH_MSG_INFO( "--> "<< t->name() ); } - + + if (m_triggerChainString.empty() and m_isExpressStreamJob) { + ATH_MSG_ERROR("Express stream job, but no trigger chain given"); + return StatusCode::FAILURE; + } + return AthMonitorAlgorithm::initialize(); } @@ -40,6 +46,18 @@ StatusCode JetMonitoringAlg::initialize() { StatusCode JetMonitoringAlg::fillHistograms( const EventContext& ctx ) const { + // if this code is being run in an express stream job, process only + // if the trigger chain passes the event. + // Note that, by the test in initialize(), the trigger chain name is + // provided for all express chain jobs. + // + + if (m_isExpressStreamJob) { + // bail out if the trigger chain does not pass in an express stream job + !(isPassedBits(m_triggerChainString) and TrigDefs::Express_passed); + return StatusCode::SUCCESS; + } + if (m_triggerChainString != "" && m_onlyPassingJets) { ATH_MSG_DEBUG("JetMonitoringAlg::fillHistograms(const EventContext&) -> enter triggerChainString = "<<m_triggerChainString); std::list<const xAOD::Jet*> tmpList; diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py index 404b515cca1027a8d2a63533630edaab9bbeab3e..7c8f8f39bb202ffc11e5e761fb24927bc8e8d5d8 100644 --- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py @@ -721,7 +721,7 @@ def TrigJetMonConfig(inputFlags): # Basic selection of histograms common for online and offline jets -def basicJetMonAlgSpec(jetcoll,isOnline,athenaMT): +def basicJetMonAlgSpec(inputFlags, jetcoll,isOnline,athenaMT): # we use a specialized dictionnary (JetMonAlgSpec) which will be translated into the final C++ tool path = 'NoTriggerSelection' if isOnline else 'standardHistos/' minNjetBin = 1 if isOnline else 0 @@ -734,7 +734,14 @@ def basicJetMonAlgSpec(jetcoll,isOnline,athenaMT): jetcollFolder = jetcoll if jetcoll in JetCollRemapping.JetCollRun2ToRun3 and not athenaMT: jetcollFolder = JetCollRemapping.JetCollRun2ToRun3[jetcoll] - Conf = JetMonAlgSpec(jetcoll+"Mon",JetContainerName = jetcoll, defaultPath = path, topLevelDir=TopLevelDir, bottomLevelDir=jetcollFolder, failureOnMissingContainer=False) + Conf = JetMonAlgSpec(jetcoll+"Mon", + JetContainerName=jetcoll, + defaultPath=path, + topLevelDir=TopLevelDir, + bottomLevelDir=jetcollFolder, + failureOnMissingContainer=False, + isExpressStreamJob=inputFlags.Common.doExpressProcessing, + ) # Now start filling the histo spec list knownHistos['phi_tight'] = HistoSpec('phi_tight', @@ -813,7 +820,7 @@ def jetMonitoringConfig(inputFlags,jetcoll,athenaMT): isOnline = True if 'HLT' in jetcoll else False InputType = 'Legacy' if not athenaMT else 'MT' - conf = basicJetMonAlgSpec(jetcoll,isOnline,athenaMT) + conf = basicJetMonAlgSpec(inputFlags, jetcoll,isOnline,athenaMT) # Declare a configuration dictionnary for a JetContainer if isOnline: @@ -941,6 +948,9 @@ def jetMonitoringConfig(inputFlags,jetcoll,athenaMT): def l1JetMonitoringConfig(inputFlags,jetcoll,chain='',matched=False): from TrigJetMonitoring.L1JetMonitoringConfig import L1JetMonAlg + if isinstance(jetcoll, list): + assert len(jetcoll) == 1 + jetcoll = jetcoll[0] name = jetcoll if chain=='' else jetcoll+'_'+chain if not L1JetCollections[jetcoll]['MatchTo']: @@ -1001,25 +1011,28 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT,onlyUsePassingJet NjetHistName = 'njetsEt{}{}'.format(getThreshold(parts),getEtaRangeString(chain)) return NjetHistName - + trigConf = JetMonAlgSpec( # the usual JetMonAlgSpec - jetMonAlgSpecName, - JetContainerName = jetcoll, - TriggerChain = chain, - defaultPath = chainFolder, - topLevelDir="HLT/JetMon/Online/", - bottomLevelDir=jetcollFolder, - failureOnMissingContainer=True, - onlyPassingJets=onlyUsePassingJets, - ) + jetMonAlgSpecName, + JetContainerName = jetcoll, + TriggerChain = chain, + defaultPath = chainFolder, + topLevelDir="HLT/JetMon/Online/", + bottomLevelDir=jetcollFolder, + failureOnMissingContainer=True, + onlyPassingJets=onlyUsePassingJets, + # isExpressStreamJob=inputFlags.Common.doExpressProcessing, + isExpressStreamJob=False + ) + trigConf.appendHistos( - "pt", - "m", - "eta", - "et", - "phi", - "phi_tight", - + "pt", + "m", + "eta", + "et", + "phi", + "phi_tight", + ) for hist in ExtraOnlineNJetHists: trigConf.appendHistos(EventHistoSpec(hist, (20,0,25), title=hist+';'+hist+';Entries')) # Add NjetEt and NjetPt histograms for simple scenarios @@ -1052,7 +1065,7 @@ def jetChainMonitoringConfig(inputFlags,jetcoll,chain,athenaMT,onlyUsePassingJet return trigConf -def jetEfficiencyMonitoringConfig(inputFlags,onlinejetcoll,offlinejetcoll,chain,refChain,athenaMT): +def jetEfficiencyMonitoringConfig(inputFlags, onlinejetcoll, offlinejetcoll, chain, refChain,athenaMT): '''Function to configures some algorithms in the monitoring system.''' # Remap online Run 2 jet collections diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/src/TrigL1FexJetMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigJetMonitoring/src/TrigL1FexJetMonitorAlgorithm.h index 9945fb2f0c1f68e353875b56ed54bf7298a3e67e..3fdaa608d17d8e4941d0237bcdeb044a46d45ddd 100644 --- a/Trigger/TrigMonitoring/TrigJetMonitoring/src/TrigL1FexJetMonitorAlgorithm.h +++ b/Trigger/TrigMonitoring/TrigJetMonitoring/src/TrigL1FexJetMonitorAlgorithm.h @@ -37,7 +37,8 @@ private: Gaudi::Property<std::string> m_groupName { this, "group_name", {}, "name of monitoring group"}; - + Gaudi::Property<bool> m_isExpressStreamJob { + this, "isExpressStreamJob", {false}, "true for express streamJobs"}; }; #endif