-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Enabling re-application of Type1 Corrections for PuppiMET and adding PUPPI MET Uncertainties #30922
Enabling re-application of Type1 Corrections for PuppiMET and adding PUPPI MET Uncertainties #30922
Conversation
…missing uncertainties
The code-checks are being triggered in jenkins. |
Sorry, PR description was not included for some reason. Please find it here: Issues that this PR intends to fix are : Reapplication of JECs for Type-1 corrections for PuppiMET is not performed to include the latest JECs during NanoAOD production. This is particularly relevant for 2018D in which the MiniAOD is PROMPT RECO. Also uncertainties for PuppiMET, particularly UnclusteredEnergy Uncertainties and the JER, JES down uncertainties are missing. This issue is already raised in the NanoAOD git area : -- Verification of code changes : |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30922/17318
|
A new Pull Request was created by @saghosh (Saranya Ghosh) for master. It involves the following packages: PhysicsTools/NanoAOD @gouskos, @cmsbuild, @fgolf, @mariadalfonso, @santocch, @peruzzim can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@@ -266,7 +266,7 @@ def nanoAOD_runMETfixEE2017(process,isData): | |||
process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(jetSequence),process.fullPatMetSequenceFixEE2017) | |||
|
|||
def nanoAOD_customizeCommon(process): | |||
# makePuppiesFromMiniAOD(process,True) # call this here as it calls switchOnVIDPhotonIdProducer | |||
makePuppiesFromMiniAOD(process,True) # call this here as it calls switchOnVIDPhotonIdProducer |
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 should be put beyond a process modifier since V14 Puppi is available already in the re-miniAOD
for master:
if run2_nanoAOD_106Xv1 (+ any other old):
makePuppiesFromMiniAOD(process,True)
for 10_6:
if NOT run2_miniAOD_devel:
makePuppiesFromMiniAOD(process,True)
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.
You need to decide which tune you want for
run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1
This need to be in compatible with the JEC analyst have in the GT, unless you plan to reserve the previous.
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.
Hello,
We want the old PUPPI tune for all the mentioned ones, except for run2_nanoAOD_106Xv1
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.
Hello, I am concerned about the code crashing if the makePuppiesFromMiniAOD(process,True) is not called at all under one of the conditions. It seems to be required to obtain the puppiMETSequence
and is recommended to be included here:
https://twiki.cern.ch/twiki/bin/view/CMS/MissingETUncertaintyPrescription#Puppi_MET
even if the PUPPI tune is not to be updated.
I tried testing out the code without that the call to makePuppiesFromMiniAOD(process,True), and the code crashes with the message
'Process' object has no attribute 'puppiMETSequence'
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.
Yes so makePuppiesFromMiniAOD(process,True) is apparently needed.
Turning on/off the new PUPPI tune is done via:
process.puppiNoLep.useExistingWeights = False
process.puppi.useExistingWeights = False
This is where the modifiers should be placed from what I understand.
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.
After some discussion with Maria, we believe the two following lines:
process.puppiNoLep.useExistingWeights = True
process.puppi.useExistingWeights = True
should be put in the nanoAOD_customizeCommon function
Then an era modifier should be used to set this to false when needed (only for run2_nanoAOD_106Xv1 in 106X from what I understand).
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.
yes correct
I suggest to put useExistingWeights = False
for EOY and UL106 basically for all these
run2_nanoAOD_94XMiniAODv1,
run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_94X2016, run2_nanoAOD_102Xv1,
run2_nanoAOD_106Xv1
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 I understand correctly that for the version to be merged with the master, no era modifier is required?
Then I'll just move those two lines to the nanoAOD_customizeCommon function for the version to be merged with the master, and add the era modifier later for the 106X version.
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.
Okay, I will make the changes and update
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.
Hello, updated with the latest commit, please check
@@ -195,10 +195,10 @@ def nanoAOD_recalibrateMETs(process,isData): | |||
table.variables.muonSubtrFactor = Var("1-userFloat('muonSubtrRawPt')/(pt()*jecFactor('Uncorrected'))",float,doc="1-(muon-subtracted raw pt)/(raw pt)",precision=6) | |||
process.metTables += process.corrT1METJetTable | |||
# makePuppiesFromMiniAOD(process,True) # call this before in the global customizer otherwise it would reset photon IDs in VID |
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.
can we clean up this call ? same lines
process.puppiNoLep.useExistingWeights = False
process.puppi.useExistingWeights = False
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.
I have now modified this part to explicitly set as True the useExistingWeights as per the previous comment thread
@saghosh @ahinzmann @lathomas |
hi @mariadalfonso , was busy with ICHEP last week, will get back to this ASAP |
The code-checks are being triggered in jenkins. |
@mariadalfonso @lathomas additional commit addresses the points mentioned in the comments above |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30922/17696
|
Comparison is ready @slava77 comparisons for the following workflows were not done due to missing matrix map:
Comparison Summary:
|
+1 |
@cms-sw/xpog-l2 @ahinzmann @lathomas Do you have further comments? |
I'd suggest to leave this PR as is and deal with re-clustering slimmedAK8Jets(Puppi v15) for the modifier run2_nanoAOD_106Xv1 in a separate PR as it is not trivial and decoupled from the bug addressed here. In this way, we are done with the bug fix part and can deal with the (more difficult) NanoAOD V8 part in a followup PR. |
+xpog For new UL (reMini and run2_nanoAOD_106Xv1 ) type1 MET fixed with:
puppiMET for EOY not touched, only type1 corrections are reapplied. to be followed in a new PR the handling of AK8puppi for the run2_nanoAOD_106Xv1:
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
@saghosh |
@mariadalfonso will do so. |
# process.puppiNoLep.useExistingWeights = False | ||
# process.puppi.useExistingWeights = False | ||
# process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(jetSequence),cms.Sequence(process.puppiMETSequence+process.fullPatMetSequencePuppi)) | ||
runMetCorAndUncFromMiniAOD(process,isData=isData,metType="Puppi",postfix="Puppi",jetFlavor="AK4PFPuppi") |
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.
For the followup PR to switch to PUPPI v15 for run2_nanoAOD_106Xv1 consistently for MET, AK4 and AK8, please considered adding the switches "recoMetFromPFCs=True, reclusterJets=True" to runMetCorAndUncFromMiniAOD for run2_nanoAOD_106Xv1 (to recompute MET and Type-1 with v15). And test if it has the desired effect.
@mariadalfonso @alefisico
any news on this backport ? |
@saghosh any news? We would need this for the upcoming JME NANOAOD production Thanks ! |
@mariadalfonso @lathomas Please see : #31638 |
PR description:
Reapplication of JECs for Type-1 corrections for PuppiMET is not performed to include the latest JECs during NanoAOD production.
https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/python/nano_cff.py#L198
This is particularly relevant for 2018D in which the MiniAOD is PROMPT RECO.
It is not possible to re-apply JECs on the fly since the AK4PuppiJet collection is not stored in NanoAOD.
Also uncertainties for PuppiMET, particularly UnclusteredEnergy Uncertainties and the JER, JES down uncertainties are missing.
Only part of the uncertainties were added previously : https://github.com/cms-nanoAOD/cmssw/pull/516/files
This issue is already raised in the NanoAOD git area :
cms-nanoAOD#523
And also CMSSW github issue:
#30304
PR validation:
For verification of code, please see the slides linked below
https://indico.cern.ch/event/924615/contributions/3885484/attachments/2049952/3435787/Pre_EPR_MET_June3.pdf