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

Add a possibility to display a GDML file #28348

Merged
merged 1 commit into from Nov 8, 2019

Conversation

ianna
Copy link
Contributor

@ianna ianna commented Nov 5, 2019

PR description:

A GDML file produced by G4 GDML writer can be viewed in cmsShow. For example:

cmsShow -c g4Geom.fwc --sim-geom-file=cmsG4Geometry.gdml --tgeo-name=world-volume

Screen Shot 2019-11-05 at 12 06 08

@civanch - FYI

PR validation:

if this PR is a backport please specify the original PR:

Before submitting your pull requests, make sure you followed this checklist:

@cmsbuild cmsbuild added this to the CMSSW_11_0_X milestone Nov 5, 2019
@ianna
Copy link
Contributor Author

ianna commented Nov 5, 2019

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 5, 2019

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 5, 2019

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28348/12627

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 5, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/3353/console Started: 2019/11/05 15:34

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 5, 2019

A new Pull Request was created by @ianna (Ianna Osborne) for master.

It involves the following packages:

Fireworks/Core

@cmsbuild, @alja, @Dr15Jones can you please review it and eventually sign? Thanks.
@alja this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 5, 2019

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 5, 2019

Comparison not run due to Fireworks only changes in PR (RelVals and Igprof tests were also skipped)

@civanch
Copy link
Contributor

civanch commented Nov 5, 2019

@ianna , looks great.

s_geoManager = (TGeoManager*)file->Get(m_TGeoName.c_str());
if (!file) {
// Try it as a GDML file
s_geoManager = TGeoManager::Import(m_fileName.c_str(), m_TGeoName.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ianna as far as I can see TGeoManager has already a protection against odd files, and in any case the final check here on the pointer not being null should be enough...

@fabiocos
Copy link
Contributor

fabiocos commented Nov 6, 2019

@alja could you please check?

@ianna
Copy link
Contributor Author

ianna commented Nov 6, 2019 via email

@alja
Copy link
Contributor

alja commented Nov 6, 2019

@fabio
The argument in FWGeometryTableViewManager::setGeoManagerFromFile() can be a root file or GDML file, which is not in root format. The TGeoManager can read the GDML files, but TFile can't be created out of it.

I think Yana's change is OK. But, I would change FWGeometry::findPath() [1] to locate just a file location without creating the TFile object. This will make a consistent search for a geo files in given environment. @yana can you also make that change?

https://github.com/cms-sw/cmssw/blob/master/Fireworks/Core/src/FWGeometry.cc#L26

@fabiocos
Copy link
Contributor

fabiocos commented Nov 8, 2019

@alja @ianna thanks for your comments, mine was not a doubt but just stating that the code should be safe also because of the TGeoManager built-in protection.

@ianna there is a suggestion for an update (with the wrong address, may be you did not see it) #28348 (comment)
Although in that piece of code I do not see a real use case now, it does not harm I would say.

@ianna
Copy link
Contributor Author

ianna commented Nov 8, 2019

@fabiocos and @alja - I think, searching for the GDML files in the CMSSW paths is not required since it's not a standard geometry file, but rather an import from another tool for debugging purposes only. Using --sim-geom-file option is a quick solution, but perhaps we should introduce another command line option --import-geom-file? We ought to discuss it and it would be another PR implementing it.

@civanch
Copy link
Contributor

civanch commented Nov 8, 2019

@ianna , @fabiocos , @alja , as far as I know, we do not have any gdml files inside CMSSW data. Production of a new gdml for any version of CMS or a sub-detector takes few minutes. In our practice, we provide these gdml for external use, for example, to study geometry performance by geometry experts of Geant4. I am not sure, if it is required to have an official gdml files supported by CMSSW external data facility. So, for me this PR is fine.

@alja
Copy link
Contributor

alja commented Nov 8, 2019

@ianna Thanks Yana for the explanation. To me PR is fine too.
+1

@fabiocos
Copy link
Contributor

fabiocos commented Nov 8, 2019

@alja apparently your +1 has not been seen by the bot as it is not the first character, anyway your will is clear, thanks

@fabiocos
Copy link
Contributor

fabiocos commented Nov 8, 2019

+1

@fabiocos
Copy link
Contributor

fabiocos commented Nov 8, 2019

merge

@cmsbuild cmsbuild merged commit d39c3b7 into cms-sw:master Nov 8, 2019
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