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

class RooStats::ToyMCSampler: public RooStats::TestStatSampler

Function Members (Methods)

public:
virtual~ToyMCSampler()
virtual RooStats::SamplingDistribution*AppendSamplingDistribution(RooArgSet& allParameters, RooStats::SamplingDistribution* last, Int_t additionalMC)
Bool_tCheckConfig()
static TClass*Class()
virtual Double_tConfidenceLevel() const
virtual Double_tEvaluateTestStatistic(RooAbsData& data, RooArgSet& nullPOI)
virtual voidGenerateGlobalObservables() const
virtual RooAbsData*GenerateToyData(RooArgSet& paramPoint) const
virtual RooAbsData*GenerateToyData(RooArgSet& paramPoint, double& weight) const
virtual RooAbsData*GenerateToyDataImportanceSampling(RooArgSet& paramPoint, double& weight) const
virtual Int_tGetNToys()
stringGetSamplingDistName()
virtual RooStats::SamplingDistribution*GetSamplingDistribution(RooArgSet& paramPoint)
virtual RooStats::SamplingDistribution*GetSamplingDistributionSingleWorker(RooArgSet& paramPoint)
virtual RooStats::TestStatistic*GetTestStatistic() const
virtual voidInitialize(RooAbsArg&, RooArgSet&, RooArgSet&)
virtual TClass*IsA() const
RooStats::TestStatSampler&RooStats::TestStatSampler::operator=(const RooStats::TestStatSampler&)
static voidSetAlwaysUseMultiGen(Bool_t flag)
virtual voidSetAsimovNuisancePar(Bool_t i = kTRUE)
virtual voidSetConfidenceLevel(Double_t cl)
virtual voidSetExpectedNuisancePar(Bool_t i = kTRUE)
voidSetGenerateBinned(bool binned = true)
virtual voidSetGlobalObservables(const RooArgSet& o)
voidSetImportanceDensity(RooAbsPdf* p)
voidSetImportanceSnapshot(const RooArgSet& s)
voidSetMaxToys(Double_t t)
virtual voidSetNEventsPerToy(const Int_t nevents)
virtual voidSetNToys(const Int_t ntoy)
virtual voidSetNuisanceParameters(const RooArgSet& np)
virtual voidSetObservables(const RooArgSet& o)
virtual voidSetParametersForTestStat(const RooArgSet& nullpoi)
virtual voidSetPdf(RooAbsPdf& pdf)
virtual voidSetPriorNuisance(RooAbsPdf* pdf)
voidSetProofConfig(RooStats::ProofConfig* pc = NULL)
voidSetProtoData(const RooDataSet* d)
virtual voidSetSamplingDistName(const char* name)
virtual voidSetTestSize(Double_t size)
virtual voidSetTestStatistic(RooStats::TestStatistic* testStatistic)
voidSetToysBothTails(Double_t toys, Double_t low_threshold, Double_t high_threshold)
voidSetToysLeftTail(Double_t toys, Double_t threshold)
voidSetToysRightTail(Double_t toys, Double_t threshold)
voidSetUseMultiGen(Bool_t flag)
virtual voidShowMembers(TMemberInspector& insp)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
RooStats::ToyMCSamplerToyMCSampler()
RooStats::ToyMCSamplerToyMCSampler(const RooStats::ToyMCSampler&)
RooStats::ToyMCSamplerToyMCSampler(RooStats::TestStatistic& ts, Int_t ntoys)
protected:
RooAbsData*Generate(RooAbsPdf& pdf, RooArgSet& observables, const RooDataSet* protoData = NULL, int forceEvents = 0) const

Data Members

protected:
RooArgSet*_allVars!
RooAbsPdf::GenSpec*_gs1! GenSpec #1
RooAbsPdf::GenSpec*_gs2! GenSpec #2
RooAbsPdf::GenSpec*_gs3! GenSpec #3
RooAbsPdf::GenSpec*_gs4! GenSpec #4
list<RooAbsPdf::GenSpec*>_gsList!
list<RooArgSet*>_obsList!
list<RooAbsPdf*>_pdfList!
Double_tfAdaptiveHighLimit
Double_tfAdaptiveLowLimit
Bool_tfExpectedNuisanceParwhether to use expectation values for nuisance parameters (ie Asimov data set)
Bool_tfGenerateBinned
const RooArgSet*fGlobalObservables
RooAbsPdf*fImportanceDensityin dev
const RooArgSet*fImportanceSnapshotin dev
Double_tfMaxToys
Int_tfNEventsnumber of events per toy (may be ignored depending on settings)
Int_tfNToysnumber of toys to generate
RooStats::NuisanceParametersSampler*fNuisanceParametersSampler!
const RooArgSet*fNuisancePars
RooArgSet*fNullPOIparameters of interest
const RooArgSet*fObservables
RooAbsPdf*fPdfmodel
RooAbsPdf*fPriorNuisanceprior pdf for nuisance parameters
RooStats::ProofConfig*fProofConfig!
const RooDataSet*fProtoDatain dev
stringfSamplingDistNamename of the model
Double_tfSize
RooStats::TestStatistic*fTestStattest statistic that is being sampled
Double_tfToysInTails
Bool_tfUseMultiGenUse PrepareMultiGen?
static Bool_tfgAlwaysUseMultiGenUse PrepareMultiGen always

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

