ATLAS Offline Software
CombinationsGrouper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include <sstream>
9 
11 
13  m_groupSize{groupSize}{}
14 
15 
17  const HypoJetVector& jets):
18  m_groupSize(groupSize), m_jets{jets}{
19 }
20 
21 
23  const HypoJetCIter& b,
24  const HypoJetCIter& e):
25  m_groupSize(groupSize), m_jets{b, e}{
26 }
27 
28 
30  HypoJetGroupVector hjgv;
31 
32  // create a combinations generator. Used to select the jets
33  // to be tested by the condition objects
34  CombinationsGen combgen(m_jets.size(), m_groupSize);
35 
36  auto combs = combgen.next();
37  if (combs.second == false){
38  return HypoJetVector{};
39  }
40 
42  for(auto i : combs.first){ v.push_back(*(m_jets.begin() + i));}
43 
44  return HypoJetVector(v);
45 }
46 
47 std::string CombinationsGrouper::getName() const {
48  return "CombinationsGrouper";
49 }
50 
51 std::string CombinationsGrouper::toString() const {
52 
53  std::stringstream ss;
54 
55  ss << "CombinationsGrouper - create all combinations of ";
56  ss << "jets of length " ;
57  ss << m_groupSize << '\n';
58 
59  return ss.str();
60 }
61 
62 
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
CombinationsGrouper.h
HypoJetGroupVector
std::vector< HypoJetVector > HypoJetGroupVector
Definition: HypoJetDefs.h:35
CombinationsGen
Definition: CombinationsGen.h:20
CombinationsGrouper::next
virtual HypoJetVector next() override
Definition: CombinationsGrouper.cxx:29
CombinationsGrouper::CombinationsGrouper
CombinationsGrouper()
Definition: CombinationsGrouper.cxx:10
HypoJetCIter
HypoJetVector::const_iterator HypoJetCIter
Definition: HypoJetDefs.h:29
lumiFormat.i
int i
Definition: lumiFormat.py:85
CombinationsGen.h
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
CombinationsGrouper::m_jets
HypoJetVector m_jets
Definition: CombinationsGrouper.h:26
CombinationsGrouper::getName
virtual std::string getName() const override
Definition: CombinationsGrouper.cxx:47
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CombinationsGen::next
std::pair< std::vector< unsigned int >, bool > next()
Definition: CombinationsGen.h:33
python.PyAthena.v
v
Definition: PyAthena.py:154
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
CombinationsGrouper::toString
virtual std::string toString() const override
Definition: CombinationsGrouper.cxx:51
CombinationsGrouper::m_groupSize
unsigned int m_groupSize
Definition: CombinationsGrouper.h:25