CMS 3D CMS Logo

Public Member Functions | Private Attributes

BinomialProbHelper Class Reference

#include <BinomialProbHelper.h>

List of all members.

Public Member Functions

 BinomialProbHelper (double rho, int x, int n)
double lratio () const
int n () const
double prob () const
double rho () const
int x () const

Private Attributes

double lratio_
int n_
double prob_
double rho_
double rho_hat_
int x_

Detailed Description

Definition at line 10 of file BinomialProbHelper.h.


Constructor & Destructor Documentation

BinomialProbHelper::BinomialProbHelper ( double  rho,
int  x,
int  n 
) [inline]

Definition at line 12 of file BinomialProbHelper.h.

References lratio_, funct::pow(), and rho_hat_.

    : rho_(rho), x_(x), n_(n),
    rho_hat_(double(x)/n),
    prob_(ROOT::Math::binomial_pdf(x, rho, n)) {
    // Cache the likelihood ratio L(\rho)/L(\hat{\rho}), too.
    if (x == 0)
      lratio_ = pow(1 - rho, n);
    else if (x == n)
      lratio_ = pow(rho, n);
    else
      lratio_ = pow(rho/rho_hat_, x) * pow((1 - rho)/(1 - rho_hat_), n - x);
  }

Member Function Documentation

double BinomialProbHelper::lratio ( ) const [inline]

Definition at line 29 of file BinomialProbHelper.h.

{ return lratio_; };
int BinomialProbHelper::n ( void  ) const [inline]

Definition at line 27 of file BinomialProbHelper.h.

References n_.

{ return n_;      };
double BinomialProbHelper::prob ( ) const [inline]

Definition at line 28 of file BinomialProbHelper.h.

References prob_.

Referenced by SterneSorter::operator()().

{ return prob_;   };
double BinomialProbHelper::rho ( ) const [inline]

Definition at line 25 of file BinomialProbHelper.h.

References rho_.

{ return rho_;    };
int BinomialProbHelper::x ( ) const [inline]

Definition at line 26 of file BinomialProbHelper.h.

References x_.

{ return x_;      };

Member Data Documentation

double BinomialProbHelper::lratio_ [private]

Definition at line 37 of file BinomialProbHelper.h.

Referenced by BinomialProbHelper().

int BinomialProbHelper::n_ [private]

Definition at line 34 of file BinomialProbHelper.h.

Referenced by n().

double BinomialProbHelper::prob_ [private]

Definition at line 36 of file BinomialProbHelper.h.

Referenced by prob().

double BinomialProbHelper::rho_ [private]

Definition at line 29 of file BinomialProbHelper.h.

Referenced by rho().

double BinomialProbHelper::rho_hat_ [private]

Definition at line 35 of file BinomialProbHelper.h.

Referenced by BinomialProbHelper().

int BinomialProbHelper::x_ [private]

Definition at line 33 of file BinomialProbHelper.h.

Referenced by x().