ATLAS Offline Software
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 
5 #include "./elementalJetGroups.h"
6 #include <algorithm>
7 
8 std::vector<std::size_t>
9 elementalJetGroups(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 }
elementalJetGroups
std::vector< std::size_t > elementalJetGroups(const std::vector< std::size_t > &non_elemental, const JetGroupInd2ElemInds &jg2elemjg)
Definition: elementalJetGroups.cxx:9
lumiFormat.i
int i
Definition: lumiFormat.py:92
JetGroupInd2ElemInds
std::map< int, std::vector< std::size_t > > JetGroupInd2ElemInds
Definition: elementalJetGroups.h:11
elementalJetGroups.h