ATLAS Offline Software
Loading...
Searching...
No Matches
elementalJetGroups.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include <algorithm>
7
8std::vector<std::size_t>
9elementalJetGroups(const std::vector<std::size_t>& non_elemental,
10 const JetGroupInd2ElemInds& jg2elemjg) {
11
12 std::vector<std::size_t> elem_indices;
13
14 for(auto i : non_elemental){
15 elem_indices.insert(elem_indices.end(),
16 jg2elemjg.at(i).begin(),
17 jg2elemjg.at(i).end());
18 }
19
20 // if any of the elemental jet group indices are repeated,
21 // stop processing the new jet group. (do not allow sharing for
22 // among Conditions. Sharing is handled by having the use of
23 // multiple FastReducer instances).
24
25 std::sort(elem_indices.begin(), elem_indices.end());
26 if (std::unique(elem_indices.begin(),
27 elem_indices.end()) != elem_indices.end()){
28 elem_indices.clear();
29 }
30 return elem_indices;
31}
std::vector< std::size_t > elementalJetGroups(const std::vector< std::size_t > &non_elemental, const JetGroupInd2ElemInds &jg2elemjg)
std::map< int, std::vector< std::size_t > > JetGroupInd2ElemInds
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.