-
Notifications
You must be signed in to change notification settings - Fork 2
Adding GenJets to LST input #214
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
base: master
Are you sure you want to change the base?
Conversation
slava77
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I mentioned during the meeting, it would help to fill the closest jet dr per sim_ (and per trk_ ) in this PR rather than to rely on the post-processing script
| #include "DataFormats/HepMCCandidate/interface/GenParticle.h" | ||
| #include "DataFormats/JetReco/interface/GenJet.h" | ||
| #include "DataFormats/JetReco/interface/GenJetCollection.h" | ||
| #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alpha-order
| std::vector<uint16_t> ph2_clustSize; | ||
| std::vector<size_t> ph2_clustSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this reverts a recent change from @alexandertuna ; please undo
| std::vector<float> genJetPt; | ||
| std::vector<float> genJetEta; | ||
| std::vector<float> genJetPhi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep the same naming style as other branches genjet_pt,eta,phi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at https://github.com/cms-sw/cmssw/blob/master/DataFormats/JetReco/interface/GenJet.h#L90C11-L99, I think it's worth to add invisibleEnergy, auxiliaryEnergy
| @@ -1473,7 +1489,8 @@ TrackingNtuple::TrackingNtuple(const edm::ParameterSet& iConfig) | |||
| keepEleSimHits_(iConfig.getUntrackedParameter<bool>("keepEleSimHits")), | |||
| saveSimHitsP3_(iConfig.getUntrackedParameter<bool>("saveSimHitsP3")), | |||
| simHitBySignificance_(iConfig.getUntrackedParameter<bool>("simHitBySignificance")), | |||
| parametersDefiner_(iConfig.getUntrackedParameter<edm::InputTag>("beamSpot"), consumesCollector()) { | |||
| parametersDefiner_(iConfig.getUntrackedParameter<edm::InputTag>("beamSpot"), consumesCollector()), | |||
| tok_jets_(consumes<reco::GenJetCollection>(iConfig.getParameter<edm::InputTag>("JetSource"))) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| tok_jets_(consumes<reco::GenJetCollection>(iConfig.getParameter<edm::InputTag>("JetSource"))) { | |
| tok_jets_(consumes<reco::GenJetCollection>(iConfig.getParameter<edm::InputTag>("jetSource"))) { |
naming style from https://cms-sw.github.io/cms_coding_rules.html
| edm::Handle<reco::GenJetCollection> genJets; | ||
| iEvent.getByToken(tok_jets_, genJets); | ||
| if (genJets.isValid()) { | ||
| for (unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) { | ||
| const reco::GenJet& genJet = (*genJets)[iGenJet]; | ||
| genJetPt.push_back(genJet.pt()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| edm::Handle<reco::GenJetCollection> genJets; | |
| iEvent.getByToken(tok_jets_, genJets); | |
| if (genJets.isValid()) { | |
| for (unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) { | |
| const reco::GenJet& genJet = (*genJets)[iGenJet]; | |
| genJetPt.push_back(genJet.pt()); | |
| auto const& genJets = iEvent.get(tok_jets_); | |
| for (auto const& jet : genJets) { | |
| genjet_pt.push_back(jet.pt()); |
more compact access.
Also, I prefer to not silently skip: jets should be available in every event; if missing there's something wrong with the configuration and this should fail.
| @@ -1043,103 +1068,101 @@ void fillEfficiencySet(int isimtrk, | |||
| const float vtx_z_thresh = 30; | |||
| const float vtx_perp_thresh = 2.5; | |||
|
|
|||
| if (pt > 0 && jet_eta < 140 && jet_eta > -140 && (jet_eta > -999 && deltaEta > -999)) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not sure if I searched well enough) shouldn't we have some jet pt minimum requirement to make the jet-related plots?
I expect it to be configurable with a default (order of or e.g.) 100 GeV
In PR #187, I added branches to trackingNtuple.root input file after clustering sim tracks into jets using FastJet. However, this method prevents us from comparing reconstructed tracks to the jets, which I need to do in order to examine how the jets affect the duplicate and fake rates. Here I have replaced the former method of jet clustering with GenJets that are added to trackingNtuple.root at the step where it is produced.
These are the pertinent changes I've made:
Validation/RecoTrack/plugins/TrackingNtuple.cc.When the trackingNtuple.root is created with
cmsDriver.py, it now will include the GenJet branches forgenJetPt,genJetEta, andgenJetPhi. I did not include a way to optionally enable/disable this.RecoTracker/LSTCore/standalone/analysis/jets/reformat_jets2.pyto compute ΔR for the sim tracks and add it to trackingNtuple.rootThis completely replaces both reformat_jets.py and myjets.py from PR 187.
RecoTracker/LSTCore/standalone/efficiency/src/performance.ccThis is still enabled/disabled when running LST by the use of the
-jtag.Modified RecoTracker/LSTCore/standalone/code/core/write_lst_ntuple.ccandRecoTracker/LSTCore/standalone/efficiency/python/lst_plot_performance.pyin small ways to reflect these changes.The input file differs from the standard one due to the addition of GenJet branches when it is created and due to the
sim_deltaEta,sim_deltaPhi, andsim_deltaRbranches that are tacked on after. The only change to the output is the inclusion of efficiency, DR, and FR vs. ΔR plots, where ΔR is the distance from a track to its closest GenJet. Otherwise, this PR should not impact the performance of LST at all. The presence of GenJets in the N-tuple also does not affect LST regardless of whether the jet branches are enabled or disabled.