CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DQM/HLTEvF/interface/TrigResRateMon.h

Go to the documentation of this file.
00001 #ifndef TRIGRESRATEMON_H
00002 #define TRIGRESRATEMON_H
00003 // -*- C++ -*-
00004 //
00005 // Package:    TrigResRateMon
00006 // Class:      TrigResRateMon
00007 // 
00015 // Original Author:
00016 //        Vladimir Rekovic, July 2010
00017 //
00018 //
00019 // $Id: TrigResRateMon.h,v 1.11 2011/09/21 16:51:09 lwming Exp $
00020 //
00021 //
00022 
00023 // system include files
00024 #include <memory>
00025 #include <unistd.h>
00026 
00027 
00028 // user include files
00029 #include "FWCore/Framework/interface/Frameworkfwd.h"
00030 #include "FWCore/Framework/interface/EDAnalyzer.h"
00031 
00032 #include "FWCore/Framework/interface/Event.h"
00033 #include "FWCore/Framework/interface/MakerMacros.h"
00034 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00035 #include "DataFormats/Common/interface/TriggerResults.h"
00036 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00037 
00038 #include "DQMServices/Core/interface/DQMStore.h"
00039 #include "DQMServices/Core/interface/MonitorElement.h"
00040 #include "FWCore/ServiceRegistry/interface/Service.h"
00041 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00042 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00043 
00044 // added VR
00045 #include "FWCore/Framework/interface/EDAnalyzer.h"
00046 #include "DataFormats/Common/interface/Handle.h"
00047 #include "FWCore/Framework/interface/Run.h"
00048 #include "FWCore/Framework/interface/MakerMacros.h"
00049 #include "FWCore/Framework/interface/ESHandle.h"
00050 
00051 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00052 
00053 #include "DataFormats/HLTReco/interface/TriggerObject.h"
00054 #include "DataFormats/Common/interface/TriggerResults.h"
00055 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00056 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
00057 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00058 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00059 
00060 /*
00061    needs cleaining of include statments (VR)
00062 */
00063 
00064 #include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
00065 #include "DataFormats/JetReco/interface/JetFloatAssociation.h"
00066 
00067 #include "DataFormats/Math/interface/deltaR.h"
00068 #include  "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
00069 
00070 #include "DQMServices/Core/interface/MonitorElement.h"
00071 
00072 
00073 
00074 #include <iostream>
00075 #include <fstream>
00076 #include <vector>
00077 #include <set>
00078 
00079 namespace edm {
00080    class TriggerNames;
00081 }
00082 
00083 //typedef std::multimap<float,int> fimmap ;
00084 //typedef std::set<fimmap , less<fimmap> > mmset;
00085 
00086 class TrigResRateMon : public edm::EDAnalyzer {
00087 
00088    public:
00089       explicit TrigResRateMon(const edm::ParameterSet&);
00090       ~TrigResRateMon();
00091 
00092       //void cleanDRMatchSet(mmset& tempSet);
00093 
00094       edm::Handle<trigger::TriggerEvent> fTriggerObj;
00095       //edm::Handle<reco::BeamSpot> fBeamSpotHandle;
00096 
00097    private:
00098       virtual void beginJob() ;
00099       virtual void analyze(const edm::Event&, const edm::EventSetup&);
00100       virtual void endJob() ;
00101 
00102       // BeginRun
00103       void beginRun(const edm::Run& run, const edm::EventSetup& c);
00104 
00105       // EndRun
00106       void endRun(const edm::Run& run, const edm::EventSetup& c);
00107       void setupHltMatrix(const std::string& label, std::vector<std::string> &  paths);
00108       void setupStreamMatrix(const std::string& label, std::vector<std::string> &  paths);
00109       void setupHltLsPlots();
00110       void setupHltBxPlots();
00111       void countHLTPathHitsEndLumiBlock(const int & lumi);
00112       void countHLTGroupHitsEndLumiBlock(const int & lumi);
00113       void countHLTGroupL1HitsEndLumiBlock(const int & lumi);
00114       void countHLTGroupBXHitsEndLumiBlock(const int & lumi);
00115 
00116   void fillHltMatrix(const edm::TriggerNames & triggerNames, const edm::Event& iEvent, const edm::EventSetup& iSetup);
00117 
00118 
00119   // JMS counts
00120   // need to fill counts per path with the prescales
00121   void fillCountsPerPath(const edm::Event& iEvent, const edm::EventSetup& iSetup);
00122   void bookCountsPerPath();
00123   void printCountsPerPathThisLumi();
00124   void clearCountsPerPath();
00125   void fillXsecPerDataset(const int& lumi);
00126 
00127   void filltestHisto(const int& lumi); //Robin
00128   void bookTestHisto(); //Robin
00129   // JMS lumi average
00130   void addLumiToAverage (double lumi);
00131   void clearLumiAverage ();
00132   
00133 
00134       void normalizeHLTMatrix();
00135 
00136       int getTriggerTypeParsePathName(const std::string & pathname);
00137       const std::string getL1ConditionModuleName(const std::string & pathname);
00138       bool hasL1Passed(const std::string & pathname, const edm::TriggerNames & triggerNames);
00139       bool hasHLTPassed(const std::string & pathname, const edm::TriggerNames& triggerNames);
00140       int getThresholdFromName(const std::string & pathname);
00141 
00142 
00143       void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);   
00144       void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c);   
00145 
00146       // ----------member data --------------------------- 
00147       int nev_;
00148       int nStream_;  //Robin
00149       int nPass_;  //Robin
00150       bool passAny;  //Robin 
00151       DQMStore * dbe_;
00152       bool fLumiFlag;
00153       bool fIsSetup;
00154 
00155       // JetID helper
00156       //reco::helper::JetIDHelper *jetID;
00157 
00158   bool jmsDebug;
00159   bool jmsFakeZBCounts;
00160   unsigned int zbIndex;
00161   bool found_zbIndex;
00162 
00163       MonitorElement* ME_HLTAll_LS;
00164       MonitorElement* ME_HLT_BX;
00165       MonitorElement* ME_HLT_CUSTOM_BX;
00166       std::vector<MonitorElement*> v_ME_HLTAll_LS;
00167       std::vector<MonitorElement*> v_ME_Total_BX;
00168       std::vector<MonitorElement*> v_ME_Total_BX_Norm;
00169 
00170       std::vector<MonitorElement*> v_ME_HLTPassPass;
00171       std::vector<MonitorElement*> v_ME_HLTPassPass_Normalized;
00172       std::vector<MonitorElement*> v_ME_HLTPass_Normalized_Any;
00173 
00174       std::string testPathsFolder_;  //Robin
00175       std::string pathsSummaryFolder_;
00176       std::string pathsSummaryStreamsFolder_;
00177       std::string pathsSummaryHLTCorrelationsFolder_;
00178       std::string pathsSummaryFilterEfficiencyFolder_;
00179       std::string pathsSummaryFilterCountsFolder_;
00180       std::string pathsSummaryHLTPathsPerLSFolder_;
00181       std::string pathsIndividualHLTPathsPerLSFolder_;
00182       std::string pathsSummaryHLTPathsPerBXFolder_;
00183       std::string fCustomBXPath;
00184 
00185       std::vector<std::string> fGroupName;
00186 
00187 
00188   // JMS Keep track of rates and average lumi
00189   std::vector<unsigned> rawCountsPerPD; //Robin 
00190   std::vector<unsigned> rawCountsPerPath; //Robin
00191   std::vector<unsigned> finalCountsPerPath;  //Robin
00192   double averageInstLumi;
00193   double averageInstLumi3LS;
00194   MonitorElement * meAverageLumiPerLS;
00195 
00196   //Robin---
00197   int64_t TotalDroppedCounts ;
00198   MonitorElement * meDiagnostic;
00199   MonitorElement * meCountsDroppedPerLS;
00200   MonitorElement * meCountsPassPerLS;
00201   MonitorElement * meCountsStreamPerLS;
00202   MonitorElement * meXsecStreamPerLS;
00203   //  MonitorElement * meXsecPerLS;
00204   //  MonitorElement * meXsec;
00205   //  MonitorElement * meXsecPerIL;
00206 
00207   MonitorElement * meXsecPerTestPath;
00208   std::vector<MonitorElement*> v_ME_XsecPerLS;
00209   std::vector<MonitorElement*> v_ME_CountsPerLS;
00210   std::vector<MonitorElement*> v_ME_Xsec;
00211 
00212   // JMS Mask off some paths so that they don't mess with your plots
00213 
00214   std::vector< std::string > maskedPaths_; 
00215   std::vector< std::string > testPaths_; //Robin
00216 
00217   // JMS calcuate a reference cross section
00218   // then scale
00219   std::string referenceTrigInput_;
00220   std::string referenceTrigName_;
00221   unsigned referenceTrigIndex_;
00222   bool foundReferenceTrigger_;
00223   unsigned referenceTrigCountsPS_;
00224   //  unsigned testTrigCountsPS_; //Robin
00225   void findReferenceTriggerIndex();
00226   //unsigned referenceTrigCounts_;
00227   
00228   
00229       unsigned int nLS_; 
00230       double LSsize_ ;
00231       double thresholdFactor_ ;
00232       unsigned int referenceBX_; 
00233       unsigned int Nbx_; 
00234 
00235       bool plotAll_;
00236       bool doCombineRuns_;
00237       bool doVBTFMuon_;
00238       int currentRun_;
00239       
00240       unsigned int nBins_; 
00241       unsigned int nBins2D_; 
00242       unsigned int nBinsDR_; 
00243       unsigned int nBinsOneOverEt_; 
00244       double ptMin_ ;
00245       double ptMax_ ;
00246       double dRMax_ ;
00247       double dRMaxElectronMuon_ ;
00248       
00249       double electronEtaMax_;
00250       double electronEtMin_;
00251       double electronDRMatch_;
00252       double electronL1DRMatch_;
00253       double muonEtaMax_;
00254       double muonEtMin_;
00255       double muonDRMatch_;
00256       double muonL1DRMatch_;
00257       double tauEtaMax_;
00258       double tauEtMin_;
00259       double tauDRMatch_;
00260       double tauL1DRMatch_;
00261       double jetEtaMax_;
00262       double jetEtMin_;
00263       double jetDRMatch_;
00264       double jetL1DRMatch_;
00265       double bjetEtaMax_;
00266       double bjetEtMin_;
00267       double bjetDRMatch_;
00268       double bjetL1DRMatch_;
00269       double photonEtaMax_;
00270       double photonEtMin_;
00271       double photonDRMatch_;
00272       double photonL1DRMatch_;
00273       double trackEtaMax_;
00274       double trackEtMin_;
00275       double trackDRMatch_;
00276       double trackL1DRMatch_;
00277       double metEtaMax_;
00278       double metMin_;
00279       double metDRMatch_;
00280       double metL1DRMatch_;
00281       double htEtaMax_;
00282       double htMin_;
00283       double htDRMatch_;
00284       double htL1DRMatch_;
00285       double sumEtMin_;
00286 
00287       // Muon quality cuts
00288       double dxyCut_;
00289       double normalizedChi2Cut_;
00290       int trackerHitsCut_;
00291       int pixelHitsCut_;
00292       int muonHitsCut_;
00293       bool isAlsoTrackerMuon_;
00294       int nMatchesCut_;
00295 
00296       std::vector<std::pair<std::string, std::string> > custompathnamepairs_;
00297 
00298       std::vector <std::vector <std::string> > triggerFilters_;
00299       std::vector <std::vector <uint> > triggerFilterIndices_;
00300       std::vector <std::pair<std::string, float> > fPathTempCountPair;
00301       std::vector <std::pair<std::string, std::vector<int> > > fPathBxTempCountPair;
00302       std::vector <std::pair<std::string, float> > fGroupTempCountPair;
00303       std::vector <std::pair<std::string, float> > fGroupL1TempCountPair;
00304 
00305 
00306       // This variable contains the list of PD, then the list of paths per PD
00307   
00308       std::vector <std::pair<std::string, std::vector<std::string> > > fGroupNamePathsPair;
00309 
00310       std::vector<std::string> specialPaths_;
00311 
00312       std::string dirname_;
00313       std::string processname_;
00314       std::string muonRecoCollectionName_;
00315       bool monitorDaemon_;
00316       int theHLTOutputType;
00317       edm::InputTag triggerSummaryLabel_;
00318       edm::InputTag triggerResultsLabel_;
00319       edm::InputTag recHitsEBTag_, recHitsEETag_;
00320       HLTConfigProvider hltConfig_;
00321       // data across paths
00322       MonitorElement* scalersSelect;
00323       // helper class to store the data path
00324 
00325       edm::Handle<edm::TriggerResults> triggerResults_;
00326 
00327 
00328   // create a class that can store all the strings
00329   // associated with a primary dataset
00330   // the 
00331   class DatasetInfo {
00332 
00333   public:
00334     std::string datasetName;
00335     std::vector<std::string> pathNames;
00336     std::set<std::string> maskedPaths;
00337     std::set<std::string> testPaths; //Robin
00338     // this tells you the name of the monitor element
00339     // that has the counts per path saved
00340     std::string countsPerPathME_Name;
00341 
00342     // name of monitor element that has xsec per path saved
00343     std::string xsecPerPathME_Name;
00344 
00345     // name of monitor element that has xsec per path saved
00346     std::string scaledXsecPerPathME_Name;
00347 
00348     std::string ratePerLSME_Name;
00349     // this tells you the name of the ME that has
00350     // raw counts (no prescale accounting)
00351     // for each path
00352 
00353     std::string rawCountsPerPathME_Name;
00354 
00355     // counts per path
00356 
00357     std::map<std::string, unsigned int> countsPerPath;
00358     
00359     //empty default constructor
00360     DatasetInfo () {};
00361 
00362     // do we need a copy constructor?
00363 
00364     // function to set the paths and
00365     // create zeroed counts per path
00366     
00367     void setPaths (std::vector<std::string> inputPaths){
00368       pathNames = inputPaths;
00369       for (std::vector<std::string>::const_iterator iPath = pathNames.begin();
00370            iPath != pathNames.end();
00371            iPath++) {
00372         countsPerPath[*iPath] = 0;
00373       }
00374     }//end setPaths
00375 
00376     void clearCountsPerPath () {
00377       std::map<std::string, unsigned int>::iterator iCounts;
00378       for (iCounts = countsPerPath.begin();
00379            iCounts != countsPerPath.end();
00380            iCounts++){
00381         iCounts->second = 0;
00382       }
00383       
00384     }// end clearCountsPerPath
00385 
00386     // put this here so that external people
00387     // don't care how you store counts
00388     void incrementCountsForPath (std::string targetPath){
00389       countsPerPath[targetPath]++;
00390     }
00391     
00392     void incrementCountsForPath (std::string targetPath, unsigned preScale){
00393       countsPerPath[targetPath] += preScale;
00394     }
00395     
00396     void printCountsPerPath () const {
00397       std::map<std::string, unsigned int>::const_iterator iCounts;
00398       for (iCounts = countsPerPath.begin();
00399            iCounts != countsPerPath.end();
00400            iCounts++){
00401         std::cout << datasetName
00402                   << "   " << iCounts->first
00403                   << "   " << iCounts->second
00404                   << std::endl;
00405       }
00406       
00407     }// end clearCountsPerPath
00408 
00409 
00410     void fillXsecPlot (MonitorElement * myXsecPlot, double currentInstLumi, double secondsPerLS, double referenceXSec) {
00411       // this will put the reference cross section in the denominator
00412       fillXsecPlot( myXsecPlot, currentInstLumi*referenceXSec, secondsPerLS);
00413     }
00414     
00415     void fillXsecPlot (MonitorElement * myXsecPlot, double currentInstLumi, double secondsPerLS) {
00416 
00417       
00418       for (unsigned iPath = 0;
00419            iPath < pathNames.size();
00420            iPath++) {
00421         std::string thisPathName = pathNames[iPath];
00422         unsigned thisPathCounts = countsPerPath[thisPathName];
00423 
00424         // if this is a masked path, then skip it        
00425         if (maskedPaths.find(thisPathName) != maskedPaths.end()) {
00426           //std::cout << "Path " << thisPathName << " is masked, not filling it " << std::endl;
00427           continue;
00428         }
00430         TString thisName = thisPathName.c_str();
00431         if ( thisName.Contains("L1") || thisName.Contains("L2") ){
00432           continue;
00433         }
00434 
00435         double xsec = 1.0;
00436         // what should we fill when averageLumi == 0 ???
00437         if (currentInstLumi > 0) {
00438           xsec = thisPathCounts / (currentInstLumi*secondsPerLS);
00439         } else if ( secondsPerLS > 0) {
00440           xsec = (9e-10) ;
00441           //          xsec = thisPathCounts / secondsPerLS;
00442         } else {
00443           xsec = (9e-20) ;
00444           //          xsec = thisPathCounts;
00445         }
00446 
00447         myXsecPlot->Fill(iPath, xsec);
00448         //Robin ???
00449         //      if (currentInstLumi > 0)  myXsecPlot->Fill(iPath, xsec);
00450         //std::cout << datasetName << "  " << thisPathName << " filled with xsec  " << xsec << std::endl;
00451         
00452       }
00453     } // end fill Xsec plot
00454 
00455     void fillRawCountsForPath (MonitorElement * myRawCountsPlot, std::string pathName) {
00456       TH1F* tempRawCounts = myRawCountsPlot->getTH1F();
00457       int binNumber = tempRawCounts->GetXaxis()->FindBin(pathName.c_str());
00458       if (binNumber > 0) {
00459         tempRawCounts->Fill(binNumber);
00460       } else {
00461         //std::cout << "Problem finding bin " << pathName << " in plot " << tempRawCounts->GetTitle() << std::endl;
00462       }
00463     }// end fill RawCountsForPath
00464 
00465     void setMaskedPaths (std::vector<std::string> inputPaths) {
00466       for (unsigned i=0; i < inputPaths.size(); i++) {
00467         std::string maskSubString = inputPaths[i];
00468         for (unsigned j=0; j < pathNames.size(); j++) {
00469           // If a path in the DS contains a masked substring
00470           // Then mask that path
00471           //
00472           std::string candidateForRemoval = pathNames[j];
00473           TString pNameTS (candidateForRemoval);
00474           if ( pNameTS.Contains(maskSubString)){
00475             
00476             maskedPaths.insert(candidateForRemoval);
00477           } // end if path contains substring
00478         }// end for each path in ds
00479       }
00480     }// end setMaskedPaths
00481 
00482     void printMaskedPaths () {
00483       std::cout << "========  Printing masked paths for " << datasetName  <<" ======== " << std::endl;
00484       for ( std::set<std::string>::const_iterator iMask = maskedPaths.begin();
00485             iMask != maskedPaths.end();
00486             iMask++) {
00487         std::cout << (*iMask) << std::endl; 
00488       }
00489       std::cout << "======DONE PRINTING=====" << std::endl;
00490     }
00491     
00492   };
00493 
00494   // create a vector of the information
00495     std::vector<DatasetInfo> primaryDataSetInformation;
00496 
00497       class PathInfo {
00498 
00499        PathInfo():
00500         pathIndex_(-1), denomPathName_("unset"), pathName_("unset"), l1pathName_("unset"), filterName_("unset"), processName_("unset"), objectType_(-1) {};
00501 
00502        public:
00503 
00504           void setFilterHistos(MonitorElement* const filters) 
00505           {
00506               filters_   =  filters;
00507           }
00508 
00509           void setHistos(
00510 
00511             MonitorElement* const NOn, 
00512             MonitorElement* const onEtOn, 
00513             MonitorElement* const onOneOverEtOn, 
00514             MonitorElement* const onEtavsonPhiOn,  
00515             MonitorElement* const NOff, 
00516             MonitorElement* const offEtOff, 
00517             MonitorElement* const offEtavsoffPhiOff,
00518             MonitorElement* const NL1, 
00519             MonitorElement* const l1EtL1, 
00520             MonitorElement* const l1Etavsl1PhiL1,
00521             MonitorElement* const NL1On, 
00522             MonitorElement* const l1EtL1On, 
00523             MonitorElement* const l1Etavsl1PhiL1On,
00524             MonitorElement* const NL1Off,   
00525             MonitorElement* const offEtL1Off, 
00526             MonitorElement* const offEtavsoffPhiL1Off,
00527             MonitorElement* const NOnOff, 
00528             MonitorElement* const offEtOnOff, 
00529             MonitorElement* const offEtavsoffPhiOnOff,
00530             MonitorElement* const NL1OnUM, 
00531             MonitorElement* const l1EtL1OnUM, 
00532             MonitorElement* const l1Etavsl1PhiL1OnUM,
00533             MonitorElement* const NL1OffUM,   
00534             MonitorElement* const offEtL1OffUM, 
00535             MonitorElement* const offEtavsoffPhiL1OffUM,
00536             MonitorElement* const NOnOffUM, 
00537             MonitorElement* const offEtOnOffUM, 
00538             MonitorElement* const offEtavsoffPhiOnOffUM,
00539             MonitorElement* const offDRL1Off, 
00540             MonitorElement* const offDROnOff, 
00541             MonitorElement* const l1DRL1On)  
00542          {
00543 
00544               NOn_ = NOn;
00545               onEtOn_ = onEtOn;
00546               onOneOverEtOn_ = onOneOverEtOn;
00547               onEtavsonPhiOn_ = onEtavsonPhiOn;
00548               NOff_ = NOff;
00549               offEtOff_ = offEtOff;
00550               offEtavsoffPhiOff_ = offEtavsoffPhiOff;
00551               NL1_ = NL1;
00552               l1EtL1_ = l1EtL1;
00553               l1Etavsl1PhiL1_ = l1Etavsl1PhiL1;
00554               NL1On_ = NL1On;
00555               l1EtL1On_ = l1EtL1On;
00556               l1Etavsl1PhiL1On_ = l1Etavsl1PhiL1On;
00557               NL1Off_ = NL1Off;
00558               offEtL1Off_ = offEtL1Off;
00559               offEtavsoffPhiL1Off_ = offEtavsoffPhiL1Off;
00560               NOnOff_ = NOnOff;
00561               offEtOnOff_ = offEtOnOff;
00562               offEtavsoffPhiOnOff_ = offEtavsoffPhiOnOff;
00563               NL1OnUM_ = NL1OnUM;
00564               l1EtL1OnUM_ = l1EtL1OnUM;
00565               l1Etavsl1PhiL1OnUM_ = l1Etavsl1PhiL1OnUM;
00566               NL1OffUM_ = NL1OffUM;
00567               offEtL1OffUM_ = offEtL1OffUM;
00568               offEtavsoffPhiL1OffUM_ = offEtavsoffPhiL1OffUM;
00569               NOnOffUM_ = NOnOffUM;
00570               offEtOnOffUM_ = offEtOnOffUM;
00571               offEtavsoffPhiOnOffUM_ = offEtavsoffPhiOnOffUM;
00572               offDRL1Off_ =  offDRL1Off; 
00573               offDROnOff_ =  offDROnOff; 
00574               l1DRL1On_   =  l1DRL1On;
00575 
00576          }
00577 
00578          MonitorElement * getNOnHisto() {
00579           return NOn_;
00580          }
00581          MonitorElement * getOnEtOnHisto() {
00582            return onEtOn_;
00583          }
00584          MonitorElement * getOnOneOverEtOnHisto() {
00585            return onOneOverEtOn_;
00586          }
00587          MonitorElement * getOnEtaVsOnPhiOnHisto() {
00588            return onEtavsonPhiOn_;
00589          }
00590          MonitorElement * getNOffHisto() {
00591            return NOff_;
00592          }
00593          MonitorElement * getOffEtOffHisto() {
00594            return offEtOff_;
00595          }
00596          MonitorElement * getOffEtaVsOffPhiOffHisto() {
00597            return offEtavsoffPhiOff_;
00598          }
00599          MonitorElement * getNL1Histo() {
00600            return NL1_;
00601          }
00602          MonitorElement * getL1EtL1Histo() {
00603            return l1EtL1_;
00604          }
00605          MonitorElement * getL1EtaVsL1PhiL1Histo() {
00606            return l1Etavsl1PhiL1_;
00607          }
00608          MonitorElement * getNL1OnHisto() {
00609            return NL1On_;
00610          }
00611          MonitorElement * getL1EtL1OnHisto() {
00612            return l1EtL1On_;
00613          }
00614          MonitorElement * getL1EtaVsL1PhiL1OnHisto() {
00615            return l1Etavsl1PhiL1On_;
00616          }
00617          MonitorElement * getNL1OffHisto() {
00618            return NL1Off_;
00619          }
00620          MonitorElement * getOffEtL1OffHisto() {
00621            return offEtL1Off_;
00622          }
00623          MonitorElement * getOffEtaVsOffPhiL1OffHisto() {
00624            return offEtavsoffPhiL1Off_;
00625          }
00626          MonitorElement * getNOnOffHisto() {
00627            return NOnOff_;
00628          }
00629          MonitorElement * getOffEtOnOffHisto() {
00630            return offEtOnOff_;
00631          }
00632          MonitorElement * getOffEtaVsOffPhiOnOffHisto() {
00633            return offEtavsoffPhiOnOff_;
00634          }
00635          MonitorElement * getNL1OnUMHisto() {
00636            return NL1OnUM_;
00637          }
00638          MonitorElement * getL1EtL1OnUMHisto() {
00639            return l1EtL1OnUM_;
00640          }
00641          MonitorElement * getL1EtaVsL1PhiL1OnUMHisto() {
00642            return l1Etavsl1PhiL1OnUM_;
00643          }
00644          MonitorElement * getNL1OffUMHisto() {
00645            return NL1OffUM_;
00646          }
00647          MonitorElement * getOffEtL1OffUMHisto() {
00648            return offEtL1OffUM_;
00649          }
00650          MonitorElement * getOffEtaVsOffPhiL1OffUMHisto() {
00651            return offEtavsoffPhiL1OffUM_;
00652          }
00653          MonitorElement * getNOnOffUMHisto() {
00654            return NOnOffUM_;
00655          }
00656          MonitorElement * getOffEtOnOffUMHisto() {
00657            return offEtOnOffUM_;
00658          }
00659          MonitorElement * getOffEtaVsOffPhiOnOffUMHisto() {
00660            return offEtavsoffPhiOnOffUM_;
00661          }
00662          MonitorElement * getOffDRL1OffHisto() {
00663            return offDRL1Off_;
00664          }
00665          MonitorElement * getOffDROnOffHisto() {
00666            return offDROnOff_;
00667          }
00668          MonitorElement * getL1DROnL1Histo() {
00669            return l1DRL1On_;
00670          }
00671          MonitorElement * getFiltersHisto() {
00672            return filters_;
00673          }
00674          const std::string getLabel(void ) const {
00675            return filterName_;
00676          }
00677          void setLabel(std::string labelName){
00678            filterName_ = labelName;
00679            return;
00680          }
00681          const std::string & getPath(void ) const {
00682            return pathName_;
00683          }
00684          const std::string & getl1Path(void ) const {
00685            return l1pathName_;
00686          }
00687          const int getL1ModuleIndex(void ) const {
00688            return l1ModuleIndex_;
00689          }
00690          const std::string & getDenomPath(void ) const {
00691            return denomPathName_;
00692          }
00693          const std::string & getProcess(void ) const {
00694            return processName_;
00695          }
00696          const int getObjectType(void ) const {
00697            return objectType_;
00698          }
00699 
00700         const edm::InputTag getTag(void) const{
00701           edm::InputTag tagName(filterName_,"",processName_);
00702           return tagName;
00703         }
00704 
00705         ~PathInfo() {};
00706 
00707         PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, int l1ModuleIndex, std::string filterName, std::string processName, size_t type, float ptmin, float ptmax, float hltThreshold, float l1Threshold):
00708 
00709           denomPathName_(denomPathName), 
00710           pathName_(pathName), 
00711           l1pathName_(l1pathName), 
00712           l1ModuleIndex_(l1ModuleIndex), 
00713           filterName_(filterName), 
00714           processName_(processName), 
00715           objectType_(type),
00716           NOn_(0), onEtOn_(0), onOneOverEtOn_(0), onEtavsonPhiOn_(0), 
00717           NOff_(0), offEtOff_(0), offEtavsoffPhiOff_(0),
00718           NL1_(0), l1EtL1_(0), l1Etavsl1PhiL1_(0),
00719           NL1On_(0), l1EtL1On_(0), l1Etavsl1PhiL1On_(0),
00720           NL1Off_(0), offEtL1Off_(0), offEtavsoffPhiL1Off_(0),
00721           NOnOff_(0), offEtOnOff_(0), offEtavsoffPhiOnOff_(0),
00722           NL1OnUM_(0), l1EtL1OnUM_(0), l1Etavsl1PhiL1OnUM_(0),
00723           NL1OffUM_(0), offEtL1OffUM_(0), offEtavsoffPhiL1OffUM_(0),
00724           NOnOffUM_(0), offEtOnOffUM_(0), offEtavsoffPhiOnOffUM_(0),
00725           offDRL1Off_(0), offDROnOff_(0), l1DRL1On_(0), filters_(0),
00726           ptmin_(ptmin), ptmax_(ptmax),
00727           hltThreshold_(hltThreshold), l1Threshold_(l1Threshold)
00728 
00729         {
00730         };
00731 
00732         PathInfo(std::string denomPathName, std::string pathName, std::string l1pathName, std::string filterName, std::string processName, size_t type,
00733           MonitorElement *NOn,
00734           MonitorElement *onEtOn,
00735           MonitorElement *onOneOverEtOn,
00736           MonitorElement *onEtavsonPhiOn,
00737           MonitorElement *NOff,
00738           MonitorElement *offEtOff,
00739           MonitorElement *offEtavsoffPhiOff,
00740           MonitorElement *NL1,
00741           MonitorElement *l1EtL1,
00742           MonitorElement *l1Etavsl1PhiL1,
00743           MonitorElement *NL1On,
00744           MonitorElement *l1EtL1On,
00745           MonitorElement *l1Etavsl1PhiL1On,
00746           MonitorElement *NL1Off,
00747           MonitorElement *offEtL1Off,
00748           MonitorElement *offEtavsoffPhiL1Off,
00749           MonitorElement *NOnOff,
00750           MonitorElement *offEtOnOff,
00751           MonitorElement *offEtavsoffPhiOnOff,
00752           MonitorElement *NL1OnUM,
00753           MonitorElement *l1EtL1OnUM,
00754           MonitorElement *l1Etavsl1PhiL1OnUM,
00755           MonitorElement *NL1OffUM,
00756           MonitorElement *offEtL1OffUM,
00757           MonitorElement *offEtavsoffPhiL1OffUM,
00758           MonitorElement *NOnOffUM,
00759           MonitorElement *offEtOnOffUM,
00760           MonitorElement *offEtavsoffPhiOnOffUM,
00761           MonitorElement *offDRL1Off, 
00762           MonitorElement *offDROnOff, 
00763           MonitorElement *l1DRL1On,
00764           MonitorElement *filters,
00765           float ptmin, float ptmax
00766           ):
00767 
00768             denomPathName_(denomPathName), 
00769             pathName_(pathName), l1pathName_(l1pathName), 
00770             filterName_(filterName), processName_(processName), objectType_(type),
00771             NOn_(NOn), onEtOn_(onEtOn), onOneOverEtOn_(onOneOverEtOn), onEtavsonPhiOn_(onEtavsonPhiOn), 
00772             NOff_(NOff), offEtOff_(offEtOff), offEtavsoffPhiOff_(offEtavsoffPhiOff),
00773             NL1_(NL1), l1EtL1_(l1EtL1), l1Etavsl1PhiL1_(l1Etavsl1PhiL1),
00774             NL1On_(NL1On), l1EtL1On_(l1EtL1On), l1Etavsl1PhiL1On_(l1Etavsl1PhiL1On),
00775             NL1Off_(NL1Off), offEtL1Off_(offEtL1Off), offEtavsoffPhiL1Off_(offEtavsoffPhiL1Off),
00776             NOnOff_(NOnOff), offEtOnOff_(offEtOnOff), offEtavsoffPhiOnOff_(offEtavsoffPhiOnOff),
00777             NL1OnUM_(NL1OnUM), l1EtL1OnUM_(l1EtL1OnUM), l1Etavsl1PhiL1OnUM_(l1Etavsl1PhiL1OnUM),
00778             NL1OffUM_(NL1OffUM), offEtL1OffUM_(offEtL1OffUM), offEtavsoffPhiL1OffUM_(offEtavsoffPhiL1OffUM),
00779             NOnOffUM_(NOnOffUM), offEtOnOffUM_(offEtOnOffUM), offEtavsoffPhiOnOffUM_(offEtavsoffPhiOnOffUM),
00780             offDRL1Off_(offDRL1Off), 
00781             offDROnOff_(offDROnOff), 
00782             l1DRL1On_(l1DRL1On),
00783             filters_(filters),
00784             ptmin_(ptmin), ptmax_(ptmax)
00785         {
00786         };
00787 
00788         bool operator==(const std::string& v) 
00789         {
00790           return v==filterName_;
00791         }
00792 
00793         bool operator!=(const std::string& v) 
00794         {
00795           return v!=filterName_;
00796         }
00797 
00798         float getPtMin() const { return ptmin_; }
00799         float getPtMax() const { return ptmax_; }
00800         float getHltThreshold() const { return hltThreshold_; }
00801         float getL1Threshold() const { return l1Threshold_; }
00802 
00803         std::vector< std::pair<std::string,unsigned int> > filtersAndIndices;
00804 
00805 
00806       private:
00807 
00808         int pathIndex_;
00809         std::string denomPathName_;
00810         std::string pathName_;
00811         std::string l1pathName_;
00812         int l1ModuleIndex_;
00813         std::string filterName_;
00814         std::string processName_;
00815         int objectType_;
00816         
00817         // we don't own this data
00818         MonitorElement *NOn_, *onEtOn_, *onOneOverEtOn_, *onEtavsonPhiOn_;
00819         MonitorElement *NOff_, *offEtOff_, *offEtavsoffPhiOff_;
00820         MonitorElement *NL1_, *l1EtL1_, *l1Etavsl1PhiL1_;
00821         MonitorElement *NL1On_, *l1EtL1On_, *l1Etavsl1PhiL1On_;
00822         MonitorElement *NL1Off_, *offEtL1Off_, *offEtavsoffPhiL1Off_;
00823         MonitorElement *NOnOff_, *offEtOnOff_, *offEtavsoffPhiOnOff_;
00824         MonitorElement *NL1OnUM_, *l1EtL1OnUM_, *l1Etavsl1PhiL1OnUM_;
00825         MonitorElement *NL1OffUM_, *offEtL1OffUM_, *offEtavsoffPhiL1OffUM_;
00826         MonitorElement *NOnOffUM_, *offEtOnOffUM_, *offEtavsoffPhiOnOffUM_;
00827         MonitorElement *offDRL1Off_, *offDROnOff_, *l1DRL1On_;
00828         MonitorElement *filters_;
00829         
00830         float ptmin_, ptmax_;
00831         float hltThreshold_, l1Threshold_;
00832         
00833         const int index() { 
00834           return pathIndex_;
00835         }
00836         const int type() { 
00837           return objectType_;
00838         }
00839 
00840 
00841      };
00842      
00843 
00844    public:
00845 
00846      // simple collection - just 
00847      class PathInfoCollection: public std::vector<PathInfo> {
00848        public:
00849 
00850          PathInfoCollection(): std::vector<PathInfo>() 
00851         {};
00852          std::vector<PathInfo>::iterator find(std::string pathName) {
00853             return std::find(begin(), end(), pathName);
00854          }
00855       };
00856 
00857       PathInfoCollection hltPaths_;
00858 
00859       PathInfoCollection hltPathsDiagonal_;
00860 
00861 };
00862 
00863 
00864 
00865 
00866 
00867 #endif