Algorithms, tools, and data flow

Members of application

class ApplicationOptions(*args, **kwargs)[source]

Holder for application configuration.

Configuration can be mutated until finalize() is called. At that point any dynamic defaults based on other properties are resolved.

applyConf()[source]

Function to be overridden to convert the high level configuration into a low level one.

finalize()[source]

Finalize configuration and prevent further changes.

getProperties()[source]

Stable-order override of Configurable.getProperties.

lockOption(option)[source]

make a specific option entry immutable

Parameters

option (str) – name of option entry to lock

set_conds_from_testfiledb(key)[source]

Set DDDB and CondDB tags, data type and simulation flag from a TestFileDB entry.

Parameters

key (str) – Key in the TestFileDB.

set_input_and_conds_from_testfiledb(key)[source]

Set input and conditions according to a TestFileDB entry.

Parameters

key (str) – Key in the TestFileDB.

set_input_from_testfiledb(key)[source]

Set input file paths and file type from a TestFileDB entry.

Parameters

key (str) – Key in the TestFileDB.

class ComponentConfig[source]

Object holding the configuration of Gaudi Configurables.

update([E, ]**F) None.  Update D from dict/iterable E and F.[source]

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

FILE_TYPES = {'MDF', 'ROOT'}

Valid input/output filetypes

all_nodes_and_algs(node, recurse_algs=False)[source]

Return the list of all reachable nodes and algorithms.

configure_input(options)[source]

Configure all aspects related to application inputs.

Parameters

options (ApplicationOptions) – Application options instance.

Returns

Dict of configured Gaudi Configurable instances.

Return type

ComponentConfig

default_raw_event(bank_types=[], raw_event_format=None, maker=None, stream=None)[source]

Return a raw event that contains a given set of banks.

Parameters
  • bank_types (list) – Required raw bank types. Defaults to all types (empty list).

  • raw_event_format – RawEventFormat key in Raw_location_db.

  • maker – Maker of input data. Defaults to make_data_with_FetchDataFromFile.

  • stream (str) – If stream is set the RawEvent containing all bank types is located at /Event/{stream}. For use post HLT2.

Returns

Raw event containing banks of the requested types.

Return type

DataHandle

format_output_location(l, add_depth=True)[source]

Return the TES location l formatted for an output writer.

Parameters

l (str or DataHandle) –

make_callgrind_profile(start=10, stop=90, dump=90, dumpName='CALLGRIND-OUT')[source]

Return algorithm that allows to use callgrind profiling.

Pass it to the application options with preamble_algs=[make_callgrind_profile()].

For more info see CodeAnalysisTools.

Parameters
  • start – Event count at which callgrind starts profiling. Defaults to 10 events.

  • stop – Event count at which callgrind stops profiling. Defaults to 90 events.

  • dump – Event count at which callgrind dumps results. Defaults to 90 events.

  • dumpName – Name of dump. Defaults to ‘CALLGRIND-OUT’.

make_data_with_FetchDataFromFile(location, force_type, **kwargs)[source]

Return input data read using FetchDataFromFile.

FetchDataFromFile preloads data on the transient event store for a given list of locations that must be present in the input file. This maker configures an instance to read a single given location and returns the DataHandle corresponding to the output.

Parameters
  • location (str) – Location to be fetched from input data.

  • force_type (str) – The type of data(handle) to be fetched (returned)

  • extra_inputs (list, optional) – Additional dependencies for Gaudi::Hive::FetchDataFromFile. Defaults to [].

mdf_writer(path, location, compression=0, ignore_tae_info=True, compression_alg='ZSTD')[source]

Return an MDF writer which writes a single TES location to path.

By default no compression is used, since IOSvc does not currently support compressed inputs and also because there is already compression internally to the “DstData” raw banks (which dominate when no detector raw banks are written out). See https://gitlab.cern.ch/lhcb/LHCb/-/issues/163.

online_writer(location)[source]

Return an OnlineAlg writer which writes a single TES location.

plot_control_flow(top_node, filename='control_flow', extensions=('gv',))[source]

Save a visualisation of the current control flow.

Parameters
  • filename (str) – Basename of the file to create.

  • extensions (list) – List of file extensions to create. One file is created per extensions. Possible values include 'gv' for saving the raw graphviz representation, and 'png' and 'pdf' for saving graphics.

Note

The dot binary must be present on the system for saving files with graphical extensions. The raw gv format can be convert be hand like:

dot -Tpdf data_flow.gv > data_flow.pdf
plot_data_flow(algs, filename='data_flow', extensions=('gv',))[source]

Save a visualisation of the current data flow.

Parameters
  • algs (list) – List of Algorithm instances.

  • filename (str) – Basename of the file to create.

  • extensions (list) – List of file extensions to create. One file is created per extensions. Possible values include 'gv' for saving the raw graphviz representation, and 'png' and 'pdf' for saving graphics.

Note

The dot binary must be present on the system for saving files with graphical extensions. The raw gv format can be convert be hand like:

dot -Tpdf data_flow.gv > data_flow.pdf
root_copy_input_writer(path, copy_input_leaves, locations=None, tes_veto_locations=None)[source]

Return algorithm for writing ROOT/DST files.

The writer will write not only the locations specified in locations, but also the locations collected by Gaudi::Hive::FetchLeavesFromFile. By scheduling the latter as the very first producer, one can copy all input file locations to the output.

Parameters
  • path (str) – Path the output file should be written to.

  • copy_input_leaves (DataHandle) – Output of FetchLeavesFromFile (the input locations to copy).

  • locations (list of str) – TES locations to write.

  • tes_veto_locations (list of str) – TES locations that should not be propagated from the input.

Returns

The writer algorithm to typically be scheduled last.

root_writer(path, locations)[source]

Return a ROOT/DST writer which writes TES locations to path.