cmssw icon indicating copy to clipboard operation
cmssw copied to clipboard

Adding HTXS variables to nanoAOD for on-the-fly 1.3 categorisation

Open jonathon-langford opened this issue 1 year ago • 9 comments

PR description:

Temporary fix to HTXS classification Rivet to enable (planned) STXS 1.3 categorisation on-the-fly using nanoAOD. This will avoid a re-nano campaign of Higgs boson signal MC for STXS Run 3 analyses. Added four new variables to nanoAOD output:

  • HTXS_V_pt: vector-boson transverse momentum for VH production mode events with precision=14. Default value of -999 for non-VH events.
  • HTXS_Mjj: dijet invariant mass for events with at-least two jets (pT>30 GeV), with precision=14. Default value of -999 for events without a valid dijet system.
  • HTXS_ptHjj: transverse momentum of dijet-plus-higgs system for events with at-least two jets (pT>30 GeV), with precision=14. Default value of -999 for events without a valid dijet system.
  • HTXS_dPhijj: delta-phi between two jets in dijet system for events with at-least two jets (pT>30 GeV), with precision=12. Variables is defined in range [-PI,PI). Default value of -999 for events without a valid dijet system.

With these variables in nanoAOD, we can re-categorise Higgs signal events into the proposed STXS 1.3 bins. The latest slides documenting the 1.3 binning scheme can be found here.

PR validation:

Tested in CMSSW_13_3_1_patch1 as used for nanoAOD v13 production.

Ran cmsDriver.py command to privately produce nanoAOD for four main production modes. For example ggH:

cmsDriver.py  --python_filename ggH_cfg.py --eventcontent NANOAODSIM --customise Configuration/DataProcessing/Utils.addMonitoring --datatier NANOAODSIM --fileout file:ggH.root --conditions 133X_mcRun3_2022_realistic_postEE_ForNanov13_v1 --step NANO --scenario pp --filein "dbs:/GluGluHtoGG_M-125_TuneCP5_13p6TeV_amcatnloFXFX-pythia8/Run3Summer22EEMiniAODv4-130X_mcRun3_2022_realistic_postEE_v6-v2/MINIAODSIM" --era Run3 --no_exec --mc -n -200

Checked outputs for 200 events in each production mode to confirm that the four new variables match for the STXS 1.2 identifier (HTXS_stage1_2_cat_pTjet30GeV).

PR backport

This PR will need to be backported into the release cycles which are used for nanoAOD production:

  • v13: CMSSW_13_3_1_patch1
  • v14: CMSSW_14_0_6_patch1

jonathon-langford avatar Oct 10 '24 17:10 jonathon-langford

cms-bot internal usage

cmsbuild avatar Oct 10 '24 17:10 cmsbuild

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46343/42173

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

  • code-format: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46343/42173/code-format.patch e.g. curl -k https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46343/42173/code-format.patch | patch -p1 You can also run scram build code-format to apply code format directly

cmsbuild avatar Oct 10 '24 17:10 cmsbuild

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46343/42216

cmsbuild avatar Oct 14 '24 13:10 cmsbuild

A new Pull Request was created by @jonathon-langford for master.

It involves the following packages:

  • GeneratorInterface/RivetInterface (generators)
  • PhysicsTools/NanoAOD (xpog)
  • SimDataFormats/HTXS (generators)

@bbilin, @cmsbuild, @ftorrresd, @hqucms, @lviliani, @menglu21, @mkirsano can you please review it and eventually sign? Thanks. @AnnikaStein, @alberto-sanchez, @apsallid, @bsunanda, @fabiocos, @gpetruc, @martinamalberti, @missirol, @mkirsano, @mmusich, @rovere, @youyingli 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

cmsbuild avatar Oct 14 '24 13:10 cmsbuild

enable nano

ftorrresd avatar Oct 14 '24 13:10 ftorrresd

please test

ftorrresd avatar Oct 14 '24 13:10 ftorrresd

+1

