Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple root dependencies by using uproot and scipy stats #87

Closed
kratsg opened this issue Jul 18, 2019 · 3 comments
Closed

Decouple root dependencies by using uproot and scipy stats #87

kratsg opened this issue Jul 18, 2019 · 3 comments

Comments

@kratsg
Copy link
Owner

kratsg commented Jul 18, 2019

def significance(signalExp, backgroundExp, relativeBkgUncert):
    """ Numpy/Scipy port of the RooStats function `BinomialExpZ'

    See: https://root.cern.ch/doc/master/NumberCountingUtils_8cxx_source.html
    """
    # pylint: disable=invalid-name
    mainInf = signalExp + backgroundExp
    tau = 1.0 / backgroundExp / (relativeBkgUncert * relativeBkgUncert)
    auxiliaryInf = backgroundExp * tau
    P_Bi = scipy.special.betainc(mainInf, auxiliaryInf + 1, 1.0 / (1.0 + tau))
    return - scipy.special.ndtri(P_Bi)
@kratsg
Copy link
Owner Author

kratsg commented Jul 18, 2019

I've decoupled RooStats with 3acfd8b.

@kratsg
Copy link
Owner Author

kratsg commented Jul 18, 2019

I've decoupled most of ROOT (except for plotting) from 3acfd8b to e1c37a8.

e1c37a...3acfd8

@kratsg
Copy link
Owner Author

kratsg commented Jul 18, 2019

Closing this for now as most of it is decoupled except for plotting which isn't under the scope of this issue.

@kratsg kratsg closed this as completed Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant