HLTMuonRateAnalyzerWithWeight

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 74 75 76 77
#ifndef HLTrigger_Muon_Test_HLTMuonRateAnalyzerWithWeight_H
#define HLTrigger_Muon_Test_HLTMuonRateAnalyzerWithWeight_H

/** \class HLTMuonRateAnalyzerWithWeight
 *  Get L1/HLT efficiency/rate plots
 *
 *  \author J. Alcaraz
 */

// Base Class Headers
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
#include "DataFormats/HLTReco/interface/TriggerRefsCollections.h"

#include <vector>

class TFile;
class TH1F;

class HLTMuonRateAnalyzerWithWeight : public edm::one::EDAnalyzer<> {
public:
  /// Constructor
  HLTMuonRateAnalyzerWithWeight(const edm::ParameterSet& pset);

  /// Destructor
  virtual ~HLTMuonRateAnalyzerWithWeight();

  // Operations

  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup);

  virtual void beginJob();
  virtual void endJob();
  virtual bool isbc(HepMC::GenEvent const& evt);
  virtual double parentWeight(HepMC::GenEvent const& evt);

private:
  // Input from cfg file
  edm::InputTag theGenLabel;
  edm::InputTag theL1CollectionLabel;
  std::vector<edm::InputTag> theHLTCollectionLabels;
  edm::EDGetTokenT<edm::HepMCProduct> theGenToken;
  edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> theL1CollectionToken;
  std::vector<edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> > theHLTCollectionTokens;
  double theL1ReferenceThreshold;
  std::vector<double> theNSigmas;
  unsigned int theNumberOfObjects;
  double theLuminosity;
  double thePtMin;
  double thePtMax;
  double theIntegratedLumi;
  int type;
  unsigned int theNbins;
  std::string theRootFileName;

  // The output Root file
  TFile* theFile;

  // Histograms
  TH1F* hBCL1eff;
  TH1F* hNumEvents;
  TH1F* hBCL1rate;
  std::vector<TH1F*> hBCHLTeff;
  std::vector<TH1F*> hBCHLTrate;
  TH1F* hLightL1eff;
  TH1F* hLightL1rate;
  std::vector<TH1F*> hLightHLTeff;
  std::vector<TH1F*> hLightHLTrate;

  // Counter of events (weighted in general)
  double theNumberOfLightEvents;
  double theNumberOfBCEvents;
};
#endif