Size: This PR adds an extra 12KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-3fbe5c/42163/summary.html COMMIT: b66d4ed5a6b696fd2fd1aa6f6743758b714ada05 CMSSW: CMSSW_14_2_X_2024-10-14-1100/el8_amd64_gcc12 Additional Tests: NANO User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/46343/42163/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 2 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 66 differences found in the comparisons
  • DQMHistoTests: Total files compared: 44
  • DQMHistoTests: Total histograms compared: 3331066
  • DQMHistoTests: Total failures: 3439
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3327607
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 43 files compared)
  • Checked 193 log files, 163 edm output root files, 44 DQM output files
  • TriggerResults: no differences found

NANO Comparison Summary

Summary:

  • You potentially removed 685 lines from the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 21
  • DQMHistoTests: Total histograms compared: 55028
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 55028
  • 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 2.948 2.947 0.000 ( +0.0% ) 3.02 3.10 -2.6% 6.061 6.055
2500.002 3.057 3.056 0.000 ( +0.0% ) 2.71 2.76 -1.7% 6.459 6.411
2500.003 2.998 2.998 0.000 ( +0.0% ) 2.82 2.89 -2.6% 6.385 6.487
2500.011 1.533 1.533 0.000 ( +0.0% ) 4.61 4.80 -4.0% 2.420 2.421
2500.012 2.030 2.030 0.000 ( +0.0% ) 2.85 2.90 -1.7% 2.224 2.605
2500.013 1.872 1.872 0.000 ( +0.0% ) 4.01 4.10 -2.1% 2.521 2.514
2500.021 0.022 0.022 0.000 ( +0.0% ) 0.90 0.98 -8.3% 2.382 2.381
2500.022 0.022 0.022 0.000 ( +0.0% ) 0.87 0.93 -6.5% 2.381 2.376
2500.023 0.022 0.022 0.000 ( +0.0% ) 0.86 0.93 -7.4% 2.250 2.244
2500.024 0.022 0.022 0.000 ( +0.0% ) 0.65 0.71 -7.9% 2.471 2.458
2500.031 0.035 0.035 0.000 ( +0.0% ) 0.80 0.86 -7.6% 2.448 2.451
2500.032 0.036 0.036 0.000 ( +0.0% ) 0.80 0.88 -8.4% 2.410 2.412
2500.033 0.037 0.037 0.000 ( +0.0% ) 0.73 0.80 -8.3% 2.491 2.492
2500.034 0.036 0.036 0.000 ( +0.0% ) 0.74 0.80 -7.7% 2.468 2.468
2500.101 2.728 2.728 0.000 ( +0.0% ) 8.33 9.00 -7.4% 6.356 6.339
2500.111 1.386 1.386 0.000 ( +0.0% ) 18.49 20.28 -8.9% 2.227 2.232
2500.112 1.803 1.803 0.000 ( +0.0% ) 13.76 15.29 -10.0% 2.309 2.313
2500.131 0.747 0.747 0.000 ( +0.0% ) 17.05 18.38 -7.3% 1.492 1.474
2500.201 2.552 2.552 0.001 ( +0.0% ) 7.04 7.58 -7.0% 5.614 5.610
2500.211 1.699 1.699 0.000 ( +0.0% ) 16.83 18.01 -6.5% 2.276 2.281
2500.212 2.095 2.095 0.000 ( +0.0% ) 13.32 14.29 -6.8% 2.358 2.361
2500.221 1.998 1.998 0.001 ( +0.0% ) 7.39 7.76 -4.9% 2.452 2.444
2500.222 3.276 3.276 0.001 ( +0.0% ) 7.28 7.62 -4.5% 2.532 2.527
2500.223 8.964 8.963 0.001 ( +0.0% ) 2.52 2.66 -5.0% 2.562 2.409
2500.224 5.810 5.810 0.001 ( +0.0% ) 0.58 0.60 -3.5% 2.272 2.130
2500.225 5.828 5.827 0.001 ( +0.0% ) 0.57 0.59 -2.9% 2.294 2.146
2500.226 3.039 3.038 0.001 ( +0.0% ) 7.19 7.60 -5.5% 2.538 2.411
2500.227 1.437 1.437 0.000 ( +0.0% ) 11.11 11.88 -6.5% 1.432 1.434
2500.231 1.403 1.403 0.000 ( +0.0% ) 13.38 13.54 -1.2% 2.179 2.180
2500.232 2.300 2.300 0.000 ( +0.0% ) 13.27 14.03 -5.4% 2.272 2.275
2500.233 4.747 4.747 0.000 ( +0.0% ) 4.04 4.26 -5.1% 2.289 2.279
2500.234 3.518 3.518 0.000 ( +0.0% ) 0.74 0.77 -4.1% 2.062 2.070
2500.235 3.530 3.530 0.000 ( +0.0% ) 0.73 0.75 -2.7% 2.087 2.088
2500.236 2.145 2.145 0.000 ( +0.0% ) 13.50 13.72 -1.6% 2.268 2.268
2500.237 1.016 1.016 0.000 ( +0.0% ) 16.14 17.05 -5.3% 1.406 1.459
2500.241 9.404 9.404 0.000 ( +0.0% ) 3.55 3.74 -5.0% 1.945 1.951
2500.242 10.331 10.331 0.000 ( +0.0% ) 0.83 0.91 -9.0% 1.736 1.735
2500.243 2.712 2.712 0.000 ( +0.0% ) 7.77 8.39 -7.3% 1.080 1.077
2500.244 485.976 485.976 0.000 ( +0.0% ) 0.51 0.56 -9.8% 1.202 1.692
2500.245 823.202 823.202 0.000 ( +0.0% ) 0.69 0.75 -6.9% 1.188 1.664
2500.901 1.777 1.777 0.001 ( +0.0% ) 19.74 21.53 -8.3% 1.836 1.846
2500.902 1.627 1.626 0.001 ( +0.0% ) 19.86 21.05 -5.6% 1.772 1.773
2500.911 14.041 13.995 0.046 ( +0.3% ) 3.08 2.92 +5.5% 1.101 1.095
2500.912 0.199 0.199 0.000 ( +0.0% ) 1.43 1.77 -18.9% 0.975 0.974
2500.913 0.110 0.110 0.000 ( +0.0% ) 1.02 1.17 -12.7% 0.978 0.972

