CMS 3D CMS Logo

Public Member Functions | Public Attributes

TrigResRateMon::DatasetInfo Class Reference

List of all members.

Public Member Functions

void clearCountsPerPath ()
 DatasetInfo ()
void fillRawCountsForPath (MonitorElement *myRawCountsPlot, std::string pathName)
void fillXsecPlot (MonitorElement *myXsecPlot, double currentInstLumi, double secondsPerLS)
void fillXsecPlot (MonitorElement *myXsecPlot, double currentInstLumi, double secondsPerLS, double referenceXSec)
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.

{};

Member Function Documentation

void TrigResRateMon::DatasetInfo::clearCountsPerPath ( ) [inline]

Definition at line 376 of file TrigResRateMon.h.

References countsPerPath.

                               {
      std::map<std::string, unsigned int>::iterator iCounts;
      for (iCounts = countsPerPath.begin();
           iCounts != countsPerPath.end();
           iCounts++){
        iCounts->second = 0;
      }
      
    }// end clearCountsPerPath
void TrigResRateMon::DatasetInfo::fillRawCountsForPath ( MonitorElement myRawCountsPlot,
std::string  pathName 
) [inline]

Definition at line 455 of file TrigResRateMon.h.

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

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

Definition at line 410 of file TrigResRateMon.h.

                                                                                                                       {
      // this will put the reference cross section in the denominator
      fillXsecPlot( myXsecPlot, currentInstLumi*referenceXSec, secondsPerLS);
    }
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.

                                                                                                 {

      
      for (unsigned iPath = 0;
           iPath < pathNames.size();
           iPath++) {
        std::string thisPathName = pathNames[iPath];
        unsigned thisPathCounts = countsPerPath[thisPathName];

        // if this is a masked path, then skip it        
        if (maskedPaths.find(thisPathName) != maskedPaths.end()) {
          //std::cout << "Path " << thisPathName << " is masked, not filling it " << std::endl;
          continue;
        }
        TString thisName = thisPathName.c_str();
        if ( thisName.Contains("L1") || thisName.Contains("L2") ){
          continue;
        }

        double xsec = 1.0;
        // what should we fill when averageLumi == 0 ???
        if (currentInstLumi > 0) {
          xsec = thisPathCounts / (currentInstLumi*secondsPerLS);
        } else if ( secondsPerLS > 0) {
          xsec = (9e-10) ;
          //          xsec = thisPathCounts / secondsPerLS;
        } else {
          xsec = (9e-20) ;
          //          xsec = thisPathCounts;
        }

        myXsecPlot->Fill(iPath, xsec);
        //Robin ???
        //      if (currentInstLumi > 0)  myXsecPlot->Fill(iPath, xsec);
        //std::cout << datasetName << "  " << thisPathName << " filled with xsec  " << xsec << std::endl;
        
      }
    } // end fill Xsec plot
void TrigResRateMon::DatasetInfo::incrementCountsForPath ( std::string  targetPath,
unsigned  preScale 
) [inline]

Definition at line 392 of file TrigResRateMon.h.

References countsPerPath.

                                                                         {
      countsPerPath[targetPath] += preScale;
    }
void TrigResRateMon::DatasetInfo::incrementCountsForPath ( std::string  targetPath) [inline]

Definition at line 388 of file TrigResRateMon.h.

References countsPerPath.

                                                      {
      countsPerPath[targetPath]++;
    }
void TrigResRateMon::DatasetInfo::printCountsPerPath ( ) const [inline]

Definition at line 396 of file TrigResRateMon.h.

References countsPerPath, gather_cfg::cout, and datasetName.

                                     {
      std::map<std::string, unsigned int>::const_iterator iCounts;
      for (iCounts = countsPerPath.begin();
           iCounts != countsPerPath.end();
           iCounts++){
        std::cout << datasetName
                  << "   " << iCounts->first
                  << "   " << iCounts->second
                  << std::endl;
      }
      
    }// end clearCountsPerPath
void TrigResRateMon::DatasetInfo::printMaskedPaths ( ) [inline]

Definition at line 482 of file TrigResRateMon.h.

References gather_cfg::cout, datasetName, and maskedPaths.

Referenced by TrigResRateMon::beginRun().

                             {
      std::cout << "========  Printing masked paths for " << datasetName  <<" ======== " << std::endl;
      for ( std::set<std::string>::const_iterator iMask = maskedPaths.begin();
            iMask != maskedPaths.end();
            iMask++) {
        std::cout << (*iMask) << std::endl; 
      }
      std::cout << "======DONE PRINTING=====" << std::endl;
    }
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().

                                                          {
      for (unsigned i=0; i < inputPaths.size(); i++) {
        std::string maskSubString = inputPaths[i];
        for (unsigned j=0; j < pathNames.size(); j++) {
          // If a path in the DS contains a masked substring
          // Then mask that path
          //
          std::string candidateForRemoval = pathNames[j];
          TString pNameTS (candidateForRemoval);
          if ( pNameTS.Contains(maskSubString)){
            
            maskedPaths.insert(candidateForRemoval);
          } // end if path contains substring
        }// end for each path in ds
      }
    }// end setMaskedPaths
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().

                                                   {
      pathNames = inputPaths;
      for (std::vector<std::string>::const_iterator iPath = pathNames.begin();
           iPath != pathNames.end();
           iPath++) {
        countsPerPath[*iPath] = 0;
      }
    }//end setPaths

Member Data Documentation

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

Definition at line 340 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

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().

Definition at line 348 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

Definition at line 353 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

Definition at line 346 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().

Definition at line 337 of file TrigResRateMon.h.

Definition at line 343 of file TrigResRateMon.h.

Referenced by TrigResRateMon::beginRun().