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 ()
 
 DTLinkBinsMap (DQMStore::IGetter &igetter, const int fed, const int mapSlot)
 
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 119 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.

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 }

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

◆ DTLinkBinsMap() [2/2]

DTBlockedROChannelsTest::DTLinkBinsMap::DTLinkBinsMap ( )

Definition at line 392 of file DTBlockedROChannelsTest.cc.

392 : init_(false), meuROS(nullptr) {}

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

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 }

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

◆ getValueLinkBin()

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

Definition at line 400 of file DTBlockedROChannelsTest.cc.

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 }

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

◆ init()

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

Definition at line 129 of file DTBlockedROChannelsTest.h.

129 { init_ = v; }

References init_, and findQualityFiles::v.

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

◆ readNewValues()

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

Definition at line 438 of file DTBlockedROChannelsTest.cc.

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 }

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

Member Data Documentation

◆ init_

bool DTBlockedROChannelsTest::DTLinkBinsMap::init_
private

Definition at line 140 of file DTBlockedROChannelsTest.h.

Referenced by init().

◆ linksAndValues

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

Definition at line 142 of file DTBlockedROChannelsTest.h.

◆ meuROS

const MonitorElement* DTBlockedROChannelsTest::DTLinkBinsMap::meuROS
private

Definition at line 144 of file DTBlockedROChannelsTest.h.

Referenced by DTLinkBinsMap().

◆ urosHName

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

Definition at line 146 of file DTBlockedROChannelsTest.h.

Referenced by DTLinkBinsMap().

DTBlockedROChannelsTest::DTLinkBinsMap::linksAndValues
std::map< int, int > linksAndValues
Definition: DTBlockedROChannelsTest.h:142
DTBlockedROChannelsTest::DTLinkBinsMap::linkChanged
bool linkChanged(int linkBin)
Definition: DTBlockedROChannelsTest.cc:410
DTBlockedROChannelsTest::DTLinkBinsMap::meuROS
const MonitorElement * meuROS
Definition: DTBlockedROChannelsTest.h:144
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
DTBlockedROChannelsTest::DTLinkBinsMap::init_
bool init_
Definition: DTBlockedROChannelsTest.h:140
DTBlockedROChannelsTest::DTLinkBinsMap::getValueLinkBin
int getValueLinkBin(int linkBin) const
Definition: DTBlockedROChannelsTest.cc:400
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
DTBlockedROChannelsTest::DTLinkBinsMap::urosHName
std::string urosHName
Definition: DTBlockedROChannelsTest.h:146
relativeConstraints.value
value
Definition: relativeConstraints.py:53
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:583