54 fNullModel(&nullModel),
56 fTestStatSampler(sampler),
114 if(nullSnapshot == NULL) {
115 oocoutE((
TObject*)0,Generation) <<
"Null model needs a snapshot. Set using modelconfig->SetSnapshot(poi)." << endl;
121 oocoutE((
TObject*)0,Generation) <<
"There was an error in CheckHook(). Stop." << endl;
126 oocoutE((
TObject*)0,InputArguments) <<
"Test Statistic Sampler or Test Statistics not defined. Stop." << endl;
135 bothParams->
add(*altParams,
false);
149 if (!allTS)
return 0;
153 obsTestStat = firstTS->
getVal();
161 oocoutP((
TObject*)0,Generation) <<
"Test Statistic on data: " << obsTestStat << endl;
166 *bothParams = *saveAll;
173 if(
PreNullHook(¶mPointNull, obsTestStat) != 0) {
174 oocoutE((
TObject*)0,Generation) <<
"PreNullHook did not return 0." << endl;
190 *bothParams = *saveAll;
195 if(
PreAltHook(¶mPointAlt, obsTestStat) != 0) {
196 oocoutE((
TObject*)0,Generation) <<
"PreAltHook did not return 0." << endl;
204 unsigned int prevSeed = 0;
228 string resultname =
"HypoTestCalculator_result";
245 *bothParams = *saveAll;
RooArgSet * getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
RooAbsData is the common abstract base class for binned and unbinned datasets.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
RooDataSet is a container class to hold unbinned data.
virtual const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
virtual void add(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0) override
Add a data point, with its coordinates specified in the 'data' argset, to the data set.
static UInt_t integer(UInt_t max, TRandom *generator=randomGenerator())
Return an integer uniformly distributed from [0,n-1].
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
RooRealVar represents a variable that can be changed from the outside.
Common base class for the Hypothesis Test Calculators.
const ModelConfig * fAltModel
virtual void PreHook() const
HypoTestCalculatorGeneric(const RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, TestStatSampler *sampler=0)
Constructor.
virtual int PreNullHook(RooArgSet *, double) const
void SetupSampler(const ModelConfig &model) const
common setup for both models
TestStatSampler * fTestStatSampler
unsigned int fAltToysSeed
virtual int PreAltHook(RooArgSet *, double) const
const ModelConfig * fNullModel
TestStatistic * fDefaultTestStat
virtual HypoTestResult * GetHypoTest() const
inherited methods from HypoTestCalculator interface
virtual int CheckHook(void) const
virtual const RooArgSet * GetFitInfo() const
void UseSameAltToys()
Set this for re-using always the same toys for alternate hypothesis in case of calls at different nul...
TestStatSampler * fDefaultSampler
virtual void PostHook() const
~HypoTestCalculatorGeneric()
HypoTestResult is a base class for results from hypothesis tests.
void SetAltDetailedOutput(RooDataSet *d)
void SetNullDetailedOutput(RooDataSet *d)
void SetAllTestStatisticsData(const RooArgList *tsd)
void SetPValueIsRightTail(Bool_t pr)
void SetTestStatisticData(const Double_t tsd)
void SetNullDistribution(SamplingDistribution *null)
void SetFitInfo(RooDataSet *d)
void SetAltDistribution(SamplingDistribution *alt)
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
void LoadSnapshot() const
load the snapshot from ws if it exists
const RooArgSet * GetObservables() const
get RooArgSet for observables (return NULL if not existing)
const RooArgSet * GetSnapshot() const
get RooArgSet for parameters for a particular hypothesis (return NULL if not existing)
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
TestStatistic that returns the ratio of profiled likelihoods.
This class simply holds a sampling distribution of some test statistic.
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
virtual Double_t EvaluateTestStatistic(RooAbsData &data, RooArgSet ¶msOfInterest)=0
virtual void SetObservables(const RooArgSet &)=0
virtual TestStatistic * GetTestStatistic() const =0
virtual void SetParametersForTestStat(const RooArgSet &)=0
virtual void SetNuisanceParameters(const RooArgSet &)=0
virtual SamplingDistribution * GetSamplingDistribution(RooArgSet ¶msOfInterest)=0
virtual void SetSamplingDistName(const char *name)=0
virtual void SetPdf(RooAbsPdf &)=0
virtual bool PValueIsRightTail(void) const
Defines the sign convention of the test statistic. Overwrite function if necessary.
ToyMCSampler is an implementation of the TestStatSampler interface.
virtual RooArgList * EvaluateAllTestStatistics(RooAbsData &data, const RooArgSet &poi)
Evaluate all test statistics, returning result and any detailed output.
virtual RooDataSet * GetSamplingDistributions(RooArgSet ¶mPoint)
Use for serial and parallel runs.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Namespace for the RooStats classes.