MetaData Wrapper

class MetaData

This is a class which wraps the output of PyAmi when performing a meta-data search on the input samples. To use this wrapper effectively, you need to authenticate using the voms-proxy-init command. Luckily, the framework comes with a pre-built script, which does this for you, simply enter auth_pyami into the terminal and it will ask for the userkey/usercert.pem directories, followed by a password prompt. If the user is not authenticated, this step is skipped and the framework will attempt to inspect the sample’s available meta-data.

Parameters:
  • file (str) – The input path of the file.

  • scan_ami (bool) – A switch which enables/disables the meta scanning.

  • sampletype (str) – An option which narrows down the DAOD sample search to a specific group.

IndexToSample(int index) str
Parameters:

index (int) – Returns the xAOD or filename of the specified event index.

ProcessKeys(dict val) None
Parameters:

val (dict) – The keys to search within the ROOT sample.

Variables:
  • Trees (list) – Expects a list of strings pointing to the trees to be read.

  • Branches (list) – Expects a list of strings pointing to the branches to be read.

  • Leaves (list) – Expects a list of strings pointing to any leaves to be read.

  • original_input (str) – Returns the original file name, i.e. file.

  • dsid (int) – Returns the dsid of the data set matched to this ROOT file.

  • amitag (str) – Returns the amitag of the same being used, this can be retrieved within the sample’s metadata.

  • generators (str) – Returns the generator which produced this sample.

  • isMC (bool) – Returns a boolean to indicate whether the sample is Monte Carlo

  • derivationFormat (str)

  • eventNumber (int)

  • ecmEnergy (float)

  • genFiltEff (float)

  • completion (float)

  • beam_energy (float)

  • crossSection (float)

  • crossSection_mean (float)

  • totalSize (float) – Returns the total file size (memory)

  • nFiles (int) – Returns the number of files within this sample set

  • run_number (int)

  • totalEvents (int)

  • datasetNumber (int)

  • identifier (str)

  • prodsysStatus (str)

  • dataType (str)

  • version (str)

  • PDF (str)

  • AtlasRelease (str)

  • principalPhysicsGroup (str)

  • physicsShort (str)

  • generatorName (str)

  • geometryVersion (str)

  • conditionsTag (str)

  • generatorTune (str)

  • amiStatus (str)

  • beamType (str)

  • productionStep (str)

  • projectName (str)

  • statsAlgorithm (str)

  • genFilterNames (str)

  • file_type (str)

  • DatasetName (str)

  • event_index (int)

  • original_name (str)

  • original_path (str)

  • hash (str)

  • keywords (list)

  • weights (list)

  • keyword (list)

  • found (bool)

  • config (dict)

  • GetLengthTrees (dict)

  • MissingTrees (list)

  • MissingBranches (list)

  • MissingLeaves (list)

  • DAODList (list)

  • Files (dict)

  • DAO (str)

  • fileGUID (dict)

  • events (dict)

  • fileSize (dict)

  • sample_name (str)

  • logicalDatasetName (str)

UpROOT wrapper

class UpROOT

This class is predominantly designed to be interfaced with core modules in the framework. However, it can be used as a completely standalone module with minimal configuration. Part of this module is the so called MetaData object. This class contains additional information about the input ROOT samples if PyAMI is enabled. If PyAMI is not installed or authenticated to, then it will try to scrape the ROOT files for additional meta data.

Parameters:
  • ROOTFiles (Union[list, dict, str, None]) – Input samples

  • EventGenerator (Union[None, EventGenerator]) – A switch which enables/disables the meta scanning.

GetAmiMeta() MetaData
ScanKeys()

A function which scans the keys within the sample recursively and matches them with the input values.

InputSamples(input)

This function will scan the given input for ROOT files. If the input is a string containing the .root extension, then only that file will be used, otherwise it will assume the input is a directory and scan it for possible ROOT files. For lists, the function will assume these to be .root files and never directories. If the input is a dictionary, then the keys can be interpreted as being directories, with values being either lists of ROOT files to read, or single ROOT file strings.

Parameters:

input (Union[str, Dict, List]) – The input samples to use.

Variables:
  • Verbose (int) – Changes the verbosity of the key scannig and sample detection.

  • StepSize (int) – Changes the cache step size within uproot.

  • Threads (int) – Sets the number of threads to utilize during the scanning process.

  • Trees (list) – Trees to retrieve from the ROOT sample.

  • Branches (list) – Branches to retrieve and match for the given trees.

  • Leaves (list) – Leaves to retrieve and match for the given trees and branches.

  • Files (dict)

  • EnablePyAMI (bool) – Enable or disable MetaData.