Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:02

0001 #ifndef ScoutingAnalyzerBase_h
0002 #define ScoutingAnalyzerBase_h
0003 
0004 /* This class, as this whole package, was inspired by the EGamma monitoring
0005  * by David Chamont. The idea is to provide a base class for all the monitoring
0006  * modules implemented as plugins.
0007  * The methods of the base class will spare the developer the pain of allocating
0008  * all the ME, make projections and manipulations with extremely ugly copy&paste
0009  * code sections
0010  * */
0011 
0012 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0013 #include "DQMServices/Core/interface/DQMStore.h"
0014 #include "FWCore/Framework/interface/Event.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 
0017 #include <Rtypes.h>
0018 
0019 class ScoutingAnalyzerBase : public DQMEDAnalyzer {
0020 protected:
0021   explicit ScoutingAnalyzerBase(const edm::ParameterSet &conf);
0022   ~ScoutingAnalyzerBase() override;
0023   // virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &,
0024   // edm::EventSetup const &);
0025   void analyze(const edm::Event &e, const edm::EventSetup &c) override {}
0026 
0027   std::string newName(const std::string &name);
0028 
0029   void prepareBooking(DQMStore::IBooker &);
0030 
0031   // Members for ME booking
0032   MonitorElement *bookH1(DQMStore::IBooker &,
0033                          const std::string &name,
0034                          const std::string &title,
0035                          int nchX,
0036                          double lowX,
0037                          double highX,
0038                          const std::string &titleX = "",
0039                          const std::string &titleY = "Events",
0040                          Option_t *option = "E1 P");
0041 
0042   MonitorElement *bookH1withSumw2(DQMStore::IBooker &,
0043                                   const std::string &name,
0044                                   const std::string &title,
0045                                   int nchX,
0046                                   double lowX,
0047                                   double highX,
0048                                   const std::string &titleX = "",
0049                                   const std::string &titleY = "Events",
0050                                   Option_t *option = "E1 P");
0051 
0052   MonitorElement *bookH1BinArray(DQMStore::IBooker &,
0053                                  const std::string &name,
0054                                  const std::string &title,
0055                                  int nchX,
0056                                  float *xbinsize,
0057                                  const std::string &titleX = "",
0058                                  const std::string &titleY = "Events",
0059                                  Option_t *option = "E1 P");
0060 
0061   MonitorElement *bookH1withSumw2BinArray(DQMStore::IBooker &,
0062                                           const std::string &name,
0063                                           const std::string &title,
0064                                           int nchX,
0065                                           float *xbinsize,
0066                                           const std::string &titleX = "",
0067                                           const std::string &titleY = "Events",
0068                                           Option_t *option = "E1 P");
0069 
0070   MonitorElement *bookH2(DQMStore::IBooker &,
0071                          const std::string &name,
0072                          const std::string &title,
0073                          int nchX,
0074                          double lowX,
0075                          double highX,
0076                          int nchY,
0077                          double lowY,
0078                          double highY,
0079                          const std::string &titleX = "",
0080                          const std::string &titleY = "",
0081                          Option_t *option = "COLZ");
0082 
0083   MonitorElement *bookH2withSumw2(DQMStore::IBooker &,
0084                                   const std::string &name,
0085                                   const std::string &title,
0086                                   int nchX,
0087                                   double lowX,
0088                                   double highX,
0089                                   int nchY,
0090                                   double lowY,
0091                                   double highY,
0092                                   const std::string &titleX = "",
0093                                   const std::string &titleY = "",
0094                                   Option_t *option = "COLZ");
0095 
0096   MonitorElement *bookP1(DQMStore::IBooker &,
0097                          const std::string &name,
0098                          const std::string &title,
0099                          int nchX,
0100                          double lowX,
0101                          double highX,
0102                          double lowY,
0103                          double highY,
0104                          const std::string &titleX = "",
0105                          const std::string &titleY = "",
0106                          Option_t *option = "E1 P");
0107 
0108   MonitorElement *bookH1andDivide(DQMStore::IBooker &,
0109                                   const std::string &name,
0110                                   MonitorElement *num,
0111                                   MonitorElement *denom,
0112                                   const std::string &titleX,
0113                                   const std::string &titleY,
0114                                   const std::string &title = "");
0115 
0116   MonitorElement *bookH2andDivide(DQMStore::IBooker &,
0117                                   const std::string &name,
0118                                   MonitorElement *num,
0119                                   MonitorElement *denom,
0120                                   const std::string &titleX,
0121                                   const std::string &titleY,
0122                                   const std::string &title = "");
0123 
0124   MonitorElement *profileX(DQMStore::IBooker &,
0125                            MonitorElement *me2d,
0126                            const std::string &title = "",
0127                            const std::string &titleX = "",
0128                            const std::string &titleY = "",
0129                            Double_t minimum = -1111,
0130                            Double_t maximum = -1111);
0131 
0132   MonitorElement *profileY(DQMStore::IBooker &,
0133                            MonitorElement *me2d,
0134                            const std::string &title = "",
0135                            const std::string &titleX = "",
0136                            const std::string &titleY = "",
0137                            Double_t minimum = -1111,
0138                            Double_t maximum = -1111);
0139 
0140 private:
0141   std::string m_modulePath;
0142   std::string m_MEsPath;
0143   unsigned m_verbosityLevel;
0144 };
0145 
0146 #endif