29 if (fFitInfo !=
NULL) {
38 void FrequentistCalculator::PostHook()
const {
41 int FrequentistCalculator::PreNullHook(
RooArgSet *parameterPoint,
double obsTestStat)
const {
46 RooArgSet * allParams = fNullModel->GetPdf()->getParameters(*fData);
55 bool doProfile =
true;
57 if( fNullModel->GetNuisanceParameters() ) {
58 allButNuisance.
remove(*fNullModel->GetNuisanceParameters());
59 if( fConditionalMLEsNull ) {
61 *allParams = *fConditionalMLEsNull;
63 allButNuisance.
add( *fConditionalMLEsNull );
64 if (fNullModel->GetNuisanceParameters()) {
65 RooArgSet remain(*fNullModel->GetNuisanceParameters());
66 remain.
remove(*fConditionalMLEsNull,
true,
true);
67 if( remain.getSize() == 0 ) doProfile =
false;
79 if (fNullModel->GetConditionalObservables()) conditionalObs.
add(*fNullModel->GetConditionalObservables());
89 RooArgSet * detOutput = DetailedOutputAggregator::GetAsArgSet(result,
"fitNull_");
90 fFitInfo->addOwned(*detOutput);
101 if(fNullModel->GetNuisanceParameters())
102 parameterPoint->
add(*fNullModel->GetNuisanceParameters());
116 if(fNToysNull >= 0) toymcs->
SetNToys(fNToysNull);
124 if(GetTestStatSampler()->GetTestStatistic()->PValueIsRightTail()) {
133 GetNullModel()->LoadSnapshot();
140 int FrequentistCalculator::PreAltHook(
RooArgSet *parameterPoint,
double obsTestStat)
const {
145 RooArgSet * allParams = fAltModel->GetPdf()->getParameters(*fData);
148 bool doProfile =
true;
150 if( fAltModel->GetNuisanceParameters() ) {
151 allButNuisance.
remove(*fAltModel->GetNuisanceParameters());
152 if( fConditionalMLEsAlt ) {
154 *allParams = *fConditionalMLEsAlt;
156 allButNuisance.
add( *fConditionalMLEsAlt );
157 if (fAltModel->GetNuisanceParameters()) {
158 RooArgSet remain(*fAltModel->GetNuisanceParameters());
159 remain.
remove(*fConditionalMLEsAlt,
true,
true);
160 if( remain.getSize() == 0 ) doProfile =
false;
172 if (fAltModel->GetConditionalObservables()) conditionalObs.
add(*fAltModel->GetConditionalObservables());
183 RooArgSet * detOutput = DetailedOutputAggregator::GetAsArgSet(result,
"fitAlt_");
184 fFitInfo->addOwned(*detOutput);
195 if(fAltModel->GetNuisanceParameters())
196 parameterPoint->
add(*fAltModel->GetNuisanceParameters());
211 if(fNToysAlt >= 0) toymcs->
SetNToys(fNToysAlt);
219 if(GetTestStatSampler()->GetTestStatistic()->PValueIsRightTail()) {
RooCmdArg Offset(Bool_t flag=kTRUE)
void SetToysLeftTail(Double_t toys, Double_t threshold)
virtual void SetGlobalObservables(const RooArgSet &o)
RooCmdArg CloneData(Bool_t flag)
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)
Double_t getVal(const RooArgSet *set=0) const
RooFit::MsgLevel globalKillBelow() const
virtual void SetNToys(const Int_t ntoy)
ClassImp(RooStats::FrequentistCalculator) using namespace RooStats
Does a frequentist hypothesis test.
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...
Hypothesis Test Calculator using a full frequentist procedure for sampling the test statistic distrib...
RooCmdArg ConditionalObservables(const RooArgSet &set)
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
RooCmdArg Constrain(const RooArgSet ¶ms)