CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
XrdAdaptor::QualityMetric Class Reference

#include <QualityMetric.h>

Inheritance diagram for XrdAdaptor::QualityMetric:
XrdAdaptor::QualityMetricSource XrdAdaptor::QualityMetricUniqueSource

Public Member Functions

unsigned get ()
 
 QualityMetric (timespec now, int default_value=260)
 

Private Member Functions

void finishWatch (timespec now, int ms)
 

Private Attributes

int m_interval0_n
 
time_t m_interval0_start
 
int m_interval0_val
 
int m_interval1_val
 
int m_interval2_val
 
int m_interval3_val
 
int m_interval4_val
 
std::mutex m_mutex
 
int m_value
 

Static Private Attributes

static const unsigned interval_length = 60
 

Friends

class QualityMetricWatch
 

Detailed Description

Definition at line 37 of file QualityMetric.h.

Constructor & Destructor Documentation

QualityMetric::QualityMetric ( timespec  now,
int  default_value = 260 
)

Member Function Documentation

void QualityMetric::finishWatch ( timespec  now,
int  ms 
)
private

Definition at line 90 of file QualityMetric.cc.

References interval_length, m_interval0_n, m_interval0_start, m_interval0_val, m_interval1_val, m_interval2_val, m_interval3_val, m_interval4_val, m_mutex, m_value, AnalysisDataFormats_SUSYBSMObjects::ms, and pileupDistInMC::num.

91 {
92  std::unique_lock<std::mutex> sentry(m_mutex);
93 
94  m_value = -1;
95  if (stop.tv_sec > m_interval0_start+interval_length)
96  {
101  m_interval0_n = 1;
103  m_interval0_start = stop.tv_sec;
104  }
105  else
106  {
108  m_interval0_n++;
110  }
111 }
susybsm::MuonSegment ms
Definition: classes.h:31
static const unsigned interval_length
Definition: QualityMetric.h:47
unsigned QualityMetric::get ( void  )

Definition at line 114 of file QualityMetric.cc.

References m_interval0_val, m_interval1_val, m_interval2_val, m_interval3_val, m_interval4_val, m_mutex, and m_value.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), and betterConfigParser.BetterConfigParser::getResultingSection().

115 {
116  std::unique_lock<std::mutex> sentry(m_mutex);
117 
118  if (m_value == -1)
119  {
120  unsigned den = 0;
121  m_value = 0;
122  if (m_interval0_val >= 0)
123  {
124  den += 16;
126  }
127  if (m_interval1_val >= 0)
128  {
129  den += 8;
131  }
132  if (m_interval2_val >= 0)
133  {
134  den += 4;
136  }
137  if (m_interval3_val >= 0)
138  {
139  den += 2;
141  }
142  if (m_interval4_val >= 0)
143  {
144  den += 1;
146  }
147  if (den)
148  m_value /= den;
149  else
150  m_value = 260;
151  }
152  return m_value;
153 }

Friends And Related Function Documentation

friend class QualityMetricWatch
friend

Definition at line 38 of file QualityMetric.h.

Member Data Documentation

const unsigned XrdAdaptor::QualityMetric::interval_length = 60
staticprivate

Definition at line 47 of file QualityMetric.h.

Referenced by finishWatch().

int XrdAdaptor::QualityMetric::m_interval0_n
private

Definition at line 50 of file QualityMetric.h.

Referenced by finishWatch().

time_t XrdAdaptor::QualityMetric::m_interval0_start
private

Definition at line 52 of file QualityMetric.h.

Referenced by finishWatch().

int XrdAdaptor::QualityMetric::m_interval0_val
private

Definition at line 51 of file QualityMetric.h.

Referenced by finishWatch(), and get().

int XrdAdaptor::QualityMetric::m_interval1_val
private

Definition at line 53 of file QualityMetric.h.

Referenced by finishWatch(), and get().

int XrdAdaptor::QualityMetric::m_interval2_val
private

Definition at line 54 of file QualityMetric.h.

Referenced by finishWatch(), and get().

int XrdAdaptor::QualityMetric::m_interval3_val
private

Definition at line 55 of file QualityMetric.h.

Referenced by finishWatch(), and get().

int XrdAdaptor::QualityMetric::m_interval4_val
private

Definition at line 56 of file QualityMetric.h.

Referenced by finishWatch(), and get().

std::mutex XrdAdaptor::QualityMetric::m_mutex
private

Definition at line 58 of file QualityMetric.h.

Referenced by finishWatch(), and get().

int XrdAdaptor::QualityMetric::m_value
private

Definition at line 49 of file QualityMetric.h.

Referenced by finishWatch(), and get().