59 std::unique_ptr<RooArgSet> allParams{
fNullModel->GetPdf()->getParameters(*
fData)};
68 bool doProfile =
true;
73 oocoutI(
nullptr,InputArguments) <<
"Using given conditional MLEs for Null." << endl;
80 if( remain.
empty() ) doProfile =
false;
87 oocoutI(
nullptr,InputArguments) <<
"Profiling conditional MLEs for Null." << endl;
101 std::unique_ptr<RooAbsArg> profileOwner{nll->createProfile(allButNuisance)};
102 auto profile =
dynamic_cast<RooProfileLL*
>(profileOwner.get());
109 std::unique_ptr<RooFitResult>
result {profile->minimizer()->save()};
120 if (testStatSampler) testStatistic = testStatSampler->GetTestStatistic();
138 oocoutI(
nullptr,InputArguments) <<
"Using a ToyMCSampler. Now configuring for Null." << endl;
148 oocoutI(
nullptr,InputArguments) <<
"Adaptive Sampling" << endl;
171 std::unique_ptr<RooArgSet> allParams{
fAltModel->GetPdf()->getParameters(*
fData)};
174 bool doProfile =
true;
176 if(
fAltModel->GetNuisanceParameters() ) {
179 oocoutI(
nullptr,InputArguments) <<
"Using given conditional MLEs for Alt." << endl;
183 if (
fAltModel->GetNuisanceParameters()) {
186 if( remain.
empty() ) doProfile =
false;
193 oocoutI(
nullptr,InputArguments) <<
"Profiling conditional MLEs for Alt." << endl;
198 if (
fAltModel->GetConditionalObservables()) conditionalObs.
add(*
fAltModel->GetConditionalObservables());
208 std::unique_ptr<RooAbsReal> profileOwner{nll->createProfile(allButNuisance)};
209 auto profile =
dynamic_cast<RooProfileLL*
>(profileOwner.get());
216 std::unique_ptr<RooFitResult>
result {profile->minimizer()->save()};
227 if (testStatSampler) testStatistic = testStatSampler->GetTestStatistic();
237 parameterPoint->
add(*
fAltModel->GetNuisanceParameters());
244 oocoutI(
nullptr,InputArguments) <<
"Using a ToyMCSampler. Now configuring for Alt." << endl;
254 oocoutI(
nullptr,InputArguments) <<
"Adaptive Sampling" << endl;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
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.
Does a frequentist hypothesis test.
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...