#########
# chain 2
# - asserting the presence of items in the datastore.
# - deleting individual items from the datastore.

ch = proc_mgr.add_chain('chain2')

# the link AssertInDs checks the presence
# of certain objects in the datastore
link = core_ops.AssertInDs()
link.keySet = ['hello', 'n_favorite']
ch.add_link(link)

# the link DsObjectDeleter removes objects from the datastore
# here, keep only 'v'
link = core_ops.DsObjectDeleter()
link.keepOnly = ['v']
ch.add_link(link)

link = core_ops.PrintDs()
link.keys = ['v', 'hello']
ch.add_link(link)

#########
# chain 3
# - deleting all items from the datastore.

ch = proc_mgr.add_chain('chain3')

# default, delete everything from the datastore
link = core_ops.DsObjectDeleter()
Ejemplo n.º 2
0
    ch = Chain('WsOps')
    wsu = root_analysis.WsUtils()
    wsu.add_simulate(pdf='keys_Ndim',
                     obs='keys_varset',
                     num=5000,
                     key='simdata',
                     into_ws=True)
    wsu.add_plot(obs='x2', data='simdata', output_file='x2_simdata.pdf')
    wsu.add_plot(obs='x3', data='simdata', output_file='x3_simdata.pdf')
    if settings['high_num_dims']:
        wsu.add_plot(obs='x4', data='simdata', output_file='x4_simdata.pdf')
    wsu.copy_into_ds = ['simdata']
    ch.add(wsu)

    # clear all from ds
    dl = core_ops.DsObjectDeleter()
    dl.deletion_keys = ['keys_Ndim']
    ch.add(dl)

if settings['make_plot']:
    # --- 3. make a summary report out of the simulated dataset
    ch = Chain('Plotting')

    rds2df = root_analysis.ConvertRooDataSet2DataFrame()
    rds2df.read_key = 'simdata'
    rds2df.store_key = 'df_simdata'
    ch.add(rds2df)

    hf = root_analysis.RootHistFiller()
    hf.columns = [
        'x2', 'x3', 'x4', ['x2', 'x3'], ['x3', 'x4'], ['x2', 'x4']