12#ifndef ROOSTATS_ToyMCImportanceSampler
13#define ROOSTATS_ToyMCImportanceSampler
57 virtual RooAbsData*
GenerateToyData(std::vector<double>& weights, std::vector<double>& nullNLLs, std::vector<double>& impNLLs)
const;
65 oocoutE((
TObject*)0,InputArguments) <<
"Index out of range. Requested index: "<<i<<
82 if( p == NULL && s == NULL ) {
83 oocoutI((
TObject*)0,InputArguments) <<
"Neither density nor snapshot given. Doing nothing." << std::endl;
86 if( p == NULL &&
fPdf == NULL ) {
87 oocoutE((
TObject*)0,InputArguments) <<
"No density given, but snapshot is there. Aborting." << std::endl;
91 if( p == NULL ) p =
fPdf;
103 if( p == NULL && s == NULL ) {
104 oocoutI((
TObject*)0,InputArguments) <<
"Neither density nor snapshot nor test statistic given. Doing nothing." << std::endl;
110 if( s ) s = (
const RooArgSet*)s->snapshot();
124 oocoutE((
TObject*)0,InputArguments) <<
"Cannot use SetPdf() when already multiple null densities are specified. Please use AddNullDensity()." << std::endl;
132 oocoutI((
TObject*)0,InputArguments) <<
"Overwriting snapshot for the only defined null density." << std::endl;
136 oocoutE((
TObject*)0,InputArguments) <<
"Cannot use SetParametersForTestStat() when already multiple null densities are specified. Please use AddNullDensity()." << std::endl;
157 double poiValueForBackground = 0.0
163 double nStdDevOverlap = 0.5,
164 double poiValueForBackground = 0.0
#define ClassDef(name, id)
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
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.
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