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 second name to elementary materials for Geant4 GDML #36149

Merged
merged 2 commits into from Nov 19, 2021

Conversation

cvuosalo
Copy link
Contributor

Elementary materials inside ROOT and Geant4 use two names, called variously the "name" and "title" or the "name" and "symbol". With DD4hep, redefined elements were given the second name "CMS element" because it was thought that this second name was not used. However, it does show up in Geant4 GDML and causes confusion when multiple elements all have "CMS element" as a second name.

It should be noted that our code uses ROOT elements unchanged by default, unless they have atomic masses that differ from the standard atomic masses specified for Geant4, in which case the elements are redefined.

This PR leaves ROOT elements unchanged, but for those elements our code redefines to make their atomic masses match the Geant4 standard, their two names are made to match each other. Thus, ROOT elements have names like "HYDROGEN (H)", while redefined elements have names like "Oxygen (Oxygen)". The format of the names doesn't matter as long as the names are unique.

This PR also promotes to Warning messages about composite materials that have undefined components. It is planned to make this condition an exception, with the Warning message as a first step to allow changing any remaining cases in Phase 2 before the exception is implemented.

A simple fix of the DD4hep overlap check config is also included in this PR.

PR validation:

The SimG4Core/PrintGeomInfo/test/python/g4OverlapCheckDD4hep_cfg.py was run to check the Geant4 materials list and the GDML file to verify that they contain unique element names for both names.

No backport is needed.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36149/26689

  • This PR adds an extra 32KB to repository

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • DetectorDescription/DDCMS (geometry)
  • SimG4Core/PrintGeomInfo (simulation)

@civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild can you please review it and eventually sign? Thanks.
@vargasa, @makortel, @rovere, @bsunanda, @fabiocos, @slomeo 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

@civanch
Copy link
Contributor

civanch commented Nov 17, 2021

@cvuosalo , in Geant4 both name and symbol are used only for printout. There is no practical sense to define symbol for Geant4 element derived from TGeo element.

Geant4 team do not recommend to build elements from G4Element(..) constructor, instead G4NistMaterial::Instance()->FindOrBuildElement(G4int Z) interface should be used.

@civanch
Copy link
Contributor

civanch commented Nov 17, 2021

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-358b2d/20581/summary.html
COMMIT: 89068eb
CMSSW: CMSSW_12_2_X_2021-11-16-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/36149/20581/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: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 42
  • DQMHistoTests: Total histograms compared: 3327156
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3327134
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 41 files compared)
  • Checked 177 log files, 37 edm output root files, 42 DQM output files
  • TriggerResults: no differences found

@cvuosalo
Copy link
Contributor Author

+1

@cvuosalo
Copy link
Contributor Author

@civanch I'm not sure I understand your comment. Should anything be changed in this PR, or is your comment for future consideration?

@civanch
Copy link
Contributor

civanch commented Nov 18, 2021

+1

my comments for further fixes: with DD4Hep we have unreasonable material and elements names.

@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)

@qliphy
Copy link
Contributor

qliphy commented Nov 19, 2021

+1

@cmsbuild cmsbuild merged commit f901f5b into cms-sw:master Nov 19, 2021
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