CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DTBlockedROChannelsTest::DTRobBinsMap Class Reference

List of all members.

Public Member Functions

void addRobBin (int robBin)
 DTRobBinsMap (const int fed, const int ros, const DQMStore *dbe)
 DTRobBinsMap ()
double getChamberPercentage ()
void readNewValues ()
bool robChanged (int robBin)
 ~DTRobBinsMap ()

Private Member Functions

int getValueRobBin (int robBin) const
int getValueRos () const

Private Attributes

std::string dduHName
const MonitorElementmeDDU
const MonitorElementmeROS
std::map< int, int > robsAndValues
int rosBin
std::string rosHName
int rosValue
const DQMStoretheDbe

Detailed Description

Definition at line 95 of file DTBlockedROChannelsTest.h.


Constructor & Destructor Documentation

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

Definition at line 297 of file DTBlockedROChannelsTest.cc.

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

                                                                                                   : rosBin(ros),
                                                                                                         rosValue(0) {
  // get the pointer to the corresondig histo
  stringstream mename; mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros
                              << "/FED" << fed << "_ROS" << ros << "_ROSError";
  rosHName = mename.str();

  stringstream whname; whname << "DT/00-DataIntegrity/FED" << fed
                              << "/FED" << fed << "_ROSStatus";
  dduHName = whname.str();

  meROS = dbe->get(rosHName);
  meDDU = dbe->get(dduHName);

  theDbe = dbe;
}
DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )

Definition at line 317 of file DTBlockedROChannelsTest.cc.

                                                  : meROS(0),
                                                        meDDU(0) {}
DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 322 of file DTBlockedROChannelsTest.cc.

{}

Member Function Documentation

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

Definition at line 327 of file DTBlockedROChannelsTest.cc.

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

Definition at line 377 of file DTBlockedROChannelsTest.cc.

                                                                 {
  meROS = theDbe->get(rosHName);
  meDDU = theDbe->get(dduHName);
  int nChangedROBs = 0;

  // check if ros status has changed
  int newValue = getValueRos();
  if(newValue > rosValue) {
    rosValue= newValue;
    return 0.;
  }

  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
      robAndValue != robsAndValues.end(); ++robAndValue) {
    if(robChanged((*robAndValue).first)) nChangedROBs++;
  }
  return 1.-((double)nChangedROBs/(double)robsAndValues.size());
}
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin ( int  robBin) const [private]

Definition at line 334 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

                                                                        {
  int value = 0;
  if(meROS) {
    value += (int)meROS->getBinContent(9,robBin);
    value += (int)meROS->getBinContent(11,robBin);
  }
  return value;
}
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const [private]

Definition at line 346 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

                                                           {
  int value = 0;
  if(meDDU) {
    value += (int)meDDU->getBinContent(2,rosBin);
    value += (int)meDDU->getBinContent(10,rosBin);
  }
  return value;
}
void DTBlockedROChannelsTest::DTRobBinsMap::readNewValues ( )

Definition at line 397 of file DTBlockedROChannelsTest.cc.

                                                        {
  meROS = theDbe->get(rosHName);
  meDDU = theDbe->get(dduHName);

  rosValue = getValueRos();
  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
      robAndValue != robsAndValues.end(); ++robAndValue) {
    robChanged((*robAndValue).first);
  }
}
bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 358 of file DTBlockedROChannelsTest.cc.

                                                               {
  // check that this is a valid ROB for this map (= it has been added!)
  if(robsAndValues.find(robBin) == robsAndValues.end()) {
     LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
       << "[DTRobBinsMap]***Error: ROB: " << robBin << " is not valid" << endl;
    return false;
  }

  int newValue = getValueRobBin(robBin);
  if(newValue > robsAndValues[robBin]) {
    robsAndValues[robBin] = newValue;
    return true;
  }
  return false;
}

Member Data Documentation

Definition at line 126 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

Definition at line 123 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

Definition at line 122 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

Definition at line 119 of file DTBlockedROChannelsTest.h.

Definition at line 117 of file DTBlockedROChannelsTest.h.

Definition at line 125 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

Definition at line 120 of file DTBlockedROChannelsTest.h.

Definition at line 128 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().