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

379  : init_(true) {
380  int wheel = (ddu - 770) % 5 - 2;
381 
382  // get the pointer to the corresondig histo
383  urosHName = "DT/00-DataIntegrity/Wheel" + to_string(wheel) + "/ROS" + to_string(ros) + "/W" + to_string(wheel) +
384  "_ROS" + to_string(ros) + "_ROSError";
385  meuROS = igetter.get(urosHName);
386 }

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

◆ DTLinkBinsMap() [2/2]

DTBlockedROChannelsTest::DTLinkBinsMap::DTLinkBinsMap ( )

Definition at line 388 of file DTBlockedROChannelsTest.cc.

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

◆ ~DTLinkBinsMap()

DTBlockedROChannelsTest::DTLinkBinsMap::~DTLinkBinsMap ( )

Definition at line 390 of file DTBlockedROChannelsTest.cc.

390 {}

Member Function Documentation

◆ addLinkBin()

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

Definition at line 392 of file DTBlockedROChannelsTest.cc.

392  {
393  linksAndValues[linkBin] = getValueLinkBin(linkBin);
394 }

◆ getChamberPercentage()

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

Definition at line 422 of file DTBlockedROChannelsTest.cc.

422  {
423  meuROS = igetter.get(urosHName);
424  int nChangedLinks = 0;
425 
426  for (map<int, int>::const_iterator linkAndValue = linksAndValues.begin(); linkAndValue != linksAndValues.end();
427  ++linkAndValue) {
428  if (linkChanged((*linkAndValue).first))
429  nChangedLinks++;
430  }
431  return 1. - ((double)nChangedLinks / (double)linksAndValues.size());
432 }

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

◆ getValueLinkBin()

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

Definition at line 396 of file DTBlockedROChannelsTest.cc.

396  {
397  if (!init_)
398  return 0;
399  int value = 0;
400  if (meuROS) {
401  value += (int)meuROS->getBinContent(5, linkBin); //ONLY NotOKFlag
402  }
403  return value;
404 }

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

◆ init()

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

Definition at line 127 of file DTBlockedROChannelsTest.h.

127 { init_ = v; }

References init_, and findQualityFiles::v.

◆ linkChanged()

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

Definition at line 406 of file DTBlockedROChannelsTest.cc.

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

◆ readNewValues()

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

Definition at line 434 of file DTBlockedROChannelsTest.cc.

434  {
435  meuROS = igetter.get(urosHName);
436 
437  for (map<int, int>::const_iterator linkAndValue = linksAndValues.begin(); linkAndValue != linksAndValues.end();
438  ++linkAndValue) {
439  linkChanged((*linkAndValue).first);
440  }
441 }

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

Member Data Documentation

◆ init_

bool DTBlockedROChannelsTest::DTLinkBinsMap::init_
private

Definition at line 138 of file DTBlockedROChannelsTest.h.

Referenced by init().

◆ linksAndValues

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

Definition at line 140 of file DTBlockedROChannelsTest.h.

◆ meuROS

const MonitorElement* DTBlockedROChannelsTest::DTLinkBinsMap::meuROS
private

Definition at line 142 of file DTBlockedROChannelsTest.h.

Referenced by DTLinkBinsMap().

◆ urosHName

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

Definition at line 144 of file DTBlockedROChannelsTest.h.

Referenced by DTLinkBinsMap().

DTBlockedROChannelsTest::DTLinkBinsMap::linksAndValues
std::map< int, int > linksAndValues
Definition: DTBlockedROChannelsTest.h:140
DTBlockedROChannelsTest::DTLinkBinsMap::linkChanged
bool linkChanged(int linkBin)
Definition: DTBlockedROChannelsTest.cc:406
DTBlockedROChannelsTest::DTLinkBinsMap::meuROS
const MonitorElement * meuROS
Definition: DTBlockedROChannelsTest.h:142
findQualityFiles.v
v
Definition: findQualityFiles.py:179
DTBlockedROChannelsTest::DTLinkBinsMap::init_
bool init_
Definition: DTBlockedROChannelsTest.h:138
edm::LogWarning
Definition: MessageLogger.h:141
DTBlockedROChannelsTest::DTLinkBinsMap::getValueLinkBin
int getValueLinkBin(int linkBin) const
Definition: DTBlockedROChannelsTest.cc:396
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:144
relativeConstraints.value
value
Definition: relativeConstraints.py:53
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592