cms-nanoAOD / nanoAOD-tools

Tools for working with NanoAOD (requiring only python + root, not CMSSW)
42 stars 326 forks source link

Undo JEC for subjets in FatJet #281

Open nurfikri89 opened 3 years ago

nurfikri89 commented 3 years ago

This PR is to address issue #280. The subjets' p4 should now have the raw (i.e no JEC applied on them) p4 and the raw softdrop mass can be correctly calculated.

nurfikri89 commented 3 years ago

FYI JMAR convenors @camclean @alefisico

mariadalfonso commented 3 years ago

@nurfikri89

can you document the change with a plot comparing the SDmass after correction and the raw ?

nurfikri89 commented 3 years ago

@mariadalfonso will do

nurfikri89 commented 3 years ago

The attached plot compares the fatjet soft-drop mass distribution for the following cases:

As shown in the plot, the Raw (Before Fix) curve overlaps exactly with Nano because currently we do not undo the jet energy correction on the subjets. With this PR, the raw soft-drop mass will be properly calculated.

FatJets with pT > 200 GeV, |eta| < 2.4 and have 2 subjets are considered. The input file used for this plot is /store/mc/RunIISummer19UL17NanoAODv2/BulkGravToWWToWhadWhad_narrow_M-2000_TuneCP5_PSWeights_13TeV-madgraph-pythia/NANOAODSIM/106X_mc2017_realistic_v8-v1/280000/7C04C439-A221-DB44-BB93-B9426EC957D8.root. The majority of the fatjets are expected to be fully-contained W->qq jets.

BulkGravToWWToWhadWhad_M2000_mSD.pdf

camclean commented 3 years ago

Can you also compare FatJet_msoftdrop_nom before and after the fix? I think it will be effected through the JMR correction factor, which contributes to the corrected softdrop mass here.

camclean commented 3 years ago

There are also these lines after your fix that affect the "raw"softdrop mass.

nurfikri89 commented 3 years ago

Can you also compare FatJet_msoftdrop_nom before and after the fix? I think it will be effected through the JMR correction factor, which contributes to the corrected softdrop mass here.

Attached is a plot comparing the FatJet_msoftdrop_nom variable before the fix (solid black) and after the fix (dashed blue). Also included in the plot is the FatJet_msoftdrop variable (red dotted) as defined in the nanoAODs. From the plot, we can see that currently FatJet_msoftdrop_nom is over-corrected, as the Puppi, JMS and JMR corrections are applied to the soft-drop mass calculated from the JEC corrected subjets. The corrections should actually be applied to the raw soft-drop mass as prescribed by JMAR.

Note: FatJets with pT > 200 GeV, |eta| < 2.4 and have 2 subjets are considered. The input file used for this plot is /store/mc/RunIISummer19UL17NanoAODv2/BulkGravToWWToWhadWhad_narrow_M-2000_TuneCP5_PSWeights_13TeV-madgraph-pythia/NANOAODSIM/106X_mc2017_realistic_v8-v1/280000/7C04C439-A221-DB44-BB93-B9426EC957D8.root. The majority of the fatjets are expected to be fully-contained W->qq jets.

BulkGravToWWToWhadWhad_M2000_mSD_Nom.pdf

camclean commented 3 years ago

Can you also compare FatJet_msoftdrop_nom before and after the fix? I think it will be effected through the JMR correction factor, which contributes to the corrected softdrop mass here.

Attached is a plot comparing the FatJet_msoftdrop_nom variable before the fix (solid black) and after the fix (dashed blue). Also included in the plot is the FatJet_msoftdrop variable (red dotted) as defined in the nanoAODs. From the plot, we can see that currently FatJet_msoftdrop_nom is over-corrected, as the Puppi, JMS and JMR corrections are applied to the soft-drop mass calculated from the JEC corrected subjets. The corrections should actually be applied to the raw soft-drop mass as prescribed by JMAR.

BulkGravToWWToWhadWhad_M2000_mSD_Nom.pdf

So now we have:

The question is whether or not we want to keep msoftdrop_nom with JES applied for consistency. We've had analyses in the past have issues with changes because there is no version control for nanoAOD-Tools. What do you think @mariadalfonso @alefisico?

alefisico commented 3 years ago

Can you also compare FatJet_msoftdrop_nom before and after the fix? I think it will be effected through the JMR correction factor, which contributes to the corrected softdrop mass here.

