-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Adding PAIReDJet Table to NanoAOD #45207
base: master
Are you sure you want to change the base?
Conversation
cms-bot internal usage |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-45207/40557
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-45207/40558
|
A new Pull Request was created by @tajrussell for master. It involves the following packages:
@vlimant, @hqucms, @ftorrresd, @jfernan2, @mandrenguyen, @cmsbuild can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
enable nano |
desc.add<edm::InputTag>("vertices", edm::InputTag("offlineSlimmedPrimaryVertices")); | ||
desc.add<edm::InputTag>("secondary_vertices", edm::InputTag("slimmedSecondaryVertices")); | ||
desc.add<edm::FileInPath>("model_path", edm::FileInPath("RecoBTag/Combined/data/PAIReD/model3.onnx")); | ||
descriptions.add("PAIReDJetTable", desc); |
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.
would be nice to use descriptions.addWithDefaultLabel(desc)
to generate the default cfi
import FWCore.ParameterSet.Config as cms | ||
from PhysicsTools.NanoAOD.common_cff import * | ||
|
||
pairedJetTable = cms.EDProducer("PAIReDONNXJetTagsProducer") |
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.
looks like you are using all default values from the fillDescription, which. is actually good to have. but I'd rather, so that the actual parameters are visible (and modifiable) in the configuration, that you import from the default cfi generated from the fillDescription (See below)
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.
Do you mean adding a file similar to this one https://cmssdt.cern.ch/lxr/source/cfipython/RecoBTag/ONNXRuntime/UnifiedParticleTransformerAK4ONNXJetTagsProducer.py that specifies the descriptions outside of the producer? Or if not is there by any chance a different piece of code you could point me to that accomplishes something similar to what you would like to see here?
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.
adding https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideConfigurationValidationAndHelp for documentation. you do not have to add the file in cfipython yourself, the fwk will do this for your upon "scram build". You should be able to do something like
from RecoBTag.ONNXRuntime.pAIRrDONNXJetTagsProducer_cfi import pAIRrDONNXJetTagsProducer
pairedJetTable = pAIRrDONNXJetTagsProducer.clone()
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.
from RecoBTag.ONNXRuntime.pAIRrDONNXJetTagsProducer_cfi import pAIRrDONNXJetTagsProducer
is what descriptions.addWithDefaultLabel(desc);
provides
gen_particle_token_(consumes<edm::View<reco::GenParticle>>(iConfig.getParameter<edm::InputTag>("gen_particles"))), | ||
vtx_token_(consumes<VertexCollection>(iConfig.getParameter<edm::InputTag>("vertices"))), | ||
sv_token_(consumes<SVCollection>(iConfig.getParameter<edm::InputTag>("secondary_vertices"))) { | ||
produces<nanoaod::FlatTable>(name_); |
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.
instead of a monolythic producer that evaluates AND create the table, can we separate the two : produce the tag in the edm (as a value map?) and pick this up with a standard table producer (preferably from an existing module type if possible) ?
type btv |
please test |
-1 Failed Tests: RelVals RelVals-INPUT RelVals-NANO RelVals
Expand to see more relval errors ...RelVals-INPUT
Expand to see more relval errors ...RelVals-NANO |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c1ad35/40049/summary.html The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
You can see more details here: Comparison SummarySummary:
NANO Comparison SummarySummary:
Nano size comparison Summary:
|
|
||
pairedJetTableTask = cms.Task(pairedJetTable) | ||
|
||
pairedJetTableMC = cms.EDProducer("PAIReDONNXJetTagsProducer") |
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.
if there is no specific parameter difference between data and MC, you should keep the same module pairedJetTable
please hold |
-1 |
Milestone for this pull request has been moved to CMSSW_14_2_X. Please open a backport if it should also go in to CMSSW_14_1_X. |
ping (to make bot change milestone) |
Milestone for this pull request has been moved to CMSSW_15_0_X. Please open a backport if it should also go in to CMSSW_14_2_X. |
PR description:
Adding PAIReD jets (https://indico.cern.ch/event/1372046/contributions/5993835/attachments/2874191/5033020/BTV_PAIReD.pdf) currently intended mainly for use in the resolved regime of heavy particle decays. The jets are added as a new flat table in NanoAOD that stores the indices of the seed jets as well as the bb, cc, and ll tagging scores from a version of parT that has been retrained on PAIReD jets. The number of b and c hadrons within the PAIReD ellipse is also stored for events that are not real data.
The main file is RecoBTag/ONNXRuntime/plugins/PAIReDONNXJetTagsProducer.cc which loops over all pairs of AK4 jets in an event and finds the candidates in the ellipse defined by the two jets. This makes use of the inEllipse() function in the newly defined file RecoBTag/FeatureTools/interface/paired_helper.h. The Producer then organizes the inputs for parT and runs on a new ONNX model that needs to be simultaneously added to RecoBTag/Combined/data to produce the bb, cc, and ll tagging scores (cms-data/RecoBTag-Combined#58).
The RecoBTag/ONNXRuntime/plugins BuildFile is updated to include a number of dependencies required for the new EDProducer.
PhysicsTools/NanoAOD/python/jetsPAIReD.py defines tasks for running the new producer on data and MC, and PhysicsTools/NanoAOD/python/nano_cff.py is edited to include these tasks in NanoAOD production.
PR validation:
We have validated that the scores produced by running the producer being added to CMSSW in this PR match those produced by the training framework which uses PFNano samples. This can be seen on slide 26 of this presentation (https://indico.cern.ch/event/1347445/contributions/5857902/attachments/2866917/5018410/Higgs-Charm%20Workshop.pdf)