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 298 of file TrigResRateMon.h.

Constructor & Destructor Documentation

TrigResRateMon::DatasetInfo::DatasetInfo ( )
inline

Definition at line 327 of file TrigResRateMon.h.

327 {};

Member Function Documentation

void TrigResRateMon::DatasetInfo::clearCountsPerPath ( )
inline

Definition at line 343 of file TrigResRateMon.h.

References countsPerPath.

343  {
344  std::map<std::string, unsigned int>::iterator iCounts;
345  for (iCounts = countsPerPath.begin();
346  iCounts != countsPerPath.end();
347  iCounts++){
348  iCounts->second = 0;
349  }
350 
351  }// end clearCountsPerPath
std::map< std::string, unsigned int > countsPerPath
void TrigResRateMon::DatasetInfo::fillRawCountsForPath ( MonitorElement myRawCountsPlot,
std::string  pathName 
)
inline

Definition at line 422 of file TrigResRateMon.h.

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

422  {
423  TH1F* tempRawCounts = myRawCountsPlot->getTH1F();
424  int binNumber = tempRawCounts->GetXaxis()->FindBin(pathName.c_str());
425  if (binNumber > 0) {
426  tempRawCounts->Fill(binNumber);
427  } else {
428  //std::cout << "Problem finding bin " << pathName << " in plot " << tempRawCounts->GetTitle() << std::endl;
429  }
430  }// end fill RawCountsForPath
TH1F * getTH1F(void) const
void TrigResRateMon::DatasetInfo::fillXsecPlot ( MonitorElement myXsecPlot,
double  currentInstLumi,
double  secondsPerLS,
double  referenceXSec 
)
inline

Definition at line 377 of file TrigResRateMon.h.

377  {
378  // this will put the reference cross section in the denominator
379  fillXsecPlot( myXsecPlot, currentInstLumi*referenceXSec, secondsPerLS);
380  }
void fillXsecPlot(MonitorElement *myXsecPlot, double currentInstLumi, double secondsPerLS, double referenceXSec)
void TrigResRateMon::DatasetInfo::fillXsecPlot ( MonitorElement myXsecPlot,
double  currentInstLumi,
double  secondsPerLS 
)
inline

Definition at line 382 of file TrigResRateMon.h.

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

382  {
383 
384 
385  for (unsigned iPath = 0;
386  iPath < pathNames.size();
387  iPath++) {
388  std::string thisPathName = pathNames[iPath];
389  unsigned thisPathCounts = countsPerPath[thisPathName];
390 
391  // if this is a masked path, then skip it
392  if (maskedPaths.find(thisPathName) != maskedPaths.end()) {
393  //std::cout << "Path " << thisPathName << " is masked, not filling it " << std::endl;
394  continue;
395  }
397  TString thisName = thisPathName.c_str();
398  if ( thisName.Contains("L1") || thisName.Contains("L2") ){
399  continue;
400  }
401 
402  double xsec = 1.0;
403  // what should we fill when averageLumi == 0 ???
404  if (currentInstLumi > 0) {
405  xsec = thisPathCounts / (currentInstLumi*secondsPerLS);
406  } else if ( secondsPerLS > 0) {
407  xsec = (9e-10) ;
408  // xsec = thisPathCounts / secondsPerLS;
409  } else {
410  xsec = (9e-20) ;
411  // xsec = thisPathCounts;
412  }
413 
414  myXsecPlot->Fill(iPath, xsec);
415  //Robin ???
416  // if (currentInstLumi > 0) myXsecPlot->Fill(iPath, xsec);
417  //std::cout << datasetName << " " << thisPathName << " filled with xsec " << xsec << std::endl;
418 
419  }
420  } // 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 355 of file TrigResRateMon.h.

References countsPerPath.

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

Definition at line 359 of file TrigResRateMon.h.

References countsPerPath.

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

Definition at line 363 of file TrigResRateMon.h.

References countsPerPath, gather_cfg::cout, and datasetName.

363  {
364  std::map<std::string, unsigned int>::const_iterator iCounts;
365  for (iCounts = countsPerPath.begin();
366  iCounts != countsPerPath.end();
367  iCounts++){
369  << " " << iCounts->first
370  << " " << iCounts->second
371  << std::endl;
372  }
373 
374  }// end clearCountsPerPath
std::map< std::string, unsigned int > countsPerPath
tuple cout
Definition: gather_cfg.py:121
void TrigResRateMon::DatasetInfo::printMaskedPaths ( )
inline

Definition at line 449 of file TrigResRateMon.h.

References gather_cfg::cout, datasetName, and maskedPaths.

Referenced by TrigResRateMon::beginRun().

449  {
450  std::cout << "======== Printing masked paths for " << datasetName <<" ======== " << std::endl;
451  for ( std::set<std::string>::const_iterator iMask = maskedPaths.begin();
452  iMask != maskedPaths.end();
453  iMask++) {
454  std::cout << (*iMask) << std::endl;
455  }
456  std::cout << "======DONE PRINTING=====" << std::endl;
457  }
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 432 of file TrigResRateMon.h.

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

Referenced by TrigResRateMon::beginRun().

432  {
433  for (unsigned i=0; i < inputPaths.size(); i++) {
434  std::string maskSubString = inputPaths[i];
435  for (unsigned j=0; j < pathNames.size(); j++) {
436  // If a path in the DS contains a masked substring
437  // Then mask that path
438  //
439  std::string candidateForRemoval = pathNames[j];
440  TString pNameTS (candidateForRemoval);
441  if ( pNameTS.Contains(maskSubString)){
442 
443  maskedPaths.insert(candidateForRemoval);
444  } // end if path contains substring
445  }// end for each path in ds
446  }
447  }// 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 334 of file TrigResRateMon.h.

References countsPerPath, and pathNames.

Referenced by TrigResRateMon::beginRun().

334  {
335  pathNames = inputPaths;
336  for (std::vector<std::string>::const_iterator iPath = pathNames.begin();
337  iPath != pathNames.end();
338  iPath++) {
339  countsPerPath[*iPath] = 0;
340  }
341  }//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 307 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

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

Definition at line 303 of file TrigResRateMon.h.

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

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

Definition at line 302 of file TrigResRateMon.h.

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

std::string TrigResRateMon::DatasetInfo::ratePerLSME_Name

Definition at line 315 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

std::string TrigResRateMon::DatasetInfo::rawCountsPerPathME_Name

Definition at line 320 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

std::string TrigResRateMon::DatasetInfo::scaledXsecPerPathME_Name

Definition at line 313 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

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

Definition at line 304 of file TrigResRateMon.h.

std::string TrigResRateMon::DatasetInfo::xsecPerPathME_Name

Definition at line 310 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().