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

a first unit test for backward compatibility of Scouting data formats #41093

Merged
merged 1 commit into from Mar 24, 2023

Conversation

missirol
Copy link
Contributor

PR description:

This PR adds a refined version of the unit test described in #41040 (comment) [*]. The aim of the test is to fail whenever non-backward-compatible changes are introduced in the Scouting data formats.

The implementation of the test could certainly be improved (one suggestion is in #41040 (comment)), but I decided to open a draft PR because I think the test in this PR is better than nothing. (I plan to address #41040 (comment), but I don't have an ETA for that.)

[*]

More precisely, there are two unit tests, one for the Run-2 Scouting data formats ("Scouting*"), and one for the Run-3 ones ("Run3Scouting*"). The two tests have the same structure:

  • a 1st step reads O(100) events from an existing EDM file, and writes the Scouting collections to disk (this first step should fail if non-backward-compatible changes are made to the data formats);

  • a 2nd step uses FWLite to print to stdout one entry/object for each of the Scouting data formats being tested. To check that the correct values are read, the test compares the output of step-2 to a reference in the form of a text file. This is currently done for 1 object per data format. It might be necessary to check more than 1 object (and/or more than 1 event), because Add additional track variables to the Run 3 scouting electron collection for low pT electrons. #41025 (comment) showed that some issues can only be spotted when checking multiple objects/events.

PR validation:

The new unit tests pass locally.

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:

If accepted, it would be good to backport it to at least CMSSW_13_0_X.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41093/34712

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @missirol (Marino Missiroli) for master.

It involves the following packages:

  • DataFormats/Scouting (core)

@cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please review it and eventually sign? Thanks.
@rovere this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor

@cmsbuild, please test

Copy link
Contributor Author

@missirol missirol left a comment

Choose a reason for hiding this comment

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

A couple of typos I'll have to fix.

('vector<Run3ScoutingVertex>', 'hltScoutingPrimaryVertexPacker:primaryVtx')
]
else:
raise RuntimeError(f'getScoutingProductsList -- invalid key (must be "Scouting", "Run3Scouting"): "{key}"')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
raise RuntimeError(f'getScoutingProductsList -- invalid key (must be "Scouting", "Run3Scouting"): "{key}"')
raise RuntimeError(f'getScoutingProductsList -- invalid key (must be "Scouting", or "Run3Scouting"): "{key}"')

parser.add_argument('-n', '--maxEvents', type = int, help = 'Max number of input events to be processed',
default = 10)

parser.add_argument('--skipEvents', type = int, help = 'Number of input events to skipped',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
parser.add_argument('--skipEvents', type = int, help = 'Number of input events to skipped',
parser.add_argument('--skipEvents', type = int, help = 'Number of input events to be skipped',

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-4d50da/31391/summary.html
COMMIT: a790a14
CMSSW: CMSSW_13_1_X_2023-03-17-2300/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/41093/31391/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 5 lines from the logs
  • Reco comparison results: 12 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3550882
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3550854
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 213 log files, 164 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41093/34722

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

Pull request #41093 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please check and sign again.

@missirol
Copy link
Contributor Author

please test

(Only fixed a few typos.)

@missirol missirol changed the title [RFC] unit test for backward compatibility of Scouting data formats a first unit test for backward compatibility of Scouting data formats Mar 22, 2023
@missirol missirol marked this pull request as ready for review March 22, 2023 19:09
@missirol
Copy link
Contributor Author

missirol commented Mar 22, 2023

I’m wondering how we proceed with this PR. From my point of view, it could be integrated (unfortunately, I haven’t found time yet to work on the ‘EDAnalyzer version’ of the test).

I suppose these tests are better than nothing, so maybe it would be beneficial to get the tests in, and improve later.

Okay, I un-drafted the PR, and the last push integrates #41093 (comment). "Better than nothing" is indeed in the PR description. I would also backport this to 13_0_X, since that will be the data-taking release for a while (although having the unit test in master is probably sufficient to catch non-bckwd-compatible changes).

It might be necessary to check more than 1 object (and/or more than 1 event), because Add additional track variables to the Run 3 scouting electron collection for low pT electrons. #41025 (comment) showed that some issues can only be spotted when checking multiple objects/events.

This is also not addressed in this PR, and should be improved in the future.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41093/34793

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

Pull request #41093 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please check and sign again.

@makortel
Copy link
Contributor

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-4d50da/31524/summary.html
COMMIT: 48774f1
CMSSW: CMSSW_13_1_X_2023-03-22-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/41093/31524/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 15 lines to the logs
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3552750
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3552727
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 213 log files, 164 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor

Another incarnation of #39803

@makortel
Copy link
Contributor

+1

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

@perrotta
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.

None yet

4 participants