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 74 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(...). | |
Protected Attributes | |
RooArgSet * | _allVars |
RooAbsPdf::GenSpec * | _gs1 |
RooAbsPdf::GenSpec * | _gs2 |
GenSpec #1. | |
RooAbsPdf::GenSpec * | _gs3 |
GenSpec #2. | |
RooAbsPdf::GenSpec * | _gs4 |
GenSpec #3. | |
std::list< RooAbsPdf::GenSpec * > | _gsList |
std::list< RooArgSet * > | _obsList |
std::list< RooAbsPdf * > | _pdfList |
Double_t | fAdaptiveHighLimit |
Double_t | fAdaptiveLowLimit |
Bool_t | fExpectedNuisancePar |
Bool_t | fGenerateAutoBinned |
Bool_t | fGenerateBinned |
TString | fGenerateBinnedTag |
const RooArgSet * | fGlobalObservables |
Double_t | fMaxToys |
Int_t | fNEvents |
Int_t | fNToys |
NuisanceParametersSampler * | fNuisanceParametersSampler |
const RooArgSet * | fNuisancePars |
const RooArgSet * | fObservables |
std::unique_ptr< const RooArgSet > | fParametersForTestStat |
RooAbsPdf * | fPdf |
RooAbsPdf * | fPriorNuisance |
ProofConfig * | fProofConfig |
const RooDataSet * | fProtoData |
std::string | fSamplingDistName |
Double_t | fSize |
std::vector< TestStatistic * > | fTestStatistics |
Double_t | fToysInTails |
Bool_t | fUseMultiGen |
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 153 of file ToyMCSampler.cxx.
RooStats::ToyMCSampler::ToyMCSampler | ( | TestStatistic & | ts, |
Int_t | ntoys | ||
) |
Definition at line 193 of file ToyMCSampler.cxx.
|
virtual |
Definition at line 234 of file ToyMCSampler.cxx.
|
inlinevirtual |
Definition at line 100 of file ToyMCSampler.h.
|
virtual |
Extended interface to append to sampling distribution more samples.
Definition at line 689 of file ToyMCSampler.cxx.
only checks, no guessing/determination (do this in calculators, e.g.
using ModelConfig::GuessObsAndNuisance(...))
Definition at line 244 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 712 of file ToyMCSampler.cxx.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 141 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 268 of file ToyMCSampler.cxx.
|
protected |
Definition at line 278 of file ToyMCSampler.cxx.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 131 of file ToyMCSampler.h.
|
inlinevirtual |
Definition at line 128 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 612 of file ToyMCSampler.cxx.
Definition at line 472 of file ToyMCSampler.cxx.
|
inlinevirtual |
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 118 of file ToyMCSampler.h.
|
inlinevirtual |
Reimplemented in RooStats::ToyMCImportanceSampler, and RooStats::ToyMCImportanceSampler.
Definition at line 121 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 544 of file ToyMCSampler.cxx.
|
inlinevirtual |
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 113 of file ToyMCSampler.h.
Definition at line 148 of file ToyMCSampler.h.
|
inline |
Definition at line 213 of file ToyMCSampler.h.
|
virtual |
Implements RooStats::TestStatSampler.
Definition at line 301 of file ToyMCSampler.cxx.
|
virtual |
Use for serial and parallel runs.
Definition at line 323 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 378 of file ToyMCSampler.cxx.
|
inlinevirtual |
Definition at line 135 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 139 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 142 of file ToyMCSampler.h.
Definition at line 148 of file ToyMCSampler.cxx.
Definition at line 199 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 183 of file ToyMCSampler.h.
Definition at line 198 of file ToyMCSampler.h.
Definition at line 209 of file ToyMCSampler.h.
Definition at line 205 of file ToyMCSampler.h.
|
inline |
Definition at line 207 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 177 of file ToyMCSampler.h.
Definition at line 216 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 152 of file ToyMCSampler.h.
Definition at line 149 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 173 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 175 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 158 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Reimplemented in RooStats::ToyMCImportanceSampler.
Definition at line 162 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 165 of file ToyMCSampler.h.
|
inline |
Definition at line 235 of file ToyMCSampler.h.
|
inline |
Definition at line 237 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 212 of file ToyMCSampler.h.
Implements RooStats::TestStatSampler.
Definition at line 181 of file ToyMCSampler.h.
|
inlinevirtual |
Implements RooStats::TestStatSampler.
Definition at line 196 of file ToyMCSampler.h.
|
inlinevirtual |
Definition at line 186 of file ToyMCSampler.h.
|
inline |
Definition at line 228 of file ToyMCSampler.h.
Definition at line 218 of file ToyMCSampler.h.
Definition at line 223 of file ToyMCSampler.h.
Definition at line 84 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 286 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 290 of file ToyMCSampler.h.
|
mutableprotected |
GenSpec #1.
Definition at line 291 of file ToyMCSampler.h.
|
mutableprotected |
GenSpec #2.
Definition at line 292 of file ToyMCSampler.h.
|
mutableprotected |
GenSpec #3.
Definition at line 293 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 289 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 288 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 287 of file ToyMCSampler.h.
|
protected |
Definition at line 277 of file ToyMCSampler.h.
|
protected |
Definition at line 276 of file ToyMCSampler.h.
|
protected |
Definition at line 263 of file ToyMCSampler.h.
GenSpec #4.
Definition at line 295 of file ToyMCSampler.h.
|
protected |
Definition at line 266 of file ToyMCSampler.h.
|
protected |
Definition at line 264 of file ToyMCSampler.h.
|
protected |
Definition at line 265 of file ToyMCSampler.h.
|
protected |
Definition at line 259 of file ToyMCSampler.h.
|
protected |
Definition at line 274 of file ToyMCSampler.h.
|
protected |
Definition at line 261 of file ToyMCSampler.h.
|
protected |
Definition at line 260 of file ToyMCSampler.h.
|
mutableprotected |
Definition at line 283 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 251 of file ToyMCSampler.h.
|
protected |
Definition at line 256 of file ToyMCSampler.h.
|
protected |
Definition at line 281 of file ToyMCSampler.h.
|
protected |
Definition at line 279 of file ToyMCSampler.h.
|
protected |
Definition at line 255 of file ToyMCSampler.h.
|
protected |
Definition at line 262 of file ToyMCSampler.h.
|
protected |
Definition at line 253 of file ToyMCSampler.h.
|
protected |
Definition at line 271 of file ToyMCSampler.h.
|
protected |
Definition at line 296 of file ToyMCSampler.h.