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
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35594/25850
|
A new Pull Request was created by @cvuosalo (Carl Vuosalo) for master. It involves the following packages:
@civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@MarkusFrankATcernch Could you please review this PR and say whether it reflects proper usage of DD4hep? |
@cmsbuild please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d11649/19509/summary.html Comparison SummarySummary:
|
@cvuosalo Hi Carl, from all I can say, this PR looks correct. |
+1 |
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) |
+1 |
When DD4hep simulation is run, these harmless warning messages appear:
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 DD4hepEvaluator
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.