39 if (fFitInfo != NULL) {
60 RooArgSet * allParams = fNullModel->GetPdf()->getParameters(*fData);
69 bool doProfile =
true;
71 if( fNullModel->GetNuisanceParameters() ) {
72 allButNuisance.
remove(*fNullModel->GetNuisanceParameters());
73 if( fConditionalMLEsNull ) {
75 *allParams = *fConditionalMLEsNull;
77 allButNuisance.
add( *fConditionalMLEsNull );
78 if (fNullModel->GetNuisanceParameters()) {
79 RooArgSet remain(*fNullModel->GetNuisanceParameters());
80 remain.
remove(*fConditionalMLEsNull,
true,
true);
81 if( remain.getSize() == 0 ) doProfile =
false;
93 if (fNullModel->GetConditionalObservables()) conditionalObs.
add(*fNullModel->GetConditionalObservables());
95 if (fNullModel->GetGlobalObservables()) globalObs.
add(*fNullModel->GetGlobalObservables());
107 fFitInfo->addOwned(*detOutput);
119 auto testStatSampler = GetTestStatSampler();
120 if (testStatSampler) testStatistic = testStatSampler->GetTestStatistic();
129 if(fNullModel->GetNuisanceParameters())
130 parameterPoint->
add(*fNullModel->GetNuisanceParameters());
143 if(fNToysNull >= 0) toymcs->
SetNToys(fNToysNull);
151 if(GetTestStatSampler()->GetTestStatistic()->PValueIsRightTail()) {
160 GetNullModel()->LoadSnapshot();
173 RooArgSet * allParams = fAltModel->GetPdf()->getParameters(*fData);
176 bool doProfile =
true;
178 if( fAltModel->GetNuisanceParameters() ) {
179 allButNuisance.
remove(*fAltModel->GetNuisanceParameters());
180 if( fConditionalMLEsAlt ) {
182 *allParams = *fConditionalMLEsAlt;
184 allButNuisance.
add( *fConditionalMLEsAlt );
185 if (fAltModel->GetNuisanceParameters()) {
186 RooArgSet remain(*fAltModel->GetNuisanceParameters());
187 remain.
remove(*fConditionalMLEsAlt,
true,
true);
188 if( remain.getSize() == 0 ) doProfile =
false;
200 if (fAltModel->GetConditionalObservables()) conditionalObs.
add(*fAltModel->GetConditionalObservables());
202 if (fAltModel->GetGlobalObservables()) globalObs.
add(*fAltModel->GetGlobalObservables());
216 fFitInfo->addOwned(*detOutput);
228 auto testStatSampler = GetTestStatSampler();
229 if (testStatSampler) testStatistic = testStatSampler->GetTestStatistic();
238 if(fAltModel->GetNuisanceParameters())
239 parameterPoint->
add(*fAltModel->GetNuisanceParameters());
251 if(fNToysAlt >= 0) toymcs->
SetNToys(fNToysAlt);
259 if(GetTestStatSampler()->GetTestStatistic()->PValueIsRightTail()) {
RooCmdArg Offset(Bool_t flag=kTRUE)
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
virtual void SetGlobalObservables(const RooArgSet &)
interface to set global observables. If a test statistics needs them it will re-implement this functi...
Class RooProfileLL implements the profile likelihood estimator for a given likelihood and set of para...
void SetToysLeftTail(Double_t toys, Double_t threshold)
virtual void SetGlobalObservables(const RooArgSet &o)
RooCmdArg CloneData(Bool_t flag)
Double_t getVal(const RooArgSet *set=0) const
RooFit::MsgLevel globalKillBelow() const
static RooMsgService & instance()
Return reference to singleton instance.
void SetToysRightTail(Double_t toys, Double_t threshold)
void SetToysBothTails(Double_t toys, Double_t low_threshold, Double_t high_threshold)
virtual void SetConditionalObservables(const RooArgSet &)
interface to set conditional observables. If a test statistics needs them it will re-implement this f...
RooCmdArg GlobalObservables(const RooArgSet &globs)
virtual void SetNToys(const Int_t ntoy)
int PreNullHook(RooArgSet *parameterPoint, double obsTestStat) const
configure TestStatSampler for the Null run
int PreAltHook(RooArgSet *parameterPoint, double obsTestStat) const
configure TestStatSampler for the Alt run
void setGlobalKillBelow(RooFit::MsgLevel level)
ToyMCSampler is an implementation of the TestStatSampler interface.
Namespace for the RooStats classes.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Mother of all ROOT objects.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
void RemoveConstantParameters(RooArgSet *set)
virtual RooAbsReal * createProfile(const RooArgSet ¶msOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function...
Does a frequentist hypothesis test.
static RooArgSet * GetAsArgSet(RooFitResult *result, TString prefix="", bool withErrorsAndPulls=false)
static function to translate the given fit result to a RooArgSet in a generic way.
RooCmdArg ConditionalObservables(const RooArgSet &set)
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
RooCmdArg Constrain(const RooArgSet ¶ms)