Add ADC bins histograms for QA - #4451
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughChangesTpcRawHitQA event ADC-bin tracking
Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to Valid multi-container events can be absent from the new ADC-bin QA histogram, producing incomplete QA data. Accumulate raw hits across the event before merging. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: sPHENIX-Collaboration/coresoftware/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID: 03d6a34b-2ce6-4213-8365-4ac88012835c
📒 Files selected for processing (2)
offline/QA/Tpc/TpcRawHitQA.ccoffline/QA/Tpc/TpcRawHitQA.h
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
| return Fun4AllReturnCodes::EVENT_OK; | ||
| } | ||
|
|
||
| h_nadc_bins_event->Fill(nadc_bins_event); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '110,275p' offline/QA/Tpc/TpcRawHitQA.ccRepository: sPHENIX-Collaboration/coresoftware
Length of output: 4782
Use an event-level raw-hit count before filling the histogram.
raw_hit_num is overwritten for each container. If the final container is empty, the early return skips h_nadc_bins_event->Fill(...) even when an earlier container contributed ADC bins. Accumulate the hit count across containers before applying the event-level guard.
Suggested fix
- unsigned int raw_hit_num = 0;
+ unsigned int raw_hit_num_event = 0;
unsigned int nadc_bins_event = 0;
for (TpcRawHitContainer *&rawhitcont : rawhitcont_vec)
{
- raw_hit_num = rawhitcont->get_nhits();
- for (unsigned int i = 0; i < raw_hit_num; i++)
+ const unsigned int raw_hit_num = rawhitcont->get_nhits();
+ raw_hit_num_event += raw_hit_num;
+ for (unsigned int i = 0; i < raw_hit_num; i++)
...
- if (raw_hit_num == 0)
+ if (raw_hit_num_event == 0)
Build & test reportReport for commit b6cddec6f79d5b99970ae48e890579314e6b0969:
Automatically generated by sPHENIX Jenkins continuous integration |



Types of changes
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)
Motivation
Add QA monitoring for the number of ADC bins per event in TPC raw-hit data. This is a new, non-breaking diagnostic.
Key changes
h_nadc_bins_eventhistogram member.nadc_bins_event.Potential risk areas
Possible future improvements
AI-generated summaries can contain errors. The source changes remain the final reference.