CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DQM/L1TMonitor/interface/L1TRate.h

Go to the documentation of this file.
00001 #ifndef DQM_L1TMONITOR_L1TRATE_H
00002 #define DQM_L1TMONITOR_L1TRATE_H
00003 
00004 /*
00005  * \file L1TRate.h
00006  *
00007  * $Date: 2011/10/28 13:24:48 $
00008  * $Revision: 1.4 $
00009  * \author J. Pela
00010  *
00011 */
00012 
00013 // system include files
00014 #include <memory>
00015 #include <unistd.h>
00016 
00017 // user include files
00018 #include "FWCore/Framework/interface/Frameworkfwd.h"
00019 #include "FWCore/Framework/interface/EDAnalyzer.h"
00020 #include "FWCore/Framework/interface/ESHandle.h"
00021 #include "FWCore/Framework/interface/Event.h"
00022 #include "FWCore/Framework/interface/LuminosityBlock.h"
00023 #include "FWCore/Framework/interface/MakerMacros.h"
00024 
00025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00026 
00027 #include "DQMServices/Core/interface/DQMStore.h"
00028 #include "DQMServices/Core/interface/MonitorElement.h"
00029 #include "FWCore/ServiceRegistry/interface/Service.h"
00030 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00031 
00032 #include <TString.h>
00033 
00034 #include <iostream>
00035 #include <fstream>
00036 #include <vector>
00037 
00038 //
00039 // class declaration
00040 //
00041 
00042 class L1TRate : public edm::EDAnalyzer {
00043 
00044   public:
00045 
00046     L1TRate(const edm::ParameterSet& ps);   // Constructor
00047     virtual ~L1TRate();                     // Destructor
00048 
00049   protected:
00050 
00051     void analyze (const edm::Event& e, const edm::EventSetup& c);      // Analyze
00052     void beginJob();                                                   // BeginJob
00053     void endJob  ();                                                   // EndJob
00054     void beginRun(const edm::Run& run, const edm::EventSetup& iSetup);
00055     void endRun  (const edm::Run& run, const edm::EventSetup& iSetup);
00056 
00057     virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
00058     virtual void endLuminosityBlock  (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
00059 
00060   // Private methods
00061   private:
00062 
00063     bool getXSexFitsOMDS  (const edm::ParameterSet& ps); 
00064     bool getXSexFitsPython(const edm::ParameterSet& ps);
00065 
00066   // Private variables
00067   private:
00068 
00069     // bool
00070     bool  m_verbose;
00071     
00072     // int
00073     int  m_refPrescaleSet; // What is the reference prescale index to use for trigger choice
00074     int  m_maxNbins;       // Maximum number of bins for MonitorElement
00075     int  m_lsShiftGTRates; // What shift (if any) to be applied to GT Rates LS number
00076 
00077     // string
00078     std::string  m_outputFile; // External output file name (for testiting)
00079     
00080     // Vectors
00081     const std::vector< std::vector<int> >* m_listsPrescaleFactors; // Collection os all sets of prescales
00082 
00083     // Maps
00084     std::map<int,int>                       m_lsPrescaleIndex;        // Map of precale index for each LS
00085     std::map<int,double>                    m_lsLuminosity;           // Map of luminosity recorded for each LS
00086     std::map<int,std::map<TString,double> > m_lsRates;                // Map of rates (by bit) recorded for each LS
00087     std::map<TString,int>                   m_algoBit;                // Map of bit associated with a L1 Algo alias
00088     std::map<std::string,bool>              m_inputCategories;        // Map of categories to monitor
00089     std::map<std::string,std::string>       m_selectedTriggers;       // Map of what trigger to monitor for each category
00090     std::map<TString,MonitorElement*>       m_xSecObservedToExpected; // Monitor Elements for Observed to Expected Algo XSec 
00091     std::map<TString,MonitorElement*>       m_xSecVsInstLumi;         // Monitor Elements for Algo XSec vs Instant Luminosity
00092     std::map<TString,TF1*>                  m_templateFunctions;      // For each trigger template f(InstLumi)=XSec
00093 
00094     // Input tags
00095     edm::InputTag m_scalersSource;       // Where to get L1 Scalers
00096     edm::InputTag m_l1GtDataDaqInputTag; // Where to get L1 GT Data DAQ
00097 
00098     // ParameterSet
00099     edm::ParameterSet m_parameters;
00100     
00101     // MonitorElement
00102     MonitorElement* m_ErrorMonitor;
00103     
00104     // Others
00105     DQMStore* dbe;  // The DQM Service Handle
00106 
00107 };
00108 
00109 #endif