Skip to content
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 unbiased superclusters to miniAOD and EGM nano #46423

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

SanghyunKo
Copy link
Contributor

PR description:

This PR addresses two issues:

  1. Replace the ratio between corrected & uncorrected energy in Run 2 NanoAOD with the uncorrected energy itself (to avoid issues like Replace buggy UL2016 EGM energy correction files #46046 - if the correction is 0, we cannot recover the energy before applying the correction using the ratio).

  2. Currently, EGM still relies on AOD to derive central reco SFs. This is because the supercluster (SC) collection stored in MiniAOD is highly biased since we only store the SC that already reconstructed electron & photon objects. This PR attempts to improve the situation by migrating from the legacy AOD-based workflow to the (EGM) nanoAOD-based workflow. A minimal change in miniAOD is required to remove the biases implied in the current miniAOD.

PR validation:

The expected increase in miniAOD file size is marginal - from 0.07% for clean events (e.g. DY) to 0.44% for busy events (e.g. TTto4Q) when tested with 1k events. The increase in EGM nanoAOD due to the new SC collection is 1.16% in DY and 1.7% in TTto2L2Nu, again tested with 1k events (as of Winter24 samples).

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

No backport is needed (this PR targets Nano v15).

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 17, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46423/42282

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46423/42283

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @SanghyunKo for master.

It involves the following packages:

  • PhysicsTools/NanoAOD (xpog)
  • PhysicsTools/PatAlgos (xpog, reconstruction)
  • RecoEgamma/EgammaPhotonProducers (reconstruction)

@cmsbuild, @ftorrresd, @hqucms, @jfernan2, @mandrenguyen can you please review it and eventually sign? Thanks.
@AlexDeMoor, @AnnikaStein, @Ming-Yan, @Prasant1993, @Sam-Harper, @Senphy, @a-kapoor, @afiqaize, @ahinzmann, @andrzejnovak, @azotz, @castaned, @gkasieczka, @gouskos, @gpetruc, @hatakeyamak, @jainshilpi, @jdamgov, @jdolen, @lgray, @mariadalfonso, @mbluj, @missirol, @mmarionncern, @nhanvtran, @ram1123, @rappoccio, @rovere, @sameasy, @schoef, @seemasharmafnal, @sobhatta, @valsdav, @varuns23 this is something you requested to watch as well.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@hqucms
Copy link
Contributor

hqucms commented Oct 17, 2024

enable nano

@hqucms
Copy link
Contributor

hqucms commented Oct 17, 2024

please test

@cmsbuild
Copy link
Contributor

-1

Failed Tests: RelVals-INPUT
Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0e79ae/42271/summary.html
COMMIT: d4762a9
CMSSW: CMSSW_14_2_X_2024-10-16-2300/el8_amd64_gcc12
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/46423/42271/install.sh to create a dev area with all the needed externals and cmssw changes.

RelVals-INPUT

The relvals timed out after 4 hours.

Comparison Summary

Summary:

NANO Comparison Summary

Summary:

  • You potentially added 70 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 116 differences found in the comparisons
  • DQMHistoTests: Total files compared: 21
  • DQMHistoTests: Total histograms compared: 55168
  • DQMHistoTests: Total failures: 24
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 55144
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 20 files compared)
  • Checked 102 log files, 58 edm output root files, 21 DQM output files
  • TriggerResults: no differences found

Nano size comparison Summary:

