CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
TrigResRateMon::DatasetInfo Class Reference

Public Member Functions

void clearCountsPerPath ()
 
 DatasetInfo ()
 
void fillRawCountsForPath (MonitorElement *myRawCountsPlot, std::string pathName)
 
void fillXsecPlot (MonitorElement *myXsecPlot, double currentInstLumi, double secondsPerLS, double referenceXSec)
 
void fillXsecPlot (MonitorElement *myXsecPlot, double currentInstLumi, double secondsPerLS)
 
void incrementCountsForPath (std::string targetPath)
 
void incrementCountsForPath (std::string targetPath, unsigned preScale)
 
void printCountsPerPath () const
 
void printMaskedPaths ()
 
void setMaskedPaths (const std::vector< std::string > &inputPaths)
 
void setPaths (const std::vector< std::string > &inputPaths)
 

Public Attributes

std::map< std::string,
unsigned int > 
countsPerPath
 
std::string countsPerPathME_Name
 
std::string datasetName
 
std::set< std::string > maskedPaths
 
std::vector< std::string > pathNames
 
std::string ratePerLSME_Name
 
std::string rawCountsPerPathME_Name
 
std::string scaledXsecPerPathME_Name
 
std::set< std::string > testPaths
 
std::string xsecPerPathME_Name
 

Detailed Description

Definition at line 338 of file TrigResRateMon.h.

Constructor & Destructor Documentation

TrigResRateMon::DatasetInfo::DatasetInfo ( )
inline

Definition at line 367 of file TrigResRateMon.h.

367 {};

Member Function Documentation

void TrigResRateMon::DatasetInfo::clearCountsPerPath ( )
inline

Definition at line 383 of file TrigResRateMon.h.

References countsPerPath.

383  {
384  std::map<std::string, unsigned int>::iterator iCounts;
385  for (iCounts = countsPerPath.begin();
386  iCounts != countsPerPath.end();
387  iCounts++){
388  iCounts->second = 0;
389  }
390 
391  }// end clearCountsPerPath
std::map< std::string, unsigned int > countsPerPath
void TrigResRateMon::DatasetInfo::fillRawCountsForPath ( MonitorElement myRawCountsPlot,
std::string  pathName 
)
inline

Definition at line 462 of file TrigResRateMon.h.

References plotTTrigFromHistos::binNumber(), and MonitorElement::getTH1F().

462  {
463  TH1F* tempRawCounts = myRawCountsPlot->getTH1F();
464  int binNumber = tempRawCounts->GetXaxis()->FindBin(pathName.c_str());
465  if (binNumber > 0) {
466  tempRawCounts->Fill(binNumber);
467  } else {
468  //std::cout << "Problem finding bin " << pathName << " in plot " << tempRawCounts->GetTitle() << std::endl;
469  }
470  }// end fill RawCountsForPath
TH1F * getTH1F(void) const
void TrigResRateMon::DatasetInfo::fillXsecPlot ( MonitorElement myXsecPlot,
double  currentInstLumi,
double  secondsPerLS,
double  referenceXSec 
)
inline

Definition at line 417 of file TrigResRateMon.h.

417  {
418  // this will put the reference cross section in the denominator
419  fillXsecPlot( myXsecPlot, currentInstLumi*referenceXSec, secondsPerLS);
420  }
void fillXsecPlot(MonitorElement *myXsecPlot, double currentInstLumi, double secondsPerLS, double referenceXSec)
void TrigResRateMon::DatasetInfo::fillXsecPlot ( MonitorElement myXsecPlot,
double  currentInstLumi,
double  secondsPerLS 
)
inline

Definition at line 422 of file TrigResRateMon.h.

References countsPerPath, alignCSCRings::e, MonitorElement::Fill(), maskedPaths, pathNames, and AlCaHLTBitMon_QueryRunRegistry::string.

422  {
423 
424 
425  for (unsigned iPath = 0;
426  iPath < pathNames.size();
427  iPath++) {
428  std::string thisPathName = pathNames[iPath];
429  unsigned thisPathCounts = countsPerPath[thisPathName];
430 
431  // if this is a masked path, then skip it
432  if (maskedPaths.find(thisPathName) != maskedPaths.end()) {
433  //std::cout << "Path " << thisPathName << " is masked, not filling it " << std::endl;
434  continue;
435  }
437  TString thisName = thisPathName.c_str();
438  if ( thisName.Contains("L1") || thisName.Contains("L2") ){
439  continue;
440  }
441 
442  double xsec = 1.0;
443  // what should we fill when averageLumi == 0 ???
444  if (currentInstLumi > 0) {
445  xsec = thisPathCounts / (currentInstLumi*secondsPerLS);
446  } else if ( secondsPerLS > 0) {
447  xsec = (9e-10) ;
448  // xsec = thisPathCounts / secondsPerLS;
449  } else {
450  xsec = (9e-20) ;
451  // xsec = thisPathCounts;
452  }
453 
454  myXsecPlot->Fill(iPath, xsec);
455  //Robin ???
456  // if (currentInstLumi > 0) myXsecPlot->Fill(iPath, xsec);
457  //std::cout << datasetName << " " << thisPathName << " filled with xsec " << xsec << std::endl;
458 
459  }
460  } // end fill Xsec plot
std::vector< std::string > pathNames
void Fill(long long x)
std::map< std::string, unsigned int > countsPerPath
std::set< std::string > maskedPaths
void TrigResRateMon::DatasetInfo::incrementCountsForPath ( std::string  targetPath)
inline

