Skip to content

Notes on file closing

Andrew Norman edited this page Aug 14, 2025 · 2 revisions

Subrun Definition

Mu2e will use "subruns" to break long runs into manageable chunks.

The actual criteria for breaking runs into these chunks is based upon two separate things. 1) The size of the resulting files and 2) the time duration.

The target file sizes are set based upon the technical requirements of the ROOT analysis framework and the performance characteristics of the Fermilab storage system (disk+tape system dCache/CTA). This sets the general target file size to: Min: 1 GB (tape system driven) Max: 5 GB (Root IO and compression driven)

Which also match up with "reasonable" sizes in terms of events for offline processing.

File Handling

To achieve this goal, art processes in the DataLogger stage of the DAQ will be configured with fileProperties such that a single subrun is written per file, and the CFO will periodically issue subrun transitions based on the number of Event Windows since the previous transition. Due to limitations in both the DAQ and the art framework, there will occasionally be events arriving for a subrun after the subrun's file has already been closed. This will cause the two subruns each to have two files:

  • Subrun N is ended. DL1 does not receive all expected EndOfSubrun Fragments within its timeout and ends the subrun
  • Subrun N+1 is started, closing the Subrun N file
  • The art filter process which was stuck processing passes an event for Subrun N
  • Subrun N+1's file is closed so that a new Subrun N file can be opened
  • Subrun N's second file is closed, Subrun N+1's second file is opened

In these cases, the DAQ must run a concatenation process to combine the files and maintain the one-file-per-subrun expectations of the Offline. This concatenation process may involve re-writing subrun-level luminosity products to have consistent results.

Clone this wiki locally