Skip to content

MinBias Class Abort and Centrality Node naming#4247

Open
danjlis wants to merge 2 commits intosPHENIX-Collaboration:masterfrom
danjlis:mbclass_abort
Open

MinBias Class Abort and Centrality Node naming#4247
danjlis wants to merge 2 commits intosPHENIX-Collaboration:masterfrom
danjlis:mbclass_abort

Conversation

@danjlis
Copy link
Copy Markdown
Contributor

@danjlis danjlis commented Apr 14, 2026

Commit includes setting node names and allowing MBClassifier to abort events if directed to do so

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work for users)
  • Requiring change in macros repository (Please provide links to the macros pull request in the last section)
  • I am a member of GitHub organization of sPHENIX Collaboration, EIC, or ECCE (contact Chris Pinkenburg to join)

What kind of change does this PR introduce? (Bug fix, feature, ...)

TODOs (if applicable)

Links to other PRs in macros and calibration repositories (if applicable)

PR Summary: MinBias Class Abort and Centrality Node Naming

Motivation / Context

This PR adds configurable node naming for reconstruction modules and event abort functionality to the minimum-bias trigger classifier. These features enable users to use non-standard node names when operating multiple centrality and trigger reconstruction chains in parallel, and allow event filtering based on minimum-bias criteria.

Key Changes

CentralityReco (node naming):

  • Added four public setter methods: set_minbiasNodeName(), set_mbdOutNodeName(), set_centralityNodeName(), set_mbdPmtNodeName()
  • Modified GetNodes() to retrieve MinimumBiasInfo, CentralityInfo, MbdPmtContainer, and MbdOut from configurable node name member variables instead of hardcoded string literals
  • Modified CreateNodes() to create the output CentralityInfo node using the configurable name variable
  • Removed GlobalVertexMap retrieval requirement (previously a no-op when node was missing)
  • Added private m_use_vtx_function flag and TF1 forward declaration

MinimumBiasClassifier (abort events + node naming):

  • Changed CreateNodes() from static to non-static member method
  • Added public method abortEvents(bool) to enable/disable event abortion
  • Added four public node-name setter methods: set_minbiasNodeName(), set_mbdPmtNodeName(), set_zdcInfoNodeName(), set_globalvertexNodeName()
  • Modified FillMinimumBiasInfo() to return integer status codes (0/1) instead of Fun4AllReturnCodes::EVENT_OK, with abortion gated by m_abortEvents flag
  • Modified process_event() to abort events (ABORTEVENT) when FillMinimumBiasInfo() returns nonzero and abortEvents() is enabled
  • Updated GetNodes() and CreateNodes() to use configurable node names instead of hardcoded values

Potential Risk Areas

  • Reconstruction behavior change: Events can now be aborted based on minimum-bias criteria when abortEvents(true) is explicitly set. Default is false (preserving current behavior), but new code enabling this may filter events unexpectedly if criteria are not properly configured.
  • Static method removal: CreateNodes() changed from static to non-static in MinimumBiasClassifier. Any out-of-tree or existing code calling this as a static method will break at compile time.
  • Default node names: Code assumes default node names match previous hardcoded values ("MinimumBiasInfo", "CentralityInfo", "MbdPmtContainer", "MbdOut", "Zdcinfo", "GlobalVertexMap"). Non-backward-compatible if external code hardcodes node creation or retrieval.
  • GlobalVertexMap dependency removed: CentralityReco no longer requires GlobalVertexMap. Verify this removal doesn't break downstream code that previously relied on its presence.

⚠️ AI-generated summaries may contain errors. Review the actual code changes carefully, especially around node retrieval order and event abort logic.

Possible Future Improvements

  • Add configuration presets or enumerations for standard node naming patterns in multi-chain scenarios
  • Implement event abortion counters or diagnostic logging for performance monitoring
  • Consider configuration framework integration for persistent run-time node naming settings

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

📝 Walkthrough

Walkthrough

This change refactors node name handling in the centrality and trigger subsystems, replacing hardcoded node identifiers with configurable member variables accessible through public setter methods. Additionally, event abortion logic is introduced to MinimumBiasClassifier.

Changes

