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] Prohibit use of undefined materials #36496
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36496/27368
|
A new Pull Request was created by @cvuosalo (Carl Vuosalo) for master. It involves the following packages:
@civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild, @AdrianoDee, @srimanob can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild please test |
@cvuosalo , I think it is a very good approach to use exception in this case. |
ns.context()->unresolvedMaterials[nam].emplace_back( | ||
cms::DDParsingContext::CompositeMaterial(ns.prepend(fracname), fraction)); | ||
throw std::runtime_error("DD4CMS Exception -- Composite material \"" + fracname + "\" or \"" + | ||
ns.prepend(fracname) + "\" not yet defined."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be cms::Exception
?
-1 Failed Tests: UnitTests Unit TestsI found errors in the following unit tests: ---> test testDD4hepDDSolid had ERRORS ---> test DetectorDescriptionDDCMSTestDriver had ERRORS ---> test GeometryTrackerCommonDataTestDriver had ERRORS ---> test GeometryMuonCommonDataTestDriver had ERRORS and more ... Comparison SummarySummary:
|
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36496/27376
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36496/27395
|
Pull request #36496 was updated. @civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild, @AdrianoDee, @srimanob can you please check and sign again. |
<Include ref="Geometry/TrackerCommonData/data/testDDPixBarLayerUpgradeAlgorithm.xml"/> | ||
<Include ref="Geometry/CMSCommonData/data/materials/2015/v1/materials.xml"/> | ||
<Include ref="Geometry/TrackerCommonData/data/trackermaterial.xml"/> | ||
<Include ref="Geometry/CMSCommonData/data/materials/2021/v1/materials.xml"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test data file, v1
of materials.xml
needed to be used instead of the more recent v3
.
@cmsbuild please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-eda0e3/21297/summary.html Comparison SummarySummary:
|
+1 comments are addressed |
@srimanob, can you, please, review this? |
+Upgrade Technical PR to handle material of DD4hep. No change is expected from this PR. The PR test runs fine. |
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
|
There are several unit test errors appearing after this PR merged. Could you have a check? https://cmssdt.cern.ch/SDT/cgi-bin/logreader/slc7_amd64_gcc10/CMSSW_12_3_X_2021-12-17-2300/unitTestLogs/Geometry/TrackerGeometryBuilder#/54-54 dd4hep: Error interpreting XML nodes of type |
@qliphy I will fix those unit tests. The fix should be simple. |
[DD4hep] Follow-up to #36496 -- Update versions of materials files in unit tests
Our code allowed composite materials in the geometry to be defined out of order, but there was a subtle problem with the resolution of these materials. Also, it turned out that very few materials were defined out of order. It was decided to simply change the few cases of out-of-order material definitions rather than debug the complexities of supporting such definitions.
The re-ordering of material definitions was propagated to the DB geometry 1, so now we can change the code to simply prohibit out-of-order material definitions. This PR adds an exception if a material that was not yet defined is referenced in a geometry XML file.
The Phase 2 D77 scenario had one material that was defined out of order. This PR puts that definition in the correct order so D77 can be run with DD4hep.
A number of unit tests used obsolete materials files. This PR updates the versions of materials files in those tests so they don't generate the exception for out-of-order material definitions.
Going forward, the change in this PR should prevent the introduction into the geometry of any material definitions that are in the wrong order, provided any such geometry change is checked with DD4hep.
PR validation:
For Run 3, all materials are already defined in proper order, so this PR has no noticeable effect. A test was done with material definitions in the wrong order, and the exception was generated as desired.
With this PR, DD4hep Phase 2 D77 simulation runs successfully.
No backport is needed.