API Reference¶
Classes¶
-
class
rexart.objects.
Sample
(name: str = 'none', signature: str = 'none', color: str = 'black', tex: str = 'none')[source]¶ Defines a physics sample
-
name
¶ name of the sample
- Type
str
-
signature
¶ name of the sample on disk
- Type
str
-
color
¶ matplotlib color
- Type
str
-
tex
¶ LaTeX label
- Type
str
-
-
class
rexart.objects.
NuisPar
(name: str = 'none', mean: float = 0, minus: float = 0, plus: float = 0, category: str = 'none', title: str = 'none')[source]¶ Defines a nuisance parameter from TRExFitter
-
name
¶ name on disk
- Type
str
-
mean
¶ mean value
- Type
float
-
minus
¶ minus part of the error bar
- Type
float
-
plus
¶ plus part of the error bar
- Type
float
-
category
¶ systematic category
- Type
str
-
title
¶ a title for the plots
- Type
str
-
Stack Plots¶
-
rexart.stacks.
stackem
(args, region, data, histograms, template_var, band=None, figsize=(6, 5.25))[source]¶ Create a stack plot
- Parameters
args (argparse.ArgumentParser) – command line arguments
region (str) – region from TRExFitter
data (rexart.objects.Sample) – data sample
histograms (List[rexart.objects.Sample]) – list of MC samples to stack
template_var (str) – name of the template variable
band (Optional[uproot_methods.classes.TGraphAsymmErrors]) – error band
figsize (tuple(float, float)) – matplotlib figure size
- Returns
fig (matplotlib.figure.Figure) – matplotlib fiture
axes (tuple(matplotlib.axes.Axes, matplotlib.axes.Axes)) – matplotlib axes (main, ratio)
-
rexart.stacks.
prefit_histograms
(args, fit_name, region, samples)[source]¶ Prepare prefit histogram objects
- Parameters
args (argparse.ArgumentParser) – command line arguments
fit_name (str) – TRExFitter fit name
region (str) – TRExFitter region
samples (List[rexart.objects.Sample]) – list of MC samples
- Returns
data (rexart.objects.Histogram) – data histogram
histograms (List[rexart.objects.Histogram]) – MC histograms
band (uproot_methods.classes.TGraphAsymmErrors) – uncertainty band
-
rexart.stacks.
postfit_histograms
(args, fit_name, region, samples)[source]¶ Prepare postfit histogram objects
- Parameters
args (argparse.ArgumentParser) – command line arguments
fit_name (str) – TRExFitter fit name
region (str) – TRExFitter region
samples (List[rexart.objects.Sample]) – list of MC samples
- Returns
data (rexart.objects.Histogram) – data histogram
histograms (List[rexart.objects.Histogram]) – MC histograms
band (uproot_methods.classes.TGraphAsymmErrors) – uncertainty band
Pull Plots¶
-
rexart.pulls.
get_blank_systematics
(config_file)[source]¶ Get list of NPs and categories from TRExFitter config file
- Parameters
config_file (str) – name of config file
- Returns
nps (list) – list of nuisance parameters
categories (set) – all categories that were found
-
rexart.pulls.
draw_pulls
(args, nps)[source]¶ Draw pulls from command line arguments and nuisance parameters
- Parameters
args (argparse.ArgumentParser) – command line arguments
nps (list) – list of nuisance parameters to draw
- Returns
fig (matplotlib.figure.Figure) – matplotlib fiture
ax (matplotlib.axes.Axes) – matplotlib axis