ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
xAODJetCollector.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
xAODJetCollector.h
"
6
7
#include <algorithm>
8
#include <cassert>
9
10
void
xAODJetCollector::addJets
(
const
HypoJetCIter
& begin,
11
const
HypoJetCIter
& end,
12
int
chainPartInd){
13
auto
& jets =
m_jets
[chainPartInd];
14
jets.insert(jets.end(), begin, end);
15
}
16
17
18
std::vector<const xAOD::Jet*>
xAODJetCollector::xAODJets
()
const
{
19
20
HypoJetVector
all;
21
for
(
const
auto
& p :
m_jets
){
22
std::copy(p.second.cbegin(),
23
p.second.cend(),
24
std::back_inserter(all)
25
);
26
}
27
return
xAODJets_
(all.cbegin(), all.cend());
28
}
29
30
31
std::vector<const xAOD::Jet*>
32
xAODJetCollector::xAODJets
(
int
chainPartInd)
const
{
33
34
if
(
m_jets
.count(chainPartInd) == 0){
35
std::vector<const xAOD::Jet*>
empty
;
36
return
empty
;
37
}
38
39
const
auto
& jets =
m_jets
.at(chainPartInd);
40
return
xAODJets_
(jets.cbegin(), jets.cend());
41
}
42
43
44
HypoJetVector
xAODJetCollector::hypoJets
()
const
{
45
HypoJetVector
all;
46
for
(
const
auto
& p :
m_jets
){
47
std::copy(p.second.cbegin(),
48
p.second.cend(),
49
std::back_inserter(all)
50
);
51
}
52
HypoJetSet
js(all.begin(), all.end());
53
return
HypoJetVector
(js.begin(), js.end());
54
}
55
56
57
58
HypoJetVector
xAODJetCollector::hypoJets
(
int
chainPartInd)
const
{
59
auto
begin =
m_jets
.at(chainPartInd).cbegin();
60
auto
end =
m_jets
.at(chainPartInd).cend();
61
HypoJetSet
js(begin, end);
62
return
HypoJetVector
(js.begin(), js.end());
63
}
64
65
66
std::size_t
xAODJetCollector::size
()
const
{
return
hypoJets
().size();}
67
68
bool
xAODJetCollector::empty
()
const
{
return
hypoJets
().empty();}
69
70
std::vector<const xAOD::Jet*>
71
xAODJetCollector::xAODJets_
(
const
HypoJetVector::const_iterator begin,
72
const
HypoJetVector::const_iterator end
73
)
const
{
74
75
HypoJetVector
hypoJets
(begin, end);
76
77
auto
new_end =
78
std::partition
(
hypoJets
.begin(),
79
hypoJets
.end(),
80
[](
const
pHypoJet
& j){
81
return (j->xAODJet()).has_value();});
82
// add xAOD::Jet* to m_jets
83
std::vector<const xAOD::Jet*> xJets;
84
xJets.reserve(new_end -
hypoJets
.begin());
85
std::transform(
hypoJets
.begin(),
86
new_end,
87
back_inserter(xJets),
88
[](
const
pHypoJet
j){
return
*(j->xAODJet());});
89
90
std::set<const xAOD::Jet*> js(xJets.begin(), xJets.end());
91
return
std::vector<const xAOD::Jet*> (js.begin(), js.end());
92
}
93
94
95
std::vector<int>
xAODJetCollector::legInds
()
const
{
96
std::vector<int>
legInds
;
97
98
for
(
auto
it =
m_jets
.begin(); it !=
m_jets
.end(); ++it){
99
legInds
.push_back(it->first);
100
}
101
102
return
legInds
;
103
}
HypoJetCIter
HypoJetVector::const_iterator HypoJetCIter
Definition
HypoJetDefs.h:29
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition
HypoJetDefs.h:27
pHypoJet
std::shared_ptr< const HypoJet::IJet > pHypoJet
Definition
HypoJetDefs.h:25
HypoJetSet
std::set< pHypoJet > HypoJetSet
Definition
HypoJetDefs.h:30
xAODJetCollector::addJets
void addJets(const HypoJetCIter &begin, const HypoJetCIter &end, int chainPartInd=-1)
Definition
xAODJetCollector.cxx:10
xAODJetCollector::empty
bool empty() const
Definition
xAODJetCollector.cxx:68
xAODJetCollector::xAODJets
std::vector< const xAOD::Jet * > xAODJets() const
Definition
xAODJetCollector.cxx:18
xAODJetCollector::size
std::size_t size() const
Definition
xAODJetCollector.cxx:66
xAODJetCollector::xAODJets_
std::vector< const xAOD::Jet * > xAODJets_(const HypoJetVector::const_iterator begin, const HypoJetVector::const_iterator end) const
Definition
xAODJetCollector.cxx:71
xAODJetCollector::hypoJets
HypoJetVector hypoJets() const
Definition
xAODJetCollector.cxx:44
xAODJetCollector::legInds
std::vector< int > legInds() const
Definition
xAODJetCollector.cxx:95
xAODJetCollector::m_jets
std::map< int, HypoJetVector > m_jets
Definition
xAODJetCollector.h:45
std::partition
DataModel_detail::iterator< DVL > partition(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of partition for DataVector/List.
Definition
DVL_algorithms.h:324
xAODJetCollector.h
Generated on
for ATLAS Offline Software by
1.17.0