Cohort / File(s) Summary
CentralityReco Configuration
offline/packages/centrality/CentralityReco.h, offline/packages/centrality/CentralityReco.cc
Added public setter methods (set_minbiasNodeName, set_mbdOutNodeName, set_centralityNodeName, set_mbdPmtNodeName) to configure node names. Modified GetNodes and CreateNodes to use member variables (m_mb_info_nodename, m_mbd_out_nodename, m_centrality_nodename, m_mbd_pmt_nodename) instead of hardcoded strings. Removed GlobalVertexMap retrieval logic. Added forward declaration for TF1 and new private m_use_vtx_function flag.
MinimumBiasClassifier Configuration & Abortion Logic
offline/packages/trigger/MinimumBiasClassifier.h, offline/packages/trigger/MinimumBiasClassifier.cc
Changed CreateNodes() from static to instance method. Added public setter methods for node names (set_minbiasNodeName, set_mbdPmtNodeName, set_zdcInfoNodeName, set_globalvertexNodeName) and event abortion control (abortEvents). Modified FillMinimumBiasInfo() to return integer status codes and conditionally abort events when m_abortEvents is enabled. Updated process_event() to handle event abortion based on return status. Replaced hardcoded node names with member variables throughout.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sphenix-jenkins-ci
Copy link
Copy Markdown

Build & test report

Report for commit cb8f934332e6d40f3ef7d440cee6b6bab175a705:
Jenkins on fire


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@bseidlit bseidlit marked this pull request as ready for review April 17, 2026 01:07
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1dc46d3e-6d55-4c9a-8b3d-57d53dfc3577

📥 Commits

Reviewing files that changed from the base of the PR and between a1e339e and cb8f934.

📒 Files selected for processing (4)
  • offline/packages/centrality/CentralityReco.cc
  • offline/packages/centrality/CentralityReco.h
  • offline/packages/trigger/MinimumBiasClassifier.cc
  • offline/packages/trigger/MinimumBiasClassifier.h

#include <string> // for string, allocator

// Forward declarations
class TF1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Is m_use_vtx_function actually read anywhere?
rg -nP '\bm_use_vtx_function\b' -C2

# Is TF1 or CDBTF used anywhere in the centrality package?
rg -nP '\bTF1\b|\bCDBTF\b' -C2 -g 'offline/packages/centrality/**'

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 1242


🏁 Script executed:

# Search for any actual usage/assignment of m_use_vtx_function (not just declaration)
rg -n 'm_use_vtx_function' offline/packages/centrality/ -A2 -B2

# Search for actual instantiation or usage of TF1 objects
rg -n 'TF1\s*[\(\[]|new\s+TF1|\..*TF1' offline/packages/centrality/ -C2

# Search for CDBTF usage
rg -n 'CDBTF\s*[\(\[]|new\s+CDBTF|CDBTF::' offline/packages/centrality/ -C2

# Check the full CentralityReco.cc to see the complete implementation context
wc -l offline/packages/centrality/CentralityReco.cc

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 467


🏁 Script executed:

# Read the full CentralityReco.cc to check for actual usage
cat -n offline/packages/centrality/CentralityReco.cc | head -50

# Also check if there are any setter/getter methods for m_use_vtx_function
rg -n 'use_vtx_function|UseVtxFunction|setUseVtxFunction' offline/packages/centrality/

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 1630


🏁 Script executed:

# Read more of the implementation to see if TF1 or m_use_vtx_function are used anywhere
sed -n '41,200p' offline/packages/centrality/CentralityReco.cc | cat -n

# Check process method and remaining code
sed -n '200,388p' offline/packages/centrality/CentralityReco.cc | cat -n

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 10825


Remove the unused TF1 forward-declaration, includes, and member toggle, or complete the implementation.

The class TF1; forward-decl (line 11), #include <TF1.h>, #include <cdbobjects/CDBTF.h>, and the m_use_vtx_function{true} member (line 96) are present but completely unused in the implementation. Shipping a public member variable that defaults to true but has no effect risks users mistaking it for working functionality and complicates future real implementation efforts.

Either complete the vertex function feature in this PR or defer it by removing these declarations until the implementation is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant