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

Constructor & Destructor Documentation

DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( DQMStore::IGetter igetter,
const int  fed,
const int  ros 
)

Definition at line 227 of file DTBlockedROChannelsTest.cc.

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

227  :
228  rosBin(ros),
229  init_(true),
230  rosValue(0)
231 {
232 
233  // get the pointer to the corresondig histo
234  stringstream mename; mename << "DT/00-DataIntegrity/FED" << fed << "/ROS" << ros
235  << "/FED" << fed << "_ROS" << ros << "_ROSError";
236  rosHName = mename.str();
237 
238  stringstream whname; whname << "DT/00-DataIntegrity/FED" << fed
239  << "/FED" << fed << "_ROSStatus";
240  dduHName = whname.str();
241 
242  meROS = igetter.get(rosHName);
243  meDDU = igetter.get(dduHName);
244 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
DTBlockedROChannelsTest::DTRobBinsMap::DTRobBinsMap ( )

Definition at line 246 of file DTBlockedROChannelsTest.cc.

246  : init_(true),
247  meROS(nullptr),
248  meDDU(nullptr){}
DTBlockedROChannelsTest::DTRobBinsMap::~DTRobBinsMap ( )

Definition at line 250 of file DTBlockedROChannelsTest.cc.

250 {}

Member Function Documentation

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

Definition at line 255 of file DTBlockedROChannelsTest.cc.

References getValueRobBin(), and robsAndValues.

255  {
256  robsAndValues[robBin] = getValueRobBin(robBin);
257  }
double DTBlockedROChannelsTest::DTRobBinsMap::getChamberPercentage ( DQMStore::IGetter igetter)

Definition at line 307 of file DTBlockedROChannelsTest.cc.

References dduHName, DQMStore::IGetter::get(), getValueRos(), meDDU, meROS, robChanged(), robsAndValues, rosHName, and rosValue.

Referenced by init().

307  {
308  meROS = igetter.get(rosHName);
309  meDDU = igetter.get(dduHName);
310  int nChangedROBs = 0;
311 
312  // check if ros status has changed
313  int newValue = getValueRos();
314  if(newValue > rosValue) {
315  rosValue= newValue;
316  return 0.;
317  }
318 
319  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
320  robAndValue != robsAndValues.end(); ++robAndValue) {
321  if(robChanged((*robAndValue).first)) nChangedROBs++;
322  }
323  return 1.-((double)nChangedROBs/(double)robsAndValues.size());
324 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRobBin ( int  robBin) const
private

Definition at line 262 of file DTBlockedROChannelsTest.cc.

References MonitorElement::getBinContent(), init_, createfilelist::int, meROS, and relativeConstraints::value.

Referenced by addRobBin(), init(), and robChanged().

262  {
263  if (init_)
264  return 0;
265  int value = 0;
266  if(meROS) {
267  value += (int)meROS->getBinContent(9,robBin);
268  value += (int)meROS->getBinContent(11,robBin);
269  }
270  return value;
271  }
Definition: value.py:1
double getBinContent(int binx) const
get content of bin (1-D)
int DTBlockedROChannelsTest::DTRobBinsMap::getValueRos ( ) const
private

Definition at line 276 of file DTBlockedROChannelsTest.cc.

References MonitorElement::getBinContent(), createfilelist::int, meDDU, rosBin, and relativeConstraints::value.

Referenced by getChamberPercentage(), init(), and readNewValues().

276  {
277  int value = 0;
278  if(meDDU) {
279  value += (int)meDDU->getBinContent(2,rosBin);
280  value += (int)meDDU->getBinContent(10,rosBin);
281  }
282  return value;
283 }
Definition: value.py:1
double getBinContent(int binx) const
get content of bin (1-D)
void DTBlockedROChannelsTest::DTRobBinsMap::init ( bool  v)
inline
void DTBlockedROChannelsTest::DTRobBinsMap::readNewValues ( DQMStore::IGetter igetter)

Definition at line 327 of file DTBlockedROChannelsTest.cc.

References dduHName, DEFINE_FWK_MODULE, DQMStore::IGetter::get(), getValueRos(), meDDU, meROS, robChanged(), robsAndValues, rosHName, and rosValue.

Referenced by init().

327  {
328  meROS = igetter.get(rosHName);
329  meDDU = igetter.get(dduHName);
330 
331  rosValue = getValueRos();
332  for(map<int, int>::const_iterator robAndValue = robsAndValues.begin();
333  robAndValue != robsAndValues.end(); ++robAndValue) {
334  robChanged((*robAndValue).first);
335  }
336 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
bool DTBlockedROChannelsTest::DTRobBinsMap::robChanged ( int  robBin)

Definition at line 288 of file DTBlockedROChannelsTest.cc.

References getValueRobBin(), and robsAndValues.

Referenced by getChamberPercentage(), init(), and readNewValues().

288  {
289  // check that this is a valid ROB for this map (= it has been added!)
290  if(robsAndValues.find(robBin) == robsAndValues.end()) {
291  LogWarning("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
292  << "[DTRobBinsMap]***Error: ROB: " << robBin << " is not valid" << endl;
293  return false;
294  }
295 
296  int newValue = getValueRobBin(robBin);
297  if(newValue > robsAndValues[robBin]) {
298  robsAndValues[robBin] = newValue;
299  return true;
300  }
301  return false;
302 }

Member Data Documentation

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

Definition at line 113 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap(), getChamberPercentage(), and readNewValues().

bool DTBlockedROChannelsTest::DTRobBinsMap::init_
private

Definition at line 104 of file DTBlockedROChannelsTest.h.

Referenced by getValueRobBin(), and init().

const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meDDU
private
const MonitorElement* DTBlockedROChannelsTest::DTRobBinsMap::meROS
private
std::map<int, int> DTBlockedROChannelsTest::DTRobBinsMap::robsAndValues
private
int DTBlockedROChannelsTest::DTRobBinsMap::rosBin
private

Definition at line 103 of file DTBlockedROChannelsTest.h.

Referenced by getValueRos().

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

Definition at line 112 of file DTBlockedROChannelsTest.h.

Referenced by DTRobBinsMap(), getChamberPercentage(), and readNewValues().

int DTBlockedROChannelsTest::DTRobBinsMap::rosValue
private

Definition at line 107 of file DTBlockedROChannelsTest.h.

Referenced by getChamberPercentage(), and readNewValues().