CMS 3D CMS Logo

Public Member Functions | Private Attributes

SimplerLikelihoodRatioTestStat Class Reference

#include <SimplerLikelihoodRatioTestStat.h>

List of all members.

Public Member Functions

virtual Double_t Evaluate (RooAbsData &data, RooArgSet &nullPOI)
virtual const TString GetVarName () const
 SimplerLikelihoodRatioTestStat (RooAbsPdf &pdfNull, RooAbsPdf &pdfAlt, const RooArgSet &paramsNull=RooArgSet(), const RooArgSet &paramsAlt=RooArgSet())

Private Attributes

std::auto_ptr< RooArgSet > paramsAlt_
std::auto_ptr< RooArgSet > paramsNull_
RooAbsPdf * pdfAlt_
RooAbsPdf * pdfNull_
RooArgSet snapAlt_
RooArgSet snapNull_

Detailed Description

Definition at line 11 of file SimplerLikelihoodRatioTestStat.h.


Constructor & Destructor Documentation

SimplerLikelihoodRatioTestStat::SimplerLikelihoodRatioTestStat ( RooAbsPdf &  pdfNull,
RooAbsPdf &  pdfAlt,
const RooArgSet &  paramsNull = RooArgSet(),
const RooArgSet &  paramsAlt = RooArgSet() 
) [inline]

Definition at line 13 of file SimplerLikelihoodRatioTestStat.h.

References snapAlt_, and snapNull_.

                                                                                                                                                                     : 
            pdfNull_(&pdfNull), pdfAlt_(&pdfAlt),
            paramsNull_(pdfNull_->getVariables()), 
            paramsAlt_(pdfAlt_->getVariables()) 
        {
            snapNull_.addClone(paramsNull);
            snapAlt_.addClone(paramsAlt);
        }

Member Function Documentation

virtual Double_t SimplerLikelihoodRatioTestStat::Evaluate ( RooAbsData &  data,
RooArgSet &  nullPOI 
) [inline, virtual]

Definition at line 22 of file SimplerLikelihoodRatioTestStat.h.

References funct::log(), paramsAlt_, paramsNull_, pdfAlt_, pdfNull_, snapAlt_, and snapNull_.

        {
            if (data.numEntries() != 1) throw std::invalid_argument("HybridNew::TestSimpleStatistics: dataset doesn't have exactly 1 entry.");
            const RooArgSet *entry = data.get(0);
            *paramsNull_ = *entry;
            *paramsNull_ = snapNull_;
            *paramsNull_ = nullPOI;
            double nullNLL = pdfNull_->getVal();

            *paramsAlt_ = *entry;
            *paramsAlt_ = snapAlt_;
            double altNLL = pdfAlt_->getVal();

            return -log(nullNLL/altNLL);
        }
virtual const TString SimplerLikelihoodRatioTestStat::GetVarName ( ) const [inline, virtual]

Definition at line 38 of file SimplerLikelihoodRatioTestStat.h.

References pdfAlt_, and pdfNull_.

                                                 {
            return TString::Format("-log(%s/%s)", pdfNull_->GetName(), pdfAlt_->GetName()); 
        }

Member Data Documentation

std::auto_ptr<RooArgSet> SimplerLikelihoodRatioTestStat::paramsAlt_ [private]

Definition at line 45 of file SimplerLikelihoodRatioTestStat.h.

Referenced by Evaluate().

std::auto_ptr<RooArgSet> SimplerLikelihoodRatioTestStat::paramsNull_ [private]

Definition at line 45 of file SimplerLikelihoodRatioTestStat.h.

Referenced by Evaluate().

Definition at line 43 of file SimplerLikelihoodRatioTestStat.h.

Referenced by Evaluate(), and GetVarName().

Definition at line 43 of file SimplerLikelihoodRatioTestStat.h.

Referenced by Evaluate(), and GetVarName().

Definition at line 44 of file SimplerLikelihoodRatioTestStat.h.

Referenced by Evaluate(), and SimplerLikelihoodRatioTestStat().

Definition at line 44 of file SimplerLikelihoodRatioTestStat.h.

Referenced by Evaluate(), and SimplerLikelihoodRatioTestStat().