ROOT logo
ROOT » ROOFIT » ROOSTATS » RooStats::ToyMCSamplerOld

class RooStats::ToyMCSamplerOld: public RooStats::TestStatSampler


ToyMCSamplerOld is a simple implementation of the TestStatSampler interface. It generates Toy Monte Carlo for a given parameter point, and evaluates a test statistic that the user specifies (passed via the RooStats::TestStatistic interface). Development notes: We need to provide a nice way for the user to:

  • specify the number of toy experiments (needed to probe a given confidence level)
  • specify if the number of events per toy experiment should be fixed (conditioning) or floating (unconditional)
  • specify if any auxiliary observations should be fixed (conditioning) or floating (unconditional)
  • specify if nuisance paramters should be part of the toy MC: eg: integrated out (Bayesian marginalization)
All of these should be made fairly explicit in the interface.



Function Members (Methods)

public:
virtual~ToyMCSamplerOld()
virtual RooStats::SamplingDistribution*AppendSamplingDistribution(RooArgSet& allParameters, RooStats::SamplingDistribution* last, Int_t additionalMC)
static TClass*Class()
virtual Double_tConfidenceLevel() const
virtual Double_tEvaluateTestStatistic(RooAbsData& data, RooArgSet& allParameters)
virtual RooAbsData*GenerateToyData(RooArgSet& allParameters) const
virtual RooStats::SamplingDistribution*GetSamplingDistribution(RooArgSet& allParameters)
virtual RooStats::TestStatistic*GetTestStatistic() const
virtual voidInitialize(RooAbsArg&, RooArgSet&, RooArgSet&)
virtual TClass*IsA() const
stringMakeName(RooArgSet&)
RooStats::TestStatSampler&RooStats::TestStatSampler::operator=(const RooStats::TestStatSampler&)
virtual voidSetConfidenceLevel(Double_t cl)
virtual voidSetData(RooAbsData& data)
virtual voidSetData(const char* name)
virtual voidSetExtended(const Bool_t isExtended)
virtual voidSetGlobalObservables(const RooArgSet&)
virtual voidSetNEventsPerToy(const Int_t nevents)
virtual voidSetNToys(const Int_t ntoy)
virtual voidSetNuisanceParameters(const RooArgSet& set)
virtual voidSetObservables(const RooArgSet& set)
virtual voidSetParametersForTestStat(const RooArgSet& nullpoi)
virtual voidSetPdf(RooAbsPdf& pdf)
virtual voidSetPdf(const char* name)
virtual voidSetPriorNuisance(RooAbsPdf*)
virtual voidSetSamplingDistName(const char* name)
virtual voidSetTestSize(Double_t size)
virtual voidSetTestStatistic(RooStats::TestStatistic* testStat)
virtual voidShowMembers(TMemberInspector& insp)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
RooStats::ToyMCSamplerOldToyMCSamplerOld(RooStats::TestStatistic& ts)
RooStats::ToyMCSamplerOldToyMCSamplerOld(const RooStats::ToyMCSamplerOld&)

Data Members

private:
Int_tfCountercounter for naming sampling dist objects
const char*fDataNamename of data set in workspace
Bool_tfExtendedif nEvents should fluctuate
RooDataSet*fLastDataSetwork around for memory issues in nllvar->setData(data, noclone)
Int_tfNeventsnumber of events per toy (may be ignored depending on settings)
Int_tfNtoysnumber of toys to generate
const RooArgSet*fNuisParamsRooArgSet specifying nuisance parameters for interval
RooArgSet*fNullPOIthe values of parameters used when evaluating test statistic
const RooArgSet*fObservablesRooArgSet specifying the observables in the dataset (needed to evaluate the test statistic)
Bool_tfOwnsWorkspaceflag if this object owns its workspace
const char*fPdfNamename of common PDF in workspace
TRandom*fRandrandom generator
stringfSamplingDistNamename of the model
Double_tfSize
RooStats::TestStatistic*fTestStatpointer to the test statistic that is being sampled
TStringfVarNamename of test statistic
RooWorkspace*fWSa workspace that owns all the components to be used by the calculator

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

ToyMCSamplerOld(TestStatistic &ts)
virtual ~ToyMCSamplerOld()
SamplingDistribution* AppendSamplingDistribution(RooArgSet& allParameters, RooStats::SamplingDistribution* last, Int_t additionalMC)
 Extended interface to append to sampling distribution more samples
SamplingDistribution* GetSamplingDistribution(RooArgSet& allParameters)
 Main interface to get a SamplingDistribution
RooAbsData* GenerateToyData(RooArgSet& allParameters) const
 This method generates a toy dataset for the given parameter point.
string MakeName(RooArgSet& )
 helper method to create meaningful names for sampling dist
Double_t EvaluateTestStatistic(RooAbsData& data, RooArgSet& allParameters)
 Main interface to evaluate the test statistic on a dataset
TestStatistic* GetTestStatistic() const
 Get the TestStatistic
Double_t ConfidenceLevel() const
 Get the Confidence level for the test
{return 1.-fSize;}
void Initialize(RooAbsArg& , RooArgSet& , RooArgSet& )
 Common Initialization
void SetNEventsPerToy(const Int_t nevents)
void SetExtended(const Bool_t isExtended)
void SetData(RooAbsData& data)
 Set the DataSet, add to the the workspace if not already there
void SetPdf(RooAbsPdf& pdf)
 Set the Pdf, add to the the workspace if not already there
void SetData(const char* name)
 specify the name of the dataset in the workspace to be used
{fDataName = name;}
void SetPdf(const char* name)
 specify the name of the PDF in the workspace to be used
{fPdfName = name;}
void SetPriorNuisance(RooAbsPdf* )
 How to randomize the prior. Set to NULL to deactivate randomization.
{}
void SetParametersForTestStat(const RooArgSet& nullpoi)
 specify the values of parameters used when evaluating test statistic
{fNullPOI = (RooArgSet*)nullpoi.snapshot();}
void SetNuisanceParameters(const RooArgSet& set)
 specify the nuisance parameters (eg. the rest of the parameters)
{fNuisParams = &set;}
void SetObservables(const RooArgSet& set)
 specify the observables in the dataset (needed to evaluate the test statistic)
{fObservables = &set;}
void SetGlobalObservables(const RooArgSet& )
 specify the conditional observables
{}
void SetTestSize(Double_t size)
 set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
{fSize = size;}
void SetConfidenceLevel(Double_t cl)
 set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
{fSize = 1.-cl;}
void SetTestStatistic(RooStats::TestStatistic* testStat)
 Set the TestStatistic (want the argument to be a function of the data & parameter points
void SetSamplingDistName(const char* name)
 Set the name of the sampling distribution used for plotting
{ if(name) fSamplingDistName = name; }