FRIBParallelanalysis
1.0
FrameworkforMPIParalleldataanalysisatFRIB
|
This section describes the format of the parameter output file. The parameter output file is built in a way that supports low over head reconstruction of the parameters in each event.
The format recognizes that the parameter ids of the program recovering data may differ from those of the same name in the program that created the data. Therefore sufficient information is provided to construct mappings between the two so that parameters named the same in the producing and consuming program have the same meaning.
Furthermore, the output file recognizes that knowing the values of the steering variables that produced the parameter file is useful.
Refer to AnalysisRingItems.h when reading this section. It defines the structs that are written to file.
The file, as with all NSCLDAQ event files is written as a stream of ring items. A ring item has a header (frib::analysis::RingItemHeader) that, in the case of files written by this framework contains the following fields:
name | type | meaning |
---|---|---|
s_size | std::uint32_t | Size of the entire item in bytes (self inclusive) |
s_type | std::uint32_t | Ring Item type [1] |
s_unused | std::uint32_t | Constant value of sizeof(std::uint32_t) [2] |
Notes:
std::uint32_t
which, in NSCLDAQ-12 indicates no body header. This field allows body finding software in e.g. NSCLDAQ to consistently locate the body of the ring item.The first two ring iitems are always of type frib::analysis::PARAMETER_DEFINITIONS and frib::analysis::VARIABLE_VALUES.
These provide information about the parameter definitions and steering variables.
Note that the parameter definitions included in the file will only be those read by the parameter reader passed in when the application is run. Any other parameters are not known to the outputter unless they are explictly declared in the outputter.
PARAMETER_DEFINITIONS
items provide sufficient information to allow consuming programs to map the data into its own parameters. This ring item is an frib::analysis::ParameterDefinitions and has the following fields:
name | type | Meaning |
---|---|---|
s_header | frib::analysis::RingItemHeader | The ring item header |
s_numParameters | std::uint32_t | the number of parameter definitions that follow |
s_parameters | frib::analysis::ParameterDefinition[] | The first of the parameter definitions. |
s_parameters
is the first of a sequence of frib::analysis::ParameterDefinition structs. each of those structs has the following fields:
name | type | Meaning |
---|---|---|
s_parameterNumber | std::uint32_t | The parameter ID used for this parameter |
s_parameterName | char [] | Null terminated string that is the name of the parameters |
Note that since s_parameterName
is variable sized, the following shows code to iterate over the parameter definitions:
Where the + 1
takes into account the null byte terminator of the string.
Following the parameter definition item will always be a frib::analysis::VARIABLE_VALUES ring item. This will be a frib::analysis::VariableItem struct. These have he following fields:
Name | type | Meaning |
---|---|---|
s_header | frib::analysis::RingItemHeader | The header of the ring item |
s_numVars | std::uint32_t | Number of variable descriptions that follow |
s_variables | frib::analysis::Variable [] | First of the variable definitions |
Each of the s_variables
has the following fields:
name | type | Meaning |
---|---|---|
s_value | double | Value of the variable |
s_variableUnits | char [frib::analysis::MAX_UNITS_LENGTH] | Unis of measure |
s_variablename | char [] | Name of the variable |
Note that the variable definitions are variable length. The following code shows how to iterate over tham:
Note that the units of measure field is fixed length. The size is generous enough to support standard units of measure (e.g. furlongs/fortnight
fits easily).
Once the documentation records have been emitted, the outputter will output a a series of ring items. These will consist of standard NSCLDAQ ring items that bypass event processing and frib::analysis::ParameterItem (type frib::analysis::PARAMETER_DATA item types). PARAMETER_DATA item types will contain events that have been decoded into parameters. These ring items will be frib::analysis::ParameterItem structs which have the following fields:
name | type | Meaning |
---|---|---|
s_header | frib::analysis::RingitemHeader | The standard ring item header |
s_triggerCount | std::uint64_t | The trigger number (the number of the event in the input file) |
s_parameterCount | std::uint32_t | The number of parameters unpacked from the event |
s_parameters | frib::analysis::ParameterValue [] | The first of a sequence of parameter values |
The parameter values (s_parameters
) are each an frib::analysis::ParameterValue struct with the fields:
name | type | Meaning |
---|---|---|
s_number | std::uint32_t | Parameter number. If the outputter knows all of the parameters this will be one of the numbers in the parameter definition ring item |
s_value | double | Value of the parameter for this event |
Note that if a parameter is not assigned a value it will not appear in the event.