Sample kb/ev ref kb/ev diff kb/ev ev/s/thd ref ev/s/thd diff rate mem/thd ref mem/thd
2500.001 3.000 2.997 0.003 ( +0.1% ) 2.93 2.91 +0.7% 6.163 6.085
2500.002 3.110 3.107 0.003 ( +0.1% ) 2.62 2.61 +0.4% 6.437 6.438
2500.003 3.054 3.051 0.002 ( +0.1% ) 2.74 2.75 -0.3% 6.414 6.415
2500.011 1.575 1.571 0.004 ( +0.3% ) 4.53 4.52 +0.2% 2.455 2.181
2500.012 2.093 2.088 0.006 ( +0.3% ) 2.75 2.77 -0.7% 2.641 2.224
2500.013 1.917 1.912 0.005 ( +0.3% ) 3.86 3.90 -0.9% 2.555 2.243
2500.021 0.022 0.022 0.000 ( +0.0% ) 0.88 0.87 +1.5% 2.416 2.386
2500.022 0.022 0.022 0.000 ( +0.0% ) 0.86 0.83 +3.1% 2.408 2.395
2500.023 0.022 0.022 0.000 ( +0.0% ) 0.84 0.81 +4.3% 2.278 2.263
2500.024 0.022 0.022 0.000 ( +0.0% ) 0.63 0.63 +0.8% 2.513 2.419
2500.031 0.035 0.035 0.000 ( +0.0% ) 0.78 0.76 +1.9% 2.485 2.448
2500.032 0.036 0.036 0.000 ( +0.0% ) 0.81 0.79 +2.5% 2.445 2.442
2500.033 0.037 0.037 0.000 ( +0.0% ) 0.73 0.71 +2.8% 2.523 2.465
2500.034 0.036 0.036 0.000 ( +0.1% ) 0.73 0.72 +2.5% 2.508 2.442
2500.101 2.753 2.753 0.000 ( +0.0% ) 7.27 7.28 -0.1% 7.040 6.431
2500.111 1.399 1.399 0.000 ( +0.0% ) 16.52 16.52 +0.0% 2.289 2.282
2500.112 1.818 1.818 0.000 ( +0.0% ) 13.51 13.40 +0.8% 2.375 2.366
2500.131 0.747 0.747 0.000 ( +0.0% ) 17.05 17.14 -0.5% 1.507 1.471
2500.201 2.582 2.582 0.000 ( +0.0% ) 6.20 6.19 +0.3% 6.315 5.700
2500.211 1.736 1.736 0.000 ( +0.0% ) 14.53 14.49 +0.3% 2.360 2.354
2500.212 2.131 2.131 0.000 ( +0.0% ) 11.97 11.76 +1.8% 2.437 2.434
2500.221 2.003 2.003 0.000 ( +0.0% ) 6.35 6.38 -0.4% 2.532 2.525
2500.222 3.372 3.309 0.063 ( +1.9% ) 6.13 6.11 +0.4% 2.619 2.603
2500.223 8.997 8.997 0.000 ( +0.0% ) 2.38 2.36 +0.7% 2.634 2.369
2500.224 6.026 6.026 0.000 ( +0.0% ) 0.57 0.58 -0.6% 2.674 2.205
2500.225 6.058 6.058 0.000 ( +0.0% ) 0.54 0.55 -0.9% 2.754 2.251
2500.226 3.072 3.072 0.000 ( +0.0% ) 6.13 6.06 +1.1% 2.608 2.195
2500.227 1.437 1.437 0.000 ( +0.0% ) 11.16 11.17 -0.1% 1.429 1.394
2500.231 1.408 1.408 0.000 ( +0.0% ) 11.87 11.76 +0.9% 2.255 2.232
2500.232 2.386 2.336 0.050 ( +2.1% ) 11.79 11.80 -0.1% 2.354 2.345
2500.233 4.783 4.783 0.000 ( +0.0% ) 3.93 3.92 +0.2% 2.374 2.371
2500.234 3.648 3.648 0.000 ( +0.0% ) 0.73 0.73 +0.4% 2.383 2.375
2500.235 3.667 3.667 0.000 ( +0.0% ) 0.71 0.71 -0.0% 2.446 2.442
2500.236 2.180 2.180 0.000 ( +0.0% ) 11.74 11.56 +1.5% 2.356 2.347
2500.237 1.016 1.016 0.000 ( +0.0% ) 16.31 16.48 -1.0% 1.464 1.462
2500.241 9.404 9.404 0.000 ( +0.0% ) 3.45 3.47 -0.4% 1.916 1.916
2500.242 10.331 10.331 0.000 ( +0.0% ) 0.84 0.83 +0.6% 1.708 1.706
2500.243 2.712 2.712 0.000 ( +0.0% ) 7.91 8.26 -4.3% 1.077 1.076
2500.244 485.976 485.976 0.000 ( +0.0% ) 0.53 0.53 -1.6% 1.673 1.688
2500.245 823.202 823.202 0.000 ( +0.0% ) 0.70 0.70 +0.0% 1.672 1.661
2500.901 1.777 1.777 0.000 ( +0.0% ) 19.91 20.14 -1.2% 1.846 1.845
2500.902 1.626 1.626 0.000 ( +0.0% ) 20.36 20.89 -2.5% 1.774 1.774
2500.911 13.995 13.995 0.000 ( +0.0% ) 2.79 3.20 -12.8% 1.097 1.096
2500.912 0.240 0.240 0.000 ( +0.0% ) 1.56 1.23 +27.6% 0.972 0.974
2500.913 0.110 0.110 0.000 ( +0.0% ) 1.05 1.04 +0.6% 0.975 0.980

