12#ifndef ROOSTATS_ToyMCImportanceSampler
13#define ROOSTATS_ToyMCImportanceSampler
56 virtual RooAbsData*
GenerateToyData(std::vector<double>& weights, std::vector<double>& nullNLLs, std::vector<double>& impNLLs)
const;
81 if( p == NULL &&
s == NULL ) {
85 if( p == NULL &&
fPdf == NULL ) {
90 if( p == NULL ) p =
fPdf;
102 if( p == NULL &&
s == NULL ) {
123 oocoutE((
TObject*)0,
InputArguments) <<
"Cannot use SetPdf() when already multiple null densities are specified. Please use AddNullDensity()." << std::endl;
135 oocoutE((
TObject*)0,
InputArguments) <<
"Cannot use SetParametersForTestStat() when already multiple null densities are specified. Please use AddNullDensity()." << std::endl;
156 double poiValueForBackground = 0.0
162 double nStdDevOverlap = 0.5,
163 double poiValueForBackground = 0.0
#define ClassDef(name, id)
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
RooAbsData is the common abstract base class for binned and unbinned datasets.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
RooDataSet is a container class to hold unbinned data.
RooRealVar represents a variable that can be changed from the outside.
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
ToyMCImportanceSampler is an extension of the ToyMCSampler for Importance Sampling.
void AddImportanceDensity(RooAbsPdf *p, const RooArgSet *s)
std::vector< const RooArgSet * > fImportanceSnapshots
void SetExpIncreasingNumToysPerDensity(void)
void SetParametersForTestStat(const RooArgSet &nullpoi)
std::vector< const RooArgSet * > fNullSnapshots
void SetDensityToGenerateFromByIndex(unsigned int i, bool fromNull=false)
specifies the pdf to sample from
virtual RooAbsData * GenerateToyData(RooArgSet ¶mPoint, double &weight) const
virtual void SetPdf(RooAbsPdf &pdf)
virtual void SetConditionalObservables(const RooArgSet &set)
ToyMCImportanceSampler(TestStatistic &ts, Int_t ntoys)
std::vector< RooAbsPdf * > fImportanceDensities
toysStrategies fToysStrategy
virtual RooDataSet * GetSamplingDistributionsSingleWorker(RooArgSet ¶mPoint)
This is the main function for serial runs.
virtual ~ToyMCImportanceSampler()
virtual void ClearCache()
clear the cache obtained from the pdf used for speeding the toy and global observables generation nee...
void AddNullDensity(RooAbsPdf *p, const RooArgSet *s=NULL)
void SetEqualNumToysPerDensity(void)
unsigned int fIndexGenDensity
void SetReuseNLL(bool r=true)
void SetApplyVeto(bool b=true)
int CreateImpDensitiesForOnePOIAdaptively(RooAbsPdf &pdf, const RooArgSet &allPOI, RooRealVar &poi, double nStdDevOverlap=0.5, double poiValueForBackground=0.0)
poi has to be fitted beforehand. This function expects this to be the muhat value.
RooArgSet fConditionalObs
std::vector< RooAbsPdf * > fNullDensities
std::vector< RooAbsReal * > fImpNLLs
int CreateNImpDensitiesForOnePOI(RooAbsPdf &pdf, const RooArgSet &allPOI, RooRealVar &poi, int n, double poiValueForBackground=0.0)
n is the number of importance densities
std::vector< RooAbsReal * > fNullNLLs
ToyMCSampler is an implementation of the TestStatSampler interface.
std::unique_ptr< const RooArgSet > fParametersForTestStat
virtual void SetPdf(RooAbsPdf &pdf)
virtual RooAbsData * GenerateToyData(RooArgSet ¶mPoint, RooAbsPdf &pdf) const
virtual void SetParametersForTestStat(const RooArgSet &nullpoi)
Mother of all ROOT objects.
Namespace for the RooStats classes.
@ EXPONENTIALTOYDISTRIBUTION
static constexpr double s