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

Constructor & Destructor Documentation

◆ CountLSFifo_t()

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

Definition at line 83 of file HLTScalersClient.h.

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

Member Function Documentation

◆ getCount()

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

Definition at line 85 of file HLTScalersClient.h.

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

Referenced by HLTScalersClient::endLuminosityBlock().

85  {
86  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(), ls);
87  if (p != end())
88  return p->second;
89  else
90  return -1;
91  }
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 84 of file HLTScalersClient.h.

References targetSize_.

84 { return targetSize_; };

◆ trim_()

void HLTScalersClient::CountLSFifo_t::trim_ ( )
inlineprivate

Definition at line 105 of file HLTScalersClient.h.

References mps_fire::end, findQualityFiles::size, jetsAK4_CHS_cff::sort, and targetSize_.

Referenced by update().

105  {
106  if (this->size() > targetSize_) {
107  std::sort(begin(), end());
108  while (size() > targetSize_) {
109  pop_front();
110  }
111  }
112  }
size
Write out results.

◆ update()

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

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

93  {
94  // do we already have data for this LS?
95  CountLSFifo_t::iterator p = std::find(this->begin(), this->end(), T.first);
96  if (p != this->end()) { // we already have data for this LS
97  p->second = T.second;
98  } else { // new data
99  this->push_back(T);
100  }
101  trim_();
102  }
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 79 of file HLTScalersClient.h.

◆ targetSize_

unsigned int HLTScalersClient::CountLSFifo_t::targetSize_
private

Definition at line 78 of file HLTScalersClient.h.

Referenced by targetSize(), and trim_().