Skip to content
Gabriele Sirri edited this page Oct 6, 2026 · 21 revisions

SANDRECO

SANDRECO performs event simulation and reconstruction for the SAND detector within the DUNE Near Detector complex. It is built on a modular framework (ufw) and is designed to be developed and deployed within a containerized environment (sand-ci), using json-based configuration files to define processing workflows.

The main output of a production job is an analysis-level .root file, consistent with the DUNE CAF format and containing only the SAND-specific portion of the full CAF.

System Architecture

SANDRECO is integrated into the Near Detector Sim/Reco workflow.

flowchart LR


EDEPSIM["edep-sim"] --> EDEPFILE[("edep-sim<br>file")]
GDML[(GDML)]
EDEPFILE --> SANDRECO["SANDRECO"]
GDML --> SANDRECO
GDML[(GDML)] --> EDEPSIM 
SANDRECO --> ANA_OBJ[("analysis<br>objects")]
ANA_OBJ --> CAFMAKER["ND CAF Maker"]
CAFMAKER --> CAFFILE[("CAF<br>files")]

REP_DUNEANAOBJ["<a href=https://github.com/DUNE/duneanaobj>duneanaobj<br>data model</a>"]
REP_DUNEANAOBJ --> SANDRECO
REP_DUNEANAOBJ --> CAFMAKER
%% STYLES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

classDef noBox fill:transparent,stroke:transparent;
classDef noBox fill:none,stroke:none,color:black;

class REP_DUNEANAOBJ noBox

Loading

You can find a description of the data fields filled at present here.

SANDRECO features a modular architecture designed for maximum flexibility and scalability. A generic workflow is illustrated in the figure below.

flowchart LR

subgraph INPUT[" "]
  EDEPFILE[("edep-sim<br>file")]
  GDML[(GDML)]
end

subgraph OUTPUT[" "]
  CALO_DGT[("ecal<br>digits")]
  TRK_DGT[("tracker<br>digits")]
  LAR_DGT[("grain<br>digits<br>(images)")]
end

subgraph SANDSIM["Simulation"]
  %% direction TB
  EDEPREADER[edep-reader]
  TGEOM[ROOT<br>TGeoM]
  GEOINFO[geoinfo]

  TRK_DGTZER[tracker<br>digitizer]
  CALO_DGTZER[calorimeter<br>digitizer]

  OPTSIM[optical<br>simulation]

  LAR_DGTZER[grain<br>digitizer]
end

%% I/O OUTPUT %%%%%%%%%%%%%%%%%%%%%%%%%
  TRK_DGT[("tracker<br>digits")]
  LAR_DGT[("grain<br>digits")]

%% LINKS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

EDEPFILE --> EDEPREADER
EDEPFILE --> TGEOM
GDML --> GEOINFO

GEOINFO --> OPTSIM
EDEPREADER --> OPTSIM
TGEOM --> OPTSIM
OPTSIM --photons--> LAR_DGTZER

EDEPREADER --> TRK_DGTZER
EDEPREADER --> CALO_DGTZER

CALO_DGTZER --> CALO_DGT
TRK_DGTZER --> TRK_DGT
LAR_DGTZER --> LAR_DGT

%% STYLES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

classDef noBox fill:transparent,stroke:transparent;
classDef noBox fill:none,stroke:none,color:black;

class INPUT,OUTPUT noBox

Loading

flowchart LR

%% INTERFACE FILES

subgraph INPUT[" "]
  %% direction TB
  CALO_DGT[("ecal<br>digits")]
  TRK_DGT[("tracker<br>digits")]
  LAR_DGT[("grain<br>digits")]
end

subgraph SANDRECO["Reconstruction"]
  %% direction TB
  SPILL_SL1[SPILL<br>SLICER]
  SPILL_SL2[SPILL<br>SLICER]
  SPILL_SL3[SPILL<br>SLICER]
  TRK_RECO[tracker<br>reco]
  CALO_RECO[calorimeter<br>reco]
  LAR_RECO[grain<br>reco]

  COMB_ANA[Combined<br>Analysis]
end

subgraph OUTPUT[" "]
  direction LR
  ANA_OBJ[("analysis<br>objects")]
  %% CAL_OBJ[("calibration<br>objects")]
  ANY_OBJ[("other<br>objects")]
end

subgraph CAF[" "]
  CAFMAKER[ ]
end

%% LINKS

CALO_DGT --> SPILL_SL1
TRK_DGT --> SPILL_SL2
LAR_DGT --> SPILL_SL3

SPILL_SL1 --> CALO_RECO
SPILL_SL2 --> TRK_RECO
SPILL_SL3 --> LAR_RECO

