Skip to content

REST_Geant4_MergeRestG4Files does not fully preserve/validate metadata and analysis outputs #152

Description

@cmargalejo

The Geant4 merge macro currently does not fully preserve or validate all metadata needed in merged restG4 ROOT files.

Update: PR #153 addresses the metadata-preservation and metadata-validation part of this issue. The AnalysisTree merge behavior remains a separate design/policy question.

Related prior work:

Observed / diagnosed problems:

  • TRestGeant4Metadata copy/merge behavior can drop particle-source information.
  • TRestGeant4PhysicsLists is not robustly validated/preserved by the current merge path.
  • Input files are assumed compatible, but compatibility is not checked.
  • AnalysisTree handling differs between the current macro and Merge supports analysis files #114; Merge supports analysis files #114 preserves trees via TFileMerger but allows duplicate event IDs.
  • Output validation only checks limited entry-count conditions and does not verify required metadata/classes.
  • ROOT StreamerInfo loss in UPDATE-mode writes is related, but tracked separately in framework #568 / PR #567.

Expected fix:

  • Preserve required metadata objects, including Geant4 metadata and physics-list metadata.
  • Validate input compatibility before merging.
  • Define and test the intended policy for AnalysisTree merging and duplicate event IDs.
  • Validate merged output contains expected trees, geometry, metadata, and entry counts.
  • Add restG4 integration coverage for simulation-only and analysis-file merge cases.

The merge should also validate that all input files were produced with compatible simulation metadata:

  • same TRestGeant4PhysicsLists;
  • same Geant4 version from TRestGeant4Metadata::GetGeant4Version();
  • compatible generator/source, geometry, and storage settings.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions