Skip to content

Commit

Permalink
Merge pull request #49 from CoffeaTeam/fix-converter-relpath
Browse files Browse the repository at this point in the history
Fix converter relpath
  • Loading branch information
lgray authored Feb 1, 2019
2 parents ab80a8f + ff3e479 commit f06a202
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions fnal_column_analysis_tools/hist/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@

def poisson_interval(sumw, sumw2, sigma=1):
"""
The so-called 'exact' interval
c.f. http://ms.mcmaster.ca/peter/s743/poissonalpha.html
The so-called 'Garwood' interval
c.f. https://www.ine.pt/revstat/pdf/rs120203.pdf
or http://ms.mcmaster.ca/peter/s743/poissonalpha.html
For weighted data, approximate the observed count by sumw**2/sumw2
When a bin is zero, find the scale of the nearest nonzero bin
If all bins zero, raise warning and set interval to sumw
This choice effectively scales the unweighted poisson interval by the average weight
Maybe not the best... see https://arxiv.org/pdf/1309.1287.pdf for a proper treatment
When a bin is zero, find the scale of the nearest nonzero bin
If all bins zero, raise warning and set interval to sumw
"""
scale = np.empty_like(sumw)
scale[sumw!=0] = sumw2[sumw!=0] / sumw[sumw!=0]
Expand Down
3 changes: 2 additions & 1 deletion fnal_column_analysis_tools/lookup_tools/extractor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import print_function
import os

import numpy as np
from .evaluator import evaluator
Expand Down Expand Up @@ -78,7 +79,7 @@ def add_weight_sets(self,weightsdescs):
def import_file(self,file):
""" cache the whole contents of a file for later processing """
if file not in self._filecache.keys():
file_dots = file.split('.')
file_dots = os.path.basename(file).split('.')
format = file_dots[-1].strip()
type = 'default'
if len(file_dots) > 2:
Expand Down

0 comments on commit f06a202

Please sign in to comment.