From 8c1182e412c3afb41a2c3fb775a8098d696f7126 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Mon, 20 Jul 2020 10:54:56 +0200 Subject: [PATCH] Update documentation regarding naming of buffer files Clarify how the path of the files are constructed and what names should be used to avoid confusion. --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3755f7f..ab6fbf2 100644 --- a/README.md +++ b/README.md @@ -139,4 +139,29 @@ terminology definitions should be followed: - start_pulse_id and stop_pulse_id (not end_pulse_id) is used to determine the inclusive range (both start and stop pulse_id are included) of pulses. - detector_folder (root folder of the buffer for a specific detector on disk) -- module_name (name of one module inside the detector_folder) \ No newline at end of file +- module_name (name of one module inside the detector_folder) +- data_folder (folder where we group more buffer files based on pulse_id range) + + +## Data location in buffer + +The written by sf_buffer are saved to: + +[detector_folder]/[module_name]/[data_folder]/[data_file].bin + +- detector_folder should always be passed as an absolute path. +- module_name is usually composed like "M00", "M01". +- data_folder and data_file are automatically calculated based on the +current pulse_id, FOLDER_MOD and FILE_MOD attributes. + +```c++ +// FOLDER_MOD = 100000 +int data_folder = (pulse_id % FOLDER_MOD) * FOLDER_MOD; +// FILE_MOD = 1000 +int data_file = (pulse_id % FILE_MOD) * FILE_MOD; +``` + +FOLDER_MOD == 100000 means that each data_folder will contain data for 100000 +pulses, while FILE_MOD == 1000 means that each file inside the data_folder +will contain 1000 pulses. The total number of data_files in each data_folder +will therefore be **FILE\_MOD / FOLDER\_MOD = 100**. \ No newline at end of file