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 ()
 
 DTRobBinsMap (DQMStore::IGetter &igetter, const int fed, const int ros)
 
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 79 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 287 of file DTBlockedROChannelsTest.cc.

288  : rosBin(ros), init_(true), rosValue(0) {
289  // get the pointer to the corresondig histo
290  // Legacy
291  stringstream mename;
292  mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros << "/FED" << fed << "_ROS" << ros << "_ROSError";
293  rosHName = mename.str();
294 
295  stringstream whname;
296  whname << "DT/00-DataIntegrity/FED" << fed << "/FED" << fed << "_ROSStatus";
297  dduHName = whname.str();
298 
299  meROS = igetter.get(rosHName);
300  meDDU = igetter.get(dduHName);
301 }

References dduHName, dqm::implementation::IGetter::get(), meDDU, meROS, and rosHName.

◆ DTRobBinsMap() [2/2]

DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )

Definition at line 303 of file DTBlockedROChannelsTest.cc.

303 : init_(true), meROS(nullptr), meDDU(nullptr) {}

◆ ~DTRobBinsMap()

DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 305 of file DTBlockedROChannelsTest.cc.

305 {}

Member Function Documentation

◆ addRobBin()

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

Definition at line 308 of file DTBlockedROChannelsTest.cc.

308 { robsAndValues[robBin] = getValueRobBin(robBin); }

◆ getChamberPercentage()

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

Definition at line 346 of file DTBlockedROChannelsTest.cc.

346  {
347  meROS = igetter.get(rosHName);
348  meDDU = igetter.get(dduHName);
349  int nChangedROBs = 0;
350 
351  // check if ros status has changed
352  int newValue = getValueRos();
353  if (newValue > rosValue) {
354  rosValue = newValue;
355  return 0.;
356  }
357 
358  for (map<int, int>::const_iterator robAndValue = robsAndValues.begin(); robAndValue != robsAndValues.end();
359  ++robAndValue) {
360  if (robChanged((*robAndValue).first))
361  nChangedROBs++;
362  }
363  return 1. - ((double)nChangedROBs / (double)robsAndValues.size());
364 }

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

◆ getValueRobBin()

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

Definition at line 310 of file DTBlockedROChannelsTest.cc.

310  {
311  if (init_)
312  return 0;
313  int value = 0;
314  if (meROS) {
315  value += (int)meROS->getBinContent(9, robBin);
316  value += (int)meROS->getBinContent(11, robBin);
317  }
318  return value;
319 }

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

◆ getValueRos()

int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 321 of file DTBlockedROChannelsTest.cc.

321  {
322  int value = 0;
323  if (meDDU) {
325  value += (int)meDDU->getBinContent(10, rosBin);
326  }
327  return value;
328 }

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

◆ init()

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

Definition at line 89 of file DTBlockedROChannelsTest.h.

89 { init_ = v; }

References init_, and findQualityFiles::v.

◆ readNewValues()

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

Definition at line 366 of file DTBlockedROChannelsTest.cc.

366  {
367  meROS = igetter.get(rosHName);
368  meDDU = igetter.get(dduHName);
369 
370  rosValue = getValueRos();
371  for (map<int, int>::const_iterator robAndValue = robsAndValues.begin(); robAndValue != robsAndValues.end();
372  ++robAndValue) {
373  robChanged((*robAndValue).first);
374  }
375 }

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

◆ robChanged()

bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 330 of file DTBlockedROChannelsTest.cc.

330  {
331  // check that this is a valid ROB for this map (= it has been added!)
332  if (robsAndValues.find(robBin) == robsAndValues.end()) {
333  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
334  << "[DTRobBinsMap]***Error: ROB: " << robBin << " is not valid" << endl;
335  return false;
336  }
337 
338  int newValue = getValueRobBin(robBin);
339  if (newValue > robsAndValues[robBin]) {
340  robsAndValues[robBin] = newValue;
341  return true;
342  }
343  return false;
344 }

Member Data Documentation

◆ dduHName

std::string DTBlockedROChannelsTest::DTRobBinsMap::dduHName
private

Definition at line 111 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ init_

bool DTBlockedROChannelsTest::DTRobBinsMap::init_
private

Definition at line 102 of file DTBlockedROChannelsTest.h.

Referenced by init().

◆ meDDU

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private

Definition at line 108 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ meROS

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private

Definition at line 107 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ robsAndValues

std::map<int, int> DTBlockedROChannelsTest::DTRobBinsMap::robsAndValues
private

Definition at line 104 of file DTBlockedROChannelsTest.h.

◆ rosBin

int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 101 of file DTBlockedROChannelsTest.h.

◆ rosHName

std::string DTBlockedROChannelsTest::DTRobBinsMap::rosHName
private

Definition at line 110 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ rosValue

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 105 of file DTBlockedROChannelsTest.h.

DTBlockedROChannelsTest::DTRobBinsMap::robsAndValues
std::map< int, int > robsAndValues
Definition: DTBlockedROChannelsTest.h:104
DTBlockedROChannelsTest::DTRobBinsMap::meDDU
const MonitorElement * meDDU
Definition: DTBlockedROChannelsTest.h:108
DTBlockedROChannelsTest::DTRobBinsMap::rosValue
int rosValue
Definition: DTBlockedROChannelsTest.h:105
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
DTBlockedROChannelsTest::DTRobBinsMap::robChanged
bool robChanged(int robBin)
Definition: DTBlockedROChannelsTest.cc:330
DTBlockedROChannelsTest::DTRobBinsMap::getValueRos
int getValueRos() const
Definition: DTBlockedROChannelsTest.cc:321
DTBlockedROChannelsTest::DTRobBinsMap::rosHName
std::string rosHName
Definition: DTBlockedROChannelsTest.h:110
DTBlockedROChannelsTest::DTRobBinsMap::rosBin
int rosBin
Definition: DTBlockedROChannelsTest.h:101
DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin
int getValueRobBin(int robBin) const
Definition: DTBlockedROChannelsTest.cc:310
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
DTBlockedROChannelsTest::DTRobBinsMap::meROS
const MonitorElement * meROS
Definition: DTBlockedROChannelsTest.h:107
DTBlockedROChannelsTest::DTRobBinsMap::dduHName
std::string dduHName
Definition: DTBlockedROChannelsTest.h:111
relativeConstraints.value
value
Definition: relativeConstraints.py:53
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
DTBlockedROChannelsTest::DTRobBinsMap::init_
bool init_
Definition: DTBlockedROChannelsTest.h:102