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 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 95 of file DTBlockedROChannelsTest.h.


Constructor & Destructor Documentation

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

Definition at line 303 of file DTBlockedROChannelsTest.cc.

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

                                                                                                   : rosBin(ros),
  init_(true),
  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 323 of file DTBlockedROChannelsTest.cc.

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

Definition at line 327 of file DTBlockedROChannelsTest.cc.

{}

Member Function Documentation

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

Definition at line 332 of file DTBlockedROChannelsTest.cc.

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

Definition at line 384 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 339 of file DTBlockedROChannelsTest.cc.

References relativeConstraints::value.

                                                                          {
    if (init_)
      return 0;
    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 353 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::init ( bool  v) [inline]

Definition at line 106 of file DTBlockedROChannelsTest.h.

References init_, and findQualityFiles::v.

{init_ = v;}
void DTBlockedROChannelsTest::DTRobBinsMap::readNewValues ( )

Definition at line 404 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 365 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 128 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

Definition at line 119 of file DTBlockedROChannelsTest.h.

Referenced by init().

Definition at line 125 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

Definition at line 124 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

Definition at line 121 of file DTBlockedROChannelsTest.h.

Definition at line 118 of file DTBlockedROChannelsTest.h.

Definition at line 127 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().

Definition at line 122 of file DTBlockedROChannelsTest.h.

Definition at line 130 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap().