Skip to content

Commit

Permalink
Merge pull request #28348 from ianna/display-gdml-file-v1
Browse files Browse the repository at this point in the history
Add a possibility to display a GDML file
  • Loading branch information
cmsbuild committed Nov 8, 2019
2 parents 1663c37 + c4cb8fc commit d39c3b7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Fireworks/Core/src/FWGeometryTableViewManager.cc
Expand Up @@ -94,12 +94,13 @@ void FWGeometryTableViewManager::setGeoManagerFromFile() {
TFile* file = FWGeometry::findFile(m_fileName.c_str());
fwLog(fwlog::kInfo) << "Geometry table file: " << m_fileName.c_str() << std::endl;
try {
if (!file)
throw std::runtime_error("No root file.");

file->ls();

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());
} else {
file->ls();
s_geoManager = (TGeoManager*)file->Get(m_TGeoName.c_str());
}
if (!s_geoManager)
throw std::runtime_error("Can't find TGeoManager object in selected file.");

Expand Down

0 comments on commit d39c3b7

Please sign in to comment.