~ToyMCSampler()
Bool_t CheckConfig(void)
 only checks, no guessing/determination (do this in calculators,
 e.g. using ModelConfig::GuessObsAndNuisance(...))
SamplingDistribution* GetSamplingDistribution(RooArgSet& paramPoint)
 Use for serial and parallel runs.
SamplingDistribution* GetSamplingDistributionSingleWorker(RooArgSet& paramPoint)
 This is the main function for serial runs. It is called automatically
 from inside GetSamplingDistribution when no ProofConfig is given.
 You should not call this function yourself. This function should
 be used by ToyMCStudy on the workers (ie. when you explicitly want
 a serial run although ProofConfig is present).
void GenerateGlobalObservables() const
RooAbsData* GenerateToyData(RooArgSet& paramPoint, double& weight) const
 This method generates a toy data set for the given parameter point taking
 global observables into account.
 The values of the generated global observables remain in the pdf's variables.
 They have to have those values for the subsequent evaluation of the
 test statistics.
RooAbsData* GenerateToyDataImportanceSampling(RooArgSet& paramPoint, double& weight) const
 This method generates a toy data set for importance sampling for the given parameter point taking
 global observables into account.
 The values of the generated global observables remain in the pdf's variables.
 They have to have those values for the subsequent evaluation of the
 test statistics.
RooAbsData* Generate(RooAbsPdf& pdf, RooArgSet& observables, const RooDataSet* protoData = NULL, int forceEvents = 0) const
 This is the generate function to use in the context of the ToyMCSampler
 instead of the standard RooAbsPdf::generate(...).
 It takes into account whether the number of events is given explicitly
 or whether it should use the expected number of events. It also takes
 into account the option to generate a binned data set (ie RooDataHist).
ToyMCSampler()
 Proof constructor. Do not use.
ToyMCSampler(RooStats::TestStatistic& ts, Int_t ntoys)
void SetAlwaysUseMultiGen(Bool_t flag)
{ fgAlwaysUseMultiGen = flag ; }
void SetUseMultiGen(Bool_t flag)
{ fUseMultiGen = flag ; }
RooAbsData* GenerateToyData(RooArgSet& paramPoint) const
 generates toy data
   without weight
SamplingDistribution* AppendSamplingDistribution(RooArgSet& allParameters, RooStats::SamplingDistribution* last, Int_t additionalMC)
 Extended interface to append to sampling distribution more samples
Double_t EvaluateTestStatistic(RooAbsData& data, RooArgSet& nullPOI)
 Main interface to evaluate the test statistic on a dataset
TestStatistic* GetTestStatistic() const
{ return fTestStat; }
Double_t ConfidenceLevel() const
{ return 1. - fSize; }
void Initialize(RooAbsArg& , RooArgSet& , RooArgSet& )
{ return fNToys; }
void SetNToys(const Int_t ntoy)
{ fNToys = ntoy; }
void SetNEventsPerToy(const Int_t nevents)
 Forces n events even for extended PDFs. Set NEvents=0 to
 use the Poisson distributed events from the extended PDF.
void SetParametersForTestStat(const RooArgSet& nullpoi)
 specify the values of parameters used when evaluating test statistic
void SetPdf(RooAbsPdf& pdf)
 Set the Pdf, add to the the workspace if not already there
{ fPdf = &pdf; }
void SetPriorNuisance(RooAbsPdf* pdf)
 How to randomize the prior. Set to NULL to deactivate randomization.
{ fPriorNuisance = pdf; }
void SetNuisanceParameters(const RooArgSet& np)
 specify the nuisance parameters (eg. the rest of the parameters)
{ fNuisancePars = &np; }
void SetObservables(const RooArgSet& o)
 specify the observables in the dataset (needed to evaluate the test statistic)
{ fObservables = &o; }
void SetGlobalObservables(const RooArgSet& o)
 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* testStatistic)
 Set the TestStatistic (want the argument to be a function of the data & parameter points
{ fTestStat = testStatistic; }
void SetExpectedNuisancePar(Bool_t i = kTRUE)
void SetAsimovNuisancePar(Bool_t i = kTRUE)
void SetGenerateBinned(bool binned = true)
 control to use bin data generation
{ fGenerateBinned = binned; }
void SetSamplingDistName(const char* name)
 Set the name of the sampling distribution used for plotting
{ if(name) fSamplingDistName = name; }
string GetSamplingDistName(void)
{ return fSamplingDistName; }
void SetMaxToys(Double_t t)
 This option forces a maximum number of total toys.
{ fMaxToys = t; }
void SetToysLeftTail(Double_t toys, Double_t threshold)
void SetToysRightTail(Double_t toys, Double_t threshold)
void SetToysBothTails(Double_t toys, Double_t low_threshold, Double_t high_threshold)
void SetImportanceDensity(RooAbsPdf* p)
 for importance sampling, specifies the pdf to sample from
void SetImportanceSnapshot(const RooArgSet& s)
 for importance sampling, a snapshot of the parameters used in importance density
void SetProofConfig(RooStats::ProofConfig* pc = NULL)
 calling with argument or NULL deactivates proof
{ fProofConfig = pc; }
void SetProtoData(const RooDataSet* d)
{ fProtoData = d; }