48 fNullModel(&nullModel),
50 fTestStatSampler(sampler),
59 altModel.GetSnapshot());
61 fDefaultSampler =
new ToyMCSampler(*fDefaultTestStat, 1000);
62 fTestStatSampler = fDefaultSampler;
71 void HypoTestCalculatorGeneric::SetupSampler(
const ModelConfig& model)
const {
108 if(nullSnapshot ==
NULL) {
129 bothParams->
add(*altParams,
false);
143 if (!allTS)
return 0;
147 obsTestStat = firstTS->
getVal();
160 *bothParams = *saveAll;
167 if(
PreNullHook(¶mPointNull, obsTestStat) != 0) {
184 *bothParams = *saveAll;
189 if(
PreAltHook(¶mPointAlt, obsTestStat) != 0) {
198 unsigned int prevSeed = 0;
222 string resultname =
"HypoTestCalculator_result";
239 *bothParams = *saveAll;
virtual const char * GetTitle() const
Returns title of object.
void UseSameAltToys()
to re-use same toys for alternate hypothesis
void SetAltDistribution(SamplingDistribution *alt)
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
virtual void SetParametersForTestStat(const RooArgSet &)=0
void SetFitInfo(RooDataSet *d)
virtual RooDataSet * GetSamplingDistributions(RooArgSet ¶mPoint)
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
virtual bool PValueIsRightTail(void) const
Defines the sign convention of the test statistic. Overwrite function if necessary.
~HypoTestCalculatorGeneric()
HypoTestResult is a base class for results from hypothesis tests.
virtual void SetPdf(RooAbsPdf &)=0
virtual int PreAltHook(RooArgSet *, double) const
virtual const RooArgSet * GetFitInfo() const
unsigned int fAltToysSeed
static UInt_t integer(UInt_t max, TRandom *generator=randomGenerator())
Return an integer uniformly distributed from [0,n-1].
TestStatSampler * fDefaultSampler
virtual void SetSamplingDistName(const char *name)=0
virtual void SetNuisanceParameters(const RooArgSet &)=0
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
TestStatistic * fDefaultTestStat
Common base class for the Hypothesis Test Calculators.
virtual HypoTestResult * GetHypoTest() const
inherited methods from HypoTestCalculator interface
virtual void SetObservables(const RooArgSet &)=0
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
void LoadSnapshot() const
virtual RooArgList * EvaluateAllTestStatistics(RooAbsData &data, const RooArgSet &poi)
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
virtual int CheckHook(void) const
Double_t getVal(const RooArgSet *set=0) const
virtual SamplingDistribution * GetSamplingDistribution(RooArgSet ¶msOfInterest)=0
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
RooRealVar represents a fundamental (non-derived) real valued object.
const ModelConfig * fNullModel
void SetAllTestStatisticsData(const RooArgList *tsd)
virtual TestStatistic * GetTestStatistic() const =0
virtual void PreHook() const
void SetAltDetailedOutput(RooDataSet *d)
virtual const char * GetName() const
Returns name of object.
RooAbsData is the common abstract base class for binned and unbinned datasets.
ToyMCSampler is an implementation of the TestStatSampler interface.
RooDataSet is a container class to hold unbinned data.
void SetTestStatisticData(const Double_t tsd)
This class simply holds a sampling distribution of some test statistic.
TestStatistic that returns the ratio of profiled likelihoods.
virtual void add(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0)
Add a data point, with its coordinates specified in the 'data' argset, to the data set...
const RooArgSet * GetObservables() const
get RooArgSet for observables (return NULL if not existing)
void SetPValueIsRightTail(Bool_t pr)
Namespace for the RooStats classes.
RooAbsArg * at(Int_t idx) const
const RooArgSet * GetSnapshot() const
get RooArgSet for parameters for a particular hypothesis (return NULL if not existing) ...
TestStatSampler * fTestStatSampler
Mother of all ROOT objects.
virtual int PreNullHook(RooArgSet *, double) const
void SetNullDetailedOutput(RooDataSet *d)
const ModelConfig * fAltModel
virtual Double_t EvaluateTestStatistic(RooAbsData &data, RooArgSet ¶msOfInterest)=0
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
virtual void PostHook() const
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
void SetNullDistribution(SamplingDistribution *null)
void SetupSampler(const ModelConfig &model) const
common setup for both models