73 struct HypoTestInvOptions {
75 bool plotHypoTestResult =
true;
76 bool writeResult =
true;
77 TString resultFileName;
79 bool useVectorStore =
true;
80 bool generateBinned =
false;
81 bool noSystematics =
false;
83 double nToysRatio = 2;
85 bool useProof =
false;
87 bool enableDetailedOutput =
false;
90 int nToyToRebuild = 100;
91 int rebuildParamValues=0;
101 bool reuseAltToys =
false;
102 double confLevel = 0.95;
106 std::string minimizerType =
"";
107 std::string massValue =
"";
110 bool useNLLOffset =
false;
115 HypoTestInvOptions optHTInv;
121 class HypoTestInvTool{
125 ~HypoTestInvTool(){};
129 const char * modelSBName,
const char * modelBName,
130 const char * dataName,
131 int type,
int testStatType,
133 int npoints,
double poimin,
double poimax,
int ntoys,
134 bool useNumberCounting =
false,
135 const char * nuisPriorName = 0);
145 const char * fileNameBase = 0 );
147 void SetParameter(
const char *
name,
const char * value);
148 void SetParameter(
const char *
name,
bool value);
149 void SetParameter(
const char *
name,
int value);
150 void SetParameter(
const char *
name,
double value);
154 bool mPlotHypoTestResult;
157 bool mUseVectorStore;
158 bool mGenerateBinned;
162 bool mEnableDetOutput;
165 int mRebuildParamValues;
172 std::string mMassValue;
173 std::string mMinimizerType;
174 TString mResultFileName;
179 RooStats::HypoTestInvTool::HypoTestInvTool() : mPlotHypoTestResult(true),
182 mUseVectorStore(true),
183 mGenerateBinned(false),
185 mEnableDetOutput(false),
187 mReuseAltToys(false),
190 mRebuildParamValues(0),
205 RooStats::HypoTestInvTool::SetParameter(
const char *
name,
bool value){
210 std::string s_name(name);
212 if (s_name.find(
"PlotHypoTestResult") != std::string::npos) mPlotHypoTestResult = value;
213 if (s_name.find(
"WriteResult") != std::string::npos) mWriteResult = value;
214 if (s_name.find(
"Optimize") != std::string::npos) mOptimize = value;
215 if (s_name.find(
"UseVectorStore") != std::string::npos) mUseVectorStore = value;
216 if (s_name.find(
"GenerateBinned") != std::string::npos) mGenerateBinned = value;
217 if (s_name.find(
"UseProof") != std::string::npos) mUseProof = value;
218 if (s_name.find(
"EnableDetailedOutput") != std::string::npos) mEnableDetOutput = value;
219 if (s_name.find(
"Rebuild") != std::string::npos) mRebuild = value;
220 if (s_name.find(
"ReuseAltToys") != std::string::npos) mReuseAltToys = value;
228 RooStats::HypoTestInvTool::SetParameter(
const char * name,
int value){
233 std::string s_name(name);
235 if (s_name.find(
"NWorkers") != std::string::npos) mNWorkers = value;
236 if (s_name.find(
"NToyToRebuild") != std::string::npos) mNToyToRebuild = value;
237 if (s_name.find(
"RebuildParamValues") != std::string::npos) mRebuildParamValues = value;
238 if (s_name.find(
"PrintLevel") != std::string::npos) mPrintLevel = value;
239 if (s_name.find(
"InitialFit") != std::string::npos) mInitialFit = value;
240 if (s_name.find(
"RandomSeed") != std::string::npos) mRandomSeed = value;
241 if (s_name.find(
"AsimovBins") != std::string::npos) mAsimovBins = value;
249 RooStats::HypoTestInvTool::SetParameter(
const char * name,
double value){
254 std::string s_name(name);
256 if (s_name.find(
"NToysRatio") != std::string::npos) mNToysRatio = value;
257 if (s_name.find(
"MaxPOI") != std::string::npos) mMaxPoi = value;
265 RooStats::HypoTestInvTool::SetParameter(
const char * name,
const char * value){
270 std::string s_name(name);
272 if (s_name.find(
"MassValue") != std::string::npos) mMassValue.assign(value);
273 if (s_name.find(
"MinimizerType") != std::string::npos) mMinimizerType.assign(value);
274 if (s_name.find(
"ResultFileName") != std::string::npos) mResultFileName = value;
282 StandardHypoTestInvDemo(
const char * infile = 0,
283 const char * wsName =
"combined",
284 const char * modelSBName =
"ModelConfig",
285 const char * modelBName =
"",
286 const char * dataName =
"obsData",
287 int calculatorType = 0,
288 int testStatType = 0,
294 bool useNumberCounting =
false,
295 const char * nuisPriorName = 0){
344 TString filename(infile);
345 if (filename.IsNull()) {
346 filename =
"results/example_combined_GaussExample_model.root";
351 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
355 cout <<
"will run standard hist2workspace example"<<endl;
356 gROOT->ProcessLine(
".! prepareHistFactory .");
357 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
358 cout <<
"\n\n---------------------"<<endl;
359 cout <<
"Done creating example input"<<endl;
360 cout <<
"---------------------\n\n"<<endl;
372 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
378 HypoTestInvTool calc;
381 calc.SetParameter(
"PlotHypoTestResult", optHTInv.plotHypoTestResult);
382 calc.SetParameter(
"WriteResult", optHTInv.writeResult);
383 calc.SetParameter(
"Optimize", optHTInv.optimize);
384 calc.SetParameter(
"UseVectorStore", optHTInv.useVectorStore);
385 calc.SetParameter(
"GenerateBinned", optHTInv.generateBinned);
386 calc.SetParameter(
"NToysRatio", optHTInv.nToysRatio);
387 calc.SetParameter(
"MaxPOI", optHTInv.maxPOI);
388 calc.SetParameter(
"UseProof", optHTInv.useProof);
389 calc.SetParameter(
"EnableDetailedOutput", optHTInv.enableDetailedOutput);
390 calc.SetParameter(
"NWorkers", optHTInv.nworkers);
391 calc.SetParameter(
"Rebuild", optHTInv.rebuild);
392 calc.SetParameter(
"ReuseAltToys", optHTInv.reuseAltToys);
393 calc.SetParameter(
"NToyToRebuild", optHTInv.nToyToRebuild);
394 calc.SetParameter(
"RebuildParamValues", optHTInv.rebuildParamValues);
395 calc.SetParameter(
"MassValue", optHTInv.massValue.c_str());
396 calc.SetParameter(
"MinimizerType", optHTInv.minimizerType.c_str());
397 calc.SetParameter(
"PrintLevel", optHTInv.printLevel);
398 calc.SetParameter(
"InitialFit", optHTInv.initialFit);
399 calc.SetParameter(
"ResultFileName", optHTInv.resultFileName);
400 calc.SetParameter(
"RandomSeed", optHTInv.randomSeed);
401 calc.SetParameter(
"AsimovBins", optHTInv.nAsimovBins);
408 std::cout << w <<
"\t" << filename << std::endl;
410 r = calc.RunInverter(w, modelSBName, modelBName,
411 dataName, calculatorType, testStatType, useCLs,
412 npoints, poimin, poimax,
413 ntoys, useNumberCounting, nuisPriorName );
415 std::cerr <<
"Error running the HypoTestInverter - Exit " << std::endl;
421 std::cout <<
"Reading an HypoTestInverterResult with name " << wsName <<
" from file " << filename << std::endl;
424 std::cerr <<
"File " << filename <<
" does not contain a workspace or an HypoTestInverterResult - Exit " 431 calc.AnalyzeResult( r, calculatorType, testStatType, useCLs, npoints, infile );
444 const char * fileNameBase ){
449 double lowerLimit = 0;
451 #if defined ROOT_SVN_VERSION && ROOT_SVN_VERSION >= 44126 466 if (lowerLimit < upperLimit*(1.- 1.
E-4) && lowerLimit != 0)
467 std::cout <<
"The computed lower limit is: " << lowerLimit <<
" +/- " << llError << std::endl;
468 std::cout <<
"The computed upper limit is: " << upperLimit <<
" +/- " << ulError << std::endl;
472 std::cout <<
"Expected upper limits, using the B (alternate) model : " << std::endl;
481 if (mEnableDetOutput) {
483 Info(
"StandardHypoTestInvDemo",
"detailed output will be written in output result file");
488 if (r != NULL && mWriteResult) {
491 const char * calcType = (calculatorType == 0) ?
"Freq" : (calculatorType == 1) ?
"Hybr" :
"Asym";
492 const char * limitType = (useCLs) ?
"CLs" :
"Cls+b";
493 const char * scanType = (npoints < 0) ?
"auto" :
"grid";
494 if (mResultFileName.IsNull()) {
495 mResultFileName =
TString::Format(
"%s_%s_%s_ts%d_",calcType,limitType,scanType,testStatType);
497 if (mMassValue.size()>0) {
498 mResultFileName += mMassValue.c_str();
499 mResultFileName +=
"_";
502 TString name = fileNameBase;
503 name.Replace(0, name.Last(
'/')+1,
"");
504 mResultFileName +=
name;
508 TString uldistFile =
"RULDist.root";
513 if (fileULDist) ulDist= fileULDist->Get(
"RULDist");
517 TFile * fileOut =
new TFile(mResultFileName,
"RECREATE");
519 if (ulDist) ulDist->
Write();
520 Info(
"StandardHypoTestInvDemo",
"HypoTestInverterResult has been written in the file %s",mResultFileName.Data());
527 std::string typeName =
"";
528 if (calculatorType == 0 )
529 typeName =
"Frequentist";
530 if (calculatorType == 1 )
532 else if (calculatorType == 2 || calculatorType == 3) {
533 typeName =
"Asymptotic";
534 mPlotHypoTestResult =
false;
537 const char * resultName = r->
GetName();
538 TString plotTitle =
TString::Format(
"%s CL Scan for workspace %s",typeName.c_str(),resultName);
546 plot->Draw(
"CLb 2CL");
556 if (mPlotHypoTestResult) {
563 for (
int i=0; i<nEntries; i++) {
564 if (nEntries > 1) c2->
cd(i+1);
578 RooStats::HypoTestInvTool::RunInverter(
RooWorkspace * w,
579 const char * modelSBName,
const char * modelBName,
580 const char * dataName,
int type,
int testStatType,
581 bool useCLs,
int npoints,
double poimin,
double poimax,
583 bool useNumberCounting,
584 const char * nuisPriorName ){
586 std::cout <<
"Running HypoTestInverter on the workspace " << w->
GetName() << std::endl;
593 Error(
"StandardHypoTestDemo",
"Not existing data %s",dataName);
597 std::cout <<
"Using data set " << dataName << std::endl;
599 if (mUseVectorStore) {
611 Error(
"StandardHypoTestDemo",
"Not existing ModelConfig %s",modelSBName);
616 Error(
"StandardHypoTestDemo",
"Model %s has no pdf ",modelSBName);
620 Error(
"StandardHypoTestDemo",
"Model %s has no poi ",modelSBName);
624 Error(
"StandardHypoTestInvDemo",
"Model %s has no observables ",modelSBName);
628 Info(
"StandardHypoTestInvDemo",
"Model %s has no snapshot - make one using model poi",modelSBName);
634 if (optHTInv.noSystematics) {
636 if (nuisPar && nuisPar->
getSize() > 0) {
637 std::cout <<
"StandardHypoTestInvDemo" <<
" - Switch off all systematics by setting them constant to their initial values" << std::endl;
647 if (!bModel || bModel == sbModel) {
648 Info(
"StandardHypoTestInvDemo",
"The background model %s does not exist",modelBName);
649 Info(
"StandardHypoTestInvDemo",
"Copy it from ModelConfig %s and set POI to zero",modelSBName);
651 bModel->
SetName(TString(modelSBName)+TString(
"_with_poi_0"));
654 double oldval = var->
getVal();
661 Info(
"StandardHypoTestInvDemo",
"Model %s has no snapshot - make one using model poi and 0 values ",modelBName);
664 double oldval = var->
getVal();
670 Error(
"StandardHypoTestInvDemo",
"Model %s has no valid poi",modelBName);
681 if (hasNuisParam && !hasGlobalObs ) {
685 Warning(
"StandardHypoTestInvDemo",
"Model %s has nuisance parameters but no global observables associated",sbModel->
GetName());
686 Warning(
"StandardHypoTestInvDemo",
"\tThe effect of the nuisance parameters will not be treated correctly ");
694 allParams->
snapshot(initialParameters);
702 std::cout <<
"StandardHypoTestInvDemo : POI initial value: " << poi->
GetName() <<
" = " << poi->
getVal() << std::endl;
707 bool doFit = mInitialFit;
708 if (testStatType == 0 && mInitialFit == -1) doFit =
false;
709 if (type == 3 && mInitialFit == -1) doFit =
false;
716 Info(
"StandardHypoTestInvDemo",
"Using %s as minimizer for computing the test statistic",
725 Info(
"StandardHypoTestInvDemo",
" Doing a first fit to the observed data ");
732 if (fitres->
status() != 0) {
733 Warning(
"StandardHypoTestInvDemo",
"Fit to the model failed - try with strategy 1 and perform first an Hesse computation");
737 if (fitres->
status() != 0)
738 Warning(
"StandardHypoTestInvDemo",
" Fit still failed - continue anyway.....");
742 std::cout <<
"StandardHypoTestInvDemo - Best Fit value : " << poi->
GetName() <<
" = " 743 << poihat <<
" +/- " << poi->
getError() << std::endl;
744 std::cout <<
"Time for fitting : "; tw.
Print();
748 std::cout <<
"StandardHypoTestInvo: snapshot of S+B Model " << sbModel->
GetName()
749 <<
" is set to the best fit value" << std::endl;
754 if (testStatType == 0) {
756 Info(
"StandardHypoTestInvDemo",
"Using LEP test statistic - an initial fit is not done and the TS will use the nuisances at the model value");
758 Info(
"StandardHypoTestInvDemo",
"Using LEP test statistic - an initial fit has been done and the TS will use the nuisances at the best fit value");
769 if (sbModel->
GetSnapshot()) slrts.SetNullParameters(nullParams);
772 if (bModel->
GetSnapshot()) slrts.SetAltParameters(altParams);
773 if (mEnableDetOutput) slrts.EnableDetailedOutput();
779 if (testStatType == 11) ropl.SetSubtractMLE(
true);
780 ropl.SetPrintLevel(mPrintLevel);
781 ropl.SetMinimizer(mMinimizerType.c_str());
782 if (mEnableDetOutput) ropl.EnableDetailedOutput();
786 if (testStatType == 4) profll.SetSigned(
true);
787 profll.SetMinimizer(mMinimizerType.c_str());
788 profll.SetPrintLevel(mPrintLevel);
789 if (mEnableDetOutput) profll.EnableDetailedOutput();
791 profll.SetReuseNLL(mOptimize);
792 slrts.SetReuseNLL(mOptimize);
793 ropl.SetReuseNLL(mOptimize);
796 profll.SetStrategy(0);
801 if (mMaxPoi > 0) poi->
setMax(mMaxPoi);
806 AsymptoticCalculator::SetPrintLevel(mPrintLevel);
817 Error(
"StandardHypoTestInvDemo",
"Invalid - calculator type = %d supported values are only :\n\t\t\t 0 (Frequentist) , 1 (Hybrid) , 2 (Asymptotic) ",type);
823 if (testStatType == 0) testStat = &slrts;
824 if (testStatType == 1 || testStatType == 11) testStat = &ropl;
825 if (testStatType == 2 || testStatType == 3 || testStatType == 4) testStat = &profll;
826 if (testStatType == 5) testStat = &maxll;
827 if (testStatType == 6) testStat = &nevtts;
830 Error(
"StandardHypoTestInvDemo",
"Invalid - test statistic type = %d supported values are only :\n\t\t\t 0 (SLR) , 1 (Tevatron) , 2 (PLR), 3 (PLR1), 4(MLE)",testStatType);
836 if (toymcs && (type == 0 || type == 1) ) {
839 if (useNumberCounting)
Warning(
"StandardHypoTestInvDemo",
"Pdf is extended: but number counting flag is set: ignore it ");
843 if (!useNumberCounting ) {
845 Info(
"StandardHypoTestInvDemo",
"Pdf is not extended: number of events to generate taken from observed data set is %d",nEvents);
849 Info(
"StandardHypoTestInvDemo",
"using a number counting pdf");
857 Info(
"StandardHypoTestInvDemo",
"Data set is weighted, nentries = %d and sum of weights = %8.1f but toy generation is unbinned - it would be faster to set mGenerateBinned to true\n",data->
numEntries(), data->
sumEntries());
864 Warning(
"StandardHypoTestInvDemo",
"generate binned is activated but the number of observable is %d. Too much memory could be needed for allocating all the bins",sbModel->
GetObservables()->
getSize() );
881 hhc->
SetToys(ntoys,ntoys/mNToysRatio);
893 ToyMCSampler::SetAlwaysUseMultiGen(
false);
896 if (nuisPriorName) nuisPdf = w->
pdf(nuisPriorName);
899 Info(
"StandardHypoTestInvDemo",
"No nuisance pdf given for the HybridCalculator - try to deduce pdf from the model");
908 Info(
"StandardHypoTestInvDemo",
"No nuisance pdf given - try to use %s that is defined as a prior pdf in the B model",nuisPdf->
GetName());
911 Error(
"StandardHypoTestInvDemo",
"Cannot run Hybrid calculator because no prior on the nuisance parameter is specified or can be derived");
916 Info(
"StandardHypoTestInvDemo",
"Using as nuisance Pdf ... " );
922 Warning(
"StandardHypoTestInvDemo",
"Prior nuisance does not depend on nuisance parameters. They will be smeared in their full range");
932 else if (type == 2 || type == 3) {
934 if (testStatType != 2 && testStatType != 3)
935 Warning(
"StandardHypoTestInvDemo",
"Only the PL test statistic can be used with AsymptoticCalculator - use by default a two-sided PL");
937 else if (type == 0 ) {
942 else if (type == 1 ) {
954 calc.SetConfidenceLevel(optHTInv.confLevel);
958 calc.SetVerbose(
true);
968 if (poimin > poimax) {
970 poimin = int(poihat);
971 poimax = int(poihat + 4 * poi->
getError());
973 std::cout <<
"Doing a fixed scan in interval : " << poimin <<
" , " << poimax << std::endl;
974 calc.SetFixedScan(npoints,poimin,poimax);
978 std::cout <<
"Doing an automatic scan in interval : " << poi->
getMin() <<
" , " << poi->
getMax() << std::endl;
983 std::cout <<
"Time to perform limit scan \n";
988 std::cout <<
"\n***************************************************************\n";
989 std::cout <<
"Rebuild the upper limit distribution by re-generating new set of pseudo-experiment and re-compute for each of them a new upper limit\n\n";
999 if (mRebuildParamValues != 0) {
1001 *allParams = initialParameters;
1003 if (mRebuildParamValues == 0 || mRebuildParamValues == 1 ) {
1012 if (mRebuildParamValues == 0 ) {
1020 std::cout <<
"rebuild using fitted parameter value for B-model snapshot" << std::endl;
1021 constrainParams.
Print(
"v");
1026 std::cout <<
"StandardHypoTestInvDemo: Initial parameters used for rebuilding: ";
1030 calc.SetCloseProof(1);
1033 std::cout <<
"Time to rebuild distributions " << std::endl;
1037 std::cout <<
"Expected limits after rebuild distribution " << std::endl;
1038 std::cout <<
"expected upper limit (median of limit distribution) " << limDist->
InverseCDF(0.5) << std::endl;
1046 limPlot.AddSamplingDistribution(limDist);
1047 limPlot.GetTH1F()->SetStats(
true);
1048 limPlot.SetLineColor(
kBlue);
1049 new TCanvas(
"limPlot",
"Upper Limit Distribution");
1054 TFile * fileOut =
new TFile(
"RULDist.root",
"RECREATE");
1062 r = calc.GetInterval();
1066 std::cout <<
"ERROR : failed to re-build distributions " << std::endl;
1074 void ReadResult(
const char * fileName,
const char * resultName=
"",
bool useCLs=
true) {
1077 StandardHypoTestInvDemo(fileName, resultName,
"",
"",
"",0,0,useCLs);
1083 StandardHypoTestInvDemo();
virtual Double_t sumEntries() const =0
virtual Double_t getMin(const char *name=0) const
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
void UseSameAltToys()
to re-use same toys for alternate hypothesis
RooCmdArg Offset(Bool_t flag=kTRUE)
Holds configuration options for proof and proof-lite.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
const RooArgSet * GetObservables() const
get RooArgSet for observables (return NULL if not existing)
virtual Double_t getMax(const char *name=0) const
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...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void LoadSnapshot() const
load the snapshot from ws if it exists
HypoTestInverter class for performing an hypothesis test inversion by scanning the hypothesis test re...
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
RooAbsPdf * MakeNuisancePdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name)
RooCmdArg PrintLevel(Int_t code)
Double_t getVal(const RooArgSet *set=0) const
double GetExpectedUpperLimit(double nsig=0, const char *opt="") const
get Limit value corresponding at the desired nsigma level (0) is median -1 sigma is 1 sigma ...
void convertToVectorStore()
Convert tree-based storage to vector-based storage.
void SetOneSided(Bool_t flag=true)
virtual void SetName(const char *name)
Set the name of the TNamed.
Double_t InverseCDF(Double_t pvalue)
get the inverse of the Cumulative distribution function
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
RooCmdArg Strategy(Int_t code)
virtual void SetNEventsPerToy(const Int_t nevents)
StreamConfig & getStream(Int_t id)
static void setDefaultStorageType(StorageType s)
void removeTopic(RooFit::MsgTopic oldTopic)
static RooMsgService & instance()
Return reference to singleton instance.
void SetLogYaxis(Bool_t ly)
changes plot to log scale on y axis
virtual ModelConfig * Clone(const char *name="") const
clone
void setMax(const char *name, Double_t value)
Set maximum of name range to given value.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
virtual void SetTestStatistic(TestStatistic *testStatistic, unsigned int i)
Common base class for the Hypothesis Test Calculators.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
double normal_cdf(double x, double sigma=1, double x0=0)
Cumulative distribution function of the normal (Gaussian) distribution (lower tail).
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
int main(int argc, char **argv)
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
Double_t LowerLimit()
lower and upper bound of the confidence interval (to get upper/lower limits, multiply the size( = 1-c...
RooRealVar represents a fundamental (non-derived) real valued object.
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
RooAbsPdf * GetPriorPdf() const
get parameters prior pdf (return NULL if not existing)
static void SetDefaultStrategy(int strat)
virtual void setVal(Double_t value)
Set value of variable to 'value'.
virtual void ls(Option_t *option="") const
List TNamed name and title.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
RooCmdArg InitialHesse(Bool_t flag=kTRUE)
R__EXTERN TSystem * gSystem
static const std::string & DefaultMinimizerType()
RooAbsArg * first() const
RooCmdArg Minimizer(const char *type, const char *alg=0)
void SetProofConfig(ProofConfig *pc=NULL)
void PrintListContent(const RooArgList &l, std::ostream &os=std::cout)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void SetSubtractMLE(bool subtract)
RooAbsData is the common abstract base class for binned and unbinned datasets.
ProfileLikelihoodTestStat is an implementation of the TestStatistic interface that calculates the pro...
ToyMCSampler is an implementation of the TestStatSampler interface.
This class simply holds a sampling distribution of some test statistic.
TestStatistic that returns the ratio of profiled likelihoods.
bool IsTwoSided() const
query if two sided result
Bool_t canBeExtended() const
void UseNLLOffset(bool on)
Same purpose as HybridCalculatorOriginal, but different implementation.
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
Namespace for the RooStats classes.
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
RooCmdArg Hesse(Bool_t flag=kTRUE)
HypoTestInverterResult class holds the array of hypothesis test results and compute a confidence inte...
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
Class to plot an HypoTestInverterResult, result of the HypoTestInverter calculator.
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
Double_t LowerLimitEstimatedError()
rough estimation of the error on the computed bound of the confidence interval Estimate of lower limi...
bool SetAllConstant(const RooAbsCollection &coll, bool constant=true)
void SetToys(int toysNull, int toysAlt)
set number of toys
TestStatistic class that returns -log(L[null] / L[alt]) where L is the likelihood.
virtual Bool_t isWeighted() const
This class provides simple and straightforward utilities to plot SamplingDistribution objects...
Mother of all ROOT objects.
MaxLikelihoodEstimateTestStat: TestStatistic that returns maximum likelihood estimate of a specified ...
Double_t UpperLimitEstimatedError()
Estimate of lower limit error function evaluates only a rough error on the lower limit.
RooCmdArg Save(Bool_t flag=kTRUE)
void RemoveConstantParameters(RooArgSet *set)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
const RooArgSet * GetGlobalObservables() const
get RooArgSet for global observables (return NULL if not existing)
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
Does a frequentist hypothesis test.
virtual RooFitResult * fitTo(RooAbsData &data, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none())
Fit PDF to given dataset.
static constexpr double pc
void SetUseMultiGen(Bool_t flag)
void SetGenerateBinned(bool binned=true)
const RooArgSet * GetSnapshot() const
get RooArgSet for parameters for a particular hypothesis (return NULL if not existing) ...
Double_t Sqrt(Double_t x)
virtual void SetGlobalObservables(const RooArgSet &set)
specify the global observables
static void SetDefaultMinimizer(const char *type, const char *algo=0)
Double_t getError() const
void Print(Option_t *opts=0) const
Print contents of the workspace.
virtual void SetSnapshot(const RooArgSet &set)
set parameter values for a particular hypothesis if using a common PDF by saving a snapshot in the wo...
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
int ArraySize() const
number of entries in the results array
Hypothesis Test Calculator based on the asymptotic formulae for the profile likelihood ratio...
Int_t CeilNint(Double_t x)
virtual void ForcePriorNuisanceAlt(RooAbsPdf &priorNuisance)
TestStatSampler * GetTestStatSampler(void) const
RooCmdArg Constrain(const RooArgSet ¶ms)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
The RooWorkspace is a persistable container for RooFit projects.
virtual void ForcePriorNuisanceNull(RooAbsPdf &priorNuisance)
Override the distribution used for marginalizing nuisance parameters that is inferred from ModelConfi...
virtual Int_t numEntries() const
NumEventsTestStat is a simple implementation of the TestStatistic interface used for simple number co...