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
fit::HistoPoissonLikelihoodRatio< T > Class Template Reference

#include <HistoPoissonLikelihoodRatio.h>

Public Member Functions

Tfunction ()
 
const Tfunction () const
 
 HistoPoissonLikelihoodRatio ()
 
 HistoPoissonLikelihoodRatio (T &t, TH1 *histo, double rangeMin, double rangeMax)
 
size_t numberOfBins () const
 
double operator() () const
 
void setHistos (TH1 *histo)
 

Private Attributes

std::vector< double > cont_
 
double deltaX_
 
size_t nBins_
 
double rangeMax_
 
double rangeMin_
 
Tt_
 
double xMax_
 
double xMin_
 

Detailed Description

template<typename T>
class fit::HistoPoissonLikelihoodRatio< T >

Definition at line 11 of file HistoPoissonLikelihoodRatio.h.

Constructor & Destructor Documentation

template<typename T>
fit::HistoPoissonLikelihoodRatio< T >::HistoPoissonLikelihoodRatio ( )
inline

Definition at line 13 of file HistoPoissonLikelihoodRatio.h.

13 { }
template<typename T>
fit::HistoPoissonLikelihoodRatio< T >::HistoPoissonLikelihoodRatio ( T t,
TH1 *  histo,
double  rangeMin,
double  rangeMax 
)
inline

Definition at line 14 of file HistoPoissonLikelihoodRatio.h.

References fit::HistoPoissonLikelihoodRatio< T >::cont_, fit::HistoPoissonLikelihoodRatio< T >::deltaX_, i, fit::HistoPoissonLikelihoodRatio< T >::nBins_, fit::HistoPoissonLikelihoodRatio< T >::xMax_, and fit::HistoPoissonLikelihoodRatio< T >::xMin_.

Member Function Documentation

template<typename T>
T& fit::HistoPoissonLikelihoodRatio< T >::function ( )
inline
template<typename T>
const T& fit::HistoPoissonLikelihoodRatio< T >::function ( ) const
inline
template<typename T>
size_t fit::HistoPoissonLikelihoodRatio< T >::numberOfBins ( ) const
inline
template<typename T>
double fit::HistoPoissonLikelihoodRatio< T >::operator() ( ) const
inline

Definition at line 24 of file HistoPoissonLikelihoodRatio.h.

References fit::HistoPoissonLikelihoodRatio< T >::cont_, fit::HistoPoissonLikelihoodRatio< T >::deltaX_, i, log, fit::HistoPoissonLikelihoodRatio< T >::nBins_, fit::HistoPoissonLikelihoodRatio< T >::rangeMax_, fit::HistoPoissonLikelihoodRatio< T >::rangeMin_, x, and fit::HistoPoissonLikelihoodRatio< T >::xMin_.

24  {
25  double chi2lambda = 0;
26  for(size_t i = 0; i < nBins_; ++i) {
27  double x = xMin_ + ( i +.5 ) * deltaX_;
28  if((x > rangeMin_)&&(x < rangeMax_)) {
29  double nu = (*t_)(x);
30  if(nu > 0 && cont_[i]>0) chi2lambda += nu - cont_[i] + cont_[i]*log(cont_[i]/nu);
31  }
32  }
33  chi2lambda *= 2;
34  return chi2lambda;
35  }
int i
Definition: DBlmapReader.cc:9
static std::vector< std::string > checklist log
Definition: DDAxes.h:10
template<typename T>
void fit::HistoPoissonLikelihoodRatio< T >::setHistos ( TH1 *  histo)
inline

Member Data Documentation

template<typename T>
std::vector<double> fit::HistoPoissonLikelihoodRatio< T >::cont_
private
template<typename T>
double fit::HistoPoissonLikelihoodRatio< T >::deltaX_
private
template<typename T>
size_t fit::HistoPoissonLikelihoodRatio< T >::nBins_
private
template<typename T>
double fit::HistoPoissonLikelihoodRatio< T >::rangeMax_
private
template<typename T>
double fit::HistoPoissonLikelihoodRatio< T >::rangeMin_
private
template<typename T>
T* fit::HistoPoissonLikelihoodRatio< T >::t_
private
template<typename T>
double fit::HistoPoissonLikelihoodRatio< T >::xMax_
private
template<typename T>
double fit::HistoPoissonLikelihoodRatio< T >::xMin_
private