CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
BinomialProbHelper Class Reference

#include <BinomialProbHelper.h>

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_.

13  : rho_(rho), x_(x), n_(n),
14  rho_hat_(double(x)/n),
15  prob_(ROOT::Math::binomial_pdf(x, rho, n)) {
16  // Cache the likelihood ratio L(\rho)/L(\hat{\rho}), too.
17  if (x == 0)
18  lratio_ = pow(1 - rho, n);
19  else if (x == n)
20  lratio_ = pow(rho, n);
21  else
22  lratio_ = pow(rho/rho_hat_, x) * pow((1 - rho)/(1 - rho_hat_), n - x);
23  }
double rho() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Function Documentation

double BinomialProbHelper::lratio ( ) const
inline

Definition at line 29 of file BinomialProbHelper.h.

Referenced by FeldmanCousinsSorter::operator()().

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

Definition at line 27 of file BinomialProbHelper.h.

References n_.

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

Definition at line 28 of file BinomialProbHelper.h.

References prob_.

Referenced by SterneSorter::operator()().

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

Definition at line 25 of file BinomialProbHelper.h.

References rho_.

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

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().