1 #ifndef Geometry_TrackerNumberingBuilder_trackerStablePhiSort_H 2 #define Geometry_TrackerNumberingBuilder_trackerStablePhiSort_H 8 template<
class RandomAccessIterator,
class Extractor>
11 using Scalar = decltype(extr(*begin));
13 using Element = std::pair<Scalar, Value*>;
15 std::vector<Element> tmpvec(end-begin);
16 std::transform(begin,end,tmpvec.begin(), [&extr](
Value& it){
return Element(extr(it), &it); });
24 constexpr unsigned int nMaxModulesPerRing = 5;
29 const unsigned int n = tmpvec.size();
31 if( n > nMaxModulesPerRing ) {
34 if(
std::abs(tmpvec.back().first - 0) < tolerance
38 tmpvec.insert(tmpvec.begin(),tmpvec.back());
46 auto p = std::find_if(tmpvec.begin(),tmpvec.end(), [&
phiMin](
auto const&
x){
return x.first >
phiMin; });
50 if(
p == tmpvec.end() ||
p->first >=
phiMax) {
55 tmpvec.insert(tmpvec.begin(),
p,tmpvec.end());
63 std::vector<Value> tmpvecy(n);
64 std::transform(tmpvec.begin(),tmpvec.end(),tmpvecy.begin(), [](
auto&
x){
return *
x.second; });
Container::value_type value_type
Abs< T >::type abs(const T &t)
reco::JetExtendedAssociation::JetExtendedData Value
void trackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)