ToyMCSampler is an implementation of the TestStatSampler interface.
It generates Toy Monte Carlo for a given parameter point and evaluates a TestStatistic.
For parallel runs, ToyMCSampler can be given an instance of ProofConfig and then run in parallel using proof or proof-lite. Internally, it uses ToyMCStudy with the RooStudyManager.
Definition at line 67 of file ToyMCSampler.h.
Public Member Functions | |
ToyMCSampler () | |
Proof constructor. Do not use. | |
ToyMCSampler (TestStatistic &ts, Int_t ntoys) | |
virtual | ~ToyMCSampler () |
virtual void | AddTestStatistic (TestStatistic *t=NULL) |
virtual SamplingDistribution * | AppendSamplingDistribution (RooArgSet &allParameters, SamplingDistribution *last, Int_t additionalMC) |
Extended interface to append to sampling distribution more samples. | |
Bool_t | CheckConfig (void) |
only checks, no guessing/determination (do this in calculators, e.g. | |
virtual Double_t | ConfidenceLevel () const |
virtual RooArgList * | EvaluateAllTestStatistics (RooAbsData &data, const RooArgSet &poi) |
Evaluate all test statistics, returning result and any detailed output. | |
virtual Double_t | EvaluateTestStatistic (RooAbsData &data, RooArgSet &nullPOI) |
virtual Double_t | EvaluateTestStatistic (RooAbsData &data, RooArgSet &nullPOI, int i) |
virtual void | GenerateGlobalObservables (RooAbsPdf &pdf) const |
virtual RooAbsData * | GenerateToyData (RooArgSet ¶mPoint) const |
virtual RooAbsData * | GenerateToyData (RooArgSet ¶mPoint, double &weight) const |
virtual RooAbsData * | GenerateToyData (RooArgSet ¶mPoint, double &weight, RooAbsPdf &pdf) const |
This method generates a toy data set for the given parameter point taking global observables into account. | |
virtual RooAbsData * | GenerateToyData (RooArgSet ¶mPoint, RooAbsPdf &pdf) const |
virtual Int_t | GetNToys (void) |
std::string | GetSamplingDistName (void) |
virtual SamplingDistribution * | GetSamplingDistribution (RooArgSet ¶mPoint) |
virtual RooDataSet * | GetSamplingDistributions (RooArgSet ¶mPoint) |
Use for serial and parallel runs. | |
virtual RooDataSet * | GetSamplingDistributionsSingleWorker (RooArgSet ¶mPoint) |
This is the main function for serial runs. | |
virtual TestStatistic * | GetTestStatistic (unsigned int i) const |
virtual TestStatistic * | GetTestStatistic (void) const |
virtual void | Initialize (RooAbsArg &, RooArgSet &, RooArgSet &) |
virtual void | SetAsimovNuisancePar (Bool_t i=kTRUE) |
virtual void | SetConfidenceLevel (Double_t cl) |
virtual void | SetExpectedNuisancePar (Bool_t i=kTRUE) |
void | SetGenerateAutoBinned (Bool_t autoBinned=kTRUE) |
void | SetGenerateBinned (bool binned=true) |
void | SetGenerateBinnedTag (const char *binnedTag="") |
virtual void | SetGlobalObservables (const RooArgSet &o) |
void | SetMaxToys (Double_t t) |
virtual void | SetNEventsPerToy (const Int_t nevents) |
Forces the generation of exactly n events even for extended PDFs. | |
virtual void | SetNToys (const Int_t ntoy) |
virtual void | SetNuisanceParameters (const RooArgSet &np) |
virtual void | SetObservables (const RooArgSet &o) |
virtual void | SetParametersForTestStat (const RooArgSet &nullpoi) |
virtual void | SetPdf (RooAbsPdf &pdf) |
virtual void | SetPriorNuisance (RooAbsPdf *pdf) |
void | SetProofConfig (ProofConfig *pc=NULL) |
void | SetProtoData (const RooDataSet *d) |
void | SetSamplingDistName (const char *name) |
virtual void | SetTestSize (Double_t size) |
virtual void | SetTestStatistic (TestStatistic *t) |
virtual void | SetTestStatistic (TestStatistic *testStatistic, unsigned int i) |
void | SetToysBothTails (Double_t toys, Double_t low_threshold, Double_t high_threshold) |
void | SetToysLeftTail (Double_t toys, Double_t threshold) |
void | SetToysRightTail (Double_t toys, Double_t threshold) |
void | SetUseMultiGen (Bool_t flag) |
Public Member Functions inherited from RooStats::TestStatSampler | |
virtual | ~TestStatSampler () |
Static Public Member Functions | |
static void | SetAlwaysUseMultiGen (Bool_t flag) |
Protected Member Functions | |
virtual void | ClearCache () |
clear the cache obtained from the pdf used for speeding the toy and global observables generation needs to be called every time the model pdf (fPdf) changes | |
const RooArgList * | EvaluateAllTestStatistics (RooAbsData &data, const RooArgSet &poi, DetailedOutputAggregator &detOutAgg) |
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(...). | |
Static Protected Attributes | |
static Bool_t | fgAlwaysUseMultiGen = kFALSE |
GenSpec #4. | |
#include <RooStats/ToyMCSampler.h>
RooStats::ToyMCSampler::ToyMCSampler | ( | ) |
Proof constructor. Do not use.
Definition at line 151 of file ToyMCSampler.cxx.
RooStats::ToyMCSampler::ToyMCSampler | ( | TestStatistic & | ts, |
Int_t | ntoys | ||
) |
Definition at line 185 of file ToyMCSampler.cxx.
|
virtual |
Definition at line 220 of file ToyMCSampler.cxx.
|
inlinevirtual |
Definition at line 93 of file ToyMCSampler.h.
|
virtual |
Extended interface to append to sampling distribution more samples.
Definition at line 669 of file ToyMCSampler.cxx.
only checks, no guessing/determination (do this in calculators, e.g.
using ModelConfig::GuessObsAndNuisance(...))
Definition at line 230 of file ToyMCSampler.cxx.
clear the cache obtained from the pdf used for speeding the toy and global observables generation needs to be called every time the model pdf (fPdf) changes
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 692 of file ToyMCSampler.cxx.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 134 of file ToyMCSampler.h.
|
virtual |
Evaluate all test statistics, returning result and any detailed output.
PDF parameter values are saved in case they are modified by TestStatistic::Evaluate (eg. SimpleLikelihoodRatioTestStat).
Definition at line 254 of file ToyMCSampler.cxx.
|
protected |
Definition at line 264 of file ToyMCSampler.cxx.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 124 of file ToyMCSampler.h.
|
inlinevirtual |
Definition at line 121 of file ToyMCSampler.h.
|
protected |
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 (i.e. RooDataHist).
Definition at line 598 of file ToyMCSampler.cxx.
Definition at line 461 of file ToyMCSampler.cxx.
|
inlinevirtual |
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 111 of file ToyMCSampler.h.
|
inlinevirtual |
Reimplemented in RooStats::ToyMCImportanceSampler, and RooStats::ToyMCImportanceSampler.
Definition at line 114 of file ToyMCSampler.h.
|
virtual |
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.
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 530 of file ToyMCSampler.cxx.
|
inlinevirtual |
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 106 of file ToyMCSampler.h.
Definition at line 141 of file ToyMCSampler.h.
|
inline |
Definition at line 206 of file ToyMCSampler.h.
|
virtual |
Implements RooStats::TestStatSampler.
Definition at line 290 of file ToyMCSampler.cxx.
|
virtual |
Use for serial and parallel runs.
Definition at line 312 of file ToyMCSampler.cxx.
|
virtual |
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).
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 367 of file ToyMCSampler.cxx.
|
inlinevirtual |
Definition at line 128 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 132 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 135 of file ToyMCSampler.h.
Definition at line 146 of file ToyMCSampler.cxx.
Definition at line 192 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 176 of file ToyMCSampler.h.
Definition at line 191 of file ToyMCSampler.h.
Definition at line 202 of file ToyMCSampler.h.
Definition at line 198 of file ToyMCSampler.h.
|
inline |
Definition at line 200 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 170 of file ToyMCSampler.h.
Definition at line 209 of file ToyMCSampler.h.
Forces the generation of exactly n
events even for extended PDFs.
Set to 0 to use the Poisson-distributed events from the extended PDF.
Definition at line 145 of file ToyMCSampler.h.
Definition at line 142 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 166 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 168 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 151 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 155 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 158 of file ToyMCSampler.h.
|
inline |
Definition at line 228 of file ToyMCSampler.h.
|
inline |
Definition at line 230 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 205 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 174 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 189 of file ToyMCSampler.h.
|
inlinevirtual |
Definition at line 179 of file ToyMCSampler.h.
|
inline |
Definition at line 221 of file ToyMCSampler.h.
Definition at line 211 of file ToyMCSampler.h.
Definition at line 216 of file ToyMCSampler.h.
Definition at line 77 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 279 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 283 of file ToyMCSampler.h.
|
mutableprotected |
GenSpec #1.
Definition at line 284 of file ToyMCSampler.h.
|
mutableprotected |
GenSpec #2.
Definition at line 285 of file ToyMCSampler.h.
|
mutableprotected |
GenSpec #3.
Definition at line 286 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 282 of file ToyMCSampler.h.
|
mutableprotected |
We don't own those objects.
Definition at line 281 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 280 of file ToyMCSampler.h.
|
protected |
Definition at line 270 of file ToyMCSampler.h.
|
protected |
Definition at line 269 of file ToyMCSampler.h.
|
protected |
Definition at line 256 of file ToyMCSampler.h.
GenSpec #4.
Definition at line 288 of file ToyMCSampler.h.
|
protected |
Definition at line 259 of file ToyMCSampler.h.
|
protected |
Definition at line 257 of file ToyMCSampler.h.
|
protected |
Definition at line 258 of file ToyMCSampler.h.
|
protected |
Definition at line 252 of file ToyMCSampler.h.
|
protected |
Definition at line 267 of file ToyMCSampler.h.
|
protected |
Definition at line 254 of file ToyMCSampler.h.
|
protected |
Definition at line 253 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 276 of file ToyMCSampler.h.
|
protected |
Definition at line 250 of file ToyMCSampler.h.
|
protected |
Definition at line 251 of file ToyMCSampler.h.
|
protected |
Definition at line 245 of file ToyMCSampler.h.
|
protected |
Definition at line 244 of file ToyMCSampler.h.
|
protected |
Definition at line 249 of file ToyMCSampler.h.
|
protected |
Definition at line 274 of file ToyMCSampler.h.
|
protected |
Definition at line 272 of file ToyMCSampler.h.
|
protected |
Definition at line 248 of file ToyMCSampler.h.
|
protected |
Definition at line 255 of file ToyMCSampler.h.
|
protected |
Definition at line 246 of file ToyMCSampler.h.
|
protected |
Definition at line 264 of file ToyMCSampler.h.
|
protected |
Definition at line 289 of file ToyMCSampler.h.