#include <WorkerInPath.h>
Public Types | |
enum | FilterAction { Normal = 0, Ignore, Veto } |
Public Member Functions | |
void | clearCounters () |
FilterAction | filterAction () const |
Worker * | getWorker () const |
template<typename T > | |
bool | runWorker (typename T::MyPrincipal &, EventSetup const &, CurrentProcessingContext const *cpc) |
std::pair< double, double > | timeCpuReal () const |
int | timesExcept () const |
int | timesFailed () const |
int | timesPassed () const |
int | timesVisited () const |
void | useStopwatch () |
WorkerInPath (Worker *) | |
WorkerInPath (Worker *, FilterAction theAction) | |
Private Attributes | |
FilterAction | filterAction_ |
RunStopwatch::StopwatchPointer | stopwatch_ |
int | timesExcept_ |
int | timesFailed_ |
int | timesPassed_ |
int | timesVisited_ |
Worker * | worker_ |
Definition at line 20 of file WorkerInPath.h.
Definition at line 22 of file WorkerInPath.h.
edm::WorkerInPath::WorkerInPath | ( | Worker * | w | ) | [explicit] |
Definition at line 17 of file WorkerInPath.cc.
: stopwatch_(new RunStopwatch::StopwatchPointer::element_type), timesVisited_(), timesPassed_(), timesFailed_(), timesExcept_(), filterAction_(Normal), worker_(w) { }
edm::WorkerInPath::WorkerInPath | ( | Worker * | w, |
FilterAction | theAction | ||
) |
Definition at line 6 of file WorkerInPath.cc.
: stopwatch_(), timesVisited_(), timesPassed_(), timesFailed_(), timesExcept_(), filterAction_(theFilterAction), worker_(w) { }
void edm::WorkerInPath::clearCounters | ( | ) | [inline] |
Definition at line 38 of file WorkerInPath.h.
References timesExcept_, timesFailed_, timesPassed_, and timesVisited_.
Referenced by edm::Path::clearCounters().
{ timesVisited_ = timesPassed_ = timesFailed_ = timesExcept_ = 0; }
FilterAction edm::WorkerInPath::filterAction | ( | ) | const [inline] |
Worker* edm::WorkerInPath::getWorker | ( | ) | const [inline] |
bool edm::WorkerInPath::runWorker | ( | typename T::MyPrincipal & | ep, |
EventSetup const & | es, | ||
CurrentProcessingContext const * | cpc | ||
) |
Definition at line 64 of file WorkerInPath.h.
References edm::Worker::doWork(), filterAction_, Ignore, stopwatch_, timesExcept_, timesFailed_, timesPassed_, timesVisited_, Veto, and worker_.
{ if (T::isEvent_) { ++timesVisited_; } bool rc = true; try { // may want to change the return value from the worker to be // the Worker::FilterAction so conditions in the path will be easier to // identify rc = worker_->doWork<T>(ep, es, cpc,stopwatch_.get()); // Ignore return code for non-event (e.g. run, lumi) calls if (!T::isEvent_) rc = true; else if (filterAction_ == Veto) rc = !rc; else if (filterAction_ == Ignore) rc = true; if (T::isEvent_) { if(rc) ++timesPassed_; else ++timesFailed_; } } catch(...) { if (T::isEvent_) ++timesExcept_; throw; } return rc; }
std::pair<double,double> edm::WorkerInPath::timeCpuReal | ( | ) | const [inline] |
Definition at line 31 of file WorkerInPath.h.
References stopwatch_.
{ if(stopwatch_) { return std::pair<double,double>(stopwatch_->cpuTime(),stopwatch_->realTime()); } return std::pair<double,double>(0.,0.); }
int edm::WorkerInPath::timesExcept | ( | ) | const [inline] |
int edm::WorkerInPath::timesFailed | ( | ) | const [inline] |
int edm::WorkerInPath::timesPassed | ( | ) | const [inline] |
int edm::WorkerInPath::timesVisited | ( | ) | const [inline] |
void edm::WorkerInPath::useStopwatch | ( | ) |
Definition at line 29 of file WorkerInPath.cc.
References stopwatch_.
{ stopwatch_.reset(new RunStopwatch::StopwatchPointer::element_type); }
FilterAction edm::WorkerInPath::filterAction_ [private] |
Definition at line 59 of file WorkerInPath.h.
Referenced by filterAction(), and runWorker().
Definition at line 52 of file WorkerInPath.h.
Referenced by runWorker(), timeCpuReal(), and useStopwatch().
int edm::WorkerInPath::timesExcept_ [private] |
Definition at line 57 of file WorkerInPath.h.
Referenced by clearCounters(), runWorker(), and timesExcept().
int edm::WorkerInPath::timesFailed_ [private] |
Definition at line 56 of file WorkerInPath.h.
Referenced by clearCounters(), runWorker(), and timesFailed().
int edm::WorkerInPath::timesPassed_ [private] |
Definition at line 55 of file WorkerInPath.h.
Referenced by clearCounters(), runWorker(), and timesPassed().
int edm::WorkerInPath::timesVisited_ [private] |
Definition at line 54 of file WorkerInPath.h.
Referenced by clearCounters(), runWorker(), and timesVisited().
Worker* edm::WorkerInPath::worker_ [private] |
Definition at line 60 of file WorkerInPath.h.
Referenced by getWorker(), and runWorker().