cmsbuild avatar Oct 15 '24 03:10 cmsbuild

Hi @jonathon-langford -- Thanks for this PR!

Would you mind clarifying two points?

1 - Why are you proposing a temporary fix? Is it because STXS 1.3 is not final? 2 - Why you plan to do backports? Samples for v13 and v14 are mostly produced, while NanoAODv15 will close soon and will encompass Run2 and Run3 samples.

Cheers, Felipe

ftorrresd avatar Oct 21 '24 15:10 ftorrresd

Hi @ftorrresd ,

Sure.

  1. Indeed, STXS 1.3 is not yet final but the variables which will be used for the boundaries are decided. When 1.3 is finalised there will be an updated Rivet routine, and we can switch to this. Hence why this fix is temporary . By adding the variables now, we can perform the 1.3 categorisation on-the-fly with v15, without the need for a nanoAOD v16.

  2. Okay, given this information the backports are not needed. It would be great to get this into v15.

Cheers, Jon

jonathon-langford avatar Oct 21 '24 15:10 jonathon-langford

+1

ftorrresd avatar Oct 28 '24 14:10 ftorrresd

@ftorrresd is there anything stopping this PR from being merged now?

jonathon-langford avatar Nov 12 '24 13:11 jonathon-langford

ping @cms-sw/generators-l2

hqucms avatar Nov 12 '24 16:11 hqucms

+1

lviliani avatar Nov 12 '24 17:11 lviliani

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. @rappoccio, @antoniovilela, @sextonkennedy, @mandrenguyen (and backports should be raised in the release meeting by the corresponding L2)

cmsbuild avatar Nov 12 '24 17:11 cmsbuild

+1

mandrenguyen avatar Nov 13 '24 11:11 mandrenguyen