CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/DQMOffline/EGamma/interface/ElectronDqmAnalyzerBase.h

Go to the documentation of this file.
00001 
00002 #ifndef ElectronDqmAnalyzerBase_h
00003 #define ElectronDqmAnalyzerBase_h
00004 
00005 class DQMStore ;
00006 class MonitorElement ;
00007 
00008 #include "FWCore/Framework/interface/EDAnalyzer.h"
00009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00010 #include <Rtypes.h>
00011 #include <string>
00012 #include <vector>
00013 
00014 class ElectronDqmAnalyzerBase : public edm::EDAnalyzer
00015  {
00016 
00017   protected:
00018 
00019     explicit ElectronDqmAnalyzerBase( const edm::ParameterSet & conf ) ;
00020     virtual ~ElectronDqmAnalyzerBase() ;
00021 
00022     // specific implementation of EDAnalyzer
00023     void beginJob() ; // prepare DQM, open input field if declared, and call book() below
00024     virtual void endRun( edm::Run const &, edm::EventSetup const & ) ; // call finialize() if finalStep==AtRunEnd
00025     virtual void endLuminosityBlock( edm::LuminosityBlock const &, edm::EventSetup const & ) ; // call  finalize() if finalStep==AtLumiEnd
00026     virtual void endJob() ; // call finalize() if if finalStep==AtJobEnd
00027 
00028     // interface to implement in derived classes
00029     virtual void book() {}
00030     virtual void analyze( const edm::Event & e, const edm::EventSetup & c ) {}
00031     virtual void finalize() {}
00032 
00033     // utility methods
00034     bool finalStepDone() { return finalDone_ ; }
00035     int verbosity() { return verbosity_ ; }
00036     MonitorElement * get( const std::string & name ) ;
00037     void remove( const std::string & name ) ;
00038     void remove_other_dirs() ;
00039 
00040     void setBookPrefix( const std::string & ) ;
00041     void setBookIndex( short ) ;
00042 
00043     MonitorElement * bookH1
00044      ( const std::string & name, const std::string & title,
00045        int nchX, double lowX, double highX,
00046        const std::string & titleX ="", const std::string & titleY ="Events",
00047        Option_t * option = "E1 P" ) ;
00048 
00049     MonitorElement * bookH1withSumw2
00050      ( const std::string & name, const std::string & title,
00051        int nchX, double lowX, double highX,
00052        const std::string & titleX ="", const std::string & titleY ="Events",
00053        Option_t * option = "E1 P"  ) ;
00054 
00055     MonitorElement * bookH2
00056      ( const std::string & name, const std::string & title,
00057        int nchX, double lowX, double highX,
00058        int nchY, double lowY, double highY,
00059        const std::string & titleX ="", const std::string & titleY ="",
00060        Option_t * option = "COLZ"  ) ;
00061 
00062     MonitorElement * bookH2withSumw2
00063      ( const std::string & name, const std::string & title,
00064        int nchX, double lowX, double highX,
00065        int nchY, double lowY, double highY,
00066        const std::string & titleX ="", const std::string & titleY ="",
00067        Option_t * option = "COLZ"  ) ;
00068 
00069     MonitorElement * bookP1
00070      ( const std::string & name, const std::string & title,
00071        int nchX, double lowX, double highX,
00072                  double lowY, double highY,
00073        const std::string & titleX ="", const std::string & titleY ="",
00074        Option_t * option = "E1 P"  ) ;
00075 
00076     MonitorElement * bookH1andDivide
00077      ( const std::string & name, MonitorElement * num, MonitorElement * denom,
00078        const std::string & titleX, const std::string & titleY,
00079        const std::string & title ="" ) ;
00080 
00081     MonitorElement * bookH2andDivide
00082      ( const std::string & name, MonitorElement * num, MonitorElement * denom,
00083        const std::string & titleX, const std::string & titleY,
00084        const std::string & title ="" ) ;
00085 
00086     MonitorElement * cloneH1
00087     ( const std::string & name, MonitorElement * original,
00088       const std::string & title ="" ) ;
00089 
00090     MonitorElement * profileX
00091      ( MonitorElement * me2d,
00092        const std::string & title ="", const std::string & titleX ="", const std::string & titleY ="",
00093        Double_t minimum = -1111, Double_t maximum = -1111 ) ;
00094 
00095     MonitorElement * profileY
00096      ( MonitorElement * me2d,
00097        const std::string & title ="", const std::string & titleX ="", const std::string & titleY ="",
00098        Double_t minimum = -1111, Double_t maximum = -1111 ) ;
00099 
00100     MonitorElement * bookH1andDivide
00101      ( const std::string & name, const std::string & num, const std::string & denom,
00102        const std::string & titleX, const std::string & titleY,
00103        const std::string & title ="" ) ;
00104 
00105     MonitorElement * bookH2andDivide
00106      ( const std::string & name, const std::string & num, const std::string & denom,
00107        const std::string & titleX, const std::string & titleY,
00108        const std::string & title ="" ) ;
00109 
00110     MonitorElement * cloneH1
00111      ( const std::string & name, const std::string & original,
00112        const std::string & title ="" ) ;
00113 
00114     MonitorElement * profileX
00115      ( const std::string & me2d,
00116        const std::string & title ="", const std::string & titleX ="", const std::string & titleY ="",
00117        Double_t minimum = -1111, Double_t maximum = -1111 ) ;
00118 
00119     MonitorElement * profileY
00120      ( const std::string & me2d,
00121        const std::string & title ="", const std::string & titleX ="", const std::string & titleY ="",
00122        Double_t minimum = -1111, Double_t maximum = -1111 ) ;
00123 
00124   private:
00125 
00126     int verbosity_ ;
00127     std::string bookPrefix_ ;
00128     short bookIndex_ ;
00129     bool histoNamesReady ;
00130     std::vector<std::string> histoNames_ ;
00131     std::string finalStep_ ;
00132     std::string inputFile_ ;
00133     std::string outputFile_ ;
00134     std::string inputInternalPath_ ;
00135     std::string outputInternalPath_ ;
00136     DQMStore * store_ ;
00137     bool finalDone_ ;
00138 
00139     // utility methods
00140     std::string newName( const std::string & name ) ;
00141     const std::string * find( const std::string & name ) ;
00142  } ;
00143 
00144 #endif
00145 
00146 
00147