Attached is a plot comparing the FatJet_msoftdrop_nom variable before the fix (solid black) and after the fix (dashed blue). Also included in the plot is the FatJet_msoftdrop variable (red dotted) as defined in the nanoAODs. From the plot, we can see that currently FatJet_msoftdrop_nom is over-corrected, as the Puppi, JMS and JMR corrections are applied to the soft-drop mass calculated from the JEC corrected subjets. The corrections should actually be applied to the raw soft-drop mass as prescribed by JMAR. BulkGravToWWToWhadWhad_M2000_mSD_Nom.pdf

So now we have:

* msoftdrop_nom (Before fix): **JES**, JER, JMR, JMS, and PUPPI softdrop mass correction applied

* msoftdrop_nom (After fix): JER, JMR, JMS, and PUPPI softdrop mass correction applied; **no JES applied**

* msoftdrop (SubJets with JEC): Only JES applied

The question is whether or not we want to keep msoftdrop_nom with JES applied for consistency. We've had analyses in the past have issues with changes because there is no version control for nanoAOD-Tools. What do you think @mariadalfonso @alefisico?

From the plots that @nurfikri89 showed, I think we should only keep the msoftdrop_nom without JES. But maybe we can check the hash of this PR and announce it in HN and in the twiki that this definition changed.

camclean commented 3 years ago

Can you also compare FatJet_msoftdrop_nom before and after the fix? I think it will be effected through the JMR correction factor, which contributes to the corrected softdrop mass here.

Attached is a plot comparing the FatJet_msoftdrop_nom variable before the fix (solid black) and after the fix (dashed blue). Also included in the plot is the FatJet_msoftdrop variable (red dotted) as defined in the nanoAODs. From the plot, we can see that currently FatJet_msoftdrop_nom is over-corrected, as the Puppi, JMS and JMR corrections are applied to the soft-drop mass calculated from the JEC corrected subjets. The corrections should actually be applied to the raw soft-drop mass as prescribed by JMAR. BulkGravToWWToWhadWhad_M2000_mSD_Nom.pdf

So now we have:

* msoftdrop_nom (Before fix): **JES**, JER, JMR, JMS, and PUPPI softdrop mass correction applied

* msoftdrop_nom (After fix): JER, JMR, JMS, and PUPPI softdrop mass correction applied; **no JES applied**

* msoftdrop (SubJets with JEC): Only JES applied

The question is whether or not we want to keep msoftdrop_nom with JES applied for consistency. We've had analyses in the past have issues with changes because there is no version control for nanoAOD-Tools. What do you think @mariadalfonso @alefisico?

From the plots that @nurfikri89 showed, I think we should only keep the msoftdrop_nom without JES. But maybe we can check the hash of this PR and announce it in HN and in the twiki that this definition changed.

Agreed

mariadalfonso commented 3 years ago

@alefisico @camclean @nurfikri89

msoftdrop_nom (After fix): JER, JMR, JMS, and PUPPI softdrop mass correction applied; no JES applied in https://github.com/cms-nanoAOD/nanoAOD-tools/pull/281#issuecomment-854042039

can you document

  1. the value of the JMR, JMS used: we have a lot of placeholders values 1.
  2. if this corresponds to the UL samples ?
lcorcodilos commented 3 years ago

Just linking that this issue was raised a year and a half ago by #234

bartokm commented 3 years ago

Shouldn't this PR to be merged to master?

nurfikri89 commented 2 years ago

msoftdrop_nom (After fix): JER, JMR, JMS, and PUPPI softdrop mass correction applied; no JES applied in #281 (comment)

can you document

  1. the value of the JMR, JMS used: we have a lot of placeholders values 1.
  2. if this corresponds to the UL samples ?

@mariadalfonso My apologies for dropping this PR. Picking this back up again so it can be merged.

The JMR and JMS values used for the plot in #281 (comment) are 1.0 which are the default values for UL2017 as defined here for JMR and here for JMS.

mariadalfonso commented 2 years ago

msoftdrop_nom (After fix): JER, JMR, JMS, and PUPPI softdrop mass correction applied; no JES applied in #281 (comment) can you document

  1. the value of the JMR, JMS used: we have a lot of placeholders values 1.
  2. if this corresponds to the UL samples ?

@mariadalfonso My apologies for dropping this PR. Picking this back up again so it can be merged.

The JMR and JMS values used for the plot in #281 (comment) are 1.0 which are the default values for UL2017 as defined here for JMR and here for JMS.

for the SF, it's safest to take the value from the json files from JMAR-EOY.