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 383 of file DTBlockedROChannelsTest.cc.

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

384  : init_(true) {
385  int wheel = (ddu - 770) % 5 - 2;
386 
387  // get the pointer to the corresondig histo
388  urosHName = "DT/00-DataIntegrity/Wheel" + to_string(wheel) + "/Sector" + to_string(ros) + "/W" + to_string(wheel) +
389  "_Sector" + to_string(ros) + "_ROSError";
390  meuROS = igetter.get(urosHName);
391 }
static std::string to_string(const XMLCh *ch)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712

◆ DTLinkBinsMap() [2/2]

DTBlockedROChannelsTest::DTLinkBinsMap::DTLinkBinsMap ( )

◆ ~DTLinkBinsMap()

DTBlockedROChannelsTest::DTLinkBinsMap::~DTLinkBinsMap ( )

Definition at line 395 of file DTBlockedROChannelsTest.cc.

395 {}

Member Function Documentation

◆ addLinkBin()

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

Definition at line 397 of file DTBlockedROChannelsTest.cc.

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

◆ getChamberPercentage()

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

Definition at line 427 of file DTBlockedROChannelsTest.cc.

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

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

◆ getValueLinkBin()

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

Definition at line 401 of file DTBlockedROChannelsTest.cc.

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

401  {
402  if (!init_)
403  return 0;
404  int value = 0;
405  if (meuROS) {
406  value += (int)meuROS->getBinContent(5, linkBin); //ONLY NotOKFlag
407  }
408  return value;
409 }
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 411 of file DTBlockedROChannelsTest.cc.

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

◆ readNewValues()

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

Definition at line 439 of file DTBlockedROChannelsTest.cc.

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

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

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().