ATLAS Offline Software
Loading...
Searching...
No Matches
xAODJetCollector Class Reference

#include <xAODJetCollector.h>

Collaboration diagram for xAODJetCollector:

Public Member Functions

void addJets (const HypoJetCIter &begin, const HypoJetCIter &end, int chainPartInd=-1)
std::vector< const xAOD::Jet * > xAODJets () const
std::vector< const xAOD::Jet * > xAODJets (int chainPartInd) const
HypoJetVector hypoJets () const
HypoJetVector hypoJets (int chainPartInd) const
std::size_t size () const
bool empty () const
std::vector< int > legInds () const

Private Member Functions

std::vector< const xAOD::Jet * > xAODJets_ (const HypoJetVector::const_iterator begin, const HypoJetVector::const_iterator end) const

Private Attributes

std::map< int, HypoJetVectorm_jets

Detailed Description

Definition at line 20 of file xAODJetCollector.h.

Member Function Documentation

◆ addJets()

void xAODJetCollector::addJets ( const HypoJetCIter & begin,
const HypoJetCIter & end,
int chainPartInd = -1 )

Definition at line 10 of file xAODJetCollector.cxx.

12 {
13 auto& jets = m_jets[chainPartInd];
14 jets.insert(jets.end(), begin, end);
15}
std::map< int, HypoJetVector > m_jets

◆ empty()

bool xAODJetCollector::empty ( ) const

Definition at line 68 of file xAODJetCollector.cxx.

68{return hypoJets().empty();}
HypoJetVector hypoJets() const

◆ hypoJets() [1/2]

HypoJetVector xAODJetCollector::hypoJets ( ) const

Definition at line 44 of file xAODJetCollector.cxx.

44 {
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}
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
std::set< pHypoJet > HypoJetSet
Definition HypoJetDefs.h:30

◆ hypoJets() [2/2]

HypoJetVector xAODJetCollector::hypoJets ( int chainPartInd) const

Definition at line 58 of file xAODJetCollector.cxx.

58 {
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}

◆ legInds()

std::vector< int > xAODJetCollector::legInds ( ) const

Definition at line 95 of file xAODJetCollector.cxx.

95 {
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}
std::vector< int > legInds() const

◆ size()

std::size_t xAODJetCollector::size ( ) const

Definition at line 66 of file xAODJetCollector.cxx.

66{return hypoJets().size();}

◆ xAODJets() [1/2]

std::vector< const xAOD::Jet * > xAODJetCollector::xAODJets ( ) const

Definition at line 18 of file xAODJetCollector.cxx.

18 {
19
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}
std::vector< const xAOD::Jet * > xAODJets_(const HypoJetVector::const_iterator begin, const HypoJetVector::const_iterator end) const

◆ xAODJets() [2/2]

std::vector< const xAOD::Jet * > xAODJetCollector::xAODJets ( int chainPartInd) const

Definition at line 32 of file xAODJetCollector.cxx.

32 {
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}

◆ xAODJets_()

std::vector< const xAOD::Jet * > xAODJetCollector::xAODJets_ ( const HypoJetVector::const_iterator begin,
const HypoJetVector::const_iterator end ) const
private

Definition at line 71 of file xAODJetCollector.cxx.

73 {
74
75 HypoJetVector hypoJets(begin, end);
76
77 auto new_end =
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}
std::shared_ptr< const HypoJet::IJet > pHypoJet
Definition HypoJetDefs.h:25
virtual std::optional< const xAOD::Jet * > xAODJet() const =0
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.

Member Data Documentation

◆ m_jets

std::map<int, HypoJetVector> xAODJetCollector::m_jets
private

Definition at line 45 of file xAODJetCollector.h.


The documentation for this class was generated from the following files: