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 (std::vector< std::string > inputPaths)
 
void setPaths (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 331 of file TrigResRateMon.h.

Constructor & Destructor Documentation

TrigResRateMon::DatasetInfo::DatasetInfo ( )
inline

Definition at line 360 of file TrigResRateMon.h.

360 {};

Member Function Documentation

void TrigResRateMon::DatasetInfo::clearCountsPerPath ( )
inline

Definition at line 376 of file TrigResRateMon.h.

References countsPerPath.

376  {
377  std::map<std::string, unsigned int>::iterator iCounts;
378  for (iCounts = countsPerPath.begin();
379  iCounts != countsPerPath.end();
380  iCounts++){
381  iCounts->second = 0;
382  }
383 
384  }// end clearCountsPerPath
std::map< std::string, unsigned int > countsPerPath
void TrigResRateMon::DatasetInfo::fillRawCountsForPath ( MonitorElement myRawCountsPlot,
std::string  pathName 
)
inline

Definition at line 455 of file TrigResRateMon.h.

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

455  {
456  TH1F* tempRawCounts = myRawCountsPlot->getTH1F();
457  int binNumber = tempRawCounts->GetXaxis()->FindBin(pathName.c_str());
458  if (binNumber > 0) {
459  tempRawCounts->Fill(binNumber);
460  } else {
461  //std::cout << "Problem finding bin " << pathName << " in plot " << tempRawCounts->GetTitle() << std::endl;
462  }
463  }// end fill RawCountsForPath
TH1F * getTH1F(void) const
void TrigResRateMon::DatasetInfo::fillXsecPlot ( MonitorElement myXsecPlot,
double  currentInstLumi,
double  secondsPerLS,
double  referenceXSec 
)
inline

Definition at line 410 of file TrigResRateMon.h.

410  {
411  // this will put the reference cross section in the denominator
412  fillXsecPlot( myXsecPlot, currentInstLumi*referenceXSec, secondsPerLS);
413  }
void fillXsecPlot(MonitorElement *myXsecPlot, double currentInstLumi, double secondsPerLS, double referenceXSec)
void TrigResRateMon::DatasetInfo::fillXsecPlot ( MonitorElement myXsecPlot,
double  currentInstLumi,
double  secondsPerLS 
)
inline

Definition at line 415 of file TrigResRateMon.h.

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

415  {
416 
417 
418  for (unsigned iPath = 0;
419  iPath < pathNames.size();
420  iPath++) {
421  std::string thisPathName = pathNames[iPath];
422  unsigned thisPathCounts = countsPerPath[thisPathName];
423 
424  // if this is a masked path, then skip it
425  if (maskedPaths.find(thisPathName) != maskedPaths.end()) {
426  //std::cout << "Path " << thisPathName << " is masked, not filling it " << std::endl;
427  continue;
428  }
430  TString thisName = thisPathName.c_str();
431  if ( thisName.Contains("L1") || thisName.Contains("L2") ){
432  continue;
433  }
434 
435  double xsec = 1.0;
436  // what should we fill when averageLumi == 0 ???
437  if (currentInstLumi > 0) {
438  xsec = thisPathCounts / (currentInstLumi*secondsPerLS);
439  } else if ( secondsPerLS > 0) {
440  xsec = (9e-10) ;
441  // xsec = thisPathCounts / secondsPerLS;
442  } else {
443  xsec = (9e-20) ;
444  // xsec = thisPathCounts;
445  }
446 
447  myXsecPlot->Fill(iPath, xsec);
448  //Robin ???
449  // if (currentInstLumi > 0) myXsecPlot->Fill(iPath, xsec);
450  //std::cout << datasetName << " " << thisPathName << " filled with xsec " << xsec << std::endl;
451 
452  }
453  } // 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 388 of file TrigResRateMon.h.

References countsPerPath.

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

Definition at line 392 of file TrigResRateMon.h.

References countsPerPath.

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

Definition at line 396 of file TrigResRateMon.h.

References countsPerPath, gather_cfg::cout, and datasetName.

396  {
397  std::map<std::string, unsigned int>::const_iterator iCounts;
398  for (iCounts = countsPerPath.begin();
399  iCounts != countsPerPath.end();
400  iCounts++){
402  << " " << iCounts->first
403  << " " << iCounts->second
404  << std::endl;
405  }
406 
407  }// end clearCountsPerPath
std::map< std::string, unsigned int > countsPerPath
tuple cout
Definition: gather_cfg.py:121
void TrigResRateMon::DatasetInfo::printMaskedPaths ( )
inline

Definition at line 482 of file TrigResRateMon.h.

References gather_cfg::cout, datasetName, and maskedPaths.

Referenced by TrigResRateMon::beginRun().

482  {
483  std::cout << "======== Printing masked paths for " << datasetName <<" ======== " << std::endl;
484  for ( std::set<std::string>::const_iterator iMask = maskedPaths.begin();
485  iMask != maskedPaths.end();
486  iMask++) {
487  std::cout << (*iMask) << std::endl;
488  }
489  std::cout << "======DONE PRINTING=====" << std::endl;
490  }
tuple cout
Definition: gather_cfg.py:121
std::set< std::string > maskedPaths
void TrigResRateMon::DatasetInfo::setMaskedPaths ( std::vector< std::string >  inputPaths)
inline

Definition at line 465 of file TrigResRateMon.h.

References i, j, maskedPaths, and pathNames.

Referenced by TrigResRateMon::beginRun().

465  {
466  for (unsigned i=0; i < inputPaths.size(); i++) {
467  std::string maskSubString = inputPaths[i];
468  for (unsigned j=0; j < pathNames.size(); j++) {
469  // If a path in the DS contains a masked substring
470  // Then mask that path
471  //
472  std::string candidateForRemoval = pathNames[j];
473  TString pNameTS (candidateForRemoval);
474  if ( pNameTS.Contains(maskSubString)){
475 
476  maskedPaths.insert(candidateForRemoval);
477  } // end if path contains substring
478  }// end for each path in ds
479  }
480  }// 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 ( std::vector< std::string >  inputPaths)
inline

Definition at line 367 of file TrigResRateMon.h.

References countsPerPath, and pathNames.

Referenced by TrigResRateMon::beginRun().

367  {
368  pathNames = inputPaths;
369  for (std::vector<std::string>::const_iterator iPath = pathNames.begin();
370  iPath != pathNames.end();
371  iPath++) {
372  countsPerPath[*iPath] = 0;
373  }
374  }//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 340 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

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

Definition at line 336 of file TrigResRateMon.h.

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

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

Definition at line 335 of file TrigResRateMon.h.

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

std::string TrigResRateMon::DatasetInfo::ratePerLSME_Name

Definition at line 348 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

std::string TrigResRateMon::DatasetInfo::rawCountsPerPathME_Name

Definition at line 353 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

std::string TrigResRateMon::DatasetInfo::scaledXsecPerPathME_Name

Definition at line 346 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

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

Definition at line 337 of file TrigResRateMon.h.

std::string TrigResRateMon::DatasetInfo::xsecPerPathME_Name

Definition at line 343 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().