CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 75 of file HLTScalersClient.h.

Constructor & Destructor Documentation

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

Definition at line 82 of file HLTScalersClient.h.

82 : std::deque<CountLS_t>(), targetSize_(sz) {}

Member Function Documentation

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

Definition at line 84 of file HLTScalersClient.h.

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

Referenced by HLTScalersClient::endLuminosityBlock().

84  {
85  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(), ls);
86  if (p != end())
87  return p->second;
88  else
89  return -1;
90  }
def ls
Definition: eostools.py:349
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
string end
Definition: dataset.py:937
unsigned int HLTScalersClient::CountLSFifo_t::targetSize ( ) const
inline

Definition at line 83 of file HLTScalersClient.h.

References targetSize_.

Referenced by HLTScalersClient::getSlope_().

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

Definition at line 104 of file HLTScalersClient.h.

References SplitLinear::begin, dataset::end, findQualityFiles::size, and targetSize_.

Referenced by update().

104  {
105  if (this->size() > targetSize_) {
106  std::sort(begin(), end());
107  while (size() > targetSize_) {
108  pop_front();
109  }
110  }
111  }
string end
Definition: dataset.py:937
tuple size
Write out results.
void HLTScalersClient::CountLSFifo_t::update ( const CountLS_t T)
inline

Definition at line 92 of file HLTScalersClient.h.

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

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), HLTScalersClient::endLuminosityBlock(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

92  {
93  // do we already have data for this LS?
94  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(), T.first);
95  if (p != this->end()) { // we already have data for this LS
96  p->second = T.second;
97  } else { // new data
98  this->push_back(T);
99  }
100  trim_();
101  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
string end
Definition: dataset.py:937
long double T

Member Data Documentation

bool HLTScalersClient::CountLSFifo_t::accumulate_
private

Definition at line 78 of file HLTScalersClient.h.

unsigned int HLTScalersClient::CountLSFifo_t::targetSize_
private

Definition at line 77 of file HLTScalersClient.h.

Referenced by targetSize(), and trim_().