Definition at line 395 of file TrigResRateMon.h.

References countsPerPath.

395  {
396  countsPerPath[targetPath]++;
397  }
std::map< std::string, unsigned int > countsPerPath
void TrigResRateMon::DatasetInfo::incrementCountsForPath ( std::string  targetPath,
unsigned  preScale 
)
inline

Definition at line 399 of file TrigResRateMon.h.

References countsPerPath.

399  {
400  countsPerPath[targetPath] += preScale;
401  }
std::map< std::string, unsigned int > countsPerPath
void TrigResRateMon::DatasetInfo::printCountsPerPath ( ) const
inline

Definition at line 403 of file TrigResRateMon.h.

References countsPerPath, gather_cfg::cout, and datasetName.

403  {
404  std::map<std::string, unsigned int>::const_iterator iCounts;
405  for (iCounts = countsPerPath.begin();
406  iCounts != countsPerPath.end();
407  iCounts++){
409  << " " << iCounts->first
410  << " " << iCounts->second
411  << std::endl;
412  }
413 
414  }// end clearCountsPerPath
std::map< std::string, unsigned int > countsPerPath
tuple cout
Definition: gather_cfg.py:121
void TrigResRateMon::DatasetInfo::printMaskedPaths ( )
inline

Definition at line 489 of file TrigResRateMon.h.

References gather_cfg::cout, datasetName, and maskedPaths.

Referenced by TrigResRateMon::beginRun().

489  {
490  std::cout << "======== Printing masked paths for " << datasetName <<" ======== " << std::endl;
491  for ( std::set<std::string>::const_iterator iMask = maskedPaths.begin();
492  iMask != maskedPaths.end();
493  iMask++) {
494  std::cout << (*iMask) << std::endl;
495  }
496  std::cout << "======DONE PRINTING=====" << std::endl;
497  }
tuple cout
Definition: gather_cfg.py:121
std::set< std::string > maskedPaths
void TrigResRateMon::DatasetInfo::setMaskedPaths ( const std::vector< std::string > &  inputPaths)
inline

Definition at line 472 of file TrigResRateMon.h.

References i, j, maskedPaths, pathNames, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by TrigResRateMon::beginRun().

472  {
473  for (unsigned i=0; i < inputPaths.size(); i++) {
474  std::string maskSubString = inputPaths[i];
475  for (unsigned j=0; j < pathNames.size(); j++) {
476  // If a path in the DS contains a masked substring
477  // Then mask that path
478  //
479  std::string candidateForRemoval = pathNames[j];
480  TString pNameTS (candidateForRemoval);
481  if ( pNameTS.Contains(maskSubString)){
482 
483  maskedPaths.insert(candidateForRemoval);
484  } // end if path contains substring
485  }// end for each path in ds
486  }
487  }// end setMaskedPaths
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > pathNames
int j
Definition: DBlmapReader.cc:9
std::set< std::string > maskedPaths
void TrigResRateMon::DatasetInfo::setPaths ( const std::vector< std::string > &  inputPaths)
inline

Definition at line 374 of file TrigResRateMon.h.

References countsPerPath, and pathNames.

Referenced by TrigResRateMon::beginRun().

374  {
375  pathNames = inputPaths;
376  for (std::vector<std::string>::const_iterator iPath = pathNames.begin();
377  iPath != pathNames.end();
378  iPath++) {
379  countsPerPath[*iPath] = 0;
380  }
381  }//end setPaths
std::vector< std::string > pathNames
std::map< std::string, unsigned int > countsPerPath

Member Data Documentation

std::map<std::string, unsigned int> TrigResRateMon::DatasetInfo::countsPerPath
std::string TrigResRateMon::DatasetInfo::countsPerPathME_Name

Definition at line 347 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

std::string TrigResRateMon::DatasetInfo::datasetName
std::set<std::string> TrigResRateMon::DatasetInfo::maskedPaths

Definition at line 343 of file TrigResRateMon.h.

Referenced by fillXsecPlot(), printMaskedPaths(), and setMaskedPaths().

std::vector<std::string> TrigResRateMon::DatasetInfo::pathNames

Definition at line 342 of file TrigResRateMon.h.

Referenced by fillXsecPlot(), setMaskedPaths(), and setPaths().

std::string TrigResRateMon::DatasetInfo::ratePerLSME_Name

Definition at line 355 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

std::string TrigResRateMon::DatasetInfo::rawCountsPerPathME_Name

Definition at line 360 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

std::string TrigResRateMon::DatasetInfo::scaledXsecPerPathME_Name

Definition at line 353 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

std::set<std::string> TrigResRateMon::DatasetInfo::testPaths

Definition at line 344 of file TrigResRateMon.h.

std::string TrigResRateMon::DatasetInfo::xsecPerPathME_Name

Definition at line 350 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().