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.

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  }

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

Referenced by HLTScalersClient::endLuminosityBlock().

◆ targetSize()

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

Definition at line 83 of file HLTScalersClient.h.

83 { return targetSize_; };

References targetSize_.

◆ trim_()

void HLTScalersClient::CountLSFifo_t::trim_ ( )
inlineprivate

Definition at line 104 of file HLTScalersClient.h.

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

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

Referenced by update().

◆ update()

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

Definition at line 92 of file HLTScalersClient.h.

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  }

References mps_fire::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().

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_().

eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HLTScalersClient::CountLSFifo_t::targetSize_
unsigned int targetSize_
Definition: HLTScalersClient.h:77
mps_fire.end
end
Definition: mps_fire.py:242
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
HLTScalersClient::CountLSFifo_t::trim_
void trim_()
Definition: HLTScalersClient.h:104
T
long double T
Definition: Basic3DVectorLD.h:48
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443