CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 81 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 291 of file DTBlockedROChannelsTest.cc.

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

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

◆ DTRobBinsMap() [2/2]

DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )

Definition at line 307 of file DTBlockedROChannelsTest.cc.

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

◆ ~DTRobBinsMap()

DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 309 of file DTBlockedROChannelsTest.cc.

309 {}

Member Function Documentation

◆ addRobBin()

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

Definition at line 312 of file DTBlockedROChannelsTest.cc.

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

◆ getChamberPercentage()

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

Definition at line 350 of file DTBlockedROChannelsTest.cc.

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

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

◆ getValueRobBin()

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

Definition at line 314 of file DTBlockedROChannelsTest.cc.

314  {
315  if (init_)
316  return 0;
317  int value = 0;
318  if (meROS) {
319  value += (int)meROS->getBinContent(9, robBin);
320  value += (int)meROS->getBinContent(11, robBin);
321  }
322  return value;
323 }

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

◆ getValueRos()

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

Definition at line 325 of file DTBlockedROChannelsTest.cc.

325  {
326  int value = 0;
327  if (meDDU) {
329  value += (int)meDDU->getBinContent(10, rosBin);
330  }
331  return value;
332 }

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

◆ init()

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

Definition at line 91 of file DTBlockedROChannelsTest.h.

91 { init_ = v; }

References init_, and findQualityFiles::v.

◆ readNewValues()

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

Definition at line 370 of file DTBlockedROChannelsTest.cc.

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

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

◆ robChanged()

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

Definition at line 334 of file DTBlockedROChannelsTest.cc.

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

Member Data Documentation

◆ dduHName

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

Definition at line 113 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ init_

bool DTBlockedROChannelsTest::DTRobBinsMap::init_
private

Definition at line 104 of file DTBlockedROChannelsTest.h.

Referenced by init().

◆ meDDU

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private

Definition at line 110 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ meROS

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private

Definition at line 109 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ robsAndValues

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

Definition at line 106 of file DTBlockedROChannelsTest.h.

◆ rosBin

int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 103 of file DTBlockedROChannelsTest.h.

◆ rosHName

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

Definition at line 112 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

◆ rosValue

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 107 of file DTBlockedROChannelsTest.h.

DTBlockedROChannelsTest::DTRobBinsMap::robsAndValues
std::map< int, int > robsAndValues
Definition: DTBlockedROChannelsTest.h:106
DTBlockedROChannelsTest::DTRobBinsMap::meDDU
const MonitorElement * meDDU
Definition: DTBlockedROChannelsTest.h:110
DTBlockedROChannelsTest::DTRobBinsMap::rosValue
int rosValue
Definition: DTBlockedROChannelsTest.h:107
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:334
DTBlockedROChannelsTest::DTRobBinsMap::getValueRos
int getValueRos() const
Definition: DTBlockedROChannelsTest.cc:325
DTBlockedROChannelsTest::DTRobBinsMap::rosHName
std::string rosHName
Definition: DTBlockedROChannelsTest.h:112
DTBlockedROChannelsTest::DTRobBinsMap::rosBin
int rosBin
Definition: DTBlockedROChannelsTest.h:103
DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin
int getValueRobBin(int robBin) const
Definition: DTBlockedROChannelsTest.cc:314
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
DTBlockedROChannelsTest::DTRobBinsMap::meROS
const MonitorElement * meROS
Definition: DTBlockedROChannelsTest.h:109
DTBlockedROChannelsTest::DTRobBinsMap::dduHName
std::string dduHName
Definition: DTBlockedROChannelsTest.h:113
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:592
DTBlockedROChannelsTest::DTRobBinsMap::init_
bool init_
Definition: DTBlockedROChannelsTest.h:104