CMS 3D CMS Logo

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  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
#define end
Definition: vmac.h:39
def ls(path, rec=False)
Definition: eostools.py:348
#define begin
Definition: vmac.h:32
unsigned int HLTScalersClient::CountLSFifo_t::targetSize ( ) const
inline

Definition at line 96 of file HLTScalersClient.h.

Referenced by HLTScalersClient::getSlope_().

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

Definition at line 122 of file HLTScalersClient.h.

References begin, end, HLTScalersClient::HLTScalersClient(), and findQualityFiles::size.

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

Definition at line 108 of file HLTScalersClient.h.

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

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.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(), dqm-mbProfile.Profile::finish(), 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(), MatrixUtil.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:20
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
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.