#include <HLTrigger/Timer/src/Timer.cc>
Public Member Functions | |
void | newTimingMeasurement (const edm::ModuleDescription &iMod, double iTime) |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Timer (const edm::ParameterSet &) | |
~Timer () | |
Private Attributes | |
bool | includeSelf |
std::string | self_module_name |
edm::EventTime | timing |
Description: EDProducer that uses the EventTime structure to store in the Event the names and processing times (per event) for all modules.
Implementation: <Notes on="" implementation>="">
Timer::Timer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 35 of file Timer.cc.
References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), includeSelf, newTimingMeasurement(), self_module_name, and cond::rpcobgas::time.
{ // produces<EventTime>("Timing"); produces<EventTime>(); // whether to include timing info about Timer module (default: false) includeSelf = iConfig.getUntrackedParameter<bool>("includeSelf", false); timing.reset(); // attach method to Timing service's "new measurement" signal Service<TimerService> time; time->newMeasurementSignal.connect(boost::bind(boost::mem_fn(&Timer::newTimingMeasurement), this, _1, _2) ); self_module_name = string(iConfig.getParameter<string>("@module_type")); }
Timer::~Timer | ( | ) |
Definition at line 52 of file Timer.cc.
References gather_cfg::cout, and includeSelf.
{ using namespace std; if(!includeSelf){ string longLine("=========================================================="); cout << longLine << endl; cout << " Timer Info:\n"; cout << " Timer module was excluded from time measurements\n"; cout << " (to include, set 'bool includeSelf = true' in .cfg file)\n"; cout << longLine << endl << endl; } }
void Timer::newTimingMeasurement | ( | const edm::ModuleDescription & | iMod, |
double | iTime | ||
) |
Definition at line 68 of file Timer.cc.
References includeSelf, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), and self_module_name.
Referenced by Timer().
{ // check if module name corresponds to "this" and skip if needed if(!includeSelf && iMod.moduleName() == self_module_name) return; // new measurement; add to private member ModuleTime newModuleTime(iMod.moduleLabel(), iTime); timing.addModuleTime(newModuleTime); }
void Timer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 86 of file Timer.cc.
References dbtoconf::out, and edm::Event::put().
bool Timer::includeSelf [private] |
Definition at line 56 of file Timer.h.
Referenced by newTimingMeasurement(), Timer(), and ~Timer().
std::string Timer::self_module_name [private] |
Definition at line 59 of file Timer.h.
Referenced by newTimingMeasurement(), and Timer().
edm::EventTime Timer::timing [private] |