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 Member Functions | Private Attributes
HLTScalersClient::CountLSFifo_t Class Reference

#include <HLTScalersClient.h>

Inheritance diagram for HLTScalersClient::CountLSFifo_t:

Public Member Functions

 CountLSFifo_t (unsigned int sz=3)
 
double getCount (int ls)
 
unsigned int targetSize ()
 
void update (const CountLS_t &T)
 

Private Member Functions

void trim_ ()
 

Private Attributes

bool accumulate_
 
unsigned int targetSize_
 

Detailed Description

Definition at line 90 of file HLTScalersClient.h.

Constructor & Destructor Documentation

HLTScalersClient::CountLSFifo_t::CountLSFifo_t ( unsigned int  sz = 3)
inline

Definition at line 97 of file HLTScalersClient.h.

97  :
98  std::deque<CountLS_t>(),
99  targetSize_(sz)
100  {}

Member Function Documentation

double HLTScalersClient::CountLSFifo_t::getCount ( int  ls)
inline

Definition at line 102 of file HLTScalersClient.h.

References begin, end, spr::find(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by HLTScalersClient::endLuminosityBlock().

103  {
104  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(),
105  ls);
106  if ( p != end() )
107  return p->second;
108  else
109  return -1;
110  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
unsigned int HLTScalersClient::CountLSFifo_t::targetSize ( )
inline

Definition at line 101 of file HLTScalersClient.h.

References targetSize_.

Referenced by HLTScalersClient::getSlope_().

101 { return targetSize_; };
void HLTScalersClient::CountLSFifo_t::trim_ ( )
inlineprivate

Definition at line 127 of file HLTScalersClient.h.

References begin, end, findQualityFiles::size, python.multivaluedict::sort(), and targetSize_.

Referenced by update().

128  {
129  if ( this->size() > targetSize_ ) {
130  std::sort(begin(), end());
131  while ( size() > targetSize_ ) {
132  pop_front();
133  }
134  }
135  }
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
tuple size
Write out results.
void HLTScalersClient::CountLSFifo_t::update ( const CountLS_t T)
inline

Definition at line 113 of file HLTScalersClient.h.

References begin, end, spr::find(), AlCaHLTBitMon_ParallelJobs::p, and trim_().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), 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(), HLTScalersClient::endLuminosityBlock(), 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().

114  {
115  // do we already have data for this LS?
116  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(),
117  T.first);
118  if ( p != this->end() ) { // we already have data for this LS
119  p->second = T.second;
120  }
121  else { // new data
122  this->push_back(T);
123  }
124  trim_();
125  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
long double T

Member Data Documentation

bool HLTScalersClient::CountLSFifo_t::accumulate_
private

Definition at line 94 of file HLTScalersClient.h.

unsigned int HLTScalersClient::CountLSFifo_t::targetSize_
private

Definition at line 93 of file HLTScalersClient.h.

Referenced by targetSize(), and trim_().