@@ -433,7 +433,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints):
electronTable.variables,
pt = Var("pt*userFloat('ecalTrkEnergyPostCorrNew')/userFloat('ecalTrkEnergyPreCorrNew')", float, precision=-1, doc="p_{T}"),
energyErr = Var("userFloat('ecalTrkEnergyErrPostCorrNew')", float, precision=6, doc="energy error of the cluster-track combination"),
eCorr = Var("userFloat('ecalTrkEnergyPostCorrNew')/userFloat('ecalTrkEnergyPreCorrNew')", float, doc="ratio of the calibrated energy/miniaod energy"),
ptPreCorr = Var("pt", float, doc="pt of the electron before energy corrections"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the nanoDQM with this change.

@@ -283,7 +283,7 @@ def make_bitmapVID_docstring(id_modules_working_points_pset):
photonTable.variables,
pt = Var("pt*userFloat('ecalEnergyPostCorrNew')/userFloat('ecalEnergyPreCorrNew')", float, precision=-1, doc="p_{T}"),
energyErr = Var("userFloat('ecalEnergyErrPostCorrNew')",float,doc="energy error of the cluster from regression",precision=6),
eCorr = Var("userFloat('ecalEnergyPostCorrNew')/userFloat('ecalEnergyPreCorrNew')",float,doc="ratio of the calibrated energy/miniaod energy"),
ptPreCorr = Var("pt",float,doc="pt of the photon before energy corrections"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the nanoDQM with this change.

@jfernan2
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0e79ae/42292/summary.html
COMMIT: d4762a9
CMSSW: CMSSW_14_2_X_2024-10-17-2300/el8_amd64_gcc12
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/46423/42292/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

NANO Comparison Summary

Summary:

  • You potentially removed 189 lines from the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 116 differences found in the comparisons
  • DQMHistoTests: Total files compared: 21
  • DQMHistoTests: Total histograms compared: 55168
  • DQMHistoTests: Total failures: 24
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 55144
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 20 files compared)
  • Checked 102 log files, 58 edm output root files, 21 DQM output files
  • TriggerResults: no differences found

Nano size comparison Summary:

Sample kb/ev ref kb/ev diff kb/ev ev/s/thd ref ev/s/thd diff rate mem/thd ref mem/thd
2500.001 3.000 2.997 0.003 ( +0.1% ) 2.96 2.91 +1.5% 6.169 6.085
2500.002 3.110 3.107 0.003 ( +0.1% ) 2.66 2.62 +1.6% 6.463 6.434
2500.003 3.054 3.051 0.002 ( +0.1% ) 2.78 2.73 +1.8% 6.412 6.414
2500.011 1.575 1.571 0.004 ( +0.3% ) 4.67 4.56 +2.4% 2.449 2.444
2500.012 2.093 2.088 0.006 ( +0.3% ) 2.79 2.76 +1.3% 2.632 2.641
2500.013 1.917 1.912 0.005 ( +0.3% ) 3.96 3.90 +1.6% 2.550 2.551
2500.021 0.022 0.022 0.000 ( +0.0% ) 0.90 0.89 +1.7% 2.411 2.406
2500.022 0.022 0.022 0.000 ( +0.0% ) 0.88 0.85 +2.7% 2.405 2.403
2500.023 0.022 0.022 0.000 ( +0.0% ) 0.85 0.85 -0.3% 2.270 2.273
2500.024 0.022 0.022 0.000 ( +0.0% ) 0.67 0.63 +7.2% 2.502 2.493
2500.031 0.035 0.035 0.000 ( +0.0% ) 0.81 0.77 +4.6% 2.481 2.466
2500.032 0.036 0.036 0.000 ( +0.0% ) 0.83 0.80 +3.4% 2.447 2.426
2500.033 0.037 0.037 0.000 ( +0.0% ) 0.75 0.73 +3.0% 2.521 2.519
2500.034 0.036 0.036 0.000 ( +0.0% ) 0.76 0.73 +4.5% 2.510 2.503
2500.101 2.753 2.753 0.000 ( +0.0% ) 7.55 7.22 +4.5% 6.415 6.424
2500.111 1.399 1.399 0.000 ( +0.0% ) 16.71 16.58 +0.8% 2.287 2.292
2500.112 1.818 1.818 0.000 ( +0.0% ) 12.10 13.39 -9.6% 2.370 2.374
2500.131 0.747 0.747 0.000 ( +0.0% ) 18.27 17.22 +6.1% 1.482 1.414
2500.201 2.582 2.582 0.000 ( +0.0% ) 6.45 6.17 +4.6% 5.701 5.717
2500.211 1.736 1.736 0.000 ( +0.0% ) 15.17 14.50 +4.6% 2.368 2.360
2500.212 2.131 2.131 0.000 ( +0.0% ) 10.98 12.08 -9.1% 2.442 2.441
2500.221 2.003 2.003 0.000 ( +0.0% ) 5.91 6.22 -5.0% 2.530 2.370
2500.222 3.372 3.309 0.063 ( +1.9% ) 5.82 6.12 -4.8% 2.621 2.422
2500.223 8.997 8.997 0.000 ( +0.0% ) 2.50 2.39 +4.3% 2.637 2.205
2500.224 6.026 6.026 0.000 ( +0.0% ) 0.59 0.58 +2.1% 2.229 2.575
2500.225 6.058 6.058 0.000 ( +0.0% ) 0.56 0.55 +1.6% 2.283 2.644
2500.226 3.072 3.072 0.000 ( +0.0% ) 6.50 6.09 +6.8% 2.614 2.616
2500.227 1.437 1.437 0.000 ( +0.0% ) 11.84 11.20 +5.7% 1.432 1.429
2500.231 1.408 1.408 0.000 ( +0.0% ) 12.67 11.96 +6.0% 2.260 2.259
2500.232 2.386 2.336 0.050 ( +2.1% ) 12.38 11.60 +6.7% 2.349 2.352
2500.233 4.783 4.783 0.000 ( +0.0% ) 4.14 3.97 +4.5% 2.252 2.363
2500.234 3.648 3.648 0.000 ( +0.0% ) 0.76 0.74 +3.0% 2.374 2.385
2500.235 3.667 3.667 0.000 ( +0.0% ) 0.73 0.71 +1.7% 2.441 2.205
2500.236 2.180 2.180 0.000 ( +0.0% ) 12.37 11.49 +7.7% 2.347 2.343
2500.237 1.016 1.016 0.000 ( +0.0% ) 17.38 16.54 +5.1% 1.465 1.460
2500.241 9.404 9.404 0.000 ( +0.0% ) 3.73 3.37 +10.5% 1.918 1.917
2500.242 10.331 10.331 0.000 ( +0.0% ) 0.89 0.84 +6.0% 1.705 1.706
2500.243 2.712 2.712 0.000 ( +0.0% ) 8.46 8.03 +5.2% 1.081 1.075
2500.244 485.976 485.976 0.000 ( +0.0% ) 0.56 0.54 +5.4% 1.688 1.687
2500.245 823.202 823.202 0.000 ( +0.0% ) 0.74 0.71 +4.7% 1.659 1.663
2500.901 1.777 1.777 0.000 ( +0.0% ) 21.12 20.37 +3.7% 1.843 1.839
2500.902 1.626 1.626 0.000 ( +0.0% ) 21.25 20.63 +3.0% 1.770 1.769
2500.911 13.995 13.995 0.000 ( +0.0% ) 3.43 2.84 +20.9% 1.098 1.097
2500.912 0.199 0.310 -0.111 ( -35.7% ) 1.04 1.34 -22.2% 0.973 0.975
2500.913 0.110 0.110 0.000 ( +0.0% ) 1.01 1.03 -1.9% 0.975 0.976

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants