Skip to content
Snippets Groups Projects
Verified Commit cd721267 authored by Frank Sauerburger's avatar Frank Sauerburger
Browse files

Implement histogram factory

parent 6e6ead6b
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
This diff is collapsed.
...@@ -6,6 +6,7 @@ from matplotlib.ticker import AutoMinorLocator ...@@ -6,6 +6,7 @@ from matplotlib.ticker import AutoMinorLocator
from nnfwtbn.process import Process from nnfwtbn.process import Process
from nnfwtbn.cut import Cut from nnfwtbn.cut import Cut
from nnfwtbn.variable import Variable from nnfwtbn.variable import Variable
import nnfwtbn.error as err
ATLAS = "Work in Progress" ATLAS = "Work in Progress"
INFO = "$\sqrt{s} = 13\,\mathrm{TeV}$, $36.1\,\mathrm{fb}^{-1}$\nSome selection" INFO = "$\sqrt{s} = 13\,\mathrm{TeV}$, $36.1\,\mathrm{fb}^{-1}$\nSome selection"
...@@ -21,6 +22,8 @@ class HistogramFactory: ...@@ -21,6 +22,8 @@ class HistogramFactory:
Accepts any number of positional and keyword arguments. The arguments Accepts any number of positional and keyword arguments. The arguments
are stored internally and use default value for hist(). See __call__(). are stored internally and use default value for hist(). See __call__().
""" """
self.args = args
self.kwds = kwds
def __call__(self, *args, **kwds): def __call__(self, *args, **kwds):
""" """
...@@ -32,8 +35,9 @@ class HistogramFactory: ...@@ -32,8 +35,9 @@ class HistogramFactory:
The method returns the return value of hist. The method returns the return value of hist.
""" """
hist(*self.args, *args, **dict(self.kwds, **kwds))
def hist(dataframe, variable, bins, *stacks, selection=None, def hist(dataframe, variable, bins, stacks, selection=None,
range=None, blind=None, axes=None, figure=None, range=None, blind=None, axes=None, figure=None,
weight=None, **kwds): weight=None, **kwds):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment