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
## My helper python functions | |
def make_dirs(dirname): | |
""" | |
Ensure that a named directory exists; if it does not, attempt to create it. | |
""" | |
try: | |
os.makedirs(dirname) | |
except OSError, e: | |
if e.errno != errno.EEXIST: |
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
# On server | |
# from https://github.com/jirutka/rsub-client | |
pip install --user rsub | |
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc #or the path where it installed | |
# On client | |
# Install Package control https://packagecontrol.io/installation | |
# CTrl+Shift+P # to open package control |
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'canary', |
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 cut(tdf, ptlow=300, pthigh=2000, mlow = 20, mhigh = 220): | |
cdf = tdf[(tdf.fj_pt < pthigh) & (tdf.fj_pt>ptlow) &(tdf.fj_sdmass < mhigh) & (tdf.fj_sdmass>mlow)] | |
return cdf | |
def roc_input(frame, signal=["HCC"], include = ["HCC", "Light", "gBB", "gCC", "HBB"], norm=False, tagger='fj_doubleb'): | |
# Bkg def - filter unwanted | |
bkg = np.zeros(frame.shape[0]) | |
for label in include: | |
bkg = np.add(bkg, frame['truth'+label].values ) | |
bkg = [bool(x) for x in bkg] |
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 FWCore.ParameterSet.Config as cms | |
from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask | |
process = cms.Process("PATtest" | |
#Run 303832, Event 1081102788, LumiSection 918i | |
#,eventsToProcess = cms.untracked.VEventRange('303832:918:1081102780-303832:918:1081102790') | |
) | |
## MessageLogger |
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
--------------------------------------------------------------------------- | |
AssertionError Traceback (most recent call last) | |
<ipython-input-7-07466b6a31e5> in <module> | |
1 for arrays in tree.iterate({"fj_pt": uproot.asarray(">f8", pt_buffer), | |
2 "fj_eta": uproot.asarray(">f8", eta_buffer)}, | |
----> 3 outputtype=tuple, entrysteps=5000): | |
4 pass | |
~/software/miniconda3/envs/def/lib/python3.7/site-packages/uproot/tree.py in iterate(self, branches, entrysteps, outputtype, namedecode, reportentries, entrystart, entrystop, flatten, flatname, awkwardlib, cache, basketcache, keycache, executor, blocking) | |
710 else: |
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
# Remove weird deepcsv events | |
def cleandf(tdf): | |
cdf = tdf[(tdf['Jet_btagDeepB'] < 1) & (tdf['Jet_btagDeepC'] < 1) | |
& (tdf['Jet_btagDeepB'] > 0) & (tdf['Jet_btagDeepC'] > 0) ]#&(tdf.fj_sdmass < mhigh) & (tdf.fj_sdmass>mlow)] | |
cdf = cdf[:2000000] | |
return cdf | |
for df in [df16, df17, df18]: | |
df['fj_pt'] = df['Jet_pt'] | |
df['truthb'] = (df['Jet_hadronFlavour'] == 5).astype(int) |
This file has been truncated, but you can view the full file.
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
==9451== Memcheck, a memory error detector | |
==9451== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. | |
==9451== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info | |
==9451== Command: cmsRunGlibC RecoBTag/ONNXRuntime/test/test_deep_doublex_cfg.py | |
==9451== | |
************************************************************** | |
b tagging needs to be run on uncorrected jets. Hence, the JECs | |
will first be undone for 'updatedPatJets' and then applied to | |
'updatedPatJetsTransientCorrected'. | |
************************************************************** |
This file has been truncated, but you can view the full file.
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
==9451== Memcheck, a memory error detector | |
==9451== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. | |
==9451== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info | |
==9451== Command: cmsRunGlibC RecoBTag/ONNXRuntime/test/test_deep_doublex_cfg.py | |
==9451== | |
************************************************************** | |
b tagging needs to be run on uncorrected jets. Hence, the JECs | |
will first be undone for 'updatedPatJets' and then applied to | |
'updatedPatJetsTransientCorrected'. | |
************************************************************** |
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
imax 1 number of channels | |
jmax 1 number of backgrounds | |
kmax 2 number of nuisance parameters (sources of systematical uncertainties) | |
------------ | |
bin bin1 | |
observation 10001 | |
------------ | |
bin bin1 bin1 | |
process sig bkg | |
process 0 1 |
OlderNewer