Skip to content

[L1T] PR containing simulation and emulation related to jet mass reconstruction (Phase-2) #47792

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

Merged
merged 11 commits into from
May 8, 2025

Conversation

lrobertshaw
Copy link
Contributor

@lrobertshaw lrobertshaw commented Apr 4, 2025

PR description:

Added logic for calculating jet mass in simulation where no approximations are made. Also added logic for firmware emulation which is bit-accurate to firmware implementation and makes a number of approximations for firmware efficiency. To integrate this work with the various taggers, a number of changes were made to the datatypes which the jet mass is read out to.

PR validation:

Resolution plots produced and compared with existing algorithms which already calculate mass (AK8) to check that the mass is similar. Simulation and emulation checked to match up well. Emulator and firmware match validated by GitLab CI pipelines in CMS-cactus repository and via running tests locally.

Edit: extra context added after PR was opened:

Below are two links for the slides from the two talks I gave on this, the first one contains the resolution plots comparing the SC8 PUPPI jet mass to AK8 PUPPI jet and AK8 gen jets without low pT constituents. I have also attached plots showing the performance of a hypothetical jet pT OR jet mass trigger, one plot being as a function of generator jet pT and the other as a function of generator jet mass. The takeaway is that at a fixed rate of 60 kHz, you increase the level-1 acceptance from 73.5% to 81.0% on a sample containing hypothetical Higgs bosons of masses 20, 40, 60 and 80 GeV, decaying to merged jets. How this extra level-1 acceptance should be utilised upstream is not yet decided - this trigger slightly boosts the offline acceptance (by a few %) of the existing pT seed, but an offline seed based on mass would gain more.

image
image
jet_tagging_2.pdf
jet_tagging_1.pdf

Commits squashed into one for the PR, below are all commit messages:

  • Adding another commit to squash ahead of PR
  • Squashing 38 previous commits relating to jet mass ahead of opening pull request
  • added logic for calculating jet mass and added this mass to the jet mass value, values printed to screen to ensure they are being set but currently mass not present in ntuples - default value of 0 present
  • changes for calculating jet mass in SW imp
  • Added code to use external seeds for SW implementation
  • removed printing for debug info
  • modified SC jet emulator header file to support jet mass inside l1ct jet type, then changed jet producer plugin to fill the EDM jet with this mass and also changed jet emulator src code makeJet_HW function so it calculates something, though its not correctly the jet mass
  • added mass calculation to emulator following same method as firmware imp, but without LUTs
  • pt_t doesnt have good enough precision for squared values - changed to use floats for now
  • converted eta/phi to from global to relative for jet mass calculation
  • changed emulator imp to use fixed types which give same precision as float with as few bits as possible
  • changed code to use LUTs as implemented in firmware instead of using cpp math functions
  • added code to sort and truncate constituents before passing to jet mass function, uses identical types to firmware
  • introduced preprocessing steps to jet mass function to replicate the format that constituents are received as in firmware
  • Fix eta/phi fiducial check for charged PUPPI candidates
  • Replace the isFiducial(hwEta, hwPhi) call for charged PUPPI candidates to use hwVtxEta and hwVtxPhi instead of hwEta and hwPhi.
  • modified datatypes and methods to handle jet mass
  • Use seed passed in to makeJet_HW as starting point for jet axis.
  • fixes after rebase
  • Cleaning up code and synchronising with p2l1pfp CMSSW fork
  • restored L1CaloTrigger package
  • added SC8 sim jets to the emulator chain
  • fixed a bug with calculating sim jet mass
  • cleaned up how LUTs are produced and synchronised with how it is done in firmware
  • removed old commented out code
  • added floatMass method to gt namespace
  • code-format and code-checks stylistic modifications
  • Fix handling of phi wrap around.
  • changed gt jet equality operator to also check mass
  • populate edmJet using GT jet mass
  • changes for testing using mass2
  • Put jet mass on second jet word. Add helper function for unpacking two-word jets.
  • made changes to use second word to store jet mass squared, instead of first word for jet mass
  • just code-checks and code-formats changes
  • store unsorted parts not truncated, sorted sparse parts as causes segfault
  • trying to fix seg fault
  • increasing bit width to allow for second word in l1ct::jets
  • fixed bug with LUTs due to compiler dependent rounding vs truncation order
  • Set mass to 17 bits and replace b tag score so that the CT jet is 64 bits.
  • code-checks and code-format
  • added sc8 corrected just to python config
  • Define separate GT Jet format for wide cone jets.
  • removed old commented out code

Adding another commit to squash ahead of PR

Squashing 38 previous commits relating to jet mass ahead of opening pull request

added logic for calculating jet mass and added this mass to the jet mass value, values printed to screen to ensure they are being set but currently mass not present in ntuples - default value of 0 present

