Skip to content

fixed function calling bug#367

Merged
tomeichlersmith merged 11 commits intomainfrom
tot_vref_fix_andreas
Feb 24, 2026
Merged

fixed function calling bug#367
tomeichlersmith merged 11 commits intomainfrom
tot_vref_fix_andreas

Conversation

@andpet1324
Copy link
Contributor

Changes to get_calibs are for future calibrations when we will want to minimize uncertainties, by setting n_events to some larger number than 1. For now, running daq_run in get_calibs with 1 event is fast and good enough for analysis.

Comment on lines +59 to +60
daq_run(tgt, "CHARGE", buffer, 1, 100);
// daq_run(tgt, "CHARGE", buffer, n_events, 100)
Copy link
Member

Choose a reason for hiding this comment

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

I think sharing the n_events setting down to daq_run through get_calibs is a good idea. I don't like hardcoding it to 1 here.

If you want to have it be 1 in some scan, then you can provide that within pftool. I'd even be okay with the default within pftool being 1.

Comment on lines +34 to +40
calibs =
get_calibs<pflib::packing::SingleROCEventPacket>(tgt, roc, target_adc);
calibs = get_calibs<pflib::packing::SingleROCEventPacket>(
tgt, roc, n_events, target_adc);
Copy link
Member

Choose a reason for hiding this comment

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

This is what I was talking about earlier. Why is n_events = 100 here? It is very confusing for a person running the code to see n_events = 100 but then only 1 event is run later.

I understand wanting the default to only be 1 event, but then you should pass in 1 event into the functions that call get_calibs so that others reading the code can understand how many events are being used.

If one algorithm needs multiple n_event arguments for different parts of the algorithm, that also makes sense to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed so that you input the n_events for that function. Probably should have done that from the beginning. We don't need to change the n_events for any other function than get_calibs (unless we would like to increase statistics in the future).

@tomeichlersmith tomeichlersmith merged commit 4758e91 into main Feb 24, 2026
@tomeichlersmith tomeichlersmith deleted the tot_vref_fix_andreas branch February 24, 2026 14:46
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.

2 participants