CALO_RECO --> COMB_ANA
TRK_RECO --> COMB_ANA
LAR_RECO --> COMB_ANA

COMB_ANA --> ANA_OBJ

CALO_RECO --> ANA_OBJ
TRK_RECO --> ANY_OBJ
TRK_RECO --> ANA_OBJ
LAR_RECO --> ANA_OBJ

ANA_OBJ --caf--> CAFMAKER

%% STYLES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

style CAFMAKER stroke:none

%% Stile per far sembrare il nodo una linea
%% style LINE fill:none,stroke:#000,width:2px,height:300px

%% classDef noBox fill:transparent,stroke:transparent;
classDef noBox fill:none,stroke:none,color:black;
classDef nullObj fill:none,stroke:none,width:1px,height:1px;

class INPUT,OUTPUT noBox
class CAFMAKER,CAF nullObj


Loading

SANDRECO Development Plan

This section outlines the evolution of the system architecture, from a minimal prototype to the full SANDRECO implementation. Each release progressively introduces new modules and data flows, increasing both system capabilities and complexity.

  • V1.0 (March 25, 2026) – Functional Prototype (fake-reco)
    Initial demonstrator with basic functionality to test I/O interfaces to Near Detector Workflow.

Upcoming Releases

  • V1.1 (Q2 2026) – Fast Reconstruction
    Introduction of fast reconstruction to fill out the interaction section of analysis objects.

  • V1.2 (Q3 2026) – Fast Reconstruction with Subdetectors
    Fast reconstruction with sub-detector specific processing.

  • V1.x (Q4 2026) – Fast Reconstruction – Combined Analysis
    Integration of (fast) subdetector-specific workflows with a combined data analysis stage.

  • V2.0 (TBD) – Full Implementation
    Implementation of a workflow where at least one subdetector workflow is complete

For a detailed technical description, please refer to the SANDRECO Development Plan.

SANDRECO Modules

  • (Module 1 – description)
  • (Module 2 – description)
  • (Add more modules as needed)

Quick Start

Set up the Development Enviroment

  • Linux + docker or podman
    podman can be substituted to docker in all the commands. This is the preferred environment, where everything is known to work, and the only one for which we can provide extensive support.

  • Windows + Podman

  • Bare Metal AL9
    consult the CI repo and reproduce the steps in the Dockerfile(s) to create your environment. Should work on Fedora as well with minimal variations.

  • HPC Bubble slurm + apptainer

FOR DEVELOPERS

sandreco-experimental

This is the current development branch of the sandreco software. The previous, non modular, version has been renamed sandreco-legacy.

This software is based on ufw, and it is meant to be developed and deployed inside a containerized environment.

A sandreco job is based on a .json configuration that specifies what modules to run and their configuration. A list of modules

The typical goal of a "production" job is to produce a CAF-like file, an analysis-oriented .root file whose content matches the SAND portion of the full CAF format. You can find a description of the data fields filled at present here.

Developer information

This is a quick overview of module development.

Modular approach

Each algorithm in ufw must be wrapped in a process, while data structures can be complex or managed (see the ufw wiki for details). Additionally, streamers exist to provide custom I/O interfaces for managed types.

Each algorithm, complex data and streamer needs to be its own module, which in concrete terms is a shared library (libmodulename.so or similar). Managed data on the other hand is not a module (as it is header only, by definition it does not have code that needs to be compiled).

A module needs its own cmake which produces the shared library that will be loaded by ufwrun. For cleanliness, one cmake shall produce only one module.

A module should have its own folder, placed according to these indications in the most suitable subfolder:

  • Managed data, which will also be used for public interface classes, i.e. data structures used also outside of sandreco, should be under include/.../
  • Complex data can go in src/data/.../
  • Algorithms go in src/processes/.../
  • Streamers go in src/streamers/.../ You will probably never write one of these.

The ... in the path indicated above may be either your subdetector folder, or a subfolder, if applicable.

The main class of your module (and realistically also the other ones) should go in a namespace as well. Super general things can go in sand::, otherwise use your subdetector, lowercase sand::grain::, sand::ecal::, sand::tracker:: and so on... The namespace becomes part of your module name, and must be used in the configuration files.

When writing the CMakeLists.txt for a module named sand::ecal::some_algo_name, make sure to use a target name sand_ecal_some_algo_name.

Automatic testing

You can place a sample .json that runs your module (and any ancillary modules used in your test) in tests/framework. It will be picked up by the testing system and run as part of the continuous integration. Only do this if you can supply a meaningful input test data that is reasonably small (under a few 100kb), as large binary files shall not be stored in baltig. Some large data files are already available in /usr/local/share/sandreco/data/; if you have a justified need for a larger file, we can bake it into the CI image.

Clone this wiki locally