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());
104 fFitInfo->addOwned(*detOutput);
115 if(fNullModel->GetNuisanceParameters())
116 parameterPoint->
add(*fNullModel->GetNuisanceParameters());
130 if(fNToysNull >= 0) toymcs->
SetNToys(fNToysNull);
138 if(GetTestStatSampler()->GetTestStatistic()->PValueIsRightTail()) {
147 GetNullModel()->LoadSnapshot();
160 RooArgSet * allParams = fAltModel->GetPdf()->getParameters(*fData);
163 bool doProfile =
true;
165 if( fAltModel->GetNuisanceParameters() ) {
166 allButNuisance.
remove(*fAltModel->GetNuisanceParameters());
167 if( fConditionalMLEsAlt ) {
169 *allParams = *fConditionalMLEsAlt;
171 allButNuisance.
add( *fConditionalMLEsAlt );
172 if (fAltModel->GetNuisanceParameters()) {
173 RooArgSet remain(*fAltModel->GetNuisanceParameters());
174 remain.
remove(*fConditionalMLEsAlt,
true,
true);
175 if( remain.getSize() == 0 ) doProfile =
false;
187 if (fAltModel->GetConditionalObservables()) conditionalObs.
add(*fAltModel->GetConditionalObservables());
199 fFitInfo->addOwned(*detOutput);
210 if(fAltModel->GetNuisanceParameters())
211 parameterPoint->
add(*fAltModel->GetNuisanceParameters());
226 if(fNToysAlt >= 0) toymcs->
SetNToys(fNToysAlt);
234 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...
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 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)
RooCmdArg Constrain(const RooArgSet ¶ms)