CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 (const int fed, const int ros, const DQMStore *dbe)
 
 DTRobBinsMap ()
 
double getChamberPercentage ()
 
void init (bool v)
 
void readNewValues ()
 
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
 
const DQMStoretheDbe
 

Detailed Description

Definition at line 93 of file DTBlockedROChannelsTest.h.

Constructor & Destructor Documentation

DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( const int  fed,
const int  ros,
const DQMStore dbe 
)

Definition at line 301 of file DTBlockedROChannelsTest.cc.

References DTBlockedROChannelsTest::dbe, dduHName, DQMStore::get(), meDDU, meROS, rosHName, and theDbe.

301  : rosBin(ros),
302  init_(true),
303  rosValue(0)
304 {
305 
306  // get the pointer to the corresondig histo
307  stringstream mename; mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros
308  << "/FED" << fed << "_ROS" << ros << "_ROSError";
309  rosHName = mename.str();
310 
311  stringstream whname; whname << "DT/00-DataIntegrity/FED" << fed
312  << "/FED" << fed << "_ROSStatus";
313  dduHName = whname.str();
314 
315  meROS = dbe->get(rosHName);
316  meDDU = dbe->get(dduHName);
317 
318  theDbe = dbe;
319 }
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )
DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 325 of file DTBlockedROChannelsTest.cc.

325 {}

Member Function Documentation

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

Definition at line 330 of file DTBlockedROChannelsTest.cc.

330  {
331  robsAndValues[robBin] = getValueRobBin(robBin);
332  }
double DTBlockedROChannelsTest::DTRobBinsMap::getChamberPercentage ( )

Definition at line 382 of file DTBlockedROChannelsTest.cc.

382  {
383  meROS = theDbe->get(rosHName);
384  meDDU = theDbe->get(dduHName);
385  int nChangedROBs = 0;
386 
387  // check if ros status has changed
388  int newValue = getValueRos();
389  if(newValue > rosValue) {
390  rosValue= newValue;
391  return 0.;
392  }
393 
394  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
395  robAndValue != robsAndValues.end(); ++robAndValue) {
396  if(robChanged((*robAndValue).first)) nChangedROBs++;
397  }
398  return 1.-((double)nChangedROBs/(double)robsAndValues.size());
399 }
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin ( int  robBin) const
private

Definition at line 337 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

337  {
338  if (init_)
339  return 0;
340  int value = 0;
341  if(meROS) {
342  value += (int)meROS->getBinContent(9,robBin);
343  value += (int)meROS->getBinContent(11,robBin);
344  }
345  return value;
346  }
double getBinContent(int binx) const
get content of bin (1-D)
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 351 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

351  {
352  int value = 0;
353  if(meDDU) {
354  value += (int)meDDU->getBinContent(2,rosBin);
355  value += (int)meDDU->getBinContent(10,rosBin);
356  }
357  return value;
358 }
double getBinContent(int binx) const
get content of bin (1-D)
void DTBlockedROChannelsTest::DTRobBinsMap::init ( bool  v)
inline
void DTBlockedROChannelsTest::DTRobBinsMap::readNewValues ( )

Definition at line 402 of file DTBlockedROChannelsTest.cc.

402  {
403  meROS = theDbe->get(rosHName);
404  meDDU = theDbe->get(dduHName);
405 
406  rosValue = getValueRos();
407  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
408  robAndValue != robsAndValues.end(); ++robAndValue) {
409  robChanged((*robAndValue).first);
410  }
411 }
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 363 of file DTBlockedROChannelsTest.cc.

363  {
364  // check that this is a valid ROB for this map (= it has been added!)
365  if(robsAndValues.find(robBin) == robsAndValues.end()) {
366  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
367  << "[DTRobBinsMap]***Error: ROB: " << robBin << " is not valid" << endl;
368  return false;
369  }
370 
371  int newValue = getValueRobBin(robBin);
372  if(newValue > robsAndValues[robBin]) {
373  robsAndValues[robBin] = newValue;
374  return true;
375  }
376  return false;
377 }

Member Data Documentation

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

Definition at line 126 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

bool DTBlockedROChannelsTest::DTRobBinsMap::init_
private

Definition at line 117 of file DTBlockedROChannelsTest.h.

Referenced by init().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private

Definition at line 123 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private

Definition at line 122 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

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

Definition at line 119 of file DTBlockedROChannelsTest.h.

int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 116 of file DTBlockedROChannelsTest.h.

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

Definition at line 125 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 120 of file DTBlockedROChannelsTest.h.

const DQMStore* DTBlockedROChannelsTest::DTRobBinsMap::theDbe
private

Definition at line 128 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().