CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HLTScalersClient::CountLSFifo_t Class Reference

#include <HLTScalersClient.h>

List of all members.

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


Constructor & Destructor Documentation

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

Definition at line 97 of file HLTScalersClient.h.

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

Member Function Documentation

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

Definition at line 102 of file HLTScalersClient.h.

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

Referenced by HLTScalersClient::endLuminosityBlock().

    {
      CountLSFifo_t::iterator p = std::find(this->begin(), this->end(),
                                            ls);
      if ( p != end() ) 
        return p->second;
      else
        return -1;
    }
unsigned int HLTScalersClient::CountLSFifo_t::targetSize ( ) [inline]

Definition at line 101 of file HLTScalersClient.h.

References targetSize_.

Referenced by HLTScalersClient::getSlope_().

{ return targetSize_; };
void HLTScalersClient::CountLSFifo_t::trim_ ( ) [inline, private]

Definition at line 127 of file HLTScalersClient.h.

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

Referenced by update().

    {
      if ( this->size() > targetSize_ ) {
        std::sort(begin(), end());
        while ( size() > targetSize_ ) {
          pop_front();
        }
      }
    }
void HLTScalersClient::CountLSFifo_t::update ( const CountLS_t T) [inline]

Definition at line 113 of file HLTScalersClient.h.

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

Referenced by HLTScalersClient::endLuminosityBlock().

    {
      // do we already have data for this LS?
      CountLSFifo_t::iterator p = std::find(this->begin(), this->end(),
                                            T.first);
      if ( p != this->end() ) { // we already have data for this LS
        p->second = T.second; 
      }
      else { // new data
        this->push_back(T);
      }
      trim_();
    }

Member Data Documentation

Definition at line 94 of file HLTScalersClient.h.

Definition at line 93 of file HLTScalersClient.h.

Referenced by targetSize(), and trim_().