-
Notifications
You must be signed in to change notification settings - Fork 4.6k
BTV OfflineDQM preparations for Run 3 #35985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8a4c9c8
add Tagger Analyzer/Harvester for DQM@MiniAOD
3aea6b7
add DeepFlavour tagger to Offline DQM
1b3b533
add Eta regions for DeepFlavour DQM
0365c0b
add jet parton flavour
533e06a
switch to hadron flavour
280040f
add MC switch to BTV DQM@MiniAOD
0e53310
update DeepCSV WPs in Offline DQM
f686f58
rework BTV DQM@MiniAOD workflow
e57ad02
renaming BTV DQM@MiniAOD sequences
826273d
minor changes
cf6d945
Revert "switch to hadron flavour"
6dfddb9
apply code-checks and code-format
b88fb50
fill JetMultiplicity in bTag DQM@MiniAOD
e6a81d9
prepare bTag Validation@MiniAOD sequences
6eca77f
add bTag Validation@MiniAOD sequences
87b4db8
Merge pull request #5 from cms-sw/master
marco-link 198558a
Merge branch 'cms-sw:master' into BTV
marco-link e3cd8d7
move DeepCSV OfflineDQM to MiniAOD
4d6881d
fix invalid discriminator values in BTV DQM@MiniAOD
e6c4ea3
remove DeepCSVDiscriminator sequence from OfflineDQM
8eab003
fix jet multiplicity in BTV OfflineDQM
a0b411a
Merge branch 'cms-sw:master' into BTV
marco-link db43d9e
apply code review comments
696c60c
minor changes from code review
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| #include "DQMOffline/RecoB/plugins/MiniAODTaggerAnalyzer.h" | ||
| #include "FWCore/Framework/interface/MakerMacros.h" | ||
| #include "FWCore/Framework/interface/Event.h" | ||
|
|
||
| MiniAODTaggerAnalyzer::MiniAODTaggerAnalyzer(const edm::ParameterSet& pSet) | ||
| : jetToken_(consumes<std::vector<pat::Jet> >(pSet.getParameter<edm::InputTag>("JetTag"))), | ||
| discrParameters_(pSet.getParameter<edm::ParameterSet>("parameters")), | ||
|
|
||
| folder_(pSet.getParameter<std::string>("folder")), | ||
| discrNumerator_(pSet.getParameter<vstring>("numerator")), | ||
| discrDenominator_(pSet.getParameter<vstring>("denominator")), | ||
|
|
||
| mclevel_(pSet.getParameter<int>("MClevel")), | ||
| doCTagPlots_(pSet.getParameter<bool>("CTagPlots")), | ||
| dodifferentialPlots_(pSet.getParameter<bool>("differentialPlots")), | ||
| discrCut_(pSet.getParameter<double>("discrCut")), | ||
|
|
||
| etaActive_(pSet.getParameter<bool>("etaActive")), | ||
| etaMin_(pSet.getParameter<double>("etaMin")), | ||
| etaMax_(pSet.getParameter<double>("etaMax")), | ||
| ptActive_(pSet.getParameter<bool>("ptActive")), | ||
| ptMin_(pSet.getParameter<double>("ptMin")), | ||
| ptMax_(pSet.getParameter<double>("ptMax")) | ||
|
|
||
| {} | ||
|
|
||
| MiniAODTaggerAnalyzer::~MiniAODTaggerAnalyzer() {} | ||
|
|
||
| void MiniAODTaggerAnalyzer::bookHistograms(DQMStore::IBooker& ibook, edm::Run const& run, edm::EventSetup const& es) { | ||
| jetTagPlotter_ = std::make_unique<JetTagPlotter>(folder_, | ||
| EtaPtBin(etaActive_, etaMin_, etaMax_, ptActive_, ptMin_, ptMax_), | ||
| discrParameters_, | ||
| mclevel_, | ||
| false, | ||
| ibook, | ||
| doCTagPlots_, | ||
| dodifferentialPlots_, | ||
| discrCut_); | ||
| } | ||
|
|
||
| void MiniAODTaggerAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { | ||
| edm::Handle<std::vector<pat::Jet> > jetCollection; | ||
| iEvent.getByToken(jetToken_, jetCollection); | ||
|
|
||
| // Loop over the pat::Jets | ||
| for (std::vector<pat::Jet>::const_iterator jet = jetCollection->begin(); jet != jetCollection->end(); ++jet) { | ||
| // fill numerator | ||
| float numerator = 0; | ||
| for (const auto& discrLabel : discrNumerator_) { | ||
| numerator += jet->bDiscriminator(discrLabel); | ||
| } | ||
|
|
||
| // fill denominator | ||
| float denominator; | ||
| if (discrDenominator_.empty()) { | ||
| denominator = 1; // no division performed | ||
| } else { | ||
| denominator = 0; | ||
|
|
||
| for (const auto& discrLabel : discrDenominator_) { | ||
| denominator += jet->bDiscriminator(discrLabel); | ||
| } | ||
| } | ||
|
|
||
| const float jec = 1.; // JEC not implemented! | ||
|
|
||
| // only add to histograms when discriminator values are valid | ||
| if (numerator >= 0 && denominator > 0) { | ||
| reco::Jet recoJet = *jet; | ||
| if (jetTagPlotter_->etaPtBin().inBin(recoJet, jec)) { | ||
| jetTagPlotter_->analyzeTag(recoJet, jec, numerator / denominator, jet->partonFlavour()); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // fill JetMultiplicity | ||
| if (mclevel_ > 0) { | ||
| jetTagPlotter_->analyzeTag(1.); | ||
| } else { | ||
| jetTagPlotter_->analyzeTag(); | ||
| } | ||
| } | ||
|
|
||
| //define this as a plug-in | ||
| DEFINE_FWK_MODULE(MiniAODTaggerAnalyzer); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #ifndef MiniAODTaggerAnalyzer_H | ||
| #define MiniAODTaggerAnalyzer_H | ||
|
|
||
| #include "FWCore/Framework/interface/Frameworkfwd.h" | ||
| #include "DQMServices/Core/interface/DQMEDAnalyzer.h" | ||
| #include "DataFormats/PatCandidates/interface/Jet.h" | ||
| #include "DQMOffline/RecoB/interface/JetTagPlotter.h" | ||
|
|
||
| /** \class MiniAODTaggerAnalyzer | ||
| * | ||
| * Tagger analyzer to run on MiniAOD | ||
| * | ||
| */ | ||
|
|
||
| class MiniAODTaggerAnalyzer : public DQMEDAnalyzer { | ||
| public: | ||
| explicit MiniAODTaggerAnalyzer(const edm::ParameterSet& pSet); | ||
| ~MiniAODTaggerAnalyzer() override; | ||
|
|
||
| void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; | ||
|
|
||
| private: | ||
| void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override; | ||
| typedef std::vector<std::string> vstring; | ||
|
|
||
| // using JetTagPlotter object for all the hard work ;) | ||
| std::unique_ptr<JetTagPlotter> jetTagPlotter_; | ||
|
|
||
| const edm::EDGetTokenT<std::vector<pat::Jet> > jetToken_; | ||
| const edm::ParameterSet discrParameters_; | ||
|
|
||
| const std::string folder_; | ||
| const vstring discrNumerator_; | ||
| const vstring discrDenominator_; | ||
|
|
||
| const int mclevel_; | ||
| const bool doCTagPlots_; | ||
| const bool dodifferentialPlots_; | ||
| const double discrCut_; | ||
|
|
||
| const bool etaActive_; | ||
| const double etaMin_; | ||
| const double etaMax_; | ||
| const bool ptActive_; | ||
| const double ptMin_; | ||
| const double ptMax_; | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #include "DQMOffline/RecoB/plugins/MiniAODTaggerHarvester.h" | ||
| #include "FWCore/Framework/interface/MakerMacros.h" | ||
| #include "FWCore/Framework/interface/Event.h" | ||
|
|
||
| MiniAODTaggerHarvester::MiniAODTaggerHarvester(const edm::ParameterSet& pSet) | ||
| : folder_(pSet.getParameter<std::string>("folder")), | ||
| discrParameters_(pSet.getParameter<edm::ParameterSet>("parameters")), | ||
|
|
||
| mclevel_(pSet.getParameter<int>("MClevel")), | ||
| doCTagPlots_(pSet.getParameter<bool>("CTagPlots")), | ||
| dodifferentialPlots_(pSet.getParameter<bool>("differentialPlots")), | ||
| discrCut_(pSet.getParameter<double>("discrCut")), | ||
|
|
||
| etaActive_(pSet.getParameter<bool>("etaActive")), | ||
| etaMin_(pSet.getParameter<double>("etaMin")), | ||
| etaMax_(pSet.getParameter<double>("etaMax")), | ||
| ptActive_(pSet.getParameter<bool>("ptActive")), | ||
| ptMin_(pSet.getParameter<double>("ptMin")), | ||
| ptMax_(pSet.getParameter<double>("ptMax")) | ||
|
|
||
| {} | ||
|
|
||
| MiniAODTaggerHarvester::~MiniAODTaggerHarvester() {} | ||
|
|
||
| void MiniAODTaggerHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGetter& iget) { | ||
| jetTagPlotter_ = std::make_unique<JetTagPlotter>(folder_, | ||
| EtaPtBin(etaActive_, etaMin_, etaMax_, ptActive_, ptMin_, ptMax_), | ||
| discrParameters_, | ||
| mclevel_, | ||
| true, | ||
| ibook, | ||
| doCTagPlots_, | ||
| dodifferentialPlots_, | ||
| discrCut_); | ||
|
|
||
| jetTagPlotter_->finalize(ibook, iget); | ||
| } | ||
|
|
||
| //define this as a plug-in | ||
| DEFINE_FWK_MODULE(MiniAODTaggerHarvester); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #ifndef MiniAODTaggerHarvester_H | ||
| #define MiniAODTaggerHarvester_H | ||
|
|
||
| #include "FWCore/Framework/interface/Frameworkfwd.h" | ||
| #include "DQMServices/Core/interface/DQMEDHarvester.h" | ||
| #include "DQMOffline/RecoB/interface/JetTagPlotter.h" | ||
|
|
||
| /** \class MiniAODTaggerHarvester | ||
| * | ||
| * Tagger harvester to run on MiniAOD | ||
| * | ||
| */ | ||
|
|
||
| class MiniAODTaggerHarvester : public DQMEDHarvester { | ||
| public: | ||
| explicit MiniAODTaggerHarvester(const edm::ParameterSet& pSet); | ||
| ~MiniAODTaggerHarvester() override; | ||
|
|
||
| private: | ||
| void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override; | ||
|
|
||
| std::unique_ptr<JetTagPlotter> jetTagPlotter_; | ||
|
|
||
| const std::string folder_; | ||
| const edm::ParameterSet discrParameters_; | ||
|
|
||
| const int mclevel_; | ||
| const bool doCTagPlots_; | ||
| const bool dodifferentialPlots_; | ||
| const double discrCut_; | ||
|
|
||
| const bool etaActive_; | ||
| const double etaMin_; | ||
| const double etaMax_; | ||
| const bool ptActive_; | ||
| const double ptMin_; | ||
| const double ptMax_; | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| from DQMOffline.RecoB.bTagGenericAnalysis_cff import bTagGenericAnalysisBlock | ||
| from DQMOffline.RecoB.cTagGenericAnalysis_cff import cTagGenericAnalysisBlock | ||
|
|
||
|
|
||
| # recommendation for UL18: https://twiki.cern.ch/twiki/bin/view/CMS/BtagRecommendation106XUL18 | ||
| deepCSVWP = { | ||
| 'BvsAll': 0.1208, # loose | ||
| 'CvsL': 0.153, # medium | ||
| 'CvsB': 0.363, # medium | ||
| } | ||
|
|
||
|
|
||
| DeepCSVDiscriminators = { | ||
| 'BvsAll': cms.PSet( | ||
| bTagGenericAnalysisBlock, | ||
|
|
||
| folder = cms.string('DeepCSV_BvsAll'), | ||
| CTagPlots = cms.bool(False), | ||
| discrCut = cms.double(deepCSVWP['BvsAll']), | ||
| numerator = cms.vstring( | ||
| 'pfDeepCSVJetTags:probb', | ||
| 'pfDeepCSVJetTags:probbb', | ||
| ), | ||
| denominator = cms.vstring(), | ||
| ), | ||
|
|
||
| 'CvsL': cms.PSet( | ||
| cTagGenericAnalysisBlock, | ||
|
|
||
| folder = cms.string('DeepCSV_CvsL'), | ||
| CTagPlots = cms.bool(True), | ||
| discrCut = cms.double(deepCSVWP['CvsL']), | ||
| numerator = cms.vstring('pfDeepCSVJetTags:probc'), | ||
| denominator = cms.vstring( | ||
| 'pfDeepCSVJetTags:probc', | ||
| 'pfDeepCSVJetTags:probudsg', | ||
| ), | ||
| ), | ||
|
|
||
| 'CvsB': cms.PSet( | ||
| cTagGenericAnalysisBlock, | ||
|
|
||
| folder = cms.string('DeepCSV_CvsB'), | ||
| CTagPlots = cms.bool(True), | ||
| discrCut = cms.double(deepCSVWP['CvsB']), | ||
| numerator = cms.vstring('pfDeepCSVJetTags:probc'), | ||
| denominator = cms.vstring( | ||
| 'pfDeepCSVJetTags:probc', | ||
| 'pfDeepCSVJetTags:probb', | ||
| 'pfDeepCSVJetTags:probbb', | ||
| ), | ||
| ), | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.