HLTMuonMatchAndPlotContainer

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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
#ifndef DQMOffline_Trigger_HLTMuonMatchAndPlotContainer_H
#define DQMOffline_Trigger_HLTMuonMatchAndPlotContainer_H

/** \class HLTMuonMatchAndPlot
 *  Contanier class to handle vector of reconstructed muons matched to 
 *  HLT objects used to plot efficiencies.
 *
 *  Note that this is not a true EDAnalyzer; rather, the intent is that one
 *  EDAnalyzer would call an instance  of HLTMuonMatchAndPlotContainer
 *
 *  Documentation available on the CMS TWiki:
 *  https://twiki.cern.ch/twiki/bin/view/CMS/MuonHLTOfflinePerformance
 *
 *  
 *  \author  C. Battilana
 */

// Base Class Headers

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"

#include "DQMOffline/Trigger/interface/HLTMuonMatchAndPlot.h"

#include "DataFormats/HLTReco/interface/TriggerEvent.h"
#include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
#include "DataFormats/Common/interface/TriggerResults.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include "DataFormats/BeamSpot/interface/BeamSpot.h"
#include "DataFormats/Math/interface/deltaR.h"

#include <vector>
#include <string>

//////////////////////////////////////////////////////////////////////////////
///Container Class Definition (this is what is used by the DQM module) ///////

class HLTMuonMatchAndPlotContainer {
public:
  typedef dqm::legacy::DQMStore DQMStore;
  typedef dqm::legacy::MonitorElement MonitorElement;

  /// Constructor
  HLTMuonMatchAndPlotContainer(edm::ConsumesCollector &&, const edm::ParameterSet &);

  /// Destructor
  ~HLTMuonMatchAndPlotContainer() { plotters_.clear(); };

  /// Add a HLTMuonMatchAndPlot for a given path
  void addPlotter(const edm::ParameterSet &, std::string, std::string, bool);

  // Analyzer Methods
  void beginRun(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &);
  void analyze(const edm::Event &, const edm::EventSetup &);
  void endRun(const edm::Run &, const edm::EventSetup &);

private:
  std::vector<HLTMuonMatchAndPlot> plotters_;

  edm::EDGetTokenT<reco::BeamSpot> bsToken_;
  edm::EDGetTokenT<reco::MuonCollection> muonToken_;
  edm::EDGetTokenT<reco::VertexCollection> pvToken_;

  edm::EDGetTokenT<trigger::TriggerEvent> trigSummaryToken_;
  edm::EDGetTokenT<edm::TriggerResults> trigResultsToken_;
};

#endif