To turn off messages like:
Info in <TCanvas::Print>: png file my_plot.png has been created
add in:
gErrorIgnoreLevel = kWarning
def plot_two_hists(var, df1, df2, title1, title2, xlabel, ylabel, **kwargs): | |
"""function to make 2 side-by-side hists to compare 2 dataframes""" | |
fig2, ax2 = plt.subplots(nrows=1, ncols=2) | |
fig2.set_size_inches(24, 8) | |
plt.subplots_adjust(wspace=0.2) | |
df1[var].plot(kind="hist", ax=ax2[0], title=title1, **kwargs) | |
ax2[0].set_xlabel(xlabel) | |
ax2[0].set_ylabel(ylabel) |
#!/usr/bin/env python | |
""" | |
Example ways to access tree elements, to test relative performance | |
""" | |
import ROOT | |
from array import array | |
# import cProfile |
#!/usr/bin/env python | |
""" | |
Script to check whether samples are at a T2 (fully). | |
Run by doing: | |
./check_sample_status.py | |
For each dataset in SAMPLES, will print out the sample in red with a 'x' | |
if not fully at any T2. | |
If it is fully present at atleast 1 T2, then it will print in green with a 'v'. |
To turn off messages like:
Info in <TCanvas::Print>: png file my_plot.png has been created
add in:
gErrorIgnoreLevel = kWarning
#!/usr/bin/env python | |
""" | |
Example ways to access tree elements, to test relative performance | |
""" | |
import ROOT | |
from array import array | |
# import cProfile |
#include "TFile.h" | |
#include "TTree.h" | |
#include "TH1F.h" | |
#include "TH2F.h" | |
#include <iostream> | |
#include <math.h> | |
#include <vector> | |
#include <string> | |
//#include "L1AnalysisEventDataFormat.h" |
class CustomFormatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescriptionHelpFormatter): | |
pass | |
parser = argparse.ArgumentParser(description='test\ntest\ntest.', | |
epilog='test\ntest\ntest.', | |
formatter_class=CustomFormatter) |
#!/usr/bin/env python | |
""" | |
Go through TeX files and count words, plot things. | |
TODO: | |
- only count commits where tex file changed? | |
""" | |
from copy import deepcopy | |
from contextlib import contextmanager | |
import pandas as pd | |
import numpy as np | |
import matplotlib as mpl | |
from matplotlib.pyplot import cm | |
import matplotlib.pyplot as plt | |
import matplotlib.patches as patches | |
from matplotlib.colors import LogNorm, Normalize |
import os | |
from copy import deepcopy | |
from contextlib import contextmanager | |
# Global bool to turn on/off plot saving for all plots in notebook | |
SAVE_PLOTS = True | |
def save_plot(filename): |