From f601c7d16986a85a27de607fe9b745fb133263fb Mon Sep 17 00:00:00 2001 From: matthier Date: Mon, 20 Jan 2020 23:56:12 +0100 Subject: [PATCH] Bugfix in TopEventSelectionTools for JetFlavorPlots tool given the new jet collection names --- .../xAOD/TopEventSelectionTools/Root/JetFlavorPlots.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopEventSelectionTools/Root/JetFlavorPlots.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopEventSelectionTools/Root/JetFlavorPlots.cxx index c70bf687435..ca40e1dfa15 100644 --- a/PhysicsAnalysis/TopPhys/xAOD/TopEventSelectionTools/Root/JetFlavorPlots.cxx +++ b/PhysicsAnalysis/TopPhys/xAOD/TopEventSelectionTools/Root/JetFlavorPlots.cxx @@ -44,7 +44,8 @@ namespace top { // retrieve jet collection and remove the "Jets" at the end of it m_jetCollection = m_config->sgKeyJets(); - m_jetCollection.erase(m_jetCollection.length() - 4); + int pos = m_jetCollection.find("Jets"); + m_jetCollection.erase(pos); //FIXME: If no metadata is available, the PMGTool will crash. Providing here a "manual" workaround. //FIXME PMG: comment from here //retrieve PMGTruthWeights @@ -246,9 +247,11 @@ namespace top { static_cast(h_ptr->hist(name))->Fill(jetPtr->pt() * toGeV, jetPtr->eta(), w_event); + // if "detailed", also making the quark_jets one if (jet_flavor >= 1 && jet_flavor <= 4) { sprintf(name, "quark_jets_%s", m_jetCollection.c_str()); + static_cast(h_ptr->hist(name))->Fill(jetPtr->pt() * toGeV, jetPtr->eta(), w_event); -- GitLab