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] Need more helpful error message for out-of-order XML files #31198

Closed
cvuosalo opened this issue Aug 20, 2020 · 8 comments
Closed

[DD4hep] Need more helpful error message for out-of-order XML files #31198

cvuosalo opened this issue Aug 20, 2020 · 8 comments

Comments

@cvuosalo
Copy link
Contributor

XML files must be processed in order such that objects are defined before they are referenced. It is an easy error for a developer to make to list files in the wrong order. The current error message for this problem does not fully describe the problem:

DD4CMS                 Processing a LogicalPartSection
DD4CMS                 +++ Current namespace is now: cavern:
DD4CMS                 +++ Current namespace is now: cavern:
DD4CMS           ERROR Exception processing xml source:file:///afs/cern.ch/work/c/cvuosalo/geometry/CMSSW_11_2_0_pre2_gemnumbug/src/Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml
DD4CMS           ERROR ----> Attempt to access invalid object of type TGeoShape [Invalid Handle]
dd4hep: Error interpreting XML nodes of type <LogicalPart/>
dd4hep: Error interpreting XML nodes of type <LogicalPartSection/>

The problem in this example is that the LogicalPart refers to a solid that hasn't been defined, but that fact is not clear from the error message.
The message should be enhanced to explain that an undefined object has been referenced and to give the name of the object.

Improving this message probably would entail changes in DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc.

@cmsbuild
Copy link
Contributor

A new Issue was created by @cvuosalo Carl Vuosalo.

@Dr15Jones, @dpiparo, @silviodonato, @smuzaffar, @makortel, @qliphy can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@cvuosalo
Copy link
Contributor Author

assign geometry

@cmsbuild
Copy link
Contributor

New categories assigned: geometry

@Dr15Jones,@cvuosalo,@mdhildreth,@makortel,@ianna,@civanch you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cvuosalo
Copy link
Contributor Author

One way to generate this error is to modify Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D49.xml by moving cavern.xml very early in the list of XML files, to a position prior to the other XML files that define the solids it uses, in particular prior to muonBase.xml. Then cmsRun Geometry/CMSCommonData/test/dd4hep/2026D49.py will generate the error.

@ianna
Copy link
Contributor

ianna commented Aug 21, 2020

@cvuosalo - Could you please make a unit test in DetectorDescription/DDCMS to reproduce the problem? It should be a simple XML file in https://cmssdt.cern.ch/lxr/source/DetectorDescription/DDCMS/test/data/, not a full scenario. The scenarios in Geometry/CMSCommonData are auto generated. Thanks!

@cvuosalo
Copy link
Contributor Author

cvuosalo commented Mar 1, 2022

This issue is resolved by PR #37112.

@cvuosalo
Copy link
Contributor Author

cvuosalo commented Mar 2, 2022

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 2, 2022

This issue is fully signed and ready to be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants