Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:36:04

0001 #ifndef DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYHARVESTING_H
0002 #define DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYHARVESTING_H
0003 
0004 /**
0005  * \file L1TEfficiencyHarvesting.h
0006  *
0007  * \author J. Pela, C. Battilana
0008  *
0009  */
0010 
0011 // system include files
0012 #include <memory>
0013 #include <unistd.h>
0014 
0015 // user include files
0016 #include "FWCore/Framework/interface/Frameworkfwd.h"
0017 #include "FWCore/Framework/interface/ESHandle.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "FWCore/Framework/interface/LuminosityBlock.h"
0020 
0021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0022 
0023 #include "DQMServices/Core/interface/DQMStore.h"
0024 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0025 
0026 #include <vector>
0027 
0028 namespace dqmoffline {
0029   namespace l1t {
0030 
0031     //
0032     // Efficiency helper class declaration
0033     //
0034 
0035     class L1TEfficiencyPlotHandler {
0036     public:
0037       typedef dqm::legacy::DQMStore DQMStore;
0038       typedef dqm::legacy::MonitorElement MonitorElement;
0039 
0040       L1TEfficiencyPlotHandler(const edm::ParameterSet &ps, std::string plotName);
0041 
0042       L1TEfficiencyPlotHandler(const L1TEfficiencyPlotHandler &handler);
0043 
0044       ~L1TEfficiencyPlotHandler() {}
0045 
0046       // book efficiency histo
0047       void book(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter);
0048 
0049       // compute efficiency
0050       void computeEfficiency(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter);
0051 
0052     private:
0053       std::string numeratorDir_;
0054       std::string denominatorDir_;
0055       std::string outputDir_;
0056       std::string plotName_;
0057       std::string numeratorSuffix_;
0058       std::string denominatorSuffix_;
0059 
0060       MonitorElement *h_efficiency_;
0061     };
0062 
0063     typedef std::vector<L1TEfficiencyPlotHandler> L1TEfficiencyPlotHandlerCollection;
0064 
0065     //
0066     // DQM class declaration
0067     //
0068 
0069     class L1TEfficiencyHarvesting : public DQMEDHarvester {
0070     public:
0071       L1TEfficiencyHarvesting(const edm::ParameterSet &ps);  // Constructor
0072       ~L1TEfficiencyHarvesting() override;                   // Destructor
0073 
0074     protected:
0075       void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override;
0076 
0077     private:
0078       bool verbose_;
0079 
0080       L1TEfficiencyPlotHandlerCollection plotHandlers_;
0081     };
0082 
0083   }  // namespace l1t
0084 }  // namespace dqmoffline
0085 
0086 #endif