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

Fix JetHTAnalyzer::fillDescriptions #40677

Merged
merged 2 commits into from Feb 3, 2023

Conversation

mmusich
Copy link
Contributor

@mmusich mmusich commented Feb 2, 2023

PR description:

It was reported by @jusaviin that the declaration of the configuration parameters in the fillDescriptions method of the JetHTAnalyzer

desc.add<int>("printTriggerTable", false);
desc.add<double>("minVertexNdf", 10.);
desc.add<double>("minVertexMeanWeight", 0.5);
desc.add<std::vector<double>>("profilePtBorders", {3, 5, 10, 20, 50, 100});
desc.add<std::vector<double>>("iovList", {0, 500000});
descriptions.addWithDefaultLabel(desc);

plugins doesn't agree with their usage in the all-in-one configuration:

printTriggerTable = cms.untracked.int32(printTriggers),
minVertexNdf = cms.untracked.double(10.),
minVertexMeanWeight = cms.untracked.double(0.5),
profilePtBorders = cms.untracked.vdouble(ptBorders),
iovList = cms.untracked.vint32(iovListList)

This results in runtime failures.
This PR fixes the issue in commit 7cc01f8
I profit of this to update the unit tests testTrackAnalyzers in order to test that the two do not go out of synch again.

PR validation:

Relies on the existing unit tests (scram b runtests_testTrackAnalysis)

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:

N/A

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 2, 2023

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-40677/34025

  • This PR adds an extra 36KB to repository

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

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 2, 2023

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-40677/34027

  • This PR adds an extra 36KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 2, 2023

A new Pull Request was created by @mmusich (Marco Musich) for master.

It involves the following packages:

  • Alignment/OfflineValidation (alca)

@malbouis, @yuanchao, @cmsbuild, @saumyaphor4252, @francescobrivio, @ChrisMisan, @tvami can you please review it and eventually sign? Thanks.
@mmusich, @adewit, @tocheng, @tlampen 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

@mmusich
Copy link
Contributor Author

mmusich commented Feb 2, 2023

type bug-fix

@mmusich
Copy link
Contributor Author

mmusich commented Feb 2, 2023

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 3, 2023

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-761149/30370/summary.html
COMMIT: 90f9cb9
CMSSW: CMSSW_13_0_X_2023-02-02-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/40677/30370/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 8 lines to the logs
  • Reco comparison results: 5 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3555495
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3555470
  • 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

@tvami
Copy link
Contributor

tvami commented Feb 3, 2023

+alca

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 3, 2023

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

perrotta commented Feb 3, 2023

@mmusich a simpler way to be sure that all parameters stay in sinc (and to check that by mistake you did not misspelled any of their names also) is to replace

process.jetHTAnalyzer = cms.EDAnalyzer('JetHTAnalyzer',
vtxCollection = cms.InputTag("offlinePrimaryVerticesFromRefittedTrks"),
trackCollection = cms.InputTag("TrackRefitter"),
triggerResults = cms.InputTag("TriggerResults","","HLT"),
printTriggerTable = cms.untracked.int32(printTriggers),
minVertexNdf = cms.untracked.double(10.),
minVertexMeanWeight = cms.untracked.double(0.5),
profilePtBorders = cms.untracked.vdouble(ptBorders),
iovList = cms.untracked.vint32(iovListList)
)
with:

from Alignment.OfflineValidation.jetHTAnalyzer_cfi.py import jetHTAnalyzer as _jetHTAnalyzer
process.jetHTAnalyzer = _jetHTAnalyzer.clone(
                                       vtxCollection       = "offlinePrimaryVerticesFromRefittedTrks",
                                       trackCollection	   ="TrackRefitter",
                                       triggerResults      = ("TriggerResults","","HLT"),
                                       printTriggerTable   = printTriggers,
                                       minVertexNdf        = 10.,
                                       minVertexMeanWeight = 0.5,
                                       profilePtBorders    = ptBorders,
                                       iovList             = iovListList
)

(which is why the release managers tend to bother the proponents of the PRs to make them remove type specifications from the cloned configs in python...)

@perrotta
Copy link
Contributor

perrotta commented Feb 3, 2023

+1

@mmusich
Copy link
Contributor Author

mmusich commented Feb 3, 2023

@perrotta

simpler way to be sure that all parameters stay in sinc (and to check that by mistake you did not misspelled any of their names also) is to replace

Right, let's do it for all the configuration files in this package another time

@cmsbuild cmsbuild merged commit 23bfa15 into cms-sw:master Feb 3, 2023
@mmusich
Copy link
Contributor Author

mmusich commented Feb 3, 2023

Also, for the record, in addition to have wrong types declared in the configuration, the plugin had a mismatch between the type expected in the constructor and the one declared in fillDescriptions. AFAIU, your solution does not prevent that kind of mistake, while the unit test does.

@perrotta
Copy link
Contributor

perrotta commented Feb 3, 2023

Also, for the record, in addition to have wrong types declared in the configuration, the plugin had a mismatch between the type expected in the constructor and the one declared in fillDescriptions. AFAIU, your solution does not prevent that kind of mistake, while the unit test does.

I am not against your unit test, which is welcome. I'm just sponsorizing a cleaner way of writing configs, which may prevent quite several possible mistakes, but not all (in particolar, it cannot fix bugs in the c++ code as the one that you are reporting)

@mmusich
Copy link
Contributor Author

mmusich commented Feb 4, 2023

Right, let's do it for all the configuration files in this package another time

for the record, that's done at #40695

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