ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 }

◆ empty()

bool xAODJetCollector::empty ( ) const

Definition at line 68 of file xAODJetCollector.cxx.

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

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 
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 }

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:
xAODJetCollector::hypoJets
HypoJetVector hypoJets() const
Definition: xAODJetCollector.cxx:44
xAODJetCollector::m_jets
std::map< int, HypoJetVector > m_jets
Definition: xAODJetCollector.h:45
HypoJetSet
std::set< pHypoJet > HypoJetSet
Definition: HypoJetDefs.h:30
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
pHypoJet
std::shared_ptr< const HypoJet::IJet > pHypoJet
Definition: HypoJetDefs.h:25
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
xAODJetCollector::legInds
std::vector< int > legInds() const
Definition: xAODJetCollector.cxx:95
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
xAODJetCollector::empty
bool empty() const
Definition: xAODJetCollector.cxx:68
xAODJetCollector::xAODJets_
std::vector< const xAOD::Jet * > xAODJets_(const HypoJetVector::const_iterator begin, const HypoJetVector::const_iterator end) const
Definition: xAODJetCollector.cxx:71
StateLessPT_NewConfig.partition
partition
Definition: StateLessPT_NewConfig.py:49
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
calibdata.copy
bool copy
Definition: calibdata.py:27