Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:20

0001 
0002 #ifndef ElectronDqmHarvesterBase_h
0003 #define ElectronDqmHarvesterBase_h
0004 
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include <Rtypes.h>
0007 #include <string>
0008 #include <vector>
0009 
0010 //DQM
0011 #include "FWCore/ServiceRegistry/interface/Service.h"
0012 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0013 #include "DQMServices/Core/interface/DQMStore.h"
0014 
0015 class ElectronDqmHarvesterBase : public DQMEDHarvester {
0016 protected:
0017   explicit ElectronDqmHarvesterBase(const edm::ParameterSet &conf);
0018   ~ElectronDqmHarvesterBase() override;
0019 
0020   // specific implementation of EDAnalyzer
0021   void beginJob() override;  // prepare DQM, open input field if declared, and call book() below
0022   void dqmEndLuminosityBlock(DQMStore::IBooker &,
0023                              DQMStore::IGetter &,
0024                              edm::LuminosityBlock const &,
0025                              edm::EventSetup const &) override;       //performed in the endLumi
0026   void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override;  //performed in the endJob
0027 
0028   // interface to implement in derived classes
0029   virtual void finalize(DQMStore::IBooker &iBooker,
0030                         DQMStore::IGetter &iGetter){};  //  override ;, const edm::Event& e, const edm::EventSetup & c
0031 
0032   // utility methods
0033   bool finalStepDone() { return finalDone_; }
0034   int verbosity() { return verbosity_; }
0035   MonitorElement *get(DQMStore::IGetter &iGetter, const std::string &name);
0036   void remove(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &name);
0037 
0038   void setBookPrefix(const std::string &);
0039   void setBookIndex(short);
0040   void setBookEfficiencyFlag(const bool &);
0041   void setBookStatOverflowFlag(const bool &);
0042 
0043   MonitorElement *bookH1(DQMStore::IBooker &,
0044                          const std::string &name,
0045                          const std::string &title,
0046                          int nchX,
0047                          double lowX,
0048                          double highX,
0049                          const std::string &titleX = "",
0050                          const std::string &titleY = "Events",
0051                          Option_t *option = "E1 P");
0052 
0053   MonitorElement *bookH1withSumw2(DQMStore::IBooker &,
0054                                   const std::string &name,
0055                                   const std::string &title,
0056                                   int nchX,
0057                                   double lowX,
0058                                   double highX,
0059                                   const std::string &titleX = "",
0060                                   const std::string &titleY = "Events",
0061                                   Option_t *option = "E1 P");
0062 
0063   MonitorElement *bookH2(DQMStore::IBooker &,
0064                          const std::string &name,
0065                          const std::string &title,
0066                          int nchX,
0067                          double lowX,
0068                          double highX,
0069                          int nchY,
0070                          double lowY,
0071                          double highY,
0072                          const std::string &titleX = "",
0073                          const std::string &titleY = "",
0074                          Option_t *option = "COLZ");
0075 
0076   MonitorElement *bookH2withSumw2(DQMStore::IBooker &,
0077                                   const std::string &name,
0078                                   const std::string &title,
0079                                   int nchX,
0080                                   double lowX,
0081                                   double highX,
0082                                   int nchY,
0083                                   double lowY,
0084                                   double highY,
0085                                   const std::string &titleX = "",
0086                                   const std::string &titleY = "",
0087                                   Option_t *option = "COLZ");
0088 
0089   MonitorElement *bookP1(DQMStore::IBooker &,
0090                          const std::string &name,
0091                          const std::string &title,
0092                          int nchX,
0093                          double lowX,
0094                          double highX,
0095                          double lowY,
0096                          double highY,
0097                          const std::string &titleX = "",
0098                          const std::string &titleY = "",
0099                          Option_t *option = "E1 P");
0100 
0101   MonitorElement *bookH1andDivide(DQMStore::IBooker &iBooker,
0102                                   DQMStore::IGetter &,
0103                                   const std::string &name,
0104                                   MonitorElement *num,
0105                                   MonitorElement *denom,
0106                                   const std::string &titleX,
0107                                   const std::string &titleY,
0108                                   const std::string &title = "");
0109 
0110   MonitorElement *bookH2andDivide(DQMStore::IBooker &iBooker,
0111                                   DQMStore::IGetter &,
0112                                   const std::string &name,
0113                                   MonitorElement *num,
0114                                   MonitorElement *denom,
0115                                   const std::string &titleX,
0116                                   const std::string &titleY,
0117                                   const std::string &title = "");
0118 
0119   MonitorElement *cloneH1(DQMStore::IBooker &iBooker,
0120                           DQMStore::IGetter &,
0121                           const std::string &name,
0122                           MonitorElement *original,
0123                           const std::string &title = "");
0124 
0125   MonitorElement *profileX(DQMStore::IBooker &iBooker,
0126                            DQMStore::IGetter &iGetter,
0127                            MonitorElement *me2d,
0128                            const std::string &title = "",
0129                            const std::string &titleX = "",
0130                            const std::string &titleY = "",
0131                            Double_t minimum = -1111,
0132                            Double_t maximum = -1111);
0133 
0134   MonitorElement *profileY(DQMStore::IBooker &iBooker,
0135                            DQMStore::IGetter &iGetter,
0136                            MonitorElement *me2d,
0137                            const std::string &title = "",
0138                            const std::string &titleX = "",
0139                            const std::string &titleY = "",
0140                            Double_t minimum = -1111,
0141                            Double_t maximum = -1111);
0142 
0143   MonitorElement *bookH1andDivide(DQMStore::IBooker &iBooker,
0144                                   DQMStore::IGetter &iGetter,
0145                                   const std::string &name,
0146                                   const std::string &num,
0147                                   const std::string &denom,
0148                                   const std::string &titleX,
0149                                   const std::string &titleY,
0150                                   const std::string &title = "");
0151 
0152   MonitorElement *bookH2andDivide(DQMStore::IBooker &iBooker,
0153                                   DQMStore::IGetter &,
0154                                   const std::string &name,
0155                                   const std::string &num,
0156                                   const std::string &denom,
0157                                   const std::string &titleX,
0158                                   const std::string &titleY,
0159                                   const std::string &title = "");
0160 
0161   MonitorElement *cloneH1(DQMStore::IBooker &iBooker,
0162                           DQMStore::IGetter &,
0163                           const std::string &name,
0164                           const std::string &original,
0165                           const std::string &title = "");
0166 
0167   MonitorElement *profileX(DQMStore::IBooker &iBooker,
0168                            DQMStore::IGetter &iGetter,
0169                            const std::string &me2d,
0170                            const std::string &title = "",
0171                            const std::string &titleX = "",
0172                            const std::string &titleY = "",
0173                            Double_t minimum = -1111,
0174                            Double_t maximum = -1111);
0175 
0176   MonitorElement *profileY(DQMStore::IBooker &iBooker,
0177                            DQMStore::IGetter &iGetter,
0178                            const std::string &me2d,
0179                            const std::string &title = "",
0180                            const std::string &titleX = "",
0181                            const std::string &titleY = "",
0182                            Double_t minimum = -1111,
0183                            Double_t maximum = -1111);
0184 
0185 private:
0186   int verbosity_;
0187   std::string bookPrefix_;
0188   short bookIndex_;
0189   bool bookEfficiencyFlag_ = false;
0190   bool bookStatOverflowFlag_ = false;
0191   bool histoNamesReady;
0192   std::vector<std::string> histoNames_;
0193   std::string finalStep_;
0194   std::string inputFile_;
0195   std::string outputFile_;
0196   std::string inputInternalPath_;
0197   std::string outputInternalPath_;
0198   bool finalDone_;
0199 
0200   // utility methods
0201   std::string newName(const std::string &name);
0202   const std::string *find(DQMStore::IGetter &iGetter, const std::string &name);
0203 };
0204 
0205 #endif