ROOT » ROOFIT » ROOSTATS » RooStats::AsymptoticCalculator

class RooStats::AsymptoticCalculator: public RooStats::HypoTestCalculatorGeneric

Function Members (Methods)

public:
virtual~AsymptoticCalculator()
RooStats::AsymptoticCalculatorAsymptoticCalculator(const RooStats::AsymptoticCalculator&)
RooStats::AsymptoticCalculatorAsymptoticCalculator(RooAbsData& data, const RooStats::ModelConfig& altModel, const RooStats::ModelConfig& nullModel, bool nominalAsimov = false)
static TClass*Class()
static RooAbsData*GenerateAsimovData(const RooAbsPdf& pdf, const RooArgSet& observables)
const RooStats::ModelConfig*RooStats::HypoTestCalculatorGeneric::GetAlternateModel() const
const RooArgSet&GetBestFitParams() const
const RooArgSet&GetBestFitPoi() const
const RooAbsData*RooStats::HypoTestCalculatorGeneric::GetData() const
static doubleGetExpectedPValues(double pnull, double palt, double nsigma, bool usecls, bool oneSided = true)
virtual const RooArgSet*RooStats::HypoTestCalculatorGeneric::GetFitInfo() const
virtual RooStats::HypoTestResult*GetHypoTest() const
const RooRealVar*GetMuHat() const
const RooStats::ModelConfig*RooStats::HypoTestCalculatorGeneric::GetNullModel() const
RooStats::TestStatSampler*RooStats::HypoTestCalculatorGeneric::GetTestStatSampler() const
RooStats::HypoTestCalculatorRooStats::HypoTestCalculator::HypoTestCalculator()
RooStats::HypoTestCalculatorRooStats::HypoTestCalculator::HypoTestCalculator(const RooStats::HypoTestCalculator&)
RooStats::HypoTestCalculatorGenericRooStats::HypoTestCalculatorGeneric::HypoTestCalculatorGeneric(const RooStats::HypoTestCalculatorGeneric&)
RooStats::HypoTestCalculatorGenericRooStats::HypoTestCalculatorGeneric::HypoTestCalculatorGeneric(const RooAbsData& data, const RooStats::ModelConfig& altModel, const RooStats::ModelConfig& nullModel, RooStats::TestStatSampler* sampler = 0)
boolInitialize() const
virtual TClass*IsA() const
boolIsOneSidedDiscovery() const
boolIsTwoSided() const
static RooAbsData*MakeAsimovData(const RooStats::ModelConfig& model, const RooArgSet& allParamValues, RooArgSet& globObs)
static RooAbsData*MakeAsimovData(RooAbsData& data, const RooStats::ModelConfig& model, const RooArgSet& poiValues, RooArgSet& globObs, const RooArgSet* genPoiValues = 0)
RooStats::AsymptoticCalculator&operator=(const RooStats::AsymptoticCalculator&)
virtual voidSetAlternateModel(const RooStats::ModelConfig& altModel)
virtual voidRooStats::HypoTestCalculator::SetCommonModel(const RooStats::ModelConfig& model)
virtual voidSetData(RooAbsData& data)
virtual voidSetNullModel(const RooStats::ModelConfig& nullModel)
voidSetOneSided(bool on)
voidSetOneSidedDiscovery(bool on)
static voidSetPrintLevel(int level)
voidSetQTilde(bool on)
voidSetTwoSided()
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
voidRooStats::HypoTestCalculatorGeneric::UseSameAltToys()
protected:
virtual intRooStats::HypoTestCalculatorGeneric::CheckHook() const
static doubleEvaluateNLL(RooAbsPdf& pdf, RooAbsData& data, const RooArgSet* condObs, const RooArgSet* poiSet = 0)
static voidFillBins(const RooAbsPdf& pdf, const RooArgList& obs, RooAbsData& data, int& index, double& binVolume, int& ibin)
static RooAbsData*GenerateAsimovDataSinglePdf(const RooAbsPdf& pdf, const RooArgSet& obs, const RooRealVar& weightVar, RooCategory* channelCat = 0)
static RooAbsData*GenerateCountingAsimovData(RooAbsPdf& pdf, const RooArgSet& obs, const RooRealVar& weightVar, RooCategory* channelCat = 0)
virtual voidRooStats::HypoTestCalculatorGeneric::PostHook() const
virtual intRooStats::HypoTestCalculatorGeneric::PreAltHook(RooArgSet*, double) const
virtual voidRooStats::HypoTestCalculatorGeneric::PreHook() const
virtual intRooStats::HypoTestCalculatorGeneric::PreNullHook(RooArgSet*, double) const
static boolSetObsToExpected(RooAbsPdf& pdf, const RooArgSet& obs)
static boolSetObsToExpected(RooProdPdf& prod, const RooArgSet& obs)

Data Members

private:
RooAbsData*fAsimovDataasimov data set
RooArgSetfAsimovGlobObssnapshot of Asimov global observables
RooArgSetfBestFitParamssnapshot of all best fitted Parameter values
RooArgSetfBestFitPoisnapshot of best fitted POI values
boolfIsInitialized! flag to check if calculator is initialized
doublefNLLAsimov
doublefNLLObs
boolfNominalAsimovmake Asimov at nominal parameter values
boolfOneSidedfor one sided PL test statistic (upper limits)
boolfOneSidedDiscoveryfor one sided PL test statistic (for discovery)
intfUseQTildeflag to indicate if using qtilde or not (-1 (default based on RooRealVar)), 0 false, 1 (true)
static intfgPrintLevelcontrol print level (0 minimal, 1 normal, 2 debug)

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

