From 7e4c8413dae9fbfdaf93f755b2ea874bdd701316 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Tue, 10 Nov 2009 15:00:42 +0000 Subject: [PATCH] --- yaml --- r: 77549 b: "refs/heads/CMSSW_7_1_X" c: b6a74292bf13caa5c7aedff7e08a94b9844da16c h: "refs/heads/CMSSW_7_1_X" i: 77547: 29bf50fbc6141aa58052c843cd9df4181c906dab v: v3 --- [refs] | 2 +- .../special/src/HLTLogMonitorFilter.cc | 23 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index dbcb18f9a69e6..d7cce33a395d2 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e -"refs/heads/CMSSW_7_1_X": c419b1ee8b278974156074f49bc40629c4ad8b3a +"refs/heads/CMSSW_7_1_X": b6a74292bf13caa5c7aedff7e08a94b9844da16c diff --git a/trunk/HLTrigger/special/src/HLTLogMonitorFilter.cc b/trunk/HLTrigger/special/src/HLTLogMonitorFilter.cc index d9370289277c1..fb26e96bc8f99 100644 --- a/trunk/HLTrigger/special/src/HLTLogMonitorFilter.cc +++ b/trunk/HLTrigger/special/src/HLTLogMonitorFilter.cc @@ -13,7 +13,7 @@ // // Original Author: Andrea Bocci // Created: Thu Nov 5 15:16:46 CET 2009 -// $Id: HLTLogMonitorFilter.cc,v 1.2 2009/11/10 10:44:40 fwyzard Exp $ +// $Id: HLTLogMonitorFilter.cc,v 1.3 2009/11/10 14:20:47 fwyzard Exp $ // @@ -108,7 +108,7 @@ class HLTLogMonitorFilter : public HLTFilter { // user include files #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/MessageLogger/interface/LoggedErrorsSummary.h" +#include "FWCore/MessageLogger/interface/MessageSender.h" // // constructors and destructor @@ -140,17 +140,19 @@ HLTLogMonitorFilter::~HLTLogMonitorFilter() // ------------ method called on each new Event ------------ bool HLTLogMonitorFilter::filter(edm::Event & event, const edm::EventSetup & setup) { // no LogErrors or LogWarnings, skip processing and reject the event - if (not edm::FreshErrorsExist()) + if (not edm::MessageSender::freshError) return false; // look at the LogErrors and LogWarnings, and accept the event if at least one is under threshold or matches the prescale bool accept = false; std::string category; - std::vector errors = edm::LoggedErrorsSummary(); // returns by value and clears the internal log - BOOST_FOREACH(const edm::ErrorSummaryEntry & error, errors) { + // FIXME: is __typeof__ allowed ? + // typedef __typeof__(edm::MessageSender::errorSummaryMap) ErrorSummaryMap; + typedef std::map ErrorSummaryMap; + BOOST_FOREACH(const ErrorSummaryMap::value_type & entry, edm::MessageSender::errorSummaryMap) { // split the message category typedef boost::split_iterator splitter; - for (splitter i = boost::make_split_iterator(error.category, boost::first_finder("|", boost::is_equal())); + for (splitter i = boost::make_split_iterator(entry.first.category, boost::first_finder("|", boost::is_equal())); i != splitter(); ++i) { @@ -163,16 +165,21 @@ bool HLTLogMonitorFilter::filter(edm::Event & event, const edm::EventSetup & set accept = true; } } + + // clear the errorSummaryMap + edm::MessageSender::errorSummaryMap.clear(); + edm::MessageSender::freshError = false; + return accept; } // ------------ method called at the end of the Job --------- void HLTLogMonitorFilter::beginJob(void) { - edm::EnableLoggedErrorsSummary(); + edm::MessageSender::errorSummaryIsBeingKept = true; } // ------------ method called at the end of the Job --------- void HLTLogMonitorFilter::endJob(void) { - edm::DisableLoggedErrorsSummary(); + edm::MessageSender::errorSummaryIsBeingKept = false; summary(); }