Project

General

Profile

Legacy Beam Data C API (MiniBooNE)

04/05/2012 New version of API for IFBeam data uploaded.

The low level function(s) are now isolated from the user.
Two higher level functions introduced: getBundle4t and getBundle4tt, they allow to get the data for the bundle either for given time or for the time range.
They both return the pointer to the NULL terminated data record array, which has to be destroyed after use.
The first record in the array will contain column names as C strings.
All other records will contain the first N-1 column data as C strings, and then array of doubles for the last column.

The sequence of operations may look like this:

#include "ifbeam_csv.h" 
#include "ifbeam_decode.h" 
    .........
    DataRec **dataRecs = getBundle4t("url_for_the_service", "bundle_name", time0);              // Get the data for bundle

    DataRec **dr = dataRecs;                            // Set moving pointer to the first record

    for ( ; *dr!=NULL; dr++) {                          // Walk through record array
        ExperimentData *eData = decodeMBED1x(*dr);      // Try to decode MBED10/MBED12 record
        if (eData) {                                    // If we get a decoded record do something with it...
            ........
        }
    }
    destroyDataRecs(dataRecs);  // Free allocated memory
    .........

See file 'test_ifbeam_csv.c' for complete example. The source tarfile is available in the Files section