#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 |
Implementation: <Notes on="" implementation>="">
Definition at line 43 of file Timer.h.
Timer::Timer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 35 of file Timer.cc.
References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), includeSelf, newTimingMeasurement(), and self_module_name.
00036 { 00037 // produces<EventTime>("Timing"); 00038 produces<EventTime>(); 00039 00040 // whether to include timing info about Timer module (default: false) 00041 includeSelf = iConfig.getUntrackedParameter<bool>("includeSelf", false); 00042 00043 timing.reset(); 00044 00045 // attach method to Timing service's "new measurement" signal 00046 Service<TimerService> time; 00047 time->newMeasurementSignal.connect(boost::bind(boost::mem_fn(&Timer::newTimingMeasurement), this, _1, _2) ); 00048 00049 self_module_name = string(iConfig.getParameter<string>("@module_type")); 00050 }
Timer::~Timer | ( | ) |
Definition at line 52 of file Timer.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), includeSelf, and std.
00053 { 00054 using namespace std; 00055 00056 if(!includeSelf){ 00057 string longLine("=========================================================="); 00058 cout << longLine << endl; 00059 cout << " Timer Info:\n"; 00060 cout << " Timer module was excluded from time measurements\n"; 00061 cout << " (to include, set 'bool includeSelf = true' in .cfg file)\n"; 00062 cout << longLine << endl << endl; 00063 } 00064 00065 }
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().
00069 { 00070 // check if module name corresponds to "this" and skip if needed 00071 if(!includeSelf && iMod.moduleName() == self_module_name) 00072 return; 00073 00074 // new measurement; add to private member 00075 ModuleTime newModuleTime(iMod.moduleLabel(), iTime); 00076 timing.addModuleTime(newModuleTime); 00077 }
void Timer::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 86 of file Timer.cc.
References out, and edm::Event::put().
00087 { 00088 std::auto_ptr<EventTime> out(new EventTime(timing)); 00089 // reset data so that we can start from scratch for next event 00090 timing.reset(); 00091 // 00092 iEvent.put(out); 00093 }
bool Timer::includeSelf [private] |
std::string Timer::self_module_name [private] |
edm::EventTime Timer::timing [private] |