Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-10 02:54:06

0001 #include "DQMOffline/Trigger/interface/HistoWrapper.h"
0002 
0003 HistoWrapper::HistoWrapper(const edm::ParameterSet& pset) {
0004   plotlevel = (PL)pset.getUntrackedParameter<int>("PlotLevel", int(kEverything));
0005   cAllHistograms = 0;
0006   cPlottedHistograms = 0;
0007 }
0008 
0009 HistoWrapper::~HistoWrapper() {
0010   std::string s_pl = "kEverything";
0011   if (plotlevel == 1)
0012     s_pl = "kVital";
0013   std::cout << "Plot level " << plotlevel << " " << s_pl << std::endl;
0014   std::cout << "Plotting " << cPlottedHistograms << " out of " << cAllHistograms << std::endl;
0015 }
0016 
0017 MonitorElement* HistoWrapper::book1D(DQMStore::IBooker& iBooker,
0018                                      TString const& name,
0019                                      TString const& title,
0020                                      int const nchX,
0021                                      double const lowX,
0022                                      double const highX,
0023                                      int level) {
0024   cAllHistograms++;
0025   if (level >= plotlevel) {
0026     cPlottedHistograms++;
0027     MonitorElement* me = iBooker.book1D(name, title, nchX, lowX, highX);
0028     return me;
0029   }
0030   return nullptr;
0031 }
0032 
0033 MonitorElement* HistoWrapper::book2D(DQMStore::IBooker& iBooker,
0034                                      TString const& name,
0035                                      TString const& title,
0036                                      int nchX,
0037                                      double lowX,
0038                                      double highX,
0039                                      int nchY,
0040                                      double lowY,
0041                                      double highY,
0042                                      int level) {
0043   cAllHistograms++;
0044   if (level >= plotlevel) {
0045     cPlottedHistograms++;
0046     MonitorElement* me = iBooker.book2D(name, title, nchX, lowX, highX, nchY, lowY, highY);
0047     return me;
0048   }
0049   return nullptr;
0050 }