ROOT logo
ROOT » ROOFIT » ROOSTATS » RooStats::ToyMCSampler

class RooStats::ToyMCSampler: public RooStats::TestStatSampler


ToyMCSampler 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~ToyMCSampler()
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 const RooAbsArg*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 voidSetNEventsPerToy(const Int_t nevents)
virtual voidSetNToys(const Int_t ntoy)
virtual voidSetNuisanceParameters(RooArgSet& set)
virtual voidSetObservables(RooArgSet& set)
virtual voidSetParameters(RooArgSet& set)
virtual voidSetPdf(RooAbsPdf& pdf)
virtual voidSetPdf(const char* name)
virtual voidSetTestSize(Double_t size)
virtual voidSetTestStatistic(RooAbsArg&) const
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
RooStats::ToyMCSamplerToyMCSampler(RooStats::TestStatistic& ts)
RooStats::ToyMCSamplerToyMCSampler(const RooStats::ToyMCSampler&)

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
RooArgSet*fNuisParamsRooArgSet specifying nuisance parameters for interval
RooArgSet*fObservablesRooArgSet specifying the observables in the dataset (needed to evaluate the test statistic)
Bool_tfOwnsWorkspaceflag if this object owns its workspace
RooArgSet*fPOIRooArgSet specifying parameters of interest for interval
const char*fPdfNamename of common PDF in workspace
TRandom*fRandrandom generator
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

ToyMCSampler(TestStatistic &ts)
virtual ~ToyMCSampler()
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.
SetParameters(&allParameters, parameters)
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
const RooAbsArg* 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 SetNuisanceParameters(RooArgSet& set)
 specify the nuisance parameters (eg. the rest of the parameters)
{fNuisParams = &set;}
void SetObservables(RooArgSet& set)
 specify the observables in the dataset (needed to evaluate the test statistic)
{fObservables = &set;}
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(RooAbsArg& ) const
 Set the TestStatistic (want the argument to be a function of the data & parameter points
{}