Configuration data format and storage options

The format to store trigger configuration in Run 3 will be json (http://www.ecma-international.org/publications/standards/Ecma-404.htm). It supports well the hierarchical storage of information in blocks containing "key" -> "value" pairs as well as "key" -> "sub-information-block". This human-readable format, which can be serialized as a string will be stored using two types of backends

  • File with the ending .json
  • Oracle database: here the serialized configuration is stored in text format (oracle type CLOB or JSON)

In the ATLAS code the transient representation of this data is currently that of boost::ptree, which is typedef basic_ptree<std::string, std::string> ptree;.

While json allows to describe values as strings or as numbers as (see here), this information is not being kept in the transient ptree representation, which only allows strings as values.

{
    "chain_counter": 1,
    "chain_name": "HLT_e26_lhtight_idperf",
    "lower_chain_name": "L1_EM22VHI",
    "streams": [
        {
            "obeyLB": "yes",
            "prescale": "1",
            "stream": "Main",
            "type": "physics"
        }
    ],
    "groups": [
        {
            "name": "RATE:IDMonitoring"
        },
        {
            "name": "BW:Egamma"
        },
        {
            "name": "BW:ID"
        }
    ]
},

API for accessing trigger configuration data

Loading the data from files

Instantiating the file loader

%CODE{"cpp"}% #include "TrigConfIO/JsonFileLoader.h"

// instantiating file loader auto fileLoader = new TrigConf::JsonFileLoader(); %ENDOCDE%

It is planned to have a DB loader, and a common interface. The user will not have to worry about the source of the configuration.

Loading an HLT menu file into the specific HLTMenu object

Two ways exist:

   // HLT menu test file
   const std::string filename = "TrigConfIO/HLTconfig_Physics_pp_v7_21.1.40.json";

   // load json file into ptree
   boost::property_tree::ptree data;
   StatusCode sc = fileLoader->loadFile( filename, data );

   // create HLTMenu from ptree
   TrigConf::HLTMenu menu(data);

or

   // HLT menu test file
   const std::string filename = "TrigConfIO/HLTconfig_Physics_pp_v7_21.1.40.json";

   // create HLTMenu and fill it directly
   TrigConf::HLTMenu menu;
   fileLoader->loadFile( filename, menu);

Accessing the content of the menu object

This is the representation of the menu in json

{
    "menu_name": "Physics_pp_v7",
    "chains": [
        {
            "chain_counter": 1,
            "chain_name": "HLT_e26_lhtight_idperf",
            "lower_chain_name": "L1_EM22VHI",
            "streams": [
                {
                    "obeyLB": "yes",
                    "prescale": "1",
                    "stream": "Main",
                    "type": "physics"
                }
            ],
            "groups": [
                {
                    "name": "RATE:IDMonitoring"
                },
                {
                    "name": "BW:Egamma"
                },
                {
                    "name": "BW:ID"
                }
            ]
        },
        ... more chains
    ]
}

Attributes of the menu and chain can be accessed using functions that correspond to the key in the json file



One can loop over the chains using the specific classes



Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2019-01-20 - JoergStelzer
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback