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 () const
 
void update (const CountLS_t &T)
 

Private Member Functions

void trim_ ()
 

Private Attributes

bool accumulate_
 
unsigned int targetSize_
 

Detailed Description

Definition at line 85 of file HLTScalersClient.h.

Constructor & Destructor Documentation

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

Definition at line 92 of file HLTScalersClient.h.

92  :
93  std::deque<CountLS_t>(),
94  targetSize_(sz)
95  {}

Member Function Documentation

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

Definition at line 97 of file HLTScalersClient.h.

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

Referenced by HLTScalersClient::endLuminosityBlock().

98  {
99  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(),
100  ls);
101  if ( p != end() )
102  return p->second;
103  else
104  return -1;
105  }
def ls
Definition: eostools.py:346
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:37
#define begin
Definition: vmac.h:30
unsigned int HLTScalersClient::CountLSFifo_t::targetSize ( ) const
inline

Definition at line 96 of file HLTScalersClient.h.

References targetSize_.

Referenced by HLTScalersClient::getSlope_().

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

Definition at line 122 of file HLTScalersClient.h.

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

Referenced by update().

123  {
124  if ( this->size() > targetSize_ ) {
125  std::sort(begin(), end());
126  while ( size() > targetSize_ ) {
127  pop_front();
128  }
129  }
130  }
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
tuple size
Write out results.
void HLTScalersClient::CountLSFifo_t::update ( const CountLS_t T)
inline

Definition at line 108 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().

109  {
110  // do we already have data for this LS?
111  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(),
112  T.first);
113  if ( p != this->end() ) { // we already have data for this LS
114  p->second = T.second;
115  }
116  else { // new data
117  this->push_back(T);
118  }
119  trim_();
120  }
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:37
#define begin
Definition: vmac.h:30
long double T

Member Data Documentation

bool HLTScalersClient::CountLSFifo_t::accumulate_
private

Definition at line 89 of file HLTScalersClient.h.

unsigned int HLTScalersClient::CountLSFifo_t::targetSize_
private

Definition at line 88 of file HLTScalersClient.h.

Referenced by targetSize(), and trim_().