ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
JetGroupUnion.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 "
./JetGroupUnion.h
"
6
#include <set>
7
#include <string>
8
#include <algorithm>
9
#include <sstream>
10
11
12
JetGroupUnion::JetGroupUnion
(
const
std::vector<std::size_t>& siblings,
13
const
CondInd2JetGroupsInds
& satisfiedBy) {
14
15
// make a vector of the jet indices that satisfy the sibling Conditions
16
// with no duplicates
17
18
for
(
const
auto
& s :siblings){
19
m_jetIndices
.insert(
m_jetIndices
.end(),
20
satisfiedBy.at(s).cbegin(),
21
satisfiedBy.at(s).cend()
22
);
23
}
24
25
std::sort
(
m_jetIndices
.begin(),
26
m_jetIndices
.end());
27
28
auto
iter =
std::unique
(
m_jetIndices
.begin(),
29
m_jetIndices
.end());
30
31
m_jetIndices
.resize(iter-
m_jetIndices
.begin());
32
m_done
=
false
;
33
}
34
35
36
std::vector<std::size_t>
JetGroupUnion::next
(
const
Collector
& collector){
37
if
(collector){
38
std::stringstream sstr;
39
sstr <<
"no of indices "
<<
m_jetIndices
.size()
40
<<
" done "
<< std::boolalpha <<
m_done
;
41
collector->
collect
(
"JetGroupUnion::next()"
, sstr.str());
42
}
43
44
if
(
m_done
) {
45
return
std::vector<std::size_t>();
46
}
47
48
m_done
=
true
;
49
return
m_jetIndices
;
50
}
51
52
bool
JetGroupUnion::valid
()
const
{
return
true
;}
JetGroupUnion.h
CondInd2JetGroupsInds
std::map< int, std::vector< std::size_t > > CondInd2JetGroupsInds
Definition
JetGroupUnion.h:13
Collector
std::unique_ptr< ITrigJetHypoInfoCollector > Collector
Definition
JetGroupUnion.h:18
ITrigJetHypoInfoCollector::collect
virtual void collect(const std::string &, const std::string &)=0
JetGroupUnion::m_jetIndices
std::vector< std::size_t > m_jetIndices
Definition
JetGroupUnion.h:32
JetGroupUnion::JetGroupUnion
JetGroupUnion(const std::vector< std::size_t > &siblings, const CondInd2JetGroupsInds &satisfiedBy)
Definition
JetGroupUnion.cxx:12
JetGroupUnion::next
virtual std::vector< std::size_t > next(const Collector &) override
Definition
JetGroupUnion.cxx:36
JetGroupUnion::valid
virtual bool valid() const override
Definition
JetGroupUnion.cxx:52
JetGroupUnion::m_done
bool m_done
Definition
JetGroupUnion.h:33
std::unique
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
Definition
DVL_algorithms.h:135
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition
DVL_algorithms.h:554
Generated on
for ATLAS Offline Software by
1.17.0