Skip to content

Commit

Permalink
Adding MCP level collision output table to substructure task
Browse files Browse the repository at this point in the history
  • Loading branch information
nzardosh committed Jan 16, 2025
1 parent 3ec537f commit cd2ce89
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
14 changes: 9 additions & 5 deletions PWGJE/Tasks/jetSubstructureHFOutput.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
16 changes: 10 additions & 6 deletions PWGJE/Tasks/jetSubstructureOutput.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct JetSubstructureOutputTask {
jetMapping.insert(std::make_pair(jet.globalIndex(), jetOutputTable.lastIndex()));
}

template <bool isMc, typename T, typename U, typename V, typename M, typename N>
template <bool isMCP, typename T, typename U, typename V, typename M, typename N>
void analyseCharged(T const& collision, U const& jets, V& collisionOutputTable, M& jetOutputTable, N& jetSubstructureOutputTable, std::map<int32_t, int32_t>& jetMapping, float jetPtMin, float eventWeight)
{
int nJetInCollision = 0;
Expand All @@ -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);
}
}
Expand Down

0 comments on commit cd2ce89

Please sign in to comment.