Skip to content

Add PTB HLT and LLT information to CAF files for real SBND data#614

Open
hbjamin wants to merge 2 commits intodevelopfrom
feature/hbjamin_PTBTriggerInfoToCAFs_v10_06_00_02
Open

Add PTB HLT and LLT information to CAF files for real SBND data#614
hbjamin wants to merge 2 commits intodevelopfrom
feature/hbjamin_PTBTriggerInfoToCAFs_v10_06_00_02

Conversation

@hbjamin
Copy link

@hbjamin hbjamin commented Dec 4, 2025

Description

This PR adds PTB information to CAF files for real SBND data, which is required for trigger efficiency studies using zero bias data. The implementation extracts all HLT (High Level Trigger) and LLT (Low Level Trigger) information from PTB fragments, decodes trigger words into individual bits, and stores them separately in the CAF structure. This PR requires merging SBNSoftware/sbnanaobj#180

  • Have you added a label? (bug/enhancement/physics etc.)
  • Have you assigned at least 1 reviewer?
  • Is this PR related to an open issue / project?
  • Does this PR affect CAF data format? If so, please assign a CAF maintainer as additional reviewer.
  • Does this PR require merging another PR in a different repository (such as sbnanobj/sbnobj etc.)? If so, please link it in the description.
  • Are you submitting this PR on behalf of someone else who made the code changes? If so, please mention them in the description.

@hbjamin hbjamin requested review from kjplows and lynnt20 December 4, 2025 18:16
@hbjamin hbjamin added the enhancement New feature or request label Dec 4, 2025
@hbjamin hbjamin requested review from fjnicolas and terezakroupa and removed request for lynnt20 December 4, 2025 18:46
@kjplows kjplows moved this to Open pull requests in SBN software development Dec 14, 2025
Copy link
Contributor

@fjnicolas fjnicolas left a comment

Choose a reason for hiding this comment

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

Looks great @hbjamin! See comment in SBNSoftware/sbnanaobj#180 about uint64_t for the decoded HLT/LLT IDs

Copy link

@terezakroupa terezakroupa left a comment

Choose a reason for hiding this comment

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

Thanks Ben, looks great!

Copy link
Member

@PetrilloAtWork PetrilloAtWork left a comment

Choose a reason for hiding this comment

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

I have dropped a few technical suggestions.
But more importantly I would like the author to deeply think about the real need for a catch(...) in the code.

@hbjamin
Copy link
Author

hbjamin commented Jan 9, 2026

Thank you for the good suggestions. There was no reason for me to use a catch statement. It was leftover from my initial debugging of extractAllPTBInfo. I've also included several changes that result from making the timestamps a uint64_t that stores nanoseconds since UTC epoch instead of a double that stores seconds since UTC epoch to avoid rounding jumps occurring at 256 and 512 ns

@kjplows kjplows moved this from Open pull requests to Partially reviewed in SBN software development Jan 15, 2026
@kjplows
Copy link
Contributor

kjplows commented Jan 15, 2026

Thanks @hbjamin ! @PetrilloAtWork , do the changes look good to you? Thanks!

@kjplows
Copy link
Contributor

kjplows commented Feb 11, 2026

Bumping this, if @PetrilloAtWork is happy we should merge this. Thanks!

@kjplows kjplows moved this from Todo to In Progress in PR archaeology Feb 11, 2026
Copy link
Member

@PetrilloAtWork PetrilloAtWork left a comment

Choose a reason for hiding this comment

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

I am going to approve the PR as I suppose that's "urgently" needed.
However, I invite the author to rethink the pattern and to update it: here we have a direct extraction from raw detector-specific data to the highest analysis level. That is a very strong coupling.
My recommendation is to move the extraction code into sbndcode producer module which puts the extracted information into a data product (std::vector<PTBInfo_t>), allowing CAF maker and anything else to access it without the need for artDAQ and the knowledge of low-level details on the data format.

@fjnicolas
Copy link
Contributor

Hi @maxdubnowski @nathanielerowe! This PR involves some changes to the POTTools and the POT exposure accounting modules. Could you please have a look/approve if these look good to you? Thanks!

@nathanielerowe
Copy link
Contributor

I don't understand some of the changes being made here. Why are we moving around factors in the data products? Was there a unit change somewhere?

@hbjamin
Copy link
Author

hbjamin commented Feb 18, 2026

I don't understand some of the changes being made here. Why are we moving around factors in the data products? Was there a unit change somewhere?

Hi @nathanielerowe the currPTBTimeStamp variable in the PTBInfo_t struct was changed to a uint64_t that stores nanoseconds since UTC epoch instead of a double that stores seconds since UTC epoch to avoid rounding jumps occurring at 256 and 512 ns

@nathanielerowe
Copy link
Contributor

@hbjamin Gotcha, checking that it doesn't change the POT results now. Are these changes also made to the decoder module? A lot of the PTB product parsing code was copied from there.

@nathanielerowe
Copy link
Contributor

Distributions match, looks good on my end!

Copy link
Contributor

@nathanielerowe nathanielerowe left a comment

Choose a reason for hiding this comment

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

Could maybe move extractAllPTBInfo elsewhere since it doesn't actually get used in the POT process, but fine if it stays!

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

Labels

enhancement New feature or request

Projects

Status: In Progress
Status: Partially reviewed

Development

Successfully merging this pull request may close these issues.

Move extraction code for SBND PTB HLT and LLT into sbndcode; remove need for CAFMaker to access it via artDAQ

7 participants

Comments