Skip to content

Update LAPPD ID handling to support LAPPD INCOM IDs#381

Open
anuj-guptta wants to merge 3 commits intoANNIEsoft:Applicationfrom
anuj-guptta:test-pr
Open

Update LAPPD ID handling to support LAPPD INCOM IDs#381
anuj-guptta wants to merge 3 commits intoANNIEsoft:Applicationfrom
anuj-guptta:test-pr

Conversation

@anuj-guptta
Copy link
Copy Markdown

Describe your changes

Checklist before submitting your PR

  • This PR implements a single change (one new/modified Tool, or a set of changes to implement one new/modified feature)
  • This PR alters the minimum number of files to affect this change
  • If this PR includes a new Tool, a README and minimal demonstration ToolChain is provided
  • If a new Tool/ToolChain requires model or configuration files, their paths are not hard-coded, and means of generating those files is described in the readme, with examples provided on /pnfs/annie/persistent
  • For every new usage, there is a reason the data must be on the heap
  • For every new there is a delete, unless I explicitly know why (e.g. ROOT or a BoostStore takes ownership)

Additional Material

Attach any validation or demonstration files here. You may also link to relavant docdb articles.

Motivation:
Newer runs use Manufacturer (Incom) IDs instead of ACC IDs, which breaks
compatibility with existing downstream tools expecting ACC IDs.

Changes:
- Added a structure in DataModel/PsecData.h to store LAPPD ID mapping
  information loaded from configfiles/LAPPDProcessedAna/LAPPDIDConfig.csv in UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp.
- Implemented lookup logic to retrieve the appropriate mapping for a given
  run number and ACC ID, returning the corresponding Manufacturer ID and position.
- Added reverse mapping function to convert Manufacturer IDs back to ACC IDs
  for compatibility with downstream tools.
- Removed redundant structure previously defined in ANNIEEventTreeMaker.h including some fixes.

Heuristic:
- If LAPPD_ID > 20, it is treated as a Manufacturer (Incom) ID
  (based on current detector configuration assumptions).

Notes / Limitations:
- Current implementation relies on a heuristic (ID > 20) to distinguish ID types.
- This assumption is based on current detector configuration and observed ID ranges.
- Planned improvement: replace heuristic with run-dependent or database-driven mapping.
- Mapping file (LAPPDIDConfig.csv) must be updated as detector configuration evolves.

Validation:
- Basic functionality verified (toolchain runs end-to-end).
- Detailed validation of Event Building + data processing before-and-after is pending.
- Update ID mapping logic for consistent handling across the toolchain.
- Store Pulse IDs and Hit IDs as INCOM IDs.
@S81D S81D self-assigned this Apr 6, 2026
result= queryNearestACCID(idConfigRecords, testRunNum, testManuID);
int nearestACCID = std::get<0>(result);
position = std::get<1>(result);
cout << "Querying nearest ACCID for RunNumber: " << testRunNum << ", ManufacturerID: " << testManuID << endl;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can put in a verbosity condition here (>1 or something equivalent)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

There is already a verbose level assigned to this in line 227.

int testManuID = 39; // example ManufacturerID to query
auto result= queryNearestACCID(idConfigRecords, testRunNum, testManuID);
int nearestACCID = std::get<0>(result);
std::string position = std::get<1>(result);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same thing here - add a verbosity threshold

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

There is a verbose level here as well in line 157 but I will increase it to '1'.

@S81D
Copy link
Copy Markdown
Collaborator

S81D commented Apr 6, 2026

This is great to see you've added the LAPPD ID and position mapping, this will be super helpful!

I also appreciate the detailed description on the individual commits, the validation testing, and the note on limitations / future work. For future PRs and ease of readability I would recommend just adding those comments to the main PR and also filling out the checklist.

No obvious problems stand out to me. You note that the "detailed validation of Event Building + data processing before-and-after is pending" - once that is verified I think its good to go and I will give my stamp of approval.

@anuj-guptta
Copy link
Copy Markdown
Author

Thanks, Steven, for reviewing this. I don’t want to take credit for the original work, most of it was done by Yue last year but wasn’t merged into the latest ToolAnalysis release. I’ve applied a minimal version of his changes along with few modifications to get a working EventBuildingV2 and associated toolchains.

For validation of all data processing steps, I’ve tested three part-files, and everything works as expected. The LAPPD data before and after these changes remains unchanged.

Let me know if this is enough for the approval.

@anuj-guptta anuj-guptta closed this Apr 6, 2026
@anuj-guptta anuj-guptta reopened this Apr 6, 2026
@S81D
Copy link
Copy Markdown
Collaborator

S81D commented Apr 6, 2026

Great! I will mark it as ready for level 0 review and merging.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants