coresoftware icon indicating copy to clipboard operation
coresoftware copied to clipboard

feat(MinimumBiasClassifier): Add PHParameters for detailed cut tracking

Open Steepspace opened this issue 3 months ago • 7 comments

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] 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)
  • [x] 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, ...)

This PR introduces PHParameters to the MinimumBiasClassifier to provide detailed, event-by-event information about why the minimum bias selection passes or fails. Previously, the module only set a single boolean, making it difficult to debug or perform quality assurance checks.

Key changes include:

  • A PHParameters object named "MinBiasParams" is now created and stored on the PAR node.
  • Individual boolean flags are set to true if an event fails a specific selection criterion, such as:
    • minbias_background_cut_fail
    • minbias_two_hit_min_fail
    • minbias_zdc_energy_min_fail
    • minbias_mbd_total_energy_max_fail
  • Key calculated values (e.g., MBD north/south charge, vertex scale) are also saved to this object for downstream analysis and QA.
  • The total MBD charge cut is no longer a hardcoded constant and can be configured via the new set_mbd_total_charge_cut() method. (Note: The default total MBD charge cut of 2100 remains unchanged.)

TODOs (if applicable)

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

Steepspace avatar Sep 19 '25 16:09 Steepspace

Build & test report

Report for commit 2af2be95566efb8e8f5eb2dda64ab85a79543791: Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration sPHENIX             jenkins.io

sphenix-jenkins-ci[bot] avatar Sep 20 '25 05:09 sphenix-jenkins-ci[bot]

PHParameters are very expensive to use on an event by event basis. They are meant to be used for configurations and have a DB backend. This is just the wrong class to handle event by event parameters in this case,

pinkenburg avatar Sep 20 '25 18:09 pinkenburg

PHParameters are very expensive to use on an event by event basis. They are meant to be used for configurations and have a DB backend. This is just the wrong class to handle event by event parameters in this case,

I will note that PHParameters is currently used in the JetBackgroundCut module that also does something similar on an event by event basis: https://github.com/sPHENIX-Collaboration/coresoftware/blob/9d03281ebaecd5e37e533df03e9836e73602d5aa/offline/packages/jetbackground/JetBackgroundCut.cc#L283-L293

However, since this is not recommended, do you suggest any other approach that will be ideal to pass the information regarding the cuts so that QA downstream can log that different cases?

Steepspace avatar Sep 20 '25 18:09 Steepspace

That was a bit of a temporary measure - before that they used PHFlag which is even worse. The very basic problem here (and in the jet background) is that it uses the temporary "PAR" which is not saved (and also not reset - so there is a possibility of carrying information from one event to the next accidentally). That means the downstream qa module can never be run off a DST which is just a bad idea (and it will potentially read info from a previous event). I don't see any qa code which accesses this node - so I am not sure if this was actually thought out or followed up with an actual qa implementation. What we probably need is some dumb i/o class with an int and double vector and then have accessors for each implementation which just look values up via index and store this thing under the DST node .

pinkenburg avatar Sep 20 '25 19:09 pinkenburg

What we probably need is some dumb i/o class with an int and double vector and then have accessors for each implementation which just look values up via index and store this thing under the DST node

Thank you for the suggestion. Could you provide a template or reference that I can use to implement this i/o class that can store these quantities under the DST node? In the meantime, please feel free to mark this PR back to Draft since it's not acceptable at this stage.

Steepspace avatar Sep 20 '25 22:09 Steepspace

Build & test report

Report for commit ef1c109a81e6aeebdf52f3a02261fea1c7da033b: Jenkins on fire


Automatically generated by sPHENIX Jenkins continuous integration sPHENIX             jenkins.io

sphenix-jenkins-ci[bot] avatar Oct 31 '25 07:10 sphenix-jenkins-ci[bot]

Build & test report

Report for commit 6aa5d2a73f9ba02afcc703a4bca98ae19d5351e5: Jenkins on fire


Automatically generated by sPHENIX Jenkins continuous integration sPHENIX             jenkins.io

sphenix-jenkins-ci[bot] avatar Nov 14 '25 08:11 sphenix-jenkins-ci[bot]