8 #include "Math/Vector4D.h"
9 #include "Math/VectorUtil.h"
12 using ROOT::Math::PtEtaPhiEVector;
29 ANA_MSG_ERROR(
"reclusteredJetsRadius is negative, please fix");
30 return StatusCode::FAILURE;
34 static const std::unordered_map<std::string, fastjet::JetAlgorithm> algorithmMap = {
40 if (
it != algorithmMap.end()) {
44 <<
" is not supported by CP::JetReclusteringAlg! Choose amongst: AntiKt, Kt, CamKt.");
45 return StatusCode::FAILURE;
50 return StatusCode::SUCCESS;
60 auto rcJetAuxContainer = std::make_unique<xAOD::JetAuxContainer>();
61 auto rcJetContainer = std::make_unique<xAOD::JetContainer>();
62 rcJetContainer->setStore(rcJetAuxContainer.get());
65 std::vector<fastjet::PseudoJet>
clusters;
66 std::vector<const xAOD::Jet*> selectedJets;
69 fastjet::PseudoJet pseudoJet(
jet->px(),
jet->py(),
jet->pz(),
jet->e());
70 clusters.emplace_back(std::move(pseudoJet));
71 selectedJets.push_back(
jet);
82 std::vector<fastjet::PseudoJet> rcJets = cluster_sequence.inclusive_jets(0.0);
84 for (
const auto& irc : rcJets) {
88 rcJetContainer->push_back(rcJet);
90 rcJetContainer->back()->setJetP4(p4);
92 const auto constituents = irc.constituents();
96 if (
indices.size() != constituents.size()) {
97 ANA_MSG_ERROR(
"Size of the contituents does not match the size of the indices");
99 return StatusCode::FAILURE;
111 return StatusCode::SUCCESS;
116 for (
const auto& iconst : constituents) {
117 PtEtaPhiEVector iconstP4(iconst.pt(), iconst.eta(), iconst.phi_std(), iconst.e());
118 for (std::size_t
i = 0;
i < smallJets.size(); ++
i) {
119 const float dR =
DeltaR(smallJets.at(
i)->p4(), iconstP4);
120 if (dR > 0.1)
continue;