Skip to content
Snippets Groups Projects
Commit ae4944be authored by Johannes Junggeburth's avatar Johannes Junggeburth :dog2:
Browse files

Add volumeId to the GeoChildNodeWithTrf

parent 930ed375
No related branches found
No related tags found
1 merge request!412Query is nothing else than a std::optional but just came earlier
......@@ -7,6 +7,7 @@
#include "GeoModelKernel/GeoVPhysVol.h"
#include "GeoModelKernel/GeoDefinitions.h"
#include <optional>
class GeoVolumeCursor;
......@@ -27,9 +28,10 @@ struct GeoChildNodeWithTrf {
bool isAlignable{false};
/// @brief tag whether the physical volume is a full physVol
bool isSensitive{false};
/// @brief Identifier of the volume. If there's any and no copies are active
std::optional<int> volumeId{std::nullopt};
GeoChildNodeWithTrf() = default;
GeoChildNodeWithTrf(GeoVolumeCursor& curs);
GeoChildNodeWithTrf(GeoVolumeCursor& curs);
};
/*** @brief Returns all direct children of a volume with their transform. Equicalent volumes can be summarized.
......
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
#include <utility>
......@@ -20,11 +20,11 @@ namespace {
volume{curs.getVolume()},
nodeName{curs.getName()},
isAlignable{curs.hasAlignableTransform()},
isSensitive{typeid(*volume) == typeid(GeoFullPhysVol)} {
isSensitive{typeid(*volume) == typeid(GeoFullPhysVol)},
volumeId{static_cast<const std::optional<int>&>(curs.getId())} {
//// Do not specify a node name if it's a dummy one
if (nodeName == dummyNodeName) {
nodeName = volume->getLogVol()->getName();
}
}
......@@ -53,6 +53,7 @@ std::vector <GeoChildNodeWithTrf> getChildrenWithRef(PVConstLink physVol,
children.emplace_back(std::move(currentChild));
} else if (prevChild.nCopies == 1) {
++prevChild.nCopies;
prevChild.volumeId = std::nullopt;
prevChild.inductionRule = prevChild.transform.inverse() *
currentChild.transform;
} else if (!transSort.compare(prevChild.inductionRule,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment