Ejemplo n.º 1
0
    },
    # HTCondor submit script
    job_extra={
        "universe": "docker",
        # To be used with coffea-casa:0.1.11
        "encrypt_input_files": "/etc/cmsaf-secrets/xcache_token",
        #"docker_network_type": "host",
        "docker_image": "coffeateam/coffea-casa-analysis:0.1.11",
        "container_service_names": "dask",
        "dask_container_port": "8787",
        "should_transfer_files": "YES",
        "when_to_transfer_output": "ON_EXIT",
        "+DaskSchedulerAddress": '"129.93.183.33:8787"',
    })

cluster.adapt(minimum_jobs=5, maximum_jobs=100, maximum_memory="4 GB"
              )  # auto-scale between 5 and 100 jobs (maximum_memory="4 GB")

client = Client(cluster)

exe_args = {
    'client': client,
}

output = processor.run_uproot_job(fileset,
                                  treename='Events',
                                  processor_instance=METProcessor(),
                                  executor=processor.dask_executor,
                                  executor_args=exe_args)

# Generates a 1D histogram from the data output to the 'MET' key. fill_opts are optional, to fill the graph (default is a line).
hist.plot1d(output['MET'],
Ejemplo n.º 2
0
from tdub import setup_logging
from tdub.train import prepare_from_root
from tdub.utils import get_selection, get_features, quick_files

import lightgbm as lgbm
from sklearn.model_selection import train_test_split

from dask_jobqueue import HTCondorCluster
from dask.distributed import Client
from dask_ml.model_selection import GridSearchCV

cluster = HTCondorCluster(cores=2, disk="4GB", memory="8GB")
client = Client(cluster)
cluster.adapt(maximum_jobs=200)

setup_logging()

qf = quick_files("/atlasgpfs01/usatlas/data/ddavis/wtloop/v29_20191111")

df, y, w = prepare_from_root(qf["tW_DR"], qf["ttbar"], "1j1b")

X_train, X_test, y_train, y_test, w_train, w_test = train_test_split(
    df, y, w, train_size=0.8, random_state=414, shuffle=True)

n_sig = y_train[y_train == 1].shape[0]
n_bkg = y_train[y_train == 0].shape[0]
spw = n_bkg / n_sig

n_sig = y[y == 1].shape[0]
n_bkg = y[y == 0].shape[0]
spw = n_bkg / n_sig