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 87 of file HLTScalersClient.h.

Constructor & Destructor Documentation

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

Definition at line 94 of file HLTScalersClient.h.

94  :
95  std::deque<CountLS_t>(),
96  targetSize_(sz)
97  {}

Member Function Documentation

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

Definition at line 99 of file HLTScalersClient.h.

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

Referenced by HLTScalersClient::endLuminosityBlock().

100  {
101  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(),
102  ls);
103  if ( p != end() )
104  return p->second;
105  else
106  return -1;
107  }
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 98 of file HLTScalersClient.h.

References targetSize_.

Referenced by HLTScalersClient::getSlope_().

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

Definition at line 124 of file HLTScalersClient.h.

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

Referenced by update().

125  {
126  if ( this->size() > targetSize_ ) {
127  std::sort(begin(), end());
128  while ( size() > targetSize_ ) {
129  pop_front();
130  }
131  }
132  }
#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 110 of file HLTScalersClient.h.

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

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), HLTScalersClient::endLuminosityBlock(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

111  {
112  // do we already have data for this LS?
113  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(),
114  T.first);
115  if ( p != this->end() ) { // we already have data for this LS
116  p->second = T.second;
117  }
118  else { // new data
119  this->push_back(T);
120  }
121  trim_();
122  }
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 91 of file HLTScalersClient.h.

unsigned int HLTScalersClient::CountLSFifo_t::targetSize_
private

Definition at line 90 of file HLTScalersClient.h.

Referenced by targetSize(), and trim_().