changes for calculating jet mass in SW imp

Added code to use external seeds for SW implementation

removed printing for debug info

modified SC jet emulator header file to support jet mass inside l1ct jet type, then changed jet producer plugin to fill the EDM jet with this mass and also changed jet emulator src code makeJet_HW function so it calculates something, though its not correctly the jet mass

added mass calculation to emulator following same method as firmware imp, but without LUTs

pt_t doesnt have good enough precision for squared values - changed to use floats for now

converted eta/phi to from global to relative for jet mass calculation

changed emulator imp to use fixed types which give same precision as float with as few bits as possible

changed code to use LUTs as implemented in firmware instead of using cpp math functions

added code to sort and truncate constituents before passing to jet mass function, uses identical types to firmware

introduced preprocessing steps to jet mass function to replicate the format that constituents are received as in firmware

Fix eta/phi fiducial check for charged PUPPI candidates

Replace the isFiducial(hwEta, hwPhi) call for charged PUPPI candidates to use hwVtxEta and hwVtxPhi instead of hwEta and hwPhi.

modified datatypes and methods to handle jet mass

Use seed passed in to makeJet_HW as starting point for jet axis.

fixes after rebase

Cleaning up code and synchronising with p2l1pfp CMSSW fork

restored L1CaloTrigger package

added SC8 sim jets to the emulator chain

fixed a bug with calculating sim jet mass

cleaned up how LUTs are produced and synchronised with how it is done in firmware

removed old commented out code

added floatMass method to gt namespace

code-format and code-checks stylistic modifications

Fix handling of phi wrap around.

changed gt jet equality operator to also check mass

populate edmJet using GT jet mass

changes for testing using mass2

Put jet mass on second jet word.  Add helper function for unpacking two-word jets.

made changes to use second word to store jet mass squared, instead of first word for jet mass

just code-checks and code-formats changes

store unsorted parts not truncated, sorted sparse parts as causes segfault

trying to fix seg fault

increasing bit width to allow for second word in l1ct::jets

fixed bug with LUTs due to compiler dependent rounding vs truncation order

Set mass to 17 bits and replace b tag score so that the CT jet is 64 bits.

code-checks and code-format

added sc8 corrected just to python config

Define separate GT Jet format for wide cone jets.

removed old commented out code
@cmsbuild cmsbuild changed the base branch from CMSSW_15_1_X to master April 4, 2025 09:32
@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 4, 2025

@lrobertshaw, CMSSW_15_1_X branch is closed for direct updates. cms-bot is going to move this PR to master branch.
In future, please use cmssw master branch to submit your changes.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 4, 2025

cms-bot internal usage

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 4, 2025

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47792/44372

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

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 4, 2025

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47792/44373

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 4, 2025

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

It involves the following packages:

  • DataFormats/L1TParticleFlow (l1, upgrade)
  • L1Trigger/Configuration (l1)
  • L1Trigger/Phase2L1ParticleFlow (l1, upgrade)

@BenjaminRS, @Moanwar, @cmsbuild, @quinnanm, @srimanob, @subirsarkar can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @missirol, @mmusich, @rovere 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

@BenjaminRS
Copy link
Contributor

test parameters:

  • workflow = 29634.78
  • relvals_opt = --what cleanedupgrade,standard,highstats,pileup,generator,extendedgen,production,identity,ged,machine,premix,nano,gpu,2017,2026

@BenjaminRS
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 4, 2025

-1

Failed Tests: RelVals
Size: This PR adds an extra 52KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-56a96b/45385/summary.html
COMMIT: f224be0
CMSSW: CMSSW_15_1_X_2025-04-03-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/47792/45385/install.sh to create a dev area with all the needed externals and cmssw changes.

@cmsbuild
Copy link
Contributor

cmsbuild commented May 7, 2025

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47792/44731

@cmsbuild
Copy link
Contributor

cmsbuild commented May 7, 2025

Pull request #47792 was updated. @BenjaminRS, @Moanwar, @cmsbuild, @quinnanm, @srimanob, @subirsarkar can you please check and sign again.

@BenjaminRS
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented May 7, 2025

+1

Size: This PR adds an extra 220KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-56a96b/45901/summary.html
COMMIT: 9daabf3
CMSSW: CMSSW_15_1_X_2025-05-06-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/47792/45901/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

@BenjaminRS
Copy link
Contributor

+l1

@Moanwar
Copy link
Contributor

Moanwar commented May 7, 2025

+Upgrade

@cmsbuild
Copy link
Contributor

cmsbuild commented May 7, 2025

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

@Dr15Jones
Copy link
Contributor

Old checksums should be static

@mandrenguyen
Copy link
Contributor

+1

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.

9 participants