From 24e6e8a91d359e9b81777dc946fb2750b5580595 Mon Sep 17 00:00:00 2001 From: Alvaro Ezquerro Date: Fri, 14 Feb 2025 13:26:19 +0100 Subject: [PATCH 1/4] populate physical and logical names vectors from file definition of physvol --- src/TRestGeant4GeometryInfo.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/TRestGeant4GeometryInfo.cxx b/src/TRestGeant4GeometryInfo.cxx index 48dfca9..bce7034 100644 --- a/src/TRestGeant4GeometryInfo.cxx +++ b/src/TRestGeant4GeometryInfo.cxx @@ -85,6 +85,19 @@ void TRestGeant4GeometryInfo::PopulateFromGdml(const TString& gdmlFilename) { nameTable[physicalVolumeName] = refName; childrenTable[volumeName].push_back(physicalVolumeName); } + if (volumeRefNodeName.EqualTo("file")){ + TString fullFileName = myXml::GetNodeAttribute(xml, volumeRefNode, "name"); + TString fileName = TRestTools::GetFileNameRoot(fullFileName.Data()); + TString refName = myXml::GetNodeAttribute(xml, volumeRefNode, "ref"); + if (physicalVolumeName.IsNull()){ + physicalVolumeName = fileName + "_PV"; + } + if (refName.IsNull()){ + refName = fileName; + } + nameTable[physicalVolumeName] = refName; // ????????? + childrenTable[volumeName].push_back(physicalVolumeName); // ???????????? + } volumeRefNode = xml.GetNext(volumeRefNode); } physicalVolumeNode = xml.GetNext(physicalVolumeNode); From fa413b4984c33f2d696d54206ca17e9eaff283d4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 12:41:04 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestGeant4GeometryInfo.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/TRestGeant4GeometryInfo.cxx b/src/TRestGeant4GeometryInfo.cxx index bce7034..2b16317 100644 --- a/src/TRestGeant4GeometryInfo.cxx +++ b/src/TRestGeant4GeometryInfo.cxx @@ -85,18 +85,18 @@ void TRestGeant4GeometryInfo::PopulateFromGdml(const TString& gdmlFilename) { nameTable[physicalVolumeName] = refName; childrenTable[volumeName].push_back(physicalVolumeName); } - if (volumeRefNodeName.EqualTo("file")){ + if (volumeRefNodeName.EqualTo("file")) { TString fullFileName = myXml::GetNodeAttribute(xml, volumeRefNode, "name"); TString fileName = TRestTools::GetFileNameRoot(fullFileName.Data()); TString refName = myXml::GetNodeAttribute(xml, volumeRefNode, "ref"); - if (physicalVolumeName.IsNull()){ + if (physicalVolumeName.IsNull()) { physicalVolumeName = fileName + "_PV"; } - if (refName.IsNull()){ + if (refName.IsNull()) { refName = fileName; } - nameTable[physicalVolumeName] = refName; // ????????? - childrenTable[volumeName].push_back(physicalVolumeName); // ???????????? + nameTable[physicalVolumeName] = refName; // ????????? + childrenTable[volumeName].push_back(physicalVolumeName); // ???????????? } volumeRefNode = xml.GetNext(volumeRefNode); } From cc0a8db0fb7a7275bbb42b82d8f7406802d1f600 Mon Sep 17 00:00:00 2001 From: Alvaro Ezquerro Date: Fri, 14 Feb 2025 13:50:52 +0100 Subject: [PATCH 3/4] add TRestTools header --- src/TRestGeant4GeometryInfo.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TRestGeant4GeometryInfo.cxx b/src/TRestGeant4GeometryInfo.cxx index 2b16317..cd5e9f0 100644 --- a/src/TRestGeant4GeometryInfo.cxx +++ b/src/TRestGeant4GeometryInfo.cxx @@ -3,6 +3,7 @@ // #include "TRestGeant4GeometryInfo.h" +#include "TRestTools.h" #include #include From 385e7ac93d1f3ee1b30a81b89a82aa1d28c4a221 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 12:51:05 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestGeant4GeometryInfo.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TRestGeant4GeometryInfo.cxx b/src/TRestGeant4GeometryInfo.cxx index cd5e9f0..940715c 100644 --- a/src/TRestGeant4GeometryInfo.cxx +++ b/src/TRestGeant4GeometryInfo.cxx @@ -3,13 +3,14 @@ // #include "TRestGeant4GeometryInfo.h" -#include "TRestTools.h" #include #include #include +#include "TRestTools.h" + using namespace std; namespace myXml {