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

Constructor & Destructor Documentation

◆ CountLSFifo_t()

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

◆ getCount()

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

Definition at line 84 of file HLTScalersClient.h.

References mps_fire::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  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
def ls(path, rec=False)
Definition: eostools.py:349

◆ targetSize()

unsigned int HLTScalersClient::CountLSFifo_t::targetSize ( ) const
inline

Definition at line 83 of file HLTScalersClient.h.

References targetSize_.

83 { return targetSize_; };

◆ trim_()

void HLTScalersClient::CountLSFifo_t::trim_ ( )
inlineprivate

Definition at line 104 of file HLTScalersClient.h.

References mps_fire::end, findQualityFiles::size, jetUpdater_cfi::sort, 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  }
size
Write out results.

◆ update()

void HLTScalersClient::CountLSFifo_t::update ( const CountLS_t T)
inline

Definition at line 92 of file HLTScalersClient.h.

References mps_fire::end, spr::find(), AlCaHLTBitMon_ParallelJobs::p, push_back(), 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
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
long double T

Member Data Documentation

◆ accumulate_

bool HLTScalersClient::CountLSFifo_t::accumulate_
private

Definition at line 78 of file HLTScalersClient.h.

◆ targetSize_

unsigned int HLTScalersClient::CountLSFifo_t::targetSize_
private

Definition at line 77 of file HLTScalersClient.h.

Referenced by targetSize(), and trim_().