CMS 3D CMS Logo

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

Public Member Functions

void addRobBin (int robBin)
 
 DTRobBinsMap (DQMStore::IGetter &igetter, const int fed, const int ros)
 
 DTRobBinsMap ()
 
double getChamberPercentage (DQMStore::IGetter &)
 
void init (bool v)
 
void readNewValues (DQMStore::IGetter &igetter)
 
bool robChanged (int robBin)
 
 ~DTRobBinsMap ()
 

Private Member Functions

int getValueRobBin (int robBin) const
 
int getValueRos () const
 

Private Attributes

std::string dduHName
 
bool init_
 
const MonitorElementmeDDU
 
const MonitorElementmeROS
 
std::map< int, int > robsAndValues
 
int rosBin
 
std::string rosHName
 
int rosValue
 

Detailed Description

Definition at line 80 of file DTBlockedROChannelsTest.h.

Constructor & Destructor Documentation

DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( DQMStore::IGetter igetter,
const int  fed,
const int  ros 
)

Definition at line 291 of file DTBlockedROChannelsTest.cc.

References dduHName, dqm::implementation::IGetter::get(), meDDU, meROS, and rosHName.

292  : rosBin(ros), init_(true), rosValue(0) {
293  // get the pointer to the corresondig histo
294  // Legacy
295  stringstream mename;
296  mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros << "/FED" << fed << "_ROS" << ros << "_ROSError";
297  rosHName = mename.str();
298 
299  stringstream whname;
300  whname << "DT/00-DataIntegrity/FED" << fed << "/FED" << fed << "_ROSStatus";
301  dduHName = whname.str();
302 
303  meROS = igetter.get(rosHName);
304  meDDU = igetter.get(dduHName);
305 }
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )
DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 309 of file DTBlockedROChannelsTest.cc.

309 {}

Member Function Documentation

void DTBlockedROChannelsTest::DTRobBinsMap::addRobBin ( int  robBin)

Definition at line 312 of file DTBlockedROChannelsTest.cc.

312 { robsAndValues[robBin] = getValueRobBin(robBin); }
double DTBlockedROChannelsTest::DTRobBinsMap::getChamberPercentage ( DQMStore::IGetter igetter)

Definition at line 350 of file DTBlockedROChannelsTest.cc.

References dqm::implementation::IGetter::get().

350  {
351  meROS = igetter.get(rosHName);
352  meDDU = igetter.get(dduHName);
353  int nChangedROBs = 0;
354 
355  // check if ros status has changed
356  int newValue = getValueRos();
357  if (newValue > rosValue) {
358  rosValue = newValue;
359  return 0.;
360  }
361 
362  for (map<int, int>::const_iterator robAndValue = robsAndValues.begin(); robAndValue != robsAndValues.end();
363  ++robAndValue) {
364  if (robChanged((*robAndValue).first))
365  nChangedROBs++;
366  }
367  return 1. - ((double)nChangedROBs / (double)robsAndValues.size());
368 }
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin ( int  robBin) const
private

Definition at line 314 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

314  {
315  if (init_)
316  return 0;
317  int value = 0;
318  if (meROS) {
319  value += (int)meROS->getBinContent(9, robBin);
320  value += (int)meROS->getBinContent(11, robBin);
321  }
322  return value;
323 }
virtual double getBinContent(int binx) const
get content of bin (1-D)
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 325 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

325  {
326  int value = 0;
327  if (meDDU) {
328  value += (int)meDDU->getBinContent(2, rosBin);
329  value += (int)meDDU->getBinContent(10, rosBin);
330  }
331  return value;
332 }
virtual double getBinContent(int binx) const
get content of bin (1-D)
void DTBlockedROChannelsTest::DTRobBinsMap::init ( bool  v)
inline
void DTBlockedROChannelsTest::DTRobBinsMap::readNewValues ( DQMStore::IGetter igetter)

Definition at line 370 of file DTBlockedROChannelsTest.cc.

References dqm::implementation::IGetter::get().

370  {
371  meROS = igetter.get(rosHName);
372  meDDU = igetter.get(dduHName);
373 
374  rosValue = getValueRos();
375  for (map<int, int>::const_iterator robAndValue = robsAndValues.begin(); robAndValue != robsAndValues.end();
376  ++robAndValue) {
377  robChanged((*robAndValue).first);
378  }
379 }
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 334 of file DTBlockedROChannelsTest.cc.

334  {
335  // check that this is a valid ROB for this map (= it has been added!)
336  if (robsAndValues.find(robBin) == robsAndValues.end()) {
337  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
338  << "[DTRobBinsMap]***Error: ROB: " << robBin << " is not valid" << endl;
339  return false;
340  }
341 
342  int newValue = getValueRobBin(robBin);
343  if (newValue > robsAndValues[robBin]) {
344  robsAndValues[robBin] = newValue;
345  return true;
346  }
347  return false;
348 }
Log< level::Warning, false > LogWarning

Member Data Documentation

std::string DTBlockedROChannelsTest::DTRobBinsMap::dduHName
private

Definition at line 112 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

bool DTBlockedROChannelsTest::DTRobBinsMap::init_
private

Definition at line 103 of file DTBlockedROChannelsTest.h.

Referenced by init().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private

Definition at line 109 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private

Definition at line 108 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

std::map<int, int> DTBlockedROChannelsTest::DTRobBinsMap::robsAndValues
private

Definition at line 105 of file DTBlockedROChannelsTest.h.

int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 102 of file DTBlockedROChannelsTest.h.

std::string DTBlockedROChannelsTest::DTRobBinsMap::rosHName
private

Definition at line 111 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 106 of file DTBlockedROChannelsTest.h.