4#ifndef MUONTRACKEVENT_AuthorHierachy_H
5#define MUONTRACKEVENT_AuthorHierachy_H
9#include "Acts/Utilities/PointerTraits.hpp"
28 template <
typename ObjType>
concept hasAuthor =
requires(
const ObjType& obj) {
29 { obj.author() } -> std::same_as<xAOD::Muon::Author>;
44 template <detail::hasAuthor ObjType>
46 return (*
this)(
a.author(), b.author());
50 template <Acts::Po
interConcept ObjPtr>
54 return (*
this)(*
a, *b);
59 template <detail::hasAuthor ObjType>
61 if (
a.empty() || b.empty()) {
65 assert(std::all_of(
a.begin(),
a.end(), [&](
const auto obj){
66 return obj->author() == a.at(0)->author();
68 assert(std::all_of(b.begin(), b.end(), [&](
const auto obj){
69 return obj->author() == b.at(0)->author();
72 return (*
this)(
a.front(), b.front());
76 template <detail::hasAuthor ObjType>
78 assert(
a !=
nullptr);
79 assert( b !=
nullptr);
80 return (*
this)(*
a, *b);
An STL vector of pointers that by default owns its pointed-to elements.
All objects can be arranged by the AuthorHierachy, if they satisfy the hasAuthor concept.
This header ties the generic definitions in this package.
Implemenation of the utility class.
bool operator()(const Author a, const Author b) const
Sorting operator between two Author values based on the author rank.
bool operator()(const ObjType &a, const ObjType &b) const
Ranks two objects satisfying the hasAuthor concept according to their Author rank.
bool operator()(const DataVector< ObjType > &a, const DataVector< ObjType > &b) const
Ranks two Data vector collections of objects satisfying the hasAuthor concept according to their Auth...
unsigned authorRank(const Author author) const
Ranks the author according to the list above.
bool operator()(const DataVector< ObjType > *a, const DataVector< ObjType > *b) const
Ranks two pointers of data vectors according to the authorRank of the underlying data vector.
bool operator()(const ObjPtr &a, const ObjPtr &b) const
Ranks two pointers according to the Author rank of the objects they are pointing to.
xAOD::Muon::Author Author