71 struct HypoTestInvOptions {
73 bool plotHypoTestResult =
true;
74 bool writeResult =
true;
75 TString resultFileName;
77 bool useVectorStore =
true;
78 bool generateBinned =
false;
79 bool noSystematics =
false;
81 double nToysRatio = 2;
83 bool useProof =
false;
85 bool enableDetailedOutput =
false;
88 int nToyToRebuild = 100;
89 int rebuildParamValues=0;
99 bool reuseAltToys =
false;
100 double confLevel = 0.95;
104 std::string minimizerType =
"";
105 std::string massValue =
"";
108 bool useNLLOffset =
false;
113 HypoTestInvOptions optHTInv;
119 class HypoTestInvTool{
123 ~HypoTestInvTool(){};
127 const char * modelSBName,
const char * modelBName,
128 const char * dataName,
129 int type,
int testStatType,
131 int npoints,
double poimin,
double poimax,
int ntoys,
132 bool useNumberCounting =
false,
133 const char * nuisPriorName = 0);
143 const char * fileNameBase = 0 );
145 void SetParameter(
const char *
name,
const char * value);
146 void SetParameter(
const char *
name,
bool value);
147 void SetParameter(
const char *
name,
int value);
148 void SetParameter(
const char *
name,
double value);
152 bool mPlotHypoTestResult;
155 bool mUseVectorStore;
156 bool mGenerateBinned;
160 bool mEnableDetOutput;
163 int mRebuildParamValues;
170 std::string mMassValue;
171 std::string mMinimizerType;
172 TString mResultFileName;
177 RooStats::HypoTestInvTool::HypoTestInvTool() : mPlotHypoTestResult(true),
180 mUseVectorStore(true),
181 mGenerateBinned(false),
183 mEnableDetOutput(false),
185 mReuseAltToys(false),
188 mRebuildParamValues(0),
203 RooStats::HypoTestInvTool::SetParameter(
const char *
name,
bool value){
208 std::string s_name(name);
210 if (s_name.find(
"PlotHypoTestResult") != std::string::npos) mPlotHypoTestResult = value;
211 if (s_name.find(
"WriteResult") != std::string::npos) mWriteResult = value;
212 if (s_name.find(
"Optimize") != std::string::npos) mOptimize = value;
213 if (s_name.find(
"UseVectorStore") != std::string::npos) mUseVectorStore = value;
214 if (s_name.find(
"GenerateBinned") != std::string::npos) mGenerateBinned = value;
215 if (s_name.find(
"UseProof") != std::string::npos) mUseProof = value;
216 if (s_name.find(
"EnableDetailedOutput") != std::string::npos) mEnableDetOutput = value;
217 if (s_name.find(
"Rebuild") != std::string::npos) mRebuild = value;
218 if (s_name.find(
"ReuseAltToys") != std::string::npos) mReuseAltToys = value;
226 RooStats::HypoTestInvTool::SetParameter(
const char * name,
int value){
231 std::string s_name(name);
233 if (s_name.find(
"NWorkers") != std::string::npos) mNWorkers = value;
234 if (s_name.find(
"NToyToRebuild") != std::string::npos) mNToyToRebuild = value;
235 if (s_name.find(
"RebuildParamValues") != std::string::npos) mRebuildParamValues = value;
236 if (s_name.find(
"PrintLevel") != std::string::npos) mPrintLevel = value;
237 if (s_name.find(
"InitialFit") != std::string::npos) mInitialFit = value;
238 if (s_name.find(
"RandomSeed") != std::string::npos) mRandomSeed = value;
239 if (s_name.find(
"AsimovBins") != std::string::npos) mAsimovBins = value;
247 RooStats::HypoTestInvTool::SetParameter(
const char * name,
double value){
252 std::string s_name(name);
254 if (s_name.find(
"NToysRatio") != std::string::npos) mNToysRatio = value;
255 if (s_name.find(
"MaxPOI") != std::string::npos) mMaxPoi = value;
263 RooStats::HypoTestInvTool::SetParameter(
const char * name,
const char * value){
268 std::string s_name(name);
270 if (s_name.find(
"MassValue") != std::string::npos) mMassValue.assign(value);
271 if (s_name.find(
"MinimizerType") != std::string::npos) mMinimizerType.assign(value);
272 if (s_name.find(
"ResultFileName") != std::string::npos) mResultFileName = value;
280 StandardHypoTestInvDemo(
const char * infile = 0,
281 const char * wsName =
"combined",
282 const char * modelSBName =
"ModelConfig",
283 const char * modelBName =
"",
284 const char * dataName =
"obsData",
285 int calculatorType = 0,
286 int testStatType = 0,
292 bool useNumberCounting =
false,
293 const char * nuisPriorName = 0){
342 TString filename(infile);
343 if (filename.IsNull()) {
344 filename =
"results/example_combined_GaussExample_model.root";
349 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
353 cout <<
"will run standard hist2workspace example"<<endl;
354 gROOT->ProcessLine(
".! prepareHistFactory .");
355 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
356 cout <<
"\n\n---------------------"<<endl;
357 cout <<
"Done creating example input"<<endl;
358 cout <<
"---------------------\n\n"<<endl;
370 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
376 HypoTestInvTool calc;
379 calc.SetParameter(
"PlotHypoTestResult", optHTInv.plotHypoTestResult);
380 calc.SetParameter(
"WriteResult", optHTInv.writeResult);
381 calc.SetParameter(
"Optimize", optHTInv.optimize);
382 calc.SetParameter(
"UseVectorStore", optHTInv.useVectorStore);
383 calc.SetParameter(
"GenerateBinned", optHTInv.generateBinned);
384 calc.SetParameter(
"NToysRatio", optHTInv.nToysRatio);
385 calc.SetParameter(
"MaxPOI", optHTInv.maxPOI);
386 calc.SetParameter(
"UseProof", optHTInv.useProof);
387 calc.SetParameter(
"EnableDetailedOutput", optHTInv.enableDetailedOutput);
388 calc.SetParameter(
"NWorkers", optHTInv.nworkers);
389 calc.SetParameter(
"Rebuild", optHTInv.rebuild);
390 calc.SetParameter(
"ReuseAltToys", optHTInv.reuseAltToys);
391 calc.SetParameter(
"NToyToRebuild", optHTInv.nToyToRebuild);
392 calc.SetParameter(
"RebuildParamValues", optHTInv.rebuildParamValues);
393 calc.SetParameter(
"MassValue", optHTInv.massValue.c_str());
394 calc.SetParameter(
"MinimizerType", optHTInv.minimizerType.c_str());
395 calc.SetParameter(
"PrintLevel", optHTInv.printLevel);
396 calc.SetParameter(
"InitialFit", optHTInv.initialFit);
397 calc.SetParameter(
"ResultFileName", optHTInv.resultFileName);
398 calc.SetParameter(
"RandomSeed", optHTInv.randomSeed);
399 calc.SetParameter(
"AsimovBins", optHTInv.nAsimovBins);
406 std::cout << w <<
"\t" << filename << std::endl;
408 r = calc.RunInverter(w, modelSBName, modelBName,
409 dataName, calculatorType, testStatType, useCLs,
410 npoints, poimin, poimax,
411 ntoys, useNumberCounting, nuisPriorName );
413 std::cerr <<
"Error running the HypoTestInverter - Exit " << std::endl;
419 std::cout <<
"Reading an HypoTestInverterResult with name " << wsName <<
" from file " << filename << std::endl;
422 std::cerr <<
"File " << filename <<
" does not contain a workspace or an HypoTestInverterResult - Exit " 429 calc.AnalyzeResult( r, calculatorType, testStatType, useCLs, npoints, infile );
442 const char * fileNameBase ){
447 double lowerLimit = 0;
449 #if defined ROOT_SVN_VERSION && ROOT_SVN_VERSION >= 44126 464 if (lowerLimit < upperLimit*(1.- 1.
E-4) && lowerLimit != 0)
465 std::cout <<
"The computed lower limit is: " << lowerLimit <<
" +/- " << llError << std::endl;
466 std::cout <<
"The computed upper limit is: " << upperLimit <<
" +/- " << ulError << std::endl;
470 std::cout <<
"Expected upper limits, using the B (alternate) model : " << std::endl;
479 if (mEnableDetOutput) {
481 Info(
"StandardHypoTestInvDemo",
"detailed output will be written in output result file");
486 if (r !=
NULL && mWriteResult) {
489 const char * calcType = (calculatorType == 0) ?
"Freq" : (calculatorType == 1) ?
"Hybr" :
"Asym";
490 const char * limitType = (useCLs) ?
"CLs" :
"Cls+b";
491 const char * scanType = (npoints < 0) ?
"auto" :
"grid";
492 if (mResultFileName.IsNull()) {
493 mResultFileName =
TString::Format(
"%s_%s_%s_ts%d_",calcType,limitType,scanType,testStatType);
495 if (mMassValue.size()>0) {
496 mResultFileName += mMassValue.c_str();
497 mResultFileName +=
"_";
500 TString name = fileNameBase;
501 name.Replace(0, name.Last(
'/')+1,
"");
502 mResultFileName +=
name;
506 TString uldistFile =
"RULDist.root";
511 if (fileULDist) ulDist= fileULDist->Get(
"RULDist");
515 TFile * fileOut =
new TFile(mResultFileName,
"RECREATE");
517 if (ulDist) ulDist->
Write();
518 Info(
"StandardHypoTestInvDemo",
"HypoTestInverterResult has been written in the file %s",mResultFileName.Data());
525 std::string typeName =
"";
526 if (calculatorType == 0 )
527 typeName =
"Frequentist";
528 if (calculatorType == 1 )
530 else if (calculatorType == 2 || calculatorType == 3) {
531 typeName =
"Asymptotic";
532 mPlotHypoTestResult =
false;
535 const char * resultName = r->
GetName();
536 TString plotTitle =
TString::Format(
"%s CL Scan for workspace %s",typeName.c_str(),resultName);
544 plot->Draw(
"CLb 2CL");
554 if (mPlotHypoTestResult) {
561 for (
int i=0; i<nEntries; i++) {
562 if (nEntries > 1) c2->
cd(i+1);
576 RooStats::HypoTestInvTool::RunInverter(
RooWorkspace * w,
577 const char * modelSBName,
const char * modelBName,
578 const char * dataName,
int type,
int testStatType,
579 bool useCLs,
int npoints,
double poimin,
double poimax,
581 bool useNumberCounting,
582 const char * nuisPriorName ){
584 std::cout <<
"Running HypoTestInverter on the workspace " << w->
GetName() << std::endl;
591 Error(
"StandardHypoTestDemo",
"Not existing data %s",dataName);
595 std::cout <<
"Using data set " << dataName << std::endl;
597 if (mUseVectorStore) {
609 Error(
"StandardHypoTestDemo",
"Not existing ModelConfig %s",modelSBName);
614 Error(
"StandardHypoTestDemo",
"Model %s has no pdf ",modelSBName);
618 Error(
"StandardHypoTestDemo",
"Model %s has no poi ",modelSBName);
622 Error(
"StandardHypoTestInvDemo",
"Model %s has no observables ",modelSBName);
626 Info(
"StandardHypoTestInvDemo",
"Model %s has no snapshot - make one using model poi",modelSBName);
632 if (optHTInv.noSystematics) {
634 if (nuisPar && nuisPar->
getSize() > 0) {
635 std::cout <<
"StandardHypoTestInvDemo" <<
" - Switch off all systematics by setting them constant to their initial values" << std::endl;
645 if (!bModel || bModel == sbModel) {
646 Info(
"StandardHypoTestInvDemo",
"The background model %s does not exist",modelBName);
647 Info(
"StandardHypoTestInvDemo",
"Copy it from ModelConfig %s and set POI to zero",modelSBName);
649 bModel->
SetName(TString(modelSBName)+TString(
"_with_poi_0"));
652 double oldval = var->
getVal();
659 Info(
"StandardHypoTestInvDemo",
"Model %s has no snapshot - make one using model poi and 0 values ",modelBName);
662 double oldval = var->
getVal();
668 Error(
"StandardHypoTestInvDemo",
"Model %s has no valid poi",modelBName);
679 if (hasNuisParam && !hasGlobalObs ) {
683 Warning(
"StandardHypoTestInvDemo",
"Model %s has nuisance parameters but no global observables associated",sbModel->
GetName());
684 Warning(
"StandardHypoTestInvDemo",
"\tThe effect of the nuisance parameters will not be treated correctly ");
692 allParams->
snapshot(initialParameters);
700 std::cout <<
"StandardHypoTestInvDemo : POI initial value: " << poi->
GetName() <<
" = " << poi->
getVal() << std::endl;
705 bool doFit = mInitialFit;
706 if (testStatType == 0 && mInitialFit == -1) doFit =
false;
707 if (type == 3 && mInitialFit == -1) doFit =
false;
714 Info(
"StandardHypoTestInvDemo",
"Using %s as minimizer for computing the test statistic",
723 Info(
"StandardHypoTestInvDemo",
" Doing a first fit to the observed data ");
730 if (fitres->
status() != 0) {
731 Warning(
"StandardHypoTestInvDemo",
"Fit to the model failed - try with strategy 1 and perform first an Hesse computation");
735 if (fitres->
status() != 0)
736 Warning(
"StandardHypoTestInvDemo",
" Fit still failed - continue anyway.....");
740 std::cout <<
"StandardHypoTestInvDemo - Best Fit value : " << poi->
GetName() <<
" = " 741 << poihat <<
" +/- " << poi->
getError() << std::endl;
742 std::cout <<
"Time for fitting : "; tw.
Print();
746 std::cout <<
"StandardHypoTestInvo: snapshot of S+B Model " << sbModel->
GetName()
747 <<
" is set to the best fit value" << std::endl;
752 if (testStatType == 0) {
754 Info(
"StandardHypoTestInvDemo",
"Using LEP test statistic - an initial fit is not done and the TS will use the nuisances at the model value");
756 Info(
"StandardHypoTestInvDemo",
"Using LEP test statistic - an initial fit has been done and the TS will use the nuisances at the best fit value");
767 if (sbModel->
GetSnapshot()) slrts.SetNullParameters(nullParams);
770 if (bModel->
GetSnapshot()) slrts.SetAltParameters(altParams);
771 if (mEnableDetOutput) slrts.EnableDetailedOutput();
777 if (testStatType == 11) ropl.SetSubtractMLE(
true);
778 ropl.SetPrintLevel(mPrintLevel);
779 ropl.SetMinimizer(mMinimizerType.c_str());
780 if (mEnableDetOutput) ropl.EnableDetailedOutput();
784 if (testStatType == 4) profll.SetSigned(
true);
785 profll.SetMinimizer(mMinimizerType.c_str());
786 profll.SetPrintLevel(mPrintLevel);
787 if (mEnableDetOutput) profll.EnableDetailedOutput();
789 profll.SetReuseNLL(mOptimize);
790 slrts.SetReuseNLL(mOptimize);
791 ropl.SetReuseNLL(mOptimize);
794 profll.SetStrategy(0);
799 if (mMaxPoi > 0) poi->
setMax(mMaxPoi);
804 AsymptoticCalculator::SetPrintLevel(mPrintLevel);
815 Error(
"StandardHypoTestInvDemo",
"Invalid - calculator type = %d supported values are only :\n\t\t\t 0 (Frequentist) , 1 (Hybrid) , 2 (Asymptotic) ",type);
821 if (testStatType == 0) testStat = &slrts;
822 if (testStatType == 1 || testStatType == 11) testStat = &ropl;
823 if (testStatType == 2 || testStatType == 3 || testStatType == 4) testStat = &profll;
824 if (testStatType == 5) testStat = &maxll;
825 if (testStatType == 6) testStat = &nevtts;
828 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);
834 if (toymcs && (type == 0 || type == 1) ) {
837 if (useNumberCounting)
Warning(
"StandardHypoTestInvDemo",
"Pdf is extended: but number counting flag is set: ignore it ");
841 if (!useNumberCounting ) {
843 Info(
"StandardHypoTestInvDemo",
"Pdf is not extended: number of events to generate taken from observed data set is %d",nEvents);
847 Info(
"StandardHypoTestInvDemo",
"using a number counting pdf");
855 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());
862 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() );
879 hhc->
SetToys(ntoys,ntoys/mNToysRatio);
891 ToyMCSampler::SetAlwaysUseMultiGen(
false);
894 if (nuisPriorName) nuisPdf = w->
pdf(nuisPriorName);
897 Info(
"StandardHypoTestInvDemo",
"No nuisance pdf given for the HybridCalculator - try to deduce pdf from the model");
906 Info(
"StandardHypoTestInvDemo",
"No nuisance pdf given - try to use %s that is defined as a prior pdf in the B model",nuisPdf->
GetName());
909 Error(
"StandardHypoTestInvDemo",
"Cannot run Hybrid calculator because no prior on the nuisance parameter is specified or can be derived");
914 Info(
"StandardHypoTestInvDemo",
"Using as nuisance Pdf ... " );
920 Warning(
"StandardHypoTestInvDemo",
"Prior nuisance does not depend on nuisance parameters. They will be smeared in their full range");
930 else if (type == 2 || type == 3) {
932 if (testStatType != 2 && testStatType != 3)
933 Warning(
"StandardHypoTestInvDemo",
"Only the PL test statistic can be used with AsymptoticCalculator - use by default a two-sided PL");
935 else if (type == 0 ) {
940 else if (type == 1 ) {
952 calc.SetConfidenceLevel(optHTInv.confLevel);
956 calc.SetVerbose(
true);
966 if (poimin > poimax) {
968 poimin = int(poihat);
969 poimax = int(poihat + 4 * poi->
getError());
971 std::cout <<
"Doing a fixed scan in interval : " << poimin <<
" , " << poimax << std::endl;
972 calc.SetFixedScan(npoints,poimin,poimax);
976 std::cout <<
"Doing an automatic scan in interval : " << poi->
getMin() <<
" , " << poi->
getMax() << std::endl;
981 std::cout <<
"Time to perform limit scan \n";
986 std::cout <<
"\n***************************************************************\n";
987 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";
997 if (mRebuildParamValues != 0) {
999 *allParams = initialParameters;
1001 if (mRebuildParamValues == 0 || mRebuildParamValues == 1 ) {
1010 if (mRebuildParamValues == 0 ) {
1018 std::cout <<
"rebuild using fitted parameter value for B-model snapshot" << std::endl;
1019 constrainParams.
Print(
"v");
1024 std::cout <<
"StandardHypoTestInvDemo: Initial parameters used for rebuilding: ";
1028 calc.SetCloseProof(1);
1031 std::cout <<
"Time to rebuild distributions " << std::endl;
1035 std::cout <<
"Expected limits after rebuild distribution " << std::endl;
1036 std::cout <<
"expected upper limit (median of limit distribution) " << limDist->
InverseCDF(0.5) << std::endl;
1044 limPlot.AddSamplingDistribution(limDist);
1045 limPlot.GetTH1F()->SetStats(
true);
1046 limPlot.SetLineColor(
kBlue);
1047 new TCanvas(
"limPlot",
"Upper Limit Distribution");
1052 TFile * fileOut =
new TFile(
"RULDist.root",
"RECREATE");
1060 r = calc.GetInterval();
1064 std::cout <<
"ERROR : failed to re-build distributions " << std::endl;
1072 void ReadResult(
const char * fileName,
const char * resultName=
"",
bool useCLs=
true) {
1075 StandardHypoTestInvDemo(fileName, resultName,
"",
"",
"",0,0,useCLs);
1081 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 doFit(int n, const char *fitter)
void LoadSnapshot() const
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 correspnding 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.
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)
This class implements the Hypothesis test calculation using an hybrid (frequentist/bayesian) procedur...
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 int...
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 rought 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)
Hypothesis Test Calculator using a full frequentist procedure for sampling the test statistic distrib...
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.
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)
int main(int argc, char **argv)
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...