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 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:697

◆ DTRobBinsMap() [2/2]

DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )

◆ ~DTRobBinsMap()

DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 309 of file DTBlockedROChannelsTest.cc.

309 {}

Member Function Documentation

◆ addRobBin()

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

Definition at line 312 of file DTBlockedROChannelsTest.cc.

◆ getChamberPercentage()

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:697

◆ getValueRobBin()

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

Definition at line 314 of file DTBlockedROChannelsTest.cc.

References createfilelist::int, and 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 }
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 325 of file DTBlockedROChannelsTest.cc.

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

325  {
326  int value = 0;
327  if (meDDU) {
329  value += (int)meDDU->getBinContent(10, rosBin);
330  }
331  return value;
332 }
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 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:697

◆ robChanged()

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

◆ 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.