CMS 3D CMS Logo

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

◆ DTRobBinsMap() [1/2]

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

Definition at line 292 of file DTBlockedROChannelsTest.cc.

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

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

◆ DTRobBinsMap() [2/2]

DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )

◆ ~DTRobBinsMap()

DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 310 of file DTBlockedROChannelsTest.cc.

310 {}

Member Function Documentation

◆ addRobBin()

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

Definition at line 313 of file DTBlockedROChannelsTest.cc.

◆ getChamberPercentage()

double DTBlockedROChannelsTest::DTRobBinsMap::getChamberPercentage ( DQMStore::IGetter igetter)

Definition at line 351 of file DTBlockedROChannelsTest.cc.

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

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

◆ getValueRobBin()

int DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin ( int  robBin) const
private

Definition at line 315 of file DTBlockedROChannelsTest.cc.

References createfilelist::int, and relativeConstraints::value.

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

◆ getValueRos()

int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 326 of file DTBlockedROChannelsTest.cc.

References createfilelist::int, and relativeConstraints::value.

326  {
327  int value = 0;
328  if (meDDU) {
330  value += (int)meDDU->getBinContent(10, rosBin);
331  }
332  return value;
333 }
Definition: value.py:1
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ init()

void DTBlockedROChannelsTest::DTRobBinsMap::init ( bool  v)
inline

◆ readNewValues()

void DTBlockedROChannelsTest::DTRobBinsMap::readNewValues ( DQMStore::IGetter igetter)

Definition at line 371 of file DTBlockedROChannelsTest.cc.

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

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

◆ robChanged()

bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 335 of file DTBlockedROChannelsTest.cc.

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

Member Data Documentation

◆ dduHName

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

Definition at line 112 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ init_

bool DTBlockedROChannelsTest::DTRobBinsMap::init_
private

Definition at line 103 of file DTBlockedROChannelsTest.h.

Referenced by init().

◆ meDDU

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private

Definition at line 109 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ meROS

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private

Definition at line 108 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ robsAndValues

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

Definition at line 105 of file DTBlockedROChannelsTest.h.

◆ rosBin

int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 102 of file DTBlockedROChannelsTest.h.

◆ rosHName

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

Definition at line 111 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ rosValue

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 106 of file DTBlockedROChannelsTest.h.