diff --git a/PWGJE/Tasks/jetSubstructureHFOutput.cxx b/PWGJE/Tasks/jetSubstructureHFOutput.cxx index d651f2d8e5b..e1329b8d14a 100644 --- a/PWGJE/Tasks/jetSubstructureHFOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureHFOutput.cxx @@ -166,13 +166,17 @@ struct JetSubstructureHFOutputTask { if (candidateTableIndex != candidateMap.end()) { candidateIndex = candidateTableIndex->second; } - if constexpr (!isMCP) { - if (nJetInCollision == 0) { - collisionOutputTable(collision.posZ(), collision.centrality(), collision.eventSel(), eventWeight); - collisionIndex = collisionOutputTable.lastIndex(); + if (nJetInCollision == 0) { + float centrality = -1.0; + uint8_t eventSel = 0.0; + if constexpr (!isMCP) { + centrality = collision.centrality(); + eventSel = collision.eventSel(); } - nJetInCollision++; + collisionOutputTable(collision.posZ(), centrality, eventSel, eventWeight); + collisionIndex = collisionOutputTable.lastIndex(); } + nJetInCollision++; fillJetTables(jet, candidate, collisionIndex, candidateIndex, jetOutputTable, jetSubstructureOutputTable, jetMap); } } diff --git a/PWGJE/Tasks/jetSubstructureOutput.cxx b/PWGJE/Tasks/jetSubstructureOutput.cxx index 695afef9e35..019c51b66be 100644 --- a/PWGJE/Tasks/jetSubstructureOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureOutput.cxx @@ -110,7 +110,7 @@ struct JetSubstructureOutputTask { jetMapping.insert(std::make_pair(jet.globalIndex(), jetOutputTable.lastIndex())); } - template + template void analyseCharged(T const& collision, U const& jets, V& collisionOutputTable, M& jetOutputTable, N& jetSubstructureOutputTable, std::map& jetMapping, float jetPtMin, float eventWeight) { int nJetInCollision = 0; @@ -124,13 +124,17 @@ struct JetSubstructureOutputTask { } for (const auto& jetRadiiValue : jetRadiiValues) { if (jet.r() == round(jetRadiiValue * 100.0f)) { - if constexpr (!isMc) { - if (nJetInCollision == 0) { - collisionOutputTable(collision.posZ(), collision.centrality(), collision.eventSel(), eventWeight); - collisionIndex = collisionOutputTable.lastIndex(); + if (nJetInCollision == 0) { + float centrality = -1.0; + uint8_t eventSel = 0.0; + if constexpr (!isMCP) { + centrality = collision.centrality(); + eventSel = collision.eventSel(); } - nJetInCollision++; + collisionOutputTable(collision.posZ(), centrality, eventSel, eventWeight); + collisionIndex = collisionOutputTable.lastIndex(); } + nJetInCollision++; fillJetTables(jet, collisionIndex, jetOutputTable, jetSubstructureOutputTable, jetMapping); } }