58 std::unique_ptr<RooArgSet> allParams{
fNullModel->GetPdf()->getParameters(*
fData)};
67 bool doProfile =
true;
72 oocoutI(
nullptr,InputArguments) <<
"Using given conditional MLEs for Null." << std::endl;
79 if( remain.
empty() ) doProfile =
false;
86 oocoutI(
nullptr,InputArguments) <<
"Profiling conditional MLEs for Null." << std::endl;
100 std::unique_ptr<RooAbsArg> profileOwner{nll->createProfile(allButNuisance)};
101 auto profile =
dynamic_cast<RooProfileLL*
>(profileOwner.get());
108 std::unique_ptr<RooFitResult> result {profile->minimizer()->save()};
119 if (testStatSampler) testStatistic = testStatSampler->GetTestStatistic();
137 oocoutI(
nullptr,InputArguments) <<
"Using a ToyMCSampler. Now configuring for Null." << std::endl;
147 oocoutI(
nullptr,InputArguments) <<
"Adaptive Sampling" << std::endl;
170 std::unique_ptr<RooArgSet> allParams{
fAltModel->GetPdf()->getParameters(*
fData)};
173 bool doProfile =
true;
175 if(
fAltModel->GetNuisanceParameters() ) {
178 oocoutI(
nullptr,InputArguments) <<
"Using given conditional MLEs for Alt." << std::endl;
182 if (
fAltModel->GetNuisanceParameters()) {
185 if( remain.
empty() ) doProfile =
false;
192 oocoutI(
nullptr,InputArguments) <<
"Profiling conditional MLEs for Alt." << std::endl;
197 if (
fAltModel->GetConditionalObservables()) conditionalObs.
add(*
fAltModel->GetConditionalObservables());
207 std::unique_ptr<RooAbsReal> profileOwner{nll->createProfile(allButNuisance)};
208 auto profile =
dynamic_cast<RooProfileLL*
>(profileOwner.get());
215 std::unique_ptr<RooFitResult> result {profile->minimizer()->save()};
226 if (testStatSampler) testStatistic = testStatSampler->GetTestStatistic();
236 parameterPoint->
add(*
fAltModel->GetNuisanceParameters());
243 oocoutI(
nullptr,InputArguments) <<
"Using a ToyMCSampler. Now configuring for Alt." << std::endl;
253 oocoutI(
nullptr,InputArguments) <<
"Adaptive Sampling" << std::endl;
static int DefaultPrintLevel()
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Abstract base class for binned and unbinned datasets.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
void setPrintLevel(int newLevel)
Change the MINUIT internal printing level.
static RooMsgService & instance()
Return reference to singleton instance.
void setGlobalKillBelow(RooFit::MsgLevel level)
RooFit::MsgLevel globalKillBelow() const
Implements the profile likelihood estimator for a given likelihood and set of parameters of interest.
RooMinimizer * minimizer()
static RooArgSet * GetAsArgSet(RooFitResult *result, TString prefix="", bool withErrorsAndPulls=false)
Translate the given fit result to a RooArgSet in a generic way.
const RooArgSet * fConditionalMLEsNull
void PostHook() const override
int PreNullHook(RooArgSet *parameterPoint, double obsTestStat) const override
configure TestStatSampler for the Null run
void PreHook() const override
int PreAltHook(RooArgSet *parameterPoint, double obsTestStat) const override
configure TestStatSampler for the Alt run
const RooArgSet * fConditionalMLEsAlt
const ModelConfig * GetNullModel(void) const
const ModelConfig * fAltModel
TestStatSampler * GetTestStatSampler(void) const
Returns instance of TestStatSampler.
const ModelConfig * fNullModel
void LoadSnapshot() const
load the snapshot from ws if it exists
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
virtual void SetConditionalObservables(const RooArgSet &)
interface to set conditional observables. If a test statistics needs them it will re-implement this f...
virtual void SetGlobalObservables(const RooArgSet &)
interface to set global observables. If a test statistics needs them it will re-implement this functi...
ToyMCSampler is an implementation of the TestStatSampler interface.
virtual void SetNToys(const Int_t ntoy)
void SetToysBothTails(double toys, double low_threshold, double high_threshold)
void SetToysRightTail(double toys, double threshold)
void SetToysLeftTail(double toys, double threshold)
void SetGlobalObservables(const RooArgSet &o) override
specify the conditional observables
RooCmdArg Offset(std::string const &mode)
RooCmdArg Constrain(const RooArgSet ¶ms)
RooCmdArg GlobalObservables(Args_t &&... argsOrArgSet)
RooCmdArg CloneData(bool flag)
RooCmdArg ConditionalObservables(Args_t &&... argsOrArgSet)
Create a RooCmdArg to declare conditional observables.
MsgLevel
Verbosity level for RooMsgService::StreamConfig in RooMsgService.
Namespace for the RooStats classes.
void RemoveConstantParameters(RooArgSet *set)
RooStatsConfig & GetGlobalRooStatsConfig()
Retrieve the config object which can be used to set flags for things like offsetting the likelihood o...