CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
fit::Likelihood< Sample, PDF, Yield > Class Template Reference

#include <Likelihood.h>

Public Member Functions

double absoluteLog () const
 
 Likelihood ()
 
 Likelihood (const Sample &sample, PDF &pdf, Yield &yield)
 
double log () const
 
double logNFactorial () const
 
double operator() () const
 
PDF & pdf ()
 
const PDF & pdf () const
 
unsigned int sampleSize () const
 
Yield & yield ()
 
const Yield & yield () const
 

Private Types

typedef LikelihoodEvaluator< PDF, typename Sample::value_type > Evaluator
 

Private Attributes

PDF * pdf_
 
Sample sample_
 
unsigned int sampleSize_ = 0u
 
Yield * yield_
 

Detailed Description

template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
class fit::Likelihood< Sample, PDF, Yield >

Definition at line 27 of file Likelihood.h.

Member Typedef Documentation

template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
typedef LikelihoodEvaluator<PDF, typename Sample::value_type> fit::Likelihood< Sample, PDF, Yield >::Evaluator
private

Definition at line 55 of file Likelihood.h.

Constructor & Destructor Documentation

template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
fit::Likelihood< Sample, PDF, Yield >::Likelihood ( )
inline

Definition at line 29 of file Likelihood.h.

29 { }
template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
fit::Likelihood< Sample, PDF, Yield >::Likelihood ( const Sample &  sample,
PDF &  pdf,
Yield &  yield 
)
inline

Definition at line 30 of file Likelihood.h.

Member Function Documentation

template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
double fit::Likelihood< Sample, PDF, Yield >::absoluteLog ( ) const
inline

Definition at line 46 of file Likelihood.h.

References cmsBatch::log.

46  {
47  return log() - logNFactorial();
48  }
double logNFactorial() const
Definition: Likelihood.h:43
double log() const
Definition: Likelihood.h:34
template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
double fit::Likelihood< Sample, PDF, Yield >::log ( ) const
inline

Definition at line 34 of file Likelihood.h.

References mps_fire::i, checklumidiff::l, cmsBatch::log, and AlCaHLTBitMon_ParallelJobs::p.

34  {
35  double l = - (*yield_)();
36  for(typename Sample::const_iterator i = sample_.begin(); i != sample_.end(); ++i) {
37  double p = Evaluator::evaluate(*pdf_, *i);
38  l += std::log(p);
39  }
40  sampleSize_ = sample_.size();
41  return l;
42  }
static double evaluate(const PDF &pdf, const Tuple &tuple)
Definition: Likelihood.h:11
unsigned int sampleSize_
Definition: Likelihood.h:59
Sample sample_
Definition: Likelihood.h:58
template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
double fit::Likelihood< Sample, PDF, Yield >::logNFactorial ( ) const
inline

Definition at line 43 of file Likelihood.h.

References cmsBatch::log.

43  {
44  return std::log(TMath::Factorial(sampleSize_));
45  }
unsigned int sampleSize_
Definition: Likelihood.h:59
template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
double fit::Likelihood< Sample, PDF, Yield >::operator() ( ) const
inline

Definition at line 33 of file Likelihood.h.

References cmsBatch::log.

33 { return log(); }
double log() const
Definition: Likelihood.h:34
template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
PDF& fit::Likelihood< Sample, PDF, Yield >::pdf ( )
inline

Definition at line 49 of file Likelihood.h.

49 { return * pdf_; }
template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
const PDF& fit::Likelihood< Sample, PDF, Yield >::pdf ( ) const
inline

Definition at line 50 of file Likelihood.h.

50 { return * pdf_; }
template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
unsigned int fit::Likelihood< Sample, PDF, Yield >::sampleSize ( ) const
inline

Definition at line 53 of file Likelihood.h.

53 { return sampleSize_; }
unsigned int sampleSize_
Definition: Likelihood.h:59
template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
Yield& fit::Likelihood< Sample, PDF, Yield >::yield ( )
inline

Definition at line 51 of file Likelihood.h.

51 { return * yield_; }
Yield * yield_
Definition: Likelihood.h:57
template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
const Yield& fit::Likelihood< Sample, PDF, Yield >::yield ( ) const
inline

Definition at line 52 of file Likelihood.h.

52 { return * yield_; }
Yield * yield_
Definition: Likelihood.h:57

Member Data Documentation

template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
PDF* fit::Likelihood< Sample, PDF, Yield >::pdf_
private

Definition at line 56 of file Likelihood.h.

template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
Sample fit::Likelihood< Sample, PDF, Yield >::sample_
private

Definition at line 58 of file Likelihood.h.

template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
unsigned int fit::Likelihood< Sample, PDF, Yield >::sampleSize_ = 0u
mutableprivate

Definition at line 59 of file Likelihood.h.

template<typename Sample, typename PDF, typename Yield = NoExtendedLikelihood>
Yield* fit::Likelihood< Sample, PDF, Yield >::yield_
private

Definition at line 57 of file Likelihood.h.