Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:47

0001 #ifndef BTagPerformanceAnalyzerOnData_H
0002 #define BTagPerformanceAnalyzerOnData_H
0003 
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0006 #include "DataFormats/JetReco/interface/Jet.h"
0007 #include "DQMOffline/RecoB/interface/AcceptJet.h"
0008 #include "DQMOffline/RecoB/interface/JetTagPlotter.h"
0009 #include "DQMOffline/RecoB/interface/TagCorrelationPlotter.h"
0010 #include "DQMOffline/RecoB/interface/BaseTagInfoPlotter.h"
0011 #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
0012 #include "JetMETCorrections/JetCorrector/interface/JetCorrector.h"
0013 
0014 /** \class BTagPerformanceAnalyzerOnData
0015  *
0016  *  Top level steering routine for b tag performance analysis.
0017  *
0018  */
0019 
0020 class BTagPerformanceAnalyzerOnData : public DQMEDAnalyzer {
0021 public:
0022   explicit BTagPerformanceAnalyzerOnData(const edm::ParameterSet& pSet);
0023 
0024   ~BTagPerformanceAnalyzerOnData() override;
0025 
0026   void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0027 
0028 private:
0029   inline bool jetRefCompare(const edm::RefToBase<reco::Jet>& j1, const edm::RefToBase<reco::Jet>& j2) {
0030     return j1.id() < j2.id() || (j1.id() == j2.id() && j1.key() < j2.key());
0031   }
0032 
0033   // Get histogram plotting options from configuration.
0034   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0035 
0036   EtaPtBin getEtaPtBin(const int& iEta, const int& iPt);
0037 
0038   std::vector<std::string> tiDataFormatType;
0039   AcceptJet jetSelector;  // Decides if jet and parton satisfy kinematic cuts.
0040   std::vector<double> etaRanges, ptRanges;
0041   bool doJEC;
0042   edm::InputTag slInfoTag;
0043 
0044   std::vector<std::vector<std::unique_ptr<JetTagPlotter>>> binJetTagPlotters;
0045   std::vector<std::vector<std::unique_ptr<TagCorrelationPlotter>>> binTagCorrelationPlotters;
0046   std::vector<std::vector<std::unique_ptr<BaseTagInfoPlotter>>> binTagInfoPlotters;
0047   std::vector<edm::InputTag> jetTagInputTags;
0048   std::vector<std::pair<edm::InputTag, edm::InputTag>> tagCorrelationInputTags;
0049   std::vector<std::vector<edm::InputTag>> tagInfoInputTags;
0050   // Contains plots for each bin of rapidity and pt.
0051   std::vector<edm::ParameterSet> moduleConfig;
0052 
0053   //add consumes
0054   edm::EDGetTokenT<reco::JetCorrector> jecMCToken;
0055   edm::EDGetTokenT<reco::JetCorrector> jecDataToken;
0056   edm::EDGetTokenT<GenEventInfoProduct> genToken;
0057   edm::EDGetTokenT<reco::SoftLeptonTagInfoCollection> slInfoToken;
0058   std::vector<edm::EDGetTokenT<reco::JetTagCollection>> jetTagToken;
0059   std::vector<std::pair<edm::EDGetTokenT<reco::JetTagCollection>, edm::EDGetTokenT<reco::JetTagCollection>>>
0060       tagCorrelationToken;
0061   std::vector<std::vector<edm::EDGetTokenT<edm::View<reco::BaseTagInfo>>>> tagInfoToken;
0062 };
0063 
0064 #endif