Skip to content

Add 'addGridCombined' and 'addGridCombinedFromFile' to SampleHandler

Tadej Novak requested to merge tadej/athena:analysis/sh into 21.2

This adds a helper function addGridCombined to the SH namespace to help users submit combined tasks. The code should also work with PyROOT:

from ROOT import SH, vector
sh = SH.SampleHandler()
sh.setMetaString(SH.MetaFields.treeName, SH.MetaFields.treeName_default)

samplesList = vector('string')()
with open(inputFile, 'r') as f:
    for line in f:
        if line.startswith('#'): continue
        if not line.strip(): continue
        samplesList.push_back(line.strip())

SH.addGridCombined(sh, 'Combined', samplesList)

@krumnack, probably the implementation is not ideal so I expect some changes will be needed.

Edited by Tadej Novak

Merge request reports