L1TDiffHarvesting

L1TDiffPlotHandler

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
#ifndef DQMOFFLINE_L1TRIGGER_L1TDIFFHARVESTING_H
#define DQMOFFLINE_L1TRIGGER_L1TDIFFHARVESTING_H

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include "DQMServices/Core/interface/DQMStore.h"

#include <string>
#include <vector>

namespace dqmoffline {
  namespace l1t {

    class L1TDiffHarvesting : public DQMEDHarvester {
    public:
      L1TDiffHarvesting(const edm::ParameterSet &ps);
      ~L1TDiffHarvesting() override;

    protected:
      void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override;

    private:
      class L1TDiffPlotHandler {
      public:
        L1TDiffPlotHandler(const edm::ParameterSet &ps, std::string plotName);
        L1TDiffPlotHandler(const L1TDiffPlotHandler &handler);  // needed for vector collection

        void computeDiff(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter);

        std::string dir1_;
        std::string dir2_;
        std::string outputDir_;
        std::string plotName_;

        MonitorElement *h1_;
        MonitorElement *h2_;
        MonitorElement *h_diff_;
        MonitorElement::Kind histType1_, histType2_;

        void loadHistograms(DQMStore::IGetter &igetter);
        bool isValid() const;
        void bookDiff(DQMStore::IBooker &ibooker);
      };

      typedef std::vector<L1TDiffPlotHandler> L1TDiffPlotHandlers;

      L1TDiffPlotHandlers plotHandlers_;
    };

  }  // namespace l1t
}  // namespace dqmoffline

#endif