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

[DD4hep] Add check for existing constant to prevent unneeded warning message #35594

Merged
merged 1 commit into from Oct 11, 2021

Conversation

cvuosalo
Copy link
Contributor

@cvuosalo cvuosalo commented Oct 8, 2021

When DD4hep simulation is run, these harmless warning messages appear:

Evaluator        WARN  +++ Overwriting variable: name=world_x value=101*m  Evaluator::Object : existing variable [setVariable error]
Evaluator        WARN  +++ Overwriting variable: name=world_y value=101*m  Evaluator::Object : existing variable [setVariable error]
Evaluator        WARN  +++ Overwriting variable: name=world_z value=450*m  Evaluator::Object : existing variable [setVariable error]

They are caused because two instances of a DD4hep Detector are created, one for the magnetic field and one for the CMS detector, and these three numeric variables are set for both. The DD4hep Evaluator is shared among all instances, so when the constants are defined a second time, these harmless warning messages are issued by DD4hep.

The fix is to check for the existence of a constant before adding it to the shared DD4hep dictionary. With this PR, constants that already exist are not added again, and the warning message is prevented. Note that the constants are still defined separately inside each Detector instance.

This PR resolves CMS issue #33712 and part of DD4hep issue AIDASoft/DD4hep#844.

PR validation:

When DD4hep simulation is run with this PR, the warning messages do not appear, and simulation completes successfully.

No backport is necessary. Since the warning messages are harmless, it is OK to leave them in 12_0.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 8, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35594/25850

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 8, 2021

A new Pull Request was created by @cvuosalo (Carl Vuosalo) for master.

It involves the following packages:

  • DetectorDescription/DDCMS (geometry)

@civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild can you please review it and eventually sign? Thanks.
@fabiocos, @slomeo, @vargasa this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@cvuosalo
Copy link
Contributor Author

cvuosalo commented Oct 8, 2021

@MarkusFrankATcernch Could you please review this PR and say whether it reflects proper usage of DD4hep?

@cvuosalo
Copy link
Contributor Author

cvuosalo commented Oct 8, 2021

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 9, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d11649/19509/summary.html
COMMIT: 31a741c
CMSSW: CMSSW_12_1_X_2021-10-08-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/35594/19509/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 40
  • DQMHistoTests: Total histograms compared: 2798082
  • DQMHistoTests: Total failures: 12
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2798048
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 39 files compared)
  • Checked 169 log files, 37 edm output root files, 40 DQM output files
  • TriggerResults: no differences found

@MarkusFrankATcernch
Copy link

@cvuosalo Hi Carl, from all I can say, this PR looks correct.

@civanch
Copy link
Contributor

civanch commented Oct 11, 2021

+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, @qliphy (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

5 participants