CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EventProgress Class Reference

#include <EventProgress.h>

Public Member Functions

 EventProgress ()
 
 EventProgress (unsigned long nEvents)
 
void update (unsigned long event)
 
 ~EventProgress ()
 

Private Attributes

unsigned int displayWidth
 
time_t lastUpdate
 
unsigned long nEvents
 
time_t startTime
 

Detailed Description

Definition at line 6 of file EventProgress.h.

Constructor & Destructor Documentation

EventProgress::EventProgress ( )

Definition at line 10 of file EventProgress.cc.

10  :
12 {
13 }
unsigned long nEvents
Definition: EventProgress.h:15
#define NULL
Definition: scimark2.h:8
unsigned int displayWidth
Definition: EventProgress.h:18
time_t startTime
Definition: EventProgress.h:16
time_t lastUpdate
Definition: EventProgress.h:17
EventProgress::EventProgress ( unsigned long  nEvents)

Definition at line 15 of file EventProgress.cc.

15  :
16  nEvents(_nEvents), startTime(time(NULL)), lastUpdate(0),
17  displayWidth(int(std::log(nEvents + 0.5) / M_LN10 + 1))
18 {
19 }
unsigned long nEvents
Definition: EventProgress.h:15
#define NULL
Definition: scimark2.h:8
unsigned int displayWidth
Definition: EventProgress.h:18
time_t startTime
Definition: EventProgress.h:16
time_t lastUpdate
Definition: EventProgress.h:17
EventProgress::~EventProgress ( )

Definition at line 21 of file EventProgress.cc.

References gather_cfg::cout.

22 {
23  std::cout << " \r" << std::flush;
24 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void EventProgress::update ( unsigned long  event)

Definition at line 26 of file EventProgress.cc.

References gather_cfg::cout, displayWidth, eta(), event(), lastUpdate, max(), nEvents, startTime, and cond::rpcobgas::time.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), JetTagMVATreeTrainer::analyze(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

27 {
28  time_t currentTime = time(0);
29  if (currentTime == lastUpdate)
30  return;
31 
32  lastUpdate = currentTime;
33 
34  if (displayWidth)
35  std::cout << "Event " << std::setw(displayWidth) << event;
36  else
37  std::cout << "Event " << event;
38 
39  if (nEvents) {
40  unsigned long eta = (event >= 10) ? ((currentTime - startTime) * (nEvents - event) / event)
42 
43  std::cout << " (" << std::setw(2) << (event * 100 / nEvents) << "%), ETA ";
44  if (eta >= 6000)
45  std::cout << "##:##\r";
46  else
47  std::cout << std::setw(2) << (eta / 60) << ":"
48  << std::setfill('0') << std::setw(2) << (eta % 60);
49  }
50 
51  std::cout << std::setfill(' ')
52  << std::resetiosflags(std::ios::fixed)
53  << std::resetiosflags(std::ios::scientific)
54  << std::resetiosflags(std::ios::floatfield)
55  << std::setprecision(8)
56  << "\r" << std::flush;
57 }
unsigned long nEvents
Definition: EventProgress.h:15
T eta() const
unsigned int displayWidth
Definition: EventProgress.h:18
const T & max(const T &a, const T &b)
time_t startTime
Definition: EventProgress.h:16
time_t lastUpdate
Definition: EventProgress.h:17
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

unsigned int EventProgress::displayWidth
private

Definition at line 18 of file EventProgress.h.

Referenced by update().

time_t EventProgress::lastUpdate
private

Definition at line 17 of file EventProgress.h.

Referenced by update().

unsigned long EventProgress::nEvents
private

Definition at line 15 of file EventProgress.h.

Referenced by update().

time_t EventProgress::startTime
private

Definition at line 16 of file EventProgress.h.

Referenced by update().