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

Fixes mismatches between emulator and fw on CDC dimuon seed #46026

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

nabrandman
Copy link
Contributor

PR description:

Corrects mismatches between emulator and firmware from L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142
This particular algorithm requires muon information from the current bunch crossing and the previous bunch crossing, this fix stores the previous bunch crossings in vectors so that the emulator can continue to access this muon data to check the conditions of this algorithm.

No changes are expected in the output.
This PR does not rely on any other PRs or externals.

PR validation:

Performed runTheMatrix with -l 11634.0, passed 5 out of 5 tests.
Test vector code was in agreement with firmware.
Changes were checked against "scram build code-format" to ensure they followed CMS Naming, Coding and Style Rules.

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:

This PR is not a backport

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 17, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • L1Trigger/L1TGlobal (l1)

@aloeliger, @cmsbuild, @epalencia can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @missirol, @mmusich 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

@mmusich
Copy link
Contributor

mmusich commented Sep 18, 2024

what's the interplay of this with #44940 and CMSHLT-3216?

@nabrandman
Copy link
Contributor Author

what's the interplay of this with #44940 and CMSHLT-3216?

If I understand the linked issues correctly then this PR shouldn't have any affect on them.

It looks to me like the problem described was that the object map didn't contain information about which BX an object came from, and so the HLTL1TSeed exclusively tried to add objects from BX=0, but sometimes when the object map was referring to an object from BX=-1 HLTL1TSeed would try to add a non-existent object, causing a crash.

All this PR changes is what muons the uGT emulator considers to be in BX=-1 & BX=-2 when evaluating if objects pass the conditions. So if HLTL1TSeed isn't adding objects from BX=-1 or BX=-2 anyway then this PR shouldn't affect it.

@mmusich
Copy link
Contributor

mmusich commented Sep 18, 2024

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 12KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-25b296/41603/summary.html
COMMIT: c8aefec
CMSSW: CMSSW_14_2_X_2024-09-18-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/46026/41603/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 1 lines to the logs
  • Reco comparison results: 5 differences found in the comparisons
  • DQMHistoTests: Total files compared: 44
  • DQMHistoTests: Total histograms compared: 3331158
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3331132
  • 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

@aloeliger
Copy link
Contributor

+l1

@cmsbuild
Copy link
Contributor

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

@mandrenguyen
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit dc4848f into cms-sw:master Sep 24, 2024
11 checks passed
@missirol
Copy link
Contributor

@cms-sw/l1-l2

I think #47030 shows (see its description) a case where this PR seems to introduce a disagreement between firmware and emulated decisions of the CDC seed (as opposed to removing such discrepancies).

Is it possible to have more details on the validation done for this PR ?

Is there a recipe to reproduce (a) the CDC firmware/emulator discrepancies seen before this PR, and (b) the removal of said discrepancies thanks to this PR ?

@aloeliger
Copy link
Contributor

@cms-sw/l1-l2

I think #47030 shows (see its description) a case where this PR seems to introduce a disagreement between firmware and emulated decisions of the CDC seed (as opposed to removing such discrepancies).

Is it possible to have more details on the validation done for this PR ?

Is there a recipe to reproduce (a) the CDC firmware/emulator discrepancies seen before this PR, and (b) the removal of said discrepancies thanks to this PR ?

@elfontan @nabrandman

@elfontan
Copy link
Contributor

elfontan commented Jan 10, 2025

Hi @missirol @aloeliger all,
Sorry for the late reply, I was waiting for a Rucio rule to access an EphemeralHLTPhysics dataset (ready just now) and repeat the kind of validation that (I guess) @nabrandman performed with this PR some months ago.

@nabrandman focused on checking the agreement via test vectors with the GT firmware, and the recipe followed was probably something like in the following. I ask him to confirm if the results that he observed were similar (e.g. an increased number of cases in which the emulator fires, as observed in the firmware and if the behaviour of the firmware test vector code was by chance counting all triggers -in all BXs- as opposed to only triggers in BX 0).

Validation steps

General recipe to prepare test vectors from data (in CMSSW_14_2_0_pre2, where cms-sw/cmssw#46026 is integrated):

cmsrel CMSSW_14_2_0_pre2
cd CMSSW_14_2_0_pre2/src/
git cms-init
cmsenv
git cms-init
git cms-addpkg L1Trigger/L1TGlobal
cd L1Trigger/L1TGlobal/
mkdir -p data/Luminosity/startup
cd data/Luminosity/startup
wget https://raw.githubusercontent.com/cms-l1-dpg/L1MenuRun3/refs/heads/master/development/L1Menu_Collisions2024_v1_3_0/L1Menu_Collisions2024_v1_3_0.xml
cd -
cp test/testVectorCode_data.py .                     # FOR DATA
> Edit testVectorCode_data.py and 1) make sure xml file is "L1Menu_Collisions2024_v1_3_0.xml" 2) Use a proper data file
voms-proxy-init --rfc --voms cms -valid 192:00
cmsRun testVectorCode_data.py 

A good data file to run from EphemeralHLTPhysics2 (now accessible thanks to a Rucio rule by @mtosi)

"/store/data/Run2024I/EphemeralHLTPhysics2/RAW/v1/000/386/593/00000/184a7ffb-babe-47de-a3f8-9a4190b2b011.root", 

The same flow can be run in CMSSW_14_2_0_pre1, instead, where PR cms-sw/cmssw#46026 is not available. (We can compare results between the two releases to reproduce before/after fix, equivalent to adding the PR on top of CMSSW_14_2_0_pre1.

Results (for 1 orbit=3564 events):

CMSSW_14_2_0_pre2:
L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142        19        19        19

CMSSW_14_2_0_pre1: 
L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142         5         5         5

@missirol
Copy link
Contributor

an increased number of cases in which the emulator fires, as observed in the firmware

Was it explicitly checked that this higher number of accepted events corresponds to better data-emulator agreement, or did you only observe that that seed was firing more often after the update of the emulator ?

CMSSW_14_2_0_pre2:
L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142        19        19        19

CMSSW_14_2_0_pre1: 
L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142         5         5         5

If I understand correctly, this only shows the emulated decision of that seed is "true" 19 times with #46026, and 5 times without it, but it does not really say anything on the agreement between unpacked and emulated decisions, does it ?

@missirol
Copy link
Contributor

Validation steps

General recipe to prepare test vectors from data (..)

Thanks for the feedback. I checked the agreement between unpacked and emulated GT decisions using the following recipe based on #46026 (comment).

cmsrel CMSSW_15_0_0_pre1
cd CMSSW_15_0_0_pre1/src
cmsenv
# the following branch adds a simple analyzer to print warnings
# in case of disagreements between unpacked and emulated GT decisions
git cms-merge-topic missirol:val_cmssw46026
mkdir -p L1Trigger/L1TGlobal/data/Luminosity/startup
cd L1Trigger/L1TGlobal/data/Luminosity/startup
wget https://raw.githubusercontent.com/cms-l1-dpg/L1MenuRun3/refs/heads/master/development/L1Menu_Collisions2024_v1_3_0/L1Menu_Collisions2024_v1_3_0.xml
cd -
scram b
voms-proxy-init --rfc --voms cms -valid 192:00
cmsRun L1Trigger/L1TGlobal/test/testVectorCode_data.py &> test1.log
grep L1_CDC test1.log

This is without reverting #46026, and it returns data-emulator disagreements for L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 in 21 events.

run: 386593 lumi: 204 event: 467063105 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 466418424 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 467023567 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 466147055 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 466159339 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 466307584 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 0, unpacked (initial) = 1
run: 386593 lumi: 204 event: 465154458 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 0, unpacked (initial) = 1
run: 386593 lumi: 204 event: 466671895 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 466720988 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 465355162 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 467006770 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 0, unpacked (initial) = 1
run: 386593 lumi: 204 event: 466086280 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 466445467 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 0, unpacked (initial) = 1
run: 386593 lumi: 204 event: 466896218 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 466990018 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 465455985 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 466911093 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 467140023 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 464967011 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 465233455 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 1, unpacked (initial) = 0
run: 386593 lumi: 204 event: 466733151 -- L1T decision (emulated vs. unpacked initial) is not the same: L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 (bit = 494), emulated = 0, unpacked (initial) = 1

If one reverts #46026, and reruns the same test, these disagreements go away: unpacked and emulated decisions for L1_CDC_SingleMu_3_er1p2_TOP120_DPHI2p618_3p142 agree for all events.

git revert c8aefec7c49eb9b9106d4544be4b73853f863822
scram b
cmsRun L1Trigger/L1TGlobal/test/testVectorCode_data.py &> test2.log
grep L1_CDC test2.log

Once again, this suggests to me that #46026 should be reverted.

@missirol
Copy link
Contributor

The revert of #46026 is now in #47088 (15_0_X) and #47089 (14_2_X). I suggest to move this discussion to #47088 (my bad for opening the discussion here in a merged PR).

cmsbuild added a commit that referenced this pull request Jan 15, 2025
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.

7 participants