4 #ifndef XAODMUONPREPDATA_CHAMBERVIEWER_H
5 #define XAODMUONPREPDATA_CHAMBERVIEWER_H
11 #include <GeoModelKernel/throwExcept.h>
13 #define BUILD_TRAIT(traitName, conceptPass) \
14 template <typename T> struct traitName{}; \
15 template <conceptPass T> struct traitName<T>{static constexpr bool value = true;}; \
16 template <typename T> requires (!conceptPass <T>) struct traitName<T>{static constexpr bool value = false;};
38 namespace ChamberViewConcepts{
45 theObj.identifierHash();
55 namespace ChamberView {
64 template<ChamberViewConcepts::ContainerConcept HitObjContainer>
72 template <
typename HitObjType>
requires (std::is_pointer_v<HitObjType>)
struct ref_trait<HitObjType>{
74 using element_type =
typename std::remove_pointer_t<HitObjType>;
76 using const_type =
typename std::add_const_t<element_type>;
78 using type = std::add_pointer_t<const_type>;
81 template <
typename HitObjType>
requires (!std::is_pointer_v<HitObjType>)
struct ref_trait<HitObjType>{
83 using const_type =
typename std::add_const_t<HitObjType>;
93 m_container{container} {
102 m_container{container},
103 m_idHelperSvc{idHelperSvc},
121 HitObjContainer::const_iterator
end()
const noexcept {
133 return (*m_begin +
idx);
138 if (m_end == m_container.end()) {
143 m_currentHash = (*m_end)->identifierHash();
144 m_end = std::find_if(m_begin, m_container.end(),
146 return meas->identifierHash() != m_currentHash;
149 m_currentHash = idHash((*m_end)->identify());
150 m_end = std::find_if(m_begin, m_container.end(),
152 return idHash(meas->identify()) != m_currentHash;
155 if (m_begin == m_end)
return next();
165 m_begin = std::ranges::find_if(m_container,[
this,&detId](
const_ref meas) {
166 return idHash(meas->identify()) == detId;
168 m_end = std::find_if(m_begin, m_container.end(),[
this,&detId](
const_ref meas) {
169 return idHash(meas->identify()) != detId;
171 return m_begin != m_end;
178 m_begin = std::ranges::find_if(m_container,[&idHash](
const_ref meas) {
179 return meas->identifierHash() == idHash;
181 m_end = std::find_if(m_begin, m_container.end(),[&idHash](
const_ref meas) {
182 return meas->identifierHash() != idHash;
184 return m_begin != m_end;
188 m_begin = std::ranges::find_if(m_container,
selector);
189 m_end = std::find_if(m_begin, m_container.end(),
191 return !selector(meas);
193 return m_begin != m_end;
199 return m_mode == ViewMode::DetElement ? m_idHelperSvc->detElementHash(
id)
200 : m_idHelperSvc->moduleHash(
id);
206 HitObjContainer::const_iterator m_end{m_container.begin()};
207 HitObjContainer::const_iterator m_begin{m_container.begin()};