How dune/duneanaobj works
Purpose and entry points
duneanaobj defines the C++ object schema for DUNE CAF (Common Analysis File) ROOT TTrees. Each TTree entry contains one caf::StandardRecord; this repository provides the headers, compiled library, ROOT dictionary metadata, and navigation/proxy interfaces needed to read that schema. It does not write CAFs; external FD/ND CAFMaker applications do.
Primary consumer entry point: duneanaobj/StandardRecord/StandardRecord.h. Library implementation and aggregate record behavior live in duneanaobj/StandardRecord/StandardRecord.cxx.
Build, packaging, and runtime boundary
The project is a CMake-built C++ library, rooted at CMakeLists.txt, with the schema target organized under duneanaobj/StandardRecord/CMakeLists.txt. It is distributed both as a normal linked library and a Fermilab UPS product via ups/product_deps and ups/setup_for_development.
Runtime dependencies are ROOT (CAF serialization, dictionaries, and interactive reading) and the Fermilab CET/UPS environment for the documented development build. Consumers need the library available at dynamic-link time and headers when compiling C++ readers.
Root record and schema composition
caf::StandardRecord is the top-level persisted event object. It aggregates global event data and detector-/domain-specific branches, rather than exposing low-level detector hit data.
Key schema surfaces:
• Root aggregate: duneanaobj/StandardRecord/StandardRecord.h, duneanaobj/StandardRecord/StandardRecord.cxx
• Global/shared event content: duneanaobj/StandardRecord/SRGlobal.h, duneanaobj/StandardRecord/SRMeta.h
• Common reconstruction branch types: duneanaobj/StandardRecord/SRCommonRecoBranch.h, duneanaobj/StandardRecord/SRRecoParticlesBranch.h
• Enumerated stable values: duneanaobj/StandardRecord/SREnums.h
The main compatibility boundary is the persisted object layout: changing record or branch fields affects CAF readers and writers across the DUNE software ecosystem.
Detector and experiment-domain branches
The schema partitions event content by source/detector while retaining a single event-level record. Far detector content is represented by SRFD and its branch; near-detector data has dedicated LAr and association structures; gas-argon and MINERvA data are independent domains.
Representative components:
• FD: duneanaobj/StandardRecord/SRFD.h, duneanaobj/StandardRecord/SRFDBranch.h
• ND LAr and cross-object associations: duneanaobj/StandardRecord/SRNDLAr.h, duneanaobj/StandardRecord/SRNDTrackAssn.h, duneanaobj/StandardRecord/SRNDShowerAssn.h
• GAr: duneanaobj/StandardRecord/SRGAr.h, duneanaobj/StandardRecord/SRGArTrack.h
• Beam and external detector summaries: duneanaobj/StandardRecord/SRBeamBranch.h, duneanaobj/StandardRecord/SRMINERvA.h
Reconstruction, truth, and links
CAF data flow is: upstream simulation/reconstruction systems populate high-level reconstructed objects and summary truth; CAFMaker serializes the populated StandardRecord into ROOT; analysis clients deserialize it and traverse object collections and associations.
Reconstructed entities include tracks, showers, PFParticles, and generic reco-particle abstractions:
duneanaobj/StandardRecord/SRTrack.h, duneanaobj/StandardRecord/SRShower.h, duneanaobj/StandardRecord/SRPFP.h.
Truth data represents interactions and particles, with event-level truth grouping:
duneanaobj/StandardRecord/SRTruthBranch.h, duneanaobj/StandardRecord/SRTrueInteraction.h, duneanaobj/StandardRecord/SRTrueParticle.h.
Associations and overlap collections are structural links between these collections, not external database references; readers must respect nested variable-length collection limits in ROOT TTreeFormula.
Math, weights, and systematic metadata
Portable schema-owned vector types avoid making consumers depend on an upstream physics framework:
duneanaobj/StandardRecord/SRVector3D.h, duneanaobj/StandardRecord/SRLorentzVector.h.
Event weighting and systematic parameter headers are modeled in-record:
duneanaobj/StandardRecord/SRWeightGlobal.h, duneanaobj/StandardRecord/SRSystParamHeader.h.
ROOT integration, navigation, and flattened access
ROOT dictionary generation is declared by duneanaobj/StandardRecord/classes.h and duneanaobj/StandardRecord/classes_def.xml; these are essential for object streaming and interactive ROOT access.
For traversal convenience, the project supplies navigation and generated proxy layers:
duneanaobj/StandardRecord/Navigate.h, duneanaobj/StandardRecord/Proxy/Instantiations.cxx.
A separate flat representation boundary exists under duneanaobj/StandardRecord/Flat/Prolog.h; flat CAF production is performed by external CAFMakers, enabling simpler branch-oriented analysis where deeply nested standard-record collections are inconvenient.
Main entry points: StandardRecord.h StandardRecord · CMakeLists.txt StandardRecord target · SRCommonRecoBranch.h Common reconstruction · classes.h ROOT dictionary metadata
Components 21
Build & Distribution
- CMake build · Builds the C++ schema library.
CMakeLists.txt - StandardRecord target
duneanaobj/StandardRecord/CMakeLists.txt - UPS product · Packages the library for the Fermilab environment.
ups/product_deps
Persisted CAF Schema
- StandardRecord · One CAF TTree entry's top-level event object.
duneanaobj/StandardRecord/StandardRecord.h - Record implementation
duneanaobj/StandardRecord/StandardRecord.cxx - Global event data
duneanaobj/StandardRecord/SRGlobal.h - Common reconstruction · Shared reco collections and generic particle abstractions.
duneanaobj/StandardRecord/SRCommonRecoBranch.h - Far detector
duneanaobj/StandardRecord/SRFDBranch.h - ND LAr & associations · Near-detector LAr data and cross-object links.
duneanaobj/StandardRecord/SRNDLAr.h - Gas argon
duneanaobj/StandardRecord/SRGAr.h - Beam & MINERvA · Beam summaries and external-detector content.
duneanaobj/StandardRecord/SRBeamBranch.h - Truth collections · Interactions and true particles grouped per event.
duneanaobj/StandardRecord/SRTruthBranch.h - Weights & systematics
duneanaobj/StandardRecord/SRWeightGlobal.h - Portable vector types · Framework-independent position and momentum types.
duneanaobj/StandardRecord/SRVector3D.h
ROOT Access Layers
- ROOT dictionary metadata · Declares streamable schema types for ROOT.
duneanaobj/StandardRecord/classes.h - Navigation API · Convenience traversal over record collections and associations.
duneanaobj/StandardRecord/Navigate.h - Generated proxies
duneanaobj/StandardRecord/Proxy/Instantiations.cxx - Flat CAF interface · Supports branch-oriented representations produced externally.
duneanaobj/StandardRecord/Flat/Prolog.h
Other components
- External CAFMaker · Populates and serializes StandardRecord objects.
- ROOT CAF TTree · Stores one StandardRecord per entry.
- Analysis clients · Link the library and deserialize CAF records.
Connections 21
- CMake build → StandardRecord target: includes
- StandardRecord target → StandardRecord: builds
- UPS product → StandardRecord target: packages
- Record implementation → StandardRecord: implements
- StandardRecord → Global event data: aggregates
- StandardRecord → Common reconstruction: aggregates
- StandardRecord → Far detector: aggregates
- StandardRecord → ND LAr & associations: aggregates
- StandardRecord → Gas argon: aggregates
- StandardRecord → Beam & MINERvA: aggregates
- StandardRecord → Truth collections: aggregates
- StandardRecord → Weights & systematics: contains
- Common reconstruction → Portable vector types: uses
- ROOT dictionary metadata → StandardRecord: streams
- Generated proxies → ROOT dictionary metadata: uses
- Navigation API → StandardRecord: traverses
- External CAFMaker → StandardRecord: populates
- External CAFMaker → ROOT CAF TTree: serializes
- ROOT CAF TTree → Analysis clients: deserializes
- Analysis clients → Navigation API: uses
- Flat CAF interface → ROOT CAF TTree: alternative flat layout