CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTBlockedROChannelsTest::DTLinkBinsMap Class Reference

Public Member Functions

void addLinkBin (int linkBin)
 
 DTLinkBinsMap (DQMStore::IGetter &igetter, const int fed, const int mapSlot)
 
 DTLinkBinsMap ()
 
double getChamberPercentage (DQMStore::IGetter &)
 
void init (bool v)
 
bool linkChanged (int linkBin)
 
void readNewValues (DQMStore::IGetter &igetter)
 
 ~DTLinkBinsMap ()
 

Private Member Functions

int getValueLinkBin (int linkBin) const
 

Private Attributes

bool init_
 
std::map< int, int > linksAndValues
 
const MonitorElementmeuROS
 
std::string urosHName
 

Detailed Description

Definition at line 118 of file DTBlockedROChannelsTest.h.

Constructor & Destructor Documentation

◆ DTLinkBinsMap() [1/2]

DTBlockedROChannelsTest::DTLinkBinsMap::DTLinkBinsMap ( DQMStore::IGetter igetter,
const int  fed,
const int  mapSlot 
)

Definition at line 382 of file DTBlockedROChannelsTest.cc.

References dqm::implementation::IGetter::get(), meuROS, cond::impl::to_string(), urosHName, and makeMuonMisalignmentScenario::wheel.

383  : init_(true) {
384  int wheel = (ddu - 770) % 5 - 2;
385 
386  // get the pointer to the corresondig histo
387  urosHName = "DT/00-DataIntegrity/Wheel" + to_string(wheel) + "/ROS" + to_string(ros) + "/W" + to_string(wheel) +
388  "_ROS" + to_string(ros) + "_ROSError";
389  meuROS = igetter.get(urosHName);
390 }
std::string to_string(const V &value)
Definition: OMSAccess.h:71
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673

◆ DTLinkBinsMap() [2/2]

DTBlockedROChannelsTest::DTLinkBinsMap::DTLinkBinsMap ( )

◆ ~DTLinkBinsMap()

DTBlockedROChannelsTest::DTLinkBinsMap::~DTLinkBinsMap ( )

Definition at line 394 of file DTBlockedROChannelsTest.cc.

394 {}

Member Function Documentation

◆ addLinkBin()

void DTBlockedROChannelsTest::DTLinkBinsMap::addLinkBin ( int  linkBin)

Definition at line 396 of file DTBlockedROChannelsTest.cc.

396  {
397  linksAndValues[linkBin] = getValueLinkBin(linkBin);
398 }

◆ getChamberPercentage()

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

Definition at line 426 of file DTBlockedROChannelsTest.cc.

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

426  {
427  meuROS = igetter.get(urosHName);
428  int nChangedLinks = 0;
429 
430  for (map<int, int>::const_iterator linkAndValue = linksAndValues.begin(); linkAndValue != linksAndValues.end();
431  ++linkAndValue) {
432  if (linkChanged((*linkAndValue).first))
433  nChangedLinks++;
434  }
435  return 1. - ((double)nChangedLinks / (double)linksAndValues.size());
436 }
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673

◆ getValueLinkBin()

int DTBlockedROChannelsTest::DTLinkBinsMap::getValueLinkBin ( int  linkBin) const
private

Definition at line 400 of file DTBlockedROChannelsTest.cc.

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

400  {
401  if (!init_)
402  return 0;
403  int value = 0;
404  if (meuROS) {
405  value += (int)meuROS->getBinContent(5, linkBin); //ONLY NotOKFlag
406  }
407  return value;
408 }
Definition: value.py:1
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ init()

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

◆ linkChanged()

bool DTBlockedROChannelsTest::DTLinkBinsMap::linkChanged ( int  linkBin)

Definition at line 410 of file DTBlockedROChannelsTest.cc.

410  {
411  // check that this is a valid Link for this map (= it has been added!)
412  if (linksAndValues.find(linkBin) == linksAndValues.end()) {
413  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
414  << "[DTLinkBinsMap]***Error: Link: " << linkBin << " is not valid" << endl;
415  return false;
416  }
417 
418  int newValue = getValueLinkBin(linkBin);
419  if (newValue > linksAndValues[linkBin]) {
420  linksAndValues[linkBin] = newValue;
421  return true;
422  }
423  return false;
424 }
Log< level::Warning, false > LogWarning

◆ readNewValues()

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

Definition at line 438 of file DTBlockedROChannelsTest.cc.

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

438  {
439  meuROS = igetter.get(urosHName);
440 
441  for (map<int, int>::const_iterator linkAndValue = linksAndValues.begin(); linkAndValue != linksAndValues.end();
442  ++linkAndValue) {
443  linkChanged((*linkAndValue).first);
444  }
445 }
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673

Member Data Documentation

◆ init_

bool DTBlockedROChannelsTest::DTLinkBinsMap::init_
private

Definition at line 139 of file DTBlockedROChannelsTest.h.

Referenced by init().

◆ linksAndValues

std::map<int, int> DTBlockedROChannelsTest::DTLinkBinsMap::linksAndValues
private

Definition at line 141 of file DTBlockedROChannelsTest.h.

◆ meuROS

const MonitorElement* DTBlockedROChannelsTest::DTLinkBinsMap::meuROS
private

Definition at line 143 of file DTBlockedROChannelsTest.h.

Referenced by DTLinkBinsMap().

◆ urosHName

std::string DTBlockedROChannelsTest::DTLinkBinsMap::urosHName
private

Definition at line 145 of file DTBlockedROChannelsTest.h.

Referenced by DTLinkBinsMap().