Skip to content

Convert SpectrumLoader to be an _ISource to handle new CAF structure - #54

Merged
chenel merged 173 commits into
masterfrom
feature/source-sink-overhaul
Apr 11, 2025
Merged

Convert SpectrumLoader to be an _ISource to handle new CAF structure#54
chenel merged 173 commits into
masterfrom
feature/source-sink-overhaul

Conversation

@chenel

@chenel chenel commented Dec 8, 2023

Copy link
Copy Markdown
Collaborator

Note: this PR proposes a significant overhaul to CAFAna. It is not backwards-compatible with TDR-era (duneanaobj v1 or v2) CAFs!

The v3 duneanaobj structure, in which each StandardRecord corresponds to the reconstructed information from a single detector trigger, is difficult to handle with the current approach in CAFAna. In particular, users will almost always want to run their primary analysis over SRRecoInteraction objects, which (with the current tools) require a lot of MultiVar constructions and make for difficult use of Cuts.

This PR takes advantage of the Source-Sink architecture in CAFAnaCore v2 to solve that problem. We follow work in SBN's implementation of CAFAna where a similar thing is done concretely: SBNSoftware/sbnana#85. Major things that change:

  • Spectrums become a client ("sink") of values that are generated by "source" objects (like SpectrumLoader).
  • We introduce machinery for implicitly iterating over SRRecoInteractions, SRParticle with interactions, etc.
  • We introduce a new approach to carrying around packages of Spectrums, EnsembleSpectrum. This allows for a natural way of doing xsec type analysis.

@mcasales's Doc 31898 explains more of the ramifications in more detail, with examples.

I (@chenel) also made a demonstration toy oscillation analysis to show that the changes proposed in this PR are basically working: Doc 33354

The TDR analysis code has also been eliminated, since it's inextricably bound to the TDR-era CAFs.

There are still a few things left to implement in this updated paradigm: PredictionInterp needs a refactor, some of the Extrap and Decomp classes have been removed for the moment, and the connection to NuSystematics needs to be rebuilt. Reviving these is part of the ongoing project https://github.com/orgs/DUNE/projects/14. However, the basic machinery is now working, and it's time for it to go mainstream.

…l' into feature/source-sink-overhaul

# Conflicts:
#	CAFAna/Core/SpectrumLoaderBase.cxx
unsure why this needs to be set, but it fixes some ABI mismatch errors
@chenel
chenel marked this pull request as ready for review April 10, 2025 18:29
@chenel
chenel merged commit b9b3f48 into master Apr 11, 2025
@chenel
chenel deleted the feature/source-sink-overhaul branch April 11, 2025 14:28
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.

Structural changes to SpectrumLoader & friends to admit one-to-many (SR -> SRNeutrinoInteraction) analysis over new CAF structure

4 participants