This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import uproot | |
| import awkward | |
| import hist | |
| import numpy as np | |
| import os | |
| import math | |
| def get_root_parent(index, mcparticles): | |
| parents = mcparticles[index].member("parents").tolist() | |
| if len(parents) == 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import awkward | |
| import uproot | |
| import glob | |
| from rich.progress import track | |
| import multiprocessing | |
| import concurrent.futures | |
| import pathlib | |
| def extract_file(c3FileName, keep): | |
| c3File = uproot.open(c3FileName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Every 1.0s: zpool iostat -vly 1 1 godrick: Mon Sep 26 19:53:16 2022 | |
| capacity operations bandwidth total_wait disk_wait syncq_wait asyncq_wait scrub trim | |
| pool alloc free read write read write read write read write read write read write wait wait | |
| ----------------------------------------------- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- | |
| chrysalid 3.81T 10.7T 13 667 1.74M 28.3M 2ms 7ms 2ms 502us 2us 1us 2us 7ms - - | |
| mirror-0 1.91T 5.35T 2 295 383K 13.1M 2ms 8ms 2ms 464us 2us 1us - 7ms - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ========================================================================== | |
| # AIDA Detector description implementation | |
| # -------------------------------------------------------------------------- | |
| # Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) | |
| # All rights reserved. | |
| # | |
| # For the licensing terms see $DD4hepINSTALL/LICENSE. | |
| # For the list of contributors see $DD4hepINSTALL/doc/CREDITS. | |
| # | |
| # ========================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| from dask.distributed import Client, worker_client, as_completed, secede, rejoin | |
| import pprint | |
| import time | |
| def reduce_chunks(items): | |
| out = 0 | |
| for item in items: | |
| out += item #.result() | |
| return out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from torch_cmspepr.gravnet_model import GravnetModelWithNoiseFilter | |
| model = GravnetModelWithNoiseFilter(input_dim=9, output_dim=6, k=50, signal_threshold=.05) | |
| weights = torch.load("ckpt_train_taus_integrated_noise_Oct20_212115_best_397.pth.tar") | |
| model.load_state_dict(weights["model"]) | |
| jitted = torch.jit.script(model) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from torch_cmspepr.dataset import TauDataset | |
| import json | |
| from tqdm import tqdm | |
| dataset = TauDataset("/mnt/d/mldata/hgcalml/npzs_all") | |
| out_list = [] | |
| for i, data in tqdm(enumerate(dataset[:1000])): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from coffea import hist | |
| import numpy as np | |
| import random | |
| import string | |
| from tqdm import tqdm | |
| N_ds = 45 | |
| N_reg = 3 | |
| N_ds_full_syst = 6 | |
| N_syst = 53 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def loadData(fileName): | |
| # 1. Load Data # | |
| #fileName = "/uscms/home/dkim2/nobackup/safetodel/nano_mc2017_1-11_Skim.root" | |
| file = uproot.open(fileName) | |
| printer.info("file: "+ fileName) | |
| events = file["Events"].arrays(how="zip") | |
| mask = events.pfcand_pt > 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ARG SERVERBASE=20.09-py3 | |
| FROM nvcr.io/nvidia/pytorch:${SERVERBASE} | |
| ENV FORCE_CUDA=1 | |
| ARG LIB_WITH_CUDA=ON | |
| ARG NPROC=4 | |
| RUN git clone https://github.com/rusty1s/pytorch_cluster.git | |
| RUN pushd pytorch_cluster &&\ |