void SetPrintLevel(int level)
 set print level (static function)
 0 minimal, 1 normal,  2 debug
AsymptoticCalculator(RooAbsData& data, const RooStats::ModelConfig& altModel, const RooStats::ModelConfig& nullModel, bool nominalAsimov = false)
 constructor for asymptotic calculator from Data set  and ModelConfig
bool Initialize() const
 Initialize the calculator
 The initialization will perform a global fit of the model to the data
 and build an Asimov data set.
 It will then also fit the model to the Asimov data set to find the likelihood value
 of the Asimov data set
 nominalAsimov is an option for using Asimov data set obtained using nominal nuisance parameter values
 By default the nuisance parameters are fitted to the data
 NOTE: If a fit has been done before, one for speeding up could set all the initial prameters
 to the fit value and in addition set the null snapshot to the best fit
Double_t EvaluateNLL(RooAbsPdf& pdf, RooAbsData& data, const RooArgSet* condObs, const RooArgSet* poiSet = 0)
HypoTestResult* GetHypoTest() const
 It performs an hypothesis tests using the likelihood function
 and computes the p values for the null and the alternate using the asymptotic
 formulae for the profile likelihood ratio.
 See G. Cowan, K. Cranmer, E. Gross and O. Vitells.
 Asymptotic formulae for likelihood- based tests of new physics. Eur. Phys. J., C71:1–19, 2011.
 The formulae are valid only for one POI. If more than one POI exists consider as POI only the
 first one
double GetExpectedPValues(double pnull, double palt, double nsigma, bool usecls, bool oneSided = true)
 function given the null and the alt p value - return the expected one given the N - sigma value
void FillBins(const RooAbsPdf& pdf, const RooArgList& obs, RooAbsData& data, int& index, double& binVolume, int& ibin)
 fill bins by looping recursivly on observables
bool SetObsToExpected(RooProdPdf& prod, const RooArgSet& obs)
 iterate a Prod pdf to find all the Poisson or Gaussian part to set the observed value to expected one
bool SetObsToExpected(RooAbsPdf& pdf, const RooArgSet& obs)
 set observed value to the expected one
 works for Gaussian, Poisson or LogNormal
 assumes mean parameter value is the argument not constant and not depoending on observables
 (if more than two arguments are not constant will use first one but printr a warning !)
 need to iterate on the components of the POisson to get n and nu (nu can be a RooAbsReal)
 (code from G. Petrucciani and extended by L.M.)
RooAbsData * GenerateCountingAsimovData(RooAbsPdf& pdf, const RooArgSet& obs, const RooRealVar& weightVar, RooCategory* channelCat = 0)
 generate counting Asimov data for the case when the pdf cannot be extended
 assume pdf is a RooPoisson or can be decomposed in a product of RooPoisson,
 otherwise we cannot know how to make the Asimov data sets in the other cases
RooAbsData * GenerateAsimovDataSinglePdf(const RooAbsPdf& pdf, const RooArgSet& obs, const RooRealVar& weightVar, RooCategory* channelCat = 0)
 compute the asimov data set for an observable of a pdf
 use the number of bins sets in the observables
 to do :  (possibility to change number of bins)
 implement integration over bin content
RooAbsData * GenerateAsimovData(const RooAbsPdf& pdf, const RooArgSet& observables)
 generate the asimov data for the observables (not the global ones)
 need to deal with the case of a sim pdf
RooAbsData * MakeAsimovData(RooAbsData& data, const RooStats::ModelConfig& model, const RooArgSet& poiValues, RooArgSet& globObs, const RooArgSet* genPoiValues = 0)
 static function to the an Asimov data set
 given an observed dat set, a model and a snapshot of poi.
 Return the asimov data set + global observables set to values satisfying the constraints
RooAbsData * MakeAsimovData(const RooStats::ModelConfig& model, const RooArgSet& allParamValues, RooArgSet& globObs)
 static function to the an Asimov data set
 given the model and the values of all parameters including the nuisance
 Return the asimov data set + global observables set to values satisfying the constraints
AsymptoticCalculator(RooAbsData& data, const RooStats::ModelConfig& altModel, const RooStats::ModelConfig& nullModel, bool nominalAsimov = false)
    HypoTestCalculatorGeneric(data, altModel, nullModel, 0)
 {
 }
void SetOneSided(bool on)
 set test statistic for one sided (upper limits)
{ fOneSided = on; }
void SetTwoSided()
 set the test statistics for two sided (in case of upper limits
 for discovery does not make really sense)
{ fOneSided = false; fOneSidedDiscovery = false;}
void SetOneSidedDiscovery(bool on)
 set the test statistics for one-sided discovery
void SetNullModel(const RooStats::ModelConfig& nullModel)
 re-implement setters since they needs to re-initialize the calculator
void SetAlternateModel(const RooStats::ModelConfig& altModel)
void SetData(RooAbsData& data)
bool IsTwoSided() const
{ return (!fOneSided && !fOneSidedDiscovery); }
bool IsOneSidedDiscovery() const
{ return fOneSidedDiscovery; }
void SetQTilde(bool on)
 set using of qtilde, by default is controlled if RoORealVar is limited or not
{ fUseQTilde = on; }
const RooArgSet & GetBestFitPoi() const
 return snapshot of the best fit parameter
{ return fBestFitPoi; }
const RooRealVar * GetMuHat() const
 return best fit parameter (firs of poi)
{ return dynamic_cast<RooRealVar*>(fBestFitPoi.first()); }
const RooArgSet & GetBestFitParams() const
 return best fit value for all parameters
{ return fBestFitPoi; }