CMS 3D CMS Logo

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 14 of file BinomialProbHelper.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file BinomialProbHelper.h.

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

17  : rho_(rho), x_(x), n_(n),
18  rho_hat_(double(x)/n),
19  prob_(ROOT::Math::binomial_pdf(x, rho, n)) {
20  // Cache the likelihood ratio L(\rho)/L(\hat{\rho}), too.
21  if (x == 0)
22  lratio_ = pow(1 - rho, n);
23  else if (x == n)
24  lratio_ = pow(rho, n);
25  else
26  lratio_ = pow(rho/rho_hat_, x) * pow((1 - rho)/(1 - rho_hat_), n - x);
27  }
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 33 of file BinomialProbHelper.h.

Referenced by FeldmanCousinsSorter::operator()().

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

Definition at line 31 of file BinomialProbHelper.h.

References n_.

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

Definition at line 32 of file BinomialProbHelper.h.

References prob_.

Referenced by SterneSorter::operator()().

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

Definition at line 29 of file BinomialProbHelper.h.

References rho_.

Referenced by Lepton.Lepton::absIsoFromEA(), and Muon.Muon::absIsoWithFSR().

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

Member Data Documentation

double BinomialProbHelper::lratio_
private

Definition at line 41 of file BinomialProbHelper.h.

Referenced by BinomialProbHelper().

int BinomialProbHelper::n_
private

Definition at line 38 of file BinomialProbHelper.h.

Referenced by n().

double BinomialProbHelper::prob_
private

Definition at line 40 of file BinomialProbHelper.h.

Referenced by prob().

double BinomialProbHelper::rho_
private

Definition at line 33 of file BinomialProbHelper.h.

Referenced by rho().

double BinomialProbHelper::rho_hat_
private

Definition at line 39 of file BinomialProbHelper.h.

Referenced by BinomialProbHelper().

int BinomialProbHelper::x_
private

Definition at line 37 of file BinomialProbHelper.h.

Referenced by x().