DD4Hep FT API completeness
The Scifi is missing a couple of functions that allow for a navigation through the hierarchy, such as layer::quarters()
and quarter::modules()
. Such functionality is there for the DetDesc version, I believe. The following is supposed to work:
for (const DeFTStation& station : deft.stations())
{
for (const DeFTLayer& layer : station.layers())
{
std::cout << module.quarters().size() << std::endl;
}
}
Unfortunately, currently even the top loop causes problems in compilation:
for (const auto& station : ftDet.stations())
{
std::cout << "hi" << std::endl;
}
results in
In file included from /home/ldufour/stack/stack_dd4hep/LHCb/InstallArea/x86_64_v2-centos7-gcc11+dd4hep-opt/include/FTDet/DeFTDetector.h:25,
from ../Pr/PrAlgorithms/src/MyFTVisualizer.cpp:22:
/home/ldufour/stack/stack_dd4hep/Detector/InstallArea/x86_64_v2-centos7-gcc11+dd4hep-opt/include/Detector/FT/DeFT.h: In instantiation of 'const std::array<LHCb::Detector::DeFTStationElement<LHCb::Detector::detail::DeFTStationObject>, 3> LHCb::Detector::DeFTElement<ObjectType>::stations() const [with ObjectType = LHCb::Detector::detail::DeFTObject]':
../Pr/PrAlgorithms/src/MyFTVisualizer.cpp:133:46: required from here
/home/ldufour/stack/stack_dd4hep/Detector/InstallArea/x86_64_v2-centos7-gcc11+dd4hep-opt/include/Detector/FT/DeFT.h:72:73: error: could not convert '{((LHCb::Detector::detail::DeFTObject*)obj)->LHCb::Detector::detail::DeFTObject::m_stations.std::array<LHCb::Detector::detail::DeFTStationObject, 3>::operator[](0), ((LHCb::Detector::detail::DeFTObject*)obj)->LHCb::Detector::detail::DeFTObject::m_stations.std::array<LHCb::Detector::detail::DeFTStationObject, 3>::operator[](1), ((LHCb::Detector::detail::DeFTObject*)obj)->LHCb::Detector::detail::DeFTObject::m_stations.std::array<LHCb::Detector::detail::DeFTStationObject, 3>::operator[](2)}' from '<brace-enclosed initializer list>' to 'const std::array<LHCb::Detector::DeFTStationElement<LHCb::Detector::detail::DeFTStationObject>, 3>'
72 | return {obj->m_stations[0], obj->m_stations[1], obj->m_stations[2]};
| ^
| |
| <brace-enclosed initializer list>