61 using namespace RooFit;
62 using namespace RooStats;
107 class HypoTestInvTool{
111 ~HypoTestInvTool(){};
115 const char * modelSBName,
const char * modelBName,
116 const char * dataName,
117 int type,
int testStatType,
119 int npoints,
double poimin,
double poimax,
int ntoys,
120 bool useNumberCounting =
false,
121 const char * nuisPriorName = 0);
131 const char * fileNameBase = 0 );
133 void SetParameter(
const char * name,
const char * value);
134 void SetParameter(
const char * name,
bool value);
135 void SetParameter(
const char * name,
int value);
136 void SetParameter(
const char * name,
double value);
140 bool mPlotHypoTestResult;
143 bool mUseVectorStore;
144 bool mGenerateBinned;
148 bool mEnableDetOutput;
151 int mRebuildParamValues;
158 std::string mMassValue;
159 std::string mMinimizerType;
165 RooStats::HypoTestInvTool::HypoTestInvTool() : mPlotHypoTestResult(true),
168 mUseVectorStore(true),
169 mGenerateBinned(
false),
171 mEnableDetOutput(
false),
173 mReuseAltToys(
false),
176 mRebuildParamValues(0),
191 RooStats::HypoTestInvTool::SetParameter(
const char * name,
bool value){
196 std::string s_name(name);
198 if (s_name.find(
"PlotHypoTestResult") != std::string::npos) mPlotHypoTestResult = value;
199 if (s_name.find(
"WriteResult") != std::string::npos) mWriteResult = value;
200 if (s_name.find(
"Optimize") != std::string::npos) mOptimize = value;
201 if (s_name.find(
"UseVectorStore") != std::string::npos) mUseVectorStore = value;
202 if (s_name.find(
"GenerateBinned") != std::string::npos) mGenerateBinned = value;
203 if (s_name.find(
"UseProof") != std::string::npos) mUseProof = value;
204 if (s_name.find(
"EnableDetailedOutput") != std::string::npos) mEnableDetOutput = value;
205 if (s_name.find(
"Rebuild") != std::string::npos) mRebuild = value;
206 if (s_name.find(
"ReuseAltToys") != std::string::npos) mReuseAltToys = value;
214 RooStats::HypoTestInvTool::SetParameter(
const char * name,
int value){
219 std::string s_name(name);
221 if (s_name.find(
"NWorkers") != std::string::npos) mNWorkers = value;
222 if (s_name.find(
"NToyToRebuild") != std::string::npos) mNToyToRebuild = value;
223 if (s_name.find(
"RebuildParamValues") != std::string::npos) mRebuildParamValues = value;
224 if (s_name.find(
"PrintLevel") != std::string::npos) mPrintLevel = value;
225 if (s_name.find(
"InitialFit") != std::string::npos) mInitialFit = value;
226 if (s_name.find(
"RandomSeed") != std::string::npos) mRandomSeed = value;
227 if (s_name.find(
"AsimovBins") != std::string::npos) mAsimovBins = value;
235 RooStats::HypoTestInvTool::SetParameter(
const char * name,
double value){
240 std::string s_name(name);
242 if (s_name.find(
"NToysRatio") != std::string::npos) mNToysRatio = value;
243 if (s_name.find(
"MaxPOI") != std::string::npos) mMaxPoi = value;
251 RooStats::HypoTestInvTool::SetParameter(
const char * name,
const char * value){
256 std::string s_name(name);
258 if (s_name.find(
"MassValue") != std::string::npos) mMassValue.assign(value);
259 if (s_name.find(
"MinimizerType") != std::string::npos) mMinimizerType.assign(value);
260 if (s_name.find(
"ResultFileName") != std::string::npos) mResultFileName = value;
269 const char * wsName =
"combined",
270 const char * modelSBName =
"ModelConfig",
271 const char * modelBName =
"",
272 const char * dataName =
"obsData",
273 int calculatorType = 0,
274 int testStatType = 0,
280 bool useNumberCounting =
false,
281 const char * nuisPriorName = 0){
332 filename =
"results/example_combined_GaussExample_model.root";
337 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
341 cout <<
"will run standard hist2workspace example"<<endl;
342 gROOT->ProcessLine(
".! prepareHistFactory .");
343 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
344 cout <<
"\n\n---------------------"<<endl;
345 cout <<
"Done creating example input"<<endl;
346 cout <<
"---------------------\n\n"<<endl;
358 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
364 HypoTestInvTool calc;
369 calc.SetParameter(
"Optimize",
optimize);
373 calc.SetParameter(
"MaxPOI",
maxPOI);
374 calc.SetParameter(
"UseProof",
useProof);
376 calc.SetParameter(
"NWorkers",
nworkers);
377 calc.SetParameter(
"Rebuild",
rebuild);
381 calc.SetParameter(
"MassValue",
massValue.c_str());
394 std::cout << w <<
"\t" << filename << std::endl;
396 r = calc.RunInverter(w, modelSBName, modelBName,
397 dataName, calculatorType, testStatType, useCLs,
398 npoints, poimin, poimax,
399 ntoys, useNumberCounting, nuisPriorName );
401 std::cerr <<
"Error running the HypoTestInverter - Exit " << std::endl;
407 std::cout <<
"Reading an HypoTestInverterResult with name " << wsName <<
" from file " << filename << std::endl;
410 std::cerr <<
"File " << filename <<
" does not contain a workspace or an HypoTestInverterResult - Exit "
417 calc.AnalyzeResult( r, calculatorType, testStatType, useCLs, npoints,
infile );
430 const char * fileNameBase ){
435 double lowerLimit = 0;
437 #if defined ROOT_SVN_VERSION && ROOT_SVN_VERSION >= 44126
452 if (lowerLimit < upperLimit*(1.- 1.
E-4) && lowerLimit != 0)
453 std::cout <<
"The computed lower limit is: " << lowerLimit <<
" +/- " << llError << std::endl;
454 std::cout <<
"The computed upper limit is: " << upperLimit <<
" +/- " << ulError << std::endl;
458 std::cout <<
"Expected upper limits, using the B (alternate) model : " << std::endl;
467 if (mEnableDetOutput) {
469 Info(
"StandardHypoTestInvDemo",
"detailed output will be written in output result file");
474 if (r !=
NULL && mWriteResult) {
477 const char * calcType = (calculatorType == 0) ?
"Freq" : (calculatorType == 1) ?
"Hybr" :
"Asym";
478 const char * limitType = (useCLs) ?
"CLs" :
"Cls+b";
479 const char * scanType = (npoints < 0) ?
"auto" :
"grid";
480 if (mResultFileName.IsNull()) {
481 mResultFileName =
TString::Format(
"%s_%s_%s_ts%d_",calcType,limitType,scanType,testStatType);
483 if (mMassValue.size()>0) {
484 mResultFileName += mMassValue.c_str();
485 mResultFileName +=
"_";
490 mResultFileName +=
name;
494 TString uldistFile =
"RULDist.root";
499 if (fileULDist) ulDist= fileULDist->Get(
"RULDist");
503 TFile * fileOut =
new TFile(mResultFileName,
"RECREATE");
505 if (ulDist) ulDist->
Write();
506 Info(
"StandardHypoTestInvDemo",
"HypoTestInverterResult has been written in the file %s",mResultFileName.Data());
513 std::string typeName =
"";
514 if (calculatorType == 0 )
515 typeName =
"Frequentist";
516 if (calculatorType == 1 )
518 else if (calculatorType == 2 || calculatorType == 3) {
519 typeName =
"Asymptotic";
520 mPlotHypoTestResult =
false;
523 const char * resultName = r->
GetName();
529 TCanvas * c1 =
new TCanvas(c1Name);
532 plot->Draw(
"CLb 2CL");
542 if (mPlotHypoTestResult) {
543 TCanvas * c2 =
new TCanvas();
549 for (
int i=0; i<nEntries; i++) {
550 if (nEntries > 1) c2->cd(i+1);
564 RooStats::HypoTestInvTool::RunInverter(
RooWorkspace * w,
565 const char * modelSBName,
const char * modelBName,
566 const char * dataName,
int type,
int testStatType,
567 bool useCLs,
int npoints,
double poimin,
double poimax,
569 bool useNumberCounting,
570 const char * nuisPriorName ){
572 std::cout <<
"Running HypoTestInverter on the workspace " << w->
GetName() << std::endl;
579 Error(
"StandardHypoTestDemo",
"Not existing data %s",dataName);
583 std::cout <<
"Using data set " << dataName << std::endl;
585 if (mUseVectorStore) {
597 Error(
"StandardHypoTestDemo",
"Not existing ModelConfig %s",modelSBName);
602 Error(
"StandardHypoTestDemo",
"Model %s has no pdf ",modelSBName);
606 Error(
"StandardHypoTestDemo",
"Model %s has no poi ",modelSBName);
610 Error(
"StandardHypoTestInvDemo",
"Model %s has no observables ",modelSBName);
614 Info(
"StandardHypoTestInvDemo",
"Model %s has no snapshot - make one using model poi",modelSBName);
622 if (nuisPar && nuisPar->
getSize() > 0) {
623 std::cout <<
"StandardHypoTestInvDemo" <<
" - Switch off all systematics by setting them constant to their initial values" << std::endl;
633 if (!bModel || bModel == sbModel) {
634 Info(
"StandardHypoTestInvDemo",
"The background model %s does not exist",modelBName);
635 Info(
"StandardHypoTestInvDemo",
"Copy it from ModelConfig %s and set POI to zero",modelSBName);
640 double oldval = var->
getVal();
647 Info(
"StandardHypoTestInvDemo",
"Model %s has no snapshot - make one using model poi and 0 values ",modelBName);
650 double oldval = var->
getVal();
656 Error(
"StandardHypoTestInvDemo",
"Model %s has no valid poi",modelBName);
667 if (hasNuisParam && !hasGlobalObs ) {
671 Warning(
"StandardHypoTestInvDemo",
"Model %s has nuisance parameters but no global observables associated",sbModel->
GetName());
672 Warning(
"StandardHypoTestInvDemo",
"\tThe effect of the nuisance parameters will not be treated correctly ");
680 allParams->
snapshot(initialParameters);
688 std::cout <<
"StandardHypoTestInvDemo : POI initial value: " << poi->
GetName() <<
" = " << poi->
getVal() << std::endl;
694 if (testStatType == 0 &&
initialFit == -1) doFit =
false;
695 if (type == 3 &&
initialFit == -1) doFit =
false;
702 Info(
"StandardHypoTestInvDemo",
"Using %s as minimizer for computing the test statistic",
711 Info(
"StandardHypoTestInvDemo",
" Doing a first fit to the observed data ");
718 if (fitres->
status() != 0) {
719 Warning(
"StandardHypoTestInvDemo",
"Fit to the model failed - try with strategy 1 and perform first an Hesse computation");
723 if (fitres->
status() != 0)
724 Warning(
"StandardHypoTestInvDemo",
" Fit still failed - continue anyway.....");
728 std::cout <<
"StandardHypoTestInvDemo - Best Fit value : " << poi->
GetName() <<
" = "
729 << poihat <<
" +/- " << poi->
getError() << std::endl;
730 std::cout <<
"Time for fitting : "; tw.
Print();
734 std::cout <<
"StandardHypoTestInvo: snapshot of S+B Model " << sbModel->
GetName()
735 <<
" is set to the best fit value" << std::endl;
740 if (testStatType == 0) {
742 Info(
"StandardHypoTestInvDemo",
"Using LEP test statistic - an initial fit is not done and the TS will use the nuisances at the model value");
744 Info(
"StandardHypoTestInvDemo",
"Using LEP test statistic - an initial fit has been done and the TS will use the nuisances at the best fit value");
755 if (sbModel->
GetSnapshot()) slrts.SetNullParameters(nullParams);
758 if (bModel->
GetSnapshot()) slrts.SetAltParameters(altParams);
759 if (mEnableDetOutput) slrts.EnableDetailedOutput();
765 if (testStatType == 11) ropl.SetSubtractMLE(
true);
766 ropl.SetPrintLevel(mPrintLevel);
768 if (mEnableDetOutput) ropl.EnableDetailedOutput();
772 if (testStatType == 4) profll.SetSigned(
true);
774 profll.SetPrintLevel(mPrintLevel);
775 if (mEnableDetOutput) profll.EnableDetailedOutput();
777 profll.SetReuseNLL(mOptimize);
778 slrts.SetReuseNLL(mOptimize);
779 ropl.SetReuseNLL(mOptimize);
782 profll.SetStrategy(0);
787 if (mMaxPoi > 0) poi->
setMax(mMaxPoi);
792 AsymptoticCalculator::SetPrintLevel(mPrintLevel);
803 Error(
"StandardHypoTestInvDemo",
"Invalid - calculator type = %d supported values are only :\n\t\t\t 0 (Frequentist) , 1 (Hybrid) , 2 (Asymptotic) ",type);
809 if (testStatType == 0) testStat = &slrts;
810 if (testStatType == 1 || testStatType == 11) testStat = &ropl;
811 if (testStatType == 2 || testStatType == 3 || testStatType == 4) testStat = &profll;
812 if (testStatType == 5) testStat = &maxll;
813 if (testStatType == 6) testStat = &nevtts;
816 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);
822 if (toymcs && (type == 0 || type == 1) ) {
825 if (useNumberCounting)
Warning(
"StandardHypoTestInvDemo",
"Pdf is extended: but number counting flag is set: ignore it ");
829 if (!useNumberCounting ) {
831 Info(
"StandardHypoTestInvDemo",
"Pdf is not extended: number of events to generate taken from observed data set is %d",nEvents);
835 Info(
"StandardHypoTestInvDemo",
"using a number counting pdf");
843 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());
850 Warning(
"StandardHypoTestInvDemo",
"generate binned is activated but the number of ovservable is %d. Too much memory could be needed for allocating all the bins",sbModel->
GetObservables()->
getSize() );
867 hhc->
SetToys(ntoys,ntoys/mNToysRatio);
879 ToyMCSampler::SetAlwaysUseMultiGen(
false);
882 if (nuisPriorName) nuisPdf = w->
pdf(nuisPriorName);
885 Info(
"StandardHypoTestInvDemo",
"No nuisance pdf given for the HybridCalculator - try to deduce pdf from the model");
894 Info(
"StandardHypoTestInvDemo",
"No nuisance pdf given - try to use %s that is defined as a prior pdf in the B model",nuisPdf->
GetName());
897 Error(
"StandardHypoTestInvDemo",
"Cannnot run Hybrid calculator because no prior on the nuisance parameter is specified or can be derived");
902 Info(
"StandardHypoTestInvDemo",
"Using as nuisance Pdf ... " );
908 Warning(
"StandardHypoTestInvDemo",
"Prior nuisance does not depend on nuisance parameters. They will be smeared in their full range");
918 else if (type == 2 || type == 3) {
920 if (testStatType != 2 && testStatType != 3)
921 Warning(
"StandardHypoTestInvDemo",
"Only the PL test statistic can be used with AsymptoticCalculator - use by default a two-sided PL");
923 else if (type == 0 || type == 1) {
939 calc.SetVerbose(
true);
949 if (poimin > poimax) {
951 poimin = int(poihat);
952 poimax = int(poihat + 4 * poi->
getError());
954 std::cout <<
"Doing a fixed scan in interval : " << poimin <<
" , " << poimax << std::endl;
955 calc.SetFixedScan(npoints,poimin,poimax);
959 std::cout <<
"Doing an automatic scan in interval : " << poi->
getMin() <<
" , " << poi->
getMax() << std::endl;
964 std::cout <<
"Time to perform limit scan \n";
969 std::cout <<
"\n***************************************************************\n";
970 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";
980 if (mRebuildParamValues != 0) {
982 *allParams = initialParameters;
984 if (mRebuildParamValues == 0 || mRebuildParamValues == 1 ) {
993 if (mRebuildParamValues == 0 ) {
1001 std::cout <<
"rebuild using fitted parameter value for B-model snapshot" << std::endl;
1002 constrainParams.
Print(
"v");
1007 std::cout <<
"StandardHypoTestInvDemo: Initial parameters used for rebuilding: ";
1011 calc.SetCloseProof(1);
1014 std::cout <<
"Time to rebuild distributions " << std::endl;
1018 std::cout <<
"Expected limits after rebuild distribution " << std::endl;
1019 std::cout <<
"expected upper limit (median of limit distribution) " << limDist->
InverseCDF(0.5) << std::endl;
1027 limPlot.AddSamplingDistribution(limDist);
1028 limPlot.GetTH1F()->SetStats(
true);
1029 limPlot.SetLineColor(
kBlue);
1030 new TCanvas(
"limPlot",
"Upper Limit Distribution");
1035 TFile * fileOut =
new TFile(
"RULDist.root",
"RECREATE");
1043 r = calc.GetInterval();
1047 std::cout <<
"ERROR : failed to re-build distributions " << std::endl;
1055 void ReadResult(
const char * fileName,
const char * resultName=
"",
bool useCLs=
true) {
virtual Double_t sumEntries() const =0
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
Ssiz_t Last(char c) const
Find last occurrence of a character c.
RooCmdArg Offset(Bool_t flag=kTRUE)
Holds configuration options for proof and proof-lite.
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
HypoTestInverter class for performing an hypothesis test inversion by scanning the hypothesis test re...
RooAbsPdf * MakeNuisancePdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name)
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
int ArraySize() const
number of entries in the results array
const RooArgSet * GetGlobalObservables() const
get RooArgSet for global observables (return NULL if not existing)
RooCmdArg PrintLevel(Int_t code)
bool enableDetailedOutput
void convertToVectorStore()
Convert tree-based storage to vector-based storage.
void SetOneSided(Bool_t flag=true)
virtual void SetName(const char *name)
Change (i.e.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Double_t InverseCDF(Double_t pvalue)
get the inverse of the Cumulative distribution function
bool IsTwoSided() const
query if two sided result
RooCmdArg Strategy(Int_t code)
static const char * filename()
virtual void SetNEventsPerToy(const Int_t nevents)
virtual Double_t getMin(const char *name=0) const
StreamConfig & getStream(Int_t id)
static void setDefaultStorageType(StorageType s)
void StandardHypoTestInvDemo(const char *infile=0, const char *wsName="combined", const char *modelSBName="ModelConfig", const char *modelBName="", const char *dataName="obsData", int calculatorType=0, int testStatType=0, bool useCLs=true, int npoints=6, double poimin=0, double poimax=5, int ntoys=1000, bool useNumberCounting=false, const char *nuisPriorName=0)
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 void SetSeed(UInt_t seed=0)
Set the random generator seed.
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
void setMax(const char *name, Double_t value)
Set maximum of name range to given value.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
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)
RooAbsArg * first() const
std::string minimizerType
virtual ModelConfig * Clone(const char *name="") const
clone
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 Print(Option_t *options=0) const
Print TNamed name and title.
TestStatSampler * GetTestStatSampler(void) const
double normal_cdf(double x, double sigma=1, double x0=0)
Cumulative distribution function of the normal (Gaussian) distribution (lower tail).
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
void LoadSnapshot() const
void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
void Info(const char *location, const char *msgfmt,...)
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
virtual Bool_t isWeighted() const
void ReadResult(const char *fileName, const char *resultName="", bool useCLs=true)
Double_t getVal(const RooArgSet *set=0) const
Double_t LowerLimit()
lower and upper bound of the confidence interval (to get upper/lower limits, multiply the size( = 1-c...
void Error(const char *location, const char *msgfmt,...)
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...
RooRealVar represents a fundamental (non-derived) real valued object.
static void SetDefaultStrategy(int strat)
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooCmdArg InitialHesse(Bool_t flag=kTRUE)
R__EXTERN TSystem * gSystem
static const std::string & DefaultMinimizerType()
RooCmdArg Minimizer(const char *type, const char *alg=0)
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
virtual Int_t numEntries() const
void SetProofConfig(ProofConfig *pc=NULL)
void PrintListContent(const RooArgList &l, std::ostream &os=std::cout)
virtual const char * GetName() const
Returns name of object.
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.
void Warning(const char *location, const char *msgfmt,...)
This class simply holds a sampling distribution of some test statistic.
TestStatistic that returns the ratio of profiled likelihoods.
void UseNLLOffset(bool on)
This class implements the Hypothesis test calculation using an hybrid (frequentist/bayesian) procedur...
const RooArgSet * GetObservables() const
get RooArgSet for observables (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...
Class to plot an HypoTestInverterResult, result of the HypoTestInverter calculator.
Bool_t canBeExtended() const
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)
const RooArgSet * GetSnapshot() const
get RooArgSet for parameters for a particular hypothesis (return NULL if not existing) ...
void SetToys(int toysNull, int toysAlt)
set number of toys
TestStatistic class that returns -log(L[null] / L[alt]) where L is the likelihood.
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
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 ...
virtual Double_t getMax(const char *name=0) const
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...
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 Print(Option_t *opts=0) const
Print contents of the workspace.
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)
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
void SetGenerateBinned(bool binned=true)
Double_t Sqrt(Double_t x)
virtual void SetGlobalObservables(const RooArgSet &set)
specify the global observables
RooAbsPdf * GetPriorPdf() const
get parameters prior pdf (return NULL if not existing)
static void SetDefaultMinimizer(const char *type, const char *algo=0)
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...
Hypothesis Test Calculator based on the asymptotic formulae for the profile likelihood ratio...
Int_t CeilNint(Double_t x)
virtual void ForcePriorNuisanceAlt(RooAbsPdf &priorNuisance)
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
RooCmdArg Constrain(const RooArgSet ¶ms)
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...
Double_t getError() const
NumEventsTestStat is a simple implementation of the TestStatistic interface used for simple number co...