13#ifndef ROOSTATS_ToyMCSampler
14#define ROOSTATS_ToyMCSampler
36 class DetailedOutputAggregator;
95 oocoutI((
TObject*)0,InputArguments) <<
"No test statistic given. Doing nothing." << std::endl;
107 if(
fExpectedNuisancePar)
oocoutE((
TObject*)NULL,InputArguments) <<
"ToyMCSampler: using expected nuisance parameters but ignoring weight. Use GetSamplingDistribution(paramPoint, weight) instead." << std::endl;
181 oocoutE((
TObject*)NULL,InputArguments) <<
"Cannot set test statistic for this index." << std::endl;
281 mutable std::vector<std::unique_ptr<RooArgSet>>
_obsList;
282 mutable std::vector<std::unique_ptr<RooAbsPdf::GenSpec>>
_gsList;
283 mutable std::unique_ptr<RooAbsPdf::GenSpec>
_gs1;
284 mutable std::unique_ptr<RooAbsPdf::GenSpec>
_gs2;
285 mutable std::unique_ptr<RooAbsPdf::GenSpec>
_gs3;
286 mutable std::unique_ptr<RooAbsPdf::GenSpec>
_gs4;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDef(name, id)
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooAbsData is the common abstract base class for binned and unbinned datasets.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
RooDataSet is a container class to hold unbinned data.
static Double_t infinity()
Return internal infinity representation.
This class is designed to aid in the construction of RooDataSets and RooArgSets, particularly those n...
Holds configuration options for proof and proof-lite.
This class simply holds a sampling distribution of some test statistic.
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
ToyMCSampler is an implementation of the TestStatSampler interface.
const RooArgSet * fGlobalObservables
virtual void SetNToys(const Int_t ntoy)
void SetToysBothTails(Double_t toys, Double_t low_threshold, Double_t high_threshold)
void SetProtoData(const RooDataSet *d)
std::string fSamplingDistName
virtual void GenerateGlobalObservables(RooAbsPdf &pdf) const
Double_t fAdaptiveLowLimit
virtual RooDataSet * GetSamplingDistributionsSingleWorker(RooArgSet ¶mPoint)
This is the main function for serial runs.
std::string GetSamplingDistName(void)
void SetProofConfig(ProofConfig *pc=NULL)
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 RooAb...
std::unique_ptr< const RooArgSet > fParametersForTestStat
virtual Double_t EvaluateTestStatistic(RooAbsData &data, RooArgSet &nullPOI, int i)
virtual SamplingDistribution * AppendSamplingDistribution(RooArgSet &allParameters, SamplingDistribution *last, Int_t additionalMC)
Extended interface to append to sampling distribution more samples.
NuisanceParametersSampler * fNuisanceParametersSampler
virtual void Initialize(RooAbsArg &, RooArgSet &, RooArgSet &)
std::unique_ptr< RooAbsPdf::GenSpec > _gs4
GenSpec #3.
const RooArgSet * fObservables
virtual void SetObservables(const RooArgSet &o)
Double_t fAdaptiveHighLimit
void SetGenerateAutoBinned(Bool_t autoBinned=kTRUE)
virtual TestStatistic * GetTestStatistic(unsigned int i) const
void SetSamplingDistName(const char *name)
void SetToysLeftTail(Double_t toys, Double_t threshold)
virtual RooArgList * EvaluateAllTestStatistics(RooAbsData &data, const RooArgSet &poi)
Evaluate all test statistics, returning result and any detailed output.
virtual void SetPdf(RooAbsPdf &pdf)
std::unique_ptr< RooAbsPdf::GenSpec > _gs1
virtual RooDataSet * GetSamplingDistributions(RooArgSet ¶mPoint)
Use for serial and parallel runs.
void SetGenerateBinnedTag(const char *binnedTag="")
Bool_t CheckConfig(void)
only checks, no guessing/determination (do this in calculators, e.g.
virtual void SetPriorNuisance(RooAbsPdf *pdf)
virtual TestStatistic * GetTestStatistic(void) const
static Bool_t fgAlwaysUseMultiGen
GenSpec #4.
virtual RooAbsData * GenerateToyData(RooArgSet ¶mPoint, RooAbsPdf &pdf) const
std::unique_ptr< RooAbsPdf::GenSpec > _gs2
GenSpec #1.
virtual void AddTestStatistic(TestStatistic *t=NULL)
const RooArgSet * fNuisancePars
static void SetAlwaysUseMultiGen(Bool_t flag)
Bool_t fExpectedNuisancePar
virtual Int_t GetNToys(void)
std::unique_ptr< RooAbsPdf::GenSpec > _gs3
GenSpec #2.
std::vector< TestStatistic * > fTestStatistics
virtual void SetTestStatistic(TestStatistic *testStatistic, unsigned int i)
ToyMCSampler()
Proof constructor. Do not use.
std::unique_ptr< RooArgSet > _allVars
virtual void SetGlobalObservables(const RooArgSet &o)
virtual Double_t EvaluateTestStatistic(RooAbsData &data, RooArgSet &nullPOI)
std::vector< RooAbsPdf * > _pdfList
virtual void SetAsimovNuisancePar(Bool_t i=kTRUE)
void SetGenerateBinned(bool binned=true)
virtual void SetExpectedNuisancePar(Bool_t i=kTRUE)
virtual Double_t ConfidenceLevel() const
virtual void SetTestSize(Double_t size)
virtual void SetTestStatistic(TestStatistic *t)
void SetUseMultiGen(Bool_t flag)
virtual void ClearCache()
clear the cache obtained from the pdf used for speeding the toy and global observables generation nee...
void SetToysRightTail(Double_t toys, Double_t threshold)
Bool_t fGenerateAutoBinned
ProofConfig * fProofConfig
void SetMaxToys(Double_t t)
virtual void SetNEventsPerToy(const Int_t nevents)
Forces the generation of exactly n events even for extended PDFs.
std::vector< std::unique_ptr< RooArgSet > > _obsList
We don't own those objects.
virtual RooAbsData * GenerateToyData(RooArgSet ¶mPoint, double &weight) const
const RooDataSet * fProtoData
virtual RooAbsData * GenerateToyData(RooArgSet ¶mPoint) const
virtual SamplingDistribution * GetSamplingDistribution(RooArgSet ¶mPoint)
virtual void SetNuisanceParameters(const RooArgSet &np)
TString fGenerateBinnedTag
std::vector< std::unique_ptr< RooAbsPdf::GenSpec > > _gsList
RooAbsPdf * fPriorNuisance
virtual void SetParametersForTestStat(const RooArgSet &nullpoi)
virtual void SetConfidenceLevel(Double_t cl)
Mother of all ROOT objects.
Namespace for the RooStats classes.