88#include "RConfigure.h" 
  117      double likelihood =  std::exp(-nll);
 
  119      if (
fPrior) likelihood *= (*fPrior)(
x);
 
  123         ooccoutD(
nullptr,Eval) << 
"Likelihood evaluation ncalls = " << 
nCalls 
  124                                    << 
" x0 " << 
x[0] << 
"  nll = " << nll+
fOffset;
 
  126         ooccoutD(
nullptr,Eval) << 
" likelihood " << likelihood
 
  127                                    << 
" max Likelihood " << 
fMaxL << std::endl;
 
  130      if  (likelihood > 
fMaxL ) {
 
  132         if ( likelihood > 1.E10) {
 
  133            ooccoutW(
nullptr,Eval) << 
"LikelihoodFunction::()  WARNING - Huge likelihood value found for  parameters ";
 
  135               ooccoutW(
nullptr,Eval) << 
" x[" << i << 
" ] = " << 
x[i];
 
  136            ooccoutW(
nullptr,Eval) << 
"  nll = " << nll << 
" L = " << likelihood << std::endl;
 
 
  148      return (*
this)(&tmp);
 
 
 
  181      ooccoutD(
nullptr,NumIntegration) << 
"PosteriorCdfFunction::Compute integral of posterior in nuisance and poi. " 
  182                                           << 
" nllMinimum is " << 
nllMinimum << std::endl;
 
  185      for (
unsigned int i = 0; i < 
fXmin.size(); ++i) {
 
  190         ooccoutD(
nullptr,NumIntegration) << 
"PosteriorFunction::Integrate" << var.
GetName()
 
  191                                              << 
" in interval [ " <<  
fXmin[i] << 
" , " << 
fXmax[i] << 
" ] " << std::endl;
 
  201      if (
fError) 
ooccoutE(
nullptr,NumIntegration) << 
"PosteriorFunction::Error computing normalization - norm = " << 
fNorm << std::endl;
 
 
  242      ooccoutD(
nullptr,NumIntegration) << 
" cloning function .........." << std::endl;
 
 
  284      ooccoutD(
nullptr,NumIntegration) << 
"PosteriorCdfFunction: poi = [" << 
fXmin[0] << 
" , " 
  285                                           << 
fXmax[0] << 
"] integral =  " << 
cdf << 
" +/- " << error
 
  290         ooccoutE(
nullptr,NumIntegration) << 
"PosteriorFunction::Error computing integral - cdf = " 
  295      if (
cdf != 0 && error / 
cdf > 0.2) {
 
  296         oocoutW(
nullptr, NumIntegration)
 
  297            << 
"PosteriorCdfFunction: integration error  is larger than 20 %   x0 = " << 
fXmin[0] << 
" x = " << 
x 
  298            << 
" cdf(x) = " << 
cdf << 
" +/- " << error << std::endl;
 
  302         oocoutI(
nullptr,NumIntegration) << 
"PosteriorCdfFunction - integral of posterior = " 
  303                                             << 
cdf << 
" +/- " << error << std::endl;
 
  317         oocoutW(
nullptr,NumIntegration) << 
"PosteriorCdfFunction: normalized cdf values is larger than 1" 
  318                                              << 
" x = " << 
x << 
" normcdf(x) = " << 
normcdf << 
" +/- " << error/
fNorm << std::endl;
 
 
 
  366      ooccoutD(
nullptr,NumIntegration) << 
"PosteriorFunction::Evaluate the posterior function by integrating the nuisances: " << std::endl;
 
  367      for (
unsigned int i = 0; i < 
fXmin.size(); ++i) {
 
  371         ooccoutD(
nullptr,NumIntegration) << 
"PosteriorFunction::Integrate " << var.
GetName()
 
  372                                              << 
" in interval [" <<  
fXmin[i] << 
" , " << 
fXmax[i] << 
" ] " << std::endl;
 
  374      if (
fXmin.size() == 1) { 
 
  382      else if (
fXmin.size() > 1) { 
 
 
  415      if (
fXmin.size() == 1) { 
 
  419      else if (
fXmin.size() > 1) { 
 
  428      ooccoutD(
nullptr,NumIntegration) << 
"PosteriorFunction:  POI value  =  " 
  429                                           << 
x << 
"\tf(x) =  " << 
f << 
" +/- " << error
 
  430                                           << 
"  norm-f(x) = " << 
f/
fNorm 
  433      if (
f != 0 && error / 
f > 0.2) {
 
  435            << 
"PosteriorFunction::DoEval - Error from integration in " << 
fXmin.size() << 
" Dim is larger than 20 % " 
  436            << 
"x = " << 
x << 
" p(x) = " << 
f << 
" +/- " << error << std::endl;
 
 
 
  480      ooccoutI(
nullptr,InputArguments) << 
"PosteriorFunctionFromToyMC::Evaluate the posterior function by randomizing the nuisances:  niter " << 
fNumIterations << std::endl;
 
  482      ooccoutI(
nullptr,InputArguments) << 
"PosteriorFunctionFromToyMC::Pdf used for randomizing the nuisance is " << 
fPdf->
GetName() << std::endl;
 
  488                                                 << 
" is not part of sampling pdf. " 
  489                                                 << 
"they will be treated as constant " << std::endl;
 
  494         ooccoutI(
nullptr,InputArguments) << 
"PosteriorFunctionFromToyMC::Generate nuisance toys only one time (for all POI points)" << std::endl;
 
 
  503         ooccoutE(
nullptr,InputArguments) << 
"PosteriorFunctionFromToyMC - failed to generate nuisance parameters" << std::endl;
 
 
  540         std::vector<double> 
p(
npar);
 
  541         for (
int i = 0; i < 
npar; ++i) {
 
  561         if( 
fval > std::numeric_limits<double>::max()  ) {
 
  562            ooccoutE(
nullptr,Eval) <<  
"BayesianCalculator::EvalPosteriorFunctionFromToy : " 
  563                        << 
"Likelihood evaluates to infinity " << std::endl;
 
  564            ooccoutE(
nullptr,Eval) <<  
"poi value =  " << 
x << std::endl;
 
  565            ooccoutE(
nullptr,Eval) <<  
"Nuisance  parameter values :  ";
 
  566            for (
int i = 0; i < 
npar; ++i)
 
  568            ooccoutE(
nullptr,Eval) <<  
" - return 0   " << std::endl;
 
  574            ooccoutE(
nullptr,Eval) <<  
"BayesianCalculator::EvalPosteriorFunctionFromToy : " 
  575                        << 
"Likelihood is a NaN " << std::endl;
 
  576            ooccoutE(
nullptr,Eval) <<  
"poi value =  " << 
x << std::endl;
 
  577            ooccoutE(
nullptr,Eval) <<  
"Nuisance  parameter values :  ";
 
  578            for (
int i = 0; i < 
npar; ++i)
 
  580            ooccoutE(
nullptr,Eval) <<  
" - return 0   " << std::endl;
 
  597      ooccoutD(
nullptr,NumIntegration) << 
"PosteriorFunctionFromToyMC:  POI value  =  " 
  598                                           << 
x << 
"\tp(x) =  " << val << 
" +/- " << 
fError << std::endl;
 
  601      if (val != 0 && 
fError/val > 0.2 ) {
 
  602         ooccoutW(
nullptr,NumIntegration) << 
"PosteriorFunctionFromToyMC::DoEval" 
  603                                              << 
" - Error in estimating posterior is larger than 20% ! " 
  604                                              << 
"x = " << 
x << 
" p(x) = " << val << 
" +/- " << 
fError << std::endl;
 
 
 
  635   fNuisancePdf(nullptr),
 
  636   fProductPdf (nullptr), fLikelihood (nullptr), fIntegratedLikelihood (nullptr), fPosteriorPdf(nullptr),
 
  637   fPosteriorFunction(nullptr), fApproxPosterior(nullptr),
 
  638   fLower(0), fUpper(0),
 
  640   fSize(0.05), fLeftSideFraction(0.5),
 
  641   fBrfPrecision(0.00005),
 
  644   fValidInterval(
false)
 
 
  663   fNuisancePdf(nullptr),
 
  664   fProductPdf (nullptr), fLikelihood (nullptr), fIntegratedLikelihood (nullptr), fPosteriorPdf(nullptr),
 
  665   fPosteriorFunction(nullptr), fApproxPosterior(nullptr),
 
  666   fLower(0), fUpper(0),
 
  668   fSize(0.05), fLeftSideFraction(0.5),
 
  669   fBrfPrecision(0.00005),
 
  672   fValidInterval(
false)
 
 
  687   fPdf(model.GetPdf()),
 
  688   fPriorPdf( model.GetPriorPdf()),
 
  689   fNuisancePdf(nullptr),
 
  690   fProductPdf (nullptr), fLikelihood (nullptr), fIntegratedLikelihood (nullptr), fPosteriorPdf(nullptr),
 
  691   fPosteriorFunction(nullptr), fApproxPosterior(nullptr),
 
  692   fLower(0), fUpper(0),
 
  694   fSize(0.05), fLeftSideFraction(0.5),
 
  695   fBrfPrecision(0.00005),
 
  698   fValidInterval(
false)
 
 
  776      coutE(InputArguments) << 
"BayesianCalculator::GetPosteriorPdf - missing pdf model" << std::endl;
 
  780      coutE(InputArguments) << 
"BayesianCalculator::GetPosteriorPdf - missing parameter of interest" << std::endl;
 
  784      coutE(InputArguments) << 
"BayesianCalculator::GetPosteriorPdf - current implementation works only on 1D intervals" << std::endl;
 
  800   ccoutD(Eval) <<  
"BayesianCalculator::GetPosteriorFunction : " 
  802                << 
" neglogLikelihood = " << 
fLogLike->getVal() << std::endl;
 
  809   if ( 
nllVal > std::numeric_limits<double>::max() ) {
 
  810      coutE(Eval) <<  
"BayesianCalculator::GetPosteriorFunction : " 
  811                  << 
" Negative log likelihood evaluates to infinity " << std::endl
 
  812                  << 
" Non-const Parameter values : ";
 
  814      for (std::size_t i = 0; i < 
p.size(); ++i) {
 
  816         if (
v!=
nullptr) 
ccoutE(Eval) << 
v->
GetName() << 
" = " << 
v->getVal() << 
"   ";
 
  818      ccoutE(Eval) << std::endl;
 
  819      ccoutE(Eval) << 
"--  Perform a full likelihood fit of the model before or set more reasonable parameter values" 
  821      coutE(Eval) << 
"BayesianCalculator::GetPosteriorFunction : " << 
" cannot compute posterior function "  << std::endl;
 
  841   coutI(Eval) <<  
"BayesianCalculator::GetPosteriorFunction : " 
  842               << 
" nll value " <<  
nllVal << 
" poi value = " << poi->
getVal() << std::endl;
 
  847   bool ret  = 
minim.Minimize(100,1.E-3,1.E-3);
 
  851   coutI(Eval) << 
"BayesianCalculator::GetPosteriorFunction : minimum of NLL vs POI for POI =  " 
  859      ccoutD(Eval) << 
"BayesianCalculator::GetPosteriorFunction : use ROOFIT integration  " 
  922         ccoutI(Eval) << 
"BayesianCalculator::GetPosteriorFunction : no nuisance pdf is provided, try using global pdf (this will be slower)" 
  952                  << 
" errors reported in evaluating log-likelihood function " << std::endl;
 
 
  970   if (!
plike) 
return nullptr;
 
 
 1025   if (!
plot) 
return nullptr;
 
 1033   plot->GetYaxis()->SetTitle(
"posterior function");
 
 
 1098      coutW(Eval) << 
"BayesianCalculator::GetInterval - recomputing interval for the same CL and same model" << std::endl;
 
 1102      coutE(Eval) << 
"BayesianCalculator::GetInterval - no parameter of interest is set " << std::endl;
 
 1141            coutW(Eval) << 
"BayesianCalculator::GetInterval - computing integral from cdf failed - do a scan in " 
 1152                  << 
" errors reported in evaluating log-likelihood function " << std::endl;
 
 1160      coutE(Eval) << 
"BayesianCalculator::GetInterval - cannot compute a valid interval - return a dummy [1,0] interval" 
 1164      coutI(Eval) << 
"BayesianCalculator::GetInterval - found a valid interval : [" << 
fLower << 
" , " 
 1165                << 
fUpper << 
" ]" << std::endl;
 
 1170   interval->SetTitle(
"SimpleInterval from BayesianCalculator");
 
 
 1186   return h->GetBinCenter(
h->GetMaximumBin() );
 
 
 1195   coutI(Eval) <<  
"BayesianCalculator: Compute interval using RooFit:  posteriorPdf + createCdf + RooBrentRootFinder " << std::endl;
 
 1230      coutE(Eval) << 
"BayesianCalculator::GetInterval " 
 1231                  << 
"Error returned from Root finder, estimated interval is not fully correct" << std::endl;
 
 
 1246   coutI(InputArguments) <<  
"BayesianCalculator:GetInterval Compute the interval from the posterior cdf " << std::endl;
 
 1251      coutE(InputArguments) <<  
"BayesianCalculator::GetInterval() cannot make posterior Function " << std::endl;
 
 1265   if( 
cdf.HasError() ) {
 
 1266      coutE(Eval) <<  
"BayesianCalculator: Numerical error computing CDF integral - try a different method " << std::endl;
 
 1274   ccoutD(Eval) << 
"BayesianCalculator::GetInterval - finding roots of posterior using RF " << 
rf.Name()
 
 1279      ccoutD(NumIntegration) << 
"Integrating posterior to get cdf and search lower limit at p =" << 
lowerCutOff << std::endl;
 
 1281      if( 
cdf.HasError() )
 
 1282         coutW(Eval) <<  
"BayesianCalculator: Numerical error integrating the  CDF   " << std::endl;
 
 1284         coutE(NumIntegration) << 
"BayesianCalculator::GetInterval - Error from root finder when searching lower limit !" << std::endl;
 
 1294      ccoutD(NumIntegration) << 
"Integrating posterior to get cdf and search upper interval limit at p =" << 
upperCutOff << std::endl;
 
 1296      if( 
cdf.HasError() )
 
 1297         coutW(Eval) <<  
"BayesianCalculator: Numerical error integrating the  CDF   " << std::endl;
 
 1299         coutE(NumIntegration) << 
"BayesianCalculator::GetInterval - Error from root finder when searching upper limit !" << std::endl;
 
 
 1338   coutI(Eval) << 
"BayesianCalculator - scan posterior function in nbins = " << tmp->GetNpx() << std::endl;
 
 
 1365   ccoutD(Eval) <<  
"BayesianCalculator: Compute interval from the approximate posterior " << std::endl;
 
 1371   double limits[2] = {0,0};
 
 
 1385   coutI(Eval) << 
"BayesianCalculator - computing shortest interval with CL = " << 1.-
fSize << std::endl;
 
 1398   std::vector<int> 
index(
n);
 
 1408   for (
int i = 0; i < 
n; ++i)  {
 
 1410      double p = bins[ idx] / 
norm;
 
 1424   ccoutD(Eval) << 
"BayesianCalculator::ComputeShortestInterval - actual interval CL = " 
 1426                << 
" limits are [ " << 
lower << 
" , " << 
" upper ] " << std::endl;
 
 1434         coutW(Eval) << 
"BayesianCalculator::ComputeShortestInterval - actual interval CL = " << 
actualCL 
 1435                     << 
" differs more than 10% from desired CL value - must increase nbins " << 
n 
 1436                     << 
" to an higher value " << std::endl;
 
 1440      coutE(Eval) << 
"BayesianCalculator::ComputeShortestInterval " << 
n << 
" bins are not sufficient " << std::endl;
 
 
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
 
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
winID h TVirtualViewer3D TVirtualGLPainter p
 
winID h TVirtualViewer3D TVirtualGLPainter char TVirtualGLPainter plot
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
 
User class for performing function minimization.
 
Functor1D class for one-dimensional functions.
 
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
 
Numerical multi dimensional integration options.
 
void Print(std::ostream &os=std::cout) const
print all the options
 
void SetNCalls(unsigned int calls)
set maximum number of function calls
 
User class for performing multidimensional integration.
 
double Integral(const double *xmin, const double *xmax)
evaluate the integral with the previously given function between xmin[] and xmax[]
 
void SetFunction(Function &f, unsigned int dim)
set integration function using a generic function implementing the operator()(double *x) The dimensio...
 
static IntegrationMultiDim::Type GetType(const char *name)
static function to get the enumeration from a string
 
ROOT::Math::IntegratorMultiDimOptions Options() const
retrieve the options
 
double Error() const
return integration error
 
static IntegrationOneDim::Type GetType(const char *name)
static function to get the enumeration from a string
 
User Class to find the Root of one dimensional functions.
 
Common abstract base class for objects that represent a value and a "shape" in RooFit.
 
RooFit::OwningPtr< RooArgSet > getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
 
RooFit::OwningPtr< RooArgSet > getVariables(bool stripDisconnected=true) const
Return RooArgSet with all variables (tree leaf nodes of expression tree)
 
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
 
const char * GetName() const override
Returns name of object.
 
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
 
Storage_t::size_type size() const
 
RooAbsArg * first() const
 
Abstract base class for binned and unbinned datasets.
 
void resetNumCall() const
Reset function call counter.
 
Int_t numCall() const
Return number of function calls since last reset.
 
Abstract interface for all probability density functions.
 
RooFit::OwningPtr< RooAbsReal > createNLL(RooAbsData &data, CmdArgs_t const &... cmdArgs)
Construct representation of -log(L) of PDF with given dataset.
 
RooFit::OwningPtr< RooAbsReal > createCdf(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Create a cumulative distribution function of this p.d.f in terms of the observables listed in iset.
 
RooFit::OwningPtr< RooDataSet > generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={})
See RooAbsPdf::generate(const RooArgSet&,const RooCmdArg&,const RooCmdArg&,const RooCmdArg&,...
 
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
 
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
 
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
 
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
 
Abstract base class for objects that represent a real value and implements functionality common to al...
 
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
 
static Int_t numEvalErrors()
Return the number of logged evaluation errors since the last clearing.
 
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
 
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
 
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Create an object that represents the integral of the function over one or more observables listed in ...
 
RooArgList is a container object that can hold multiple RooAbsArg objects.
 
RooArgSet is a container object that can hold multiple RooAbsArg objects.
 
Implement the abstract 1-dimensional root finding interface using the Brent-Decker method.
 
RooCFunction1Binding is a templated implementation of class RooAbsReal that binds generic C(++) funct...
 
Lightweight interface adaptor that exports a RooAbsPdf as a functor.
 
Implementation of a probability density function that takes a RooArgList of servers and a C++ express...
 
Plot frame and a container for graphics objects within that frame.
 
Efficient implementation of a product of PDFs of the form.
 
Variable that can be changed from the outside.
 
void setVal(double value) override
Set value of variable to 'value'.
 
ROOT::Math::IGenFunction * fPosteriorFunction
function representing the posterior
 
RooAbsReal * fLikelihood
internal pointer to likelihood function
 
double fNLLMin
minimum value of Nll
 
int fNumIterations
number of iterations (when using ToyMC)
 
RooAbsPdf * GetPosteriorPdf() const
return posterior pdf (object is managed by the user)
 
RooAbsData * fData
data set
 
RooPlot * GetPosteriorPlot(bool norm=false, double precision=0.01) const
get the plot with option to get it normalized
 
int fNScanBins
number of bins to scan, if = -1 no scan is done (default)
 
void ClearAll() const
clear all cached pdf objects
 
void ComputeShortestInterval() const
compute the shortest interval from the histogram representing the posterior
 
RooAbsPdf * fNuisancePdf
nuisance pdf (needed when using nuisance sampling technique)
 
RooArgSet fConditionalObs
conditional observables
 
double fBrfPrecision
root finder precision
 
RooAbsReal * fIntegratedLikelihood
integrated likelihood function, i.e - unnormalized posterior function
 
void ApproximatePosterior() const
approximate posterior in nbins using a TF1 scan the poi values and evaluate the posterior at each poi...
 
double fSize
size used for getting the interval
 
RooArgSet fNuisanceParameters
nuisance parameters
 
double fLeftSideFraction
fraction of probability content on left side of interval
 
RooArgSet fGlobalObs
global observables
 
double GetMode() const
return the mode (most probable value of the posterior function)
 
RooAbsPdf * fPdf
model pdf (could contain the nuisance pdf as constraint term)
 
SimpleInterval * GetInterval() const override
compute the interval.
 
RooAbsPdf * fProductPdf
internal pointer to model * prior
 
TF1 * fApproxPosterior
TF1 representing the scanned posterior function.
 
RooAbsReal * GetPosteriorFunction() const
return posterior function (object is managed by the BayesianCalculator class)
 
void SetIntegrationType(const char *type)
set the integration type (possible type are) :
 
RooAbsPdf * fPosteriorPdf
normalized (on the poi) posterior pdf
 
double fUpper
upper interval bound
 
double fLower
computer lower interval bound
 
TH1 * GetPosteriorHistogram() const
return the approximate posterior as histogram (TH1 object). Note the object is managed by the Bayesia...
 
void ComputeIntervalFromApproxPosterior(double c1, double c2) const
compute the interval using the approximate posterior function
 
BayesianCalculator()
constructor
 
void SetModel(const ModelConfig &model) override
set the model via the ModelConfig
 
RooAbsPdf * fPriorPdf
prior pdf (typically for the POI)
 
std::unique_ptr< RooAbsReal > fLogLike
internal pointer to log likelihood function
 
double ConfidenceLevel() const override
Get the Confidence level for the test.
 
~BayesianCalculator() override
destructor
 
void ComputeIntervalUsingRooFit(double c1, double c2) const
internal function compute the interval using RooFit
 
void ComputeIntervalFromCdf(double c1, double c2) const
internal function compute the interval using Cdf integration
 
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
 
const RooArgSet * GetConditionalObservables() const
get RooArgSet for conditional observables (return nullptr if not existing)
 
const RooArgSet * GetGlobalObservables() const
get RooArgSet for global observables (return nullptr if not existing)
 
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return nullptr if not existing)
 
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return nullptr if not existing)
 
RooAbsPdf * GetPdf() const
get model PDF (return nullptr if pdf has not been specified or does not exist)
 
RooAbsPdf * GetPriorPdf() const
get parameters prior pdf (return nullptr if not existing)
 
std::shared_ptr< RooFunctor > fPriorFunc
 
PosteriorCdfFunction & operator=(const PosteriorCdfFunction &)
 
void SetOffset(double offset)
 
PosteriorCdfFunction(const PosteriorCdfFunction &rhs)
 
std::vector< double > fXmax
 
ROOT::Math::IntegratorMultiDim fIntegrator
 
PosteriorCdfFunction(RooAbsReal &nll, RooArgList &bindParams, RooAbsReal *prior=nullptr, const char *integType=nullptr, double nllMinimum=0)
 
double DoEval(double x) const override
implementation of the evaluation function. Must be implemented by derived classes
 
std::map< double, double > fNormCdfValues
 
std::vector< double > fXmin
 
ROOT::Math::IGenFunction * Clone() const override
Clone a function.
 
LikelihoodFunction fLikelihood
 
Posterior function obtaining sampling toy MC for the nuisance according to their pdf.
 
void GenerateToys() const
 
LikelihoodFunction fLikelihood
 
std::shared_ptr< RooFunctor > fPriorFunc
 
std::unique_ptr< RooDataSet > fGenParams
 
double DoEval(double x) const override
implementation of the evaluation function. Must be implemented by derived classes
 
PosteriorFunctionFromToyMC(RooAbsReal &nll, RooAbsPdf &pdf, RooRealVar &poi, RooArgList &nuisParams, RooAbsReal *prior=nullptr, double nllOffset=0, int niter=0, bool redoToys=true)
 
ROOT::Math::IGenFunction * Clone() const override
Clone a function.
 
LikelihoodFunction fLikelihood
 
PosteriorFunction(RooAbsReal &nll, RooRealVar &poi, RooArgList &nuisParams, RooAbsReal *prior=nullptr, const char *integType=nullptr, double norm=1.0, double nllOffset=0, int niter=0)
 
std::shared_ptr< RooFunctor > fPriorFunc
 
std::unique_ptr< ROOT::Math::IntegratorMultiDim > fIntegratorMultiDim
 
ROOT::Math::IGenFunction * Clone() const override
Clone a function.
 
std::vector< double > fXmin
 
std::vector< double > fXmax
 
double DoEval(double x) const override
implementation of the evaluation function. Must be implemented by derived classes
 
std::unique_ptr< ROOT::Math::Integrator > fIntegratorOneDim
 
SimpleInterval is a concrete implementation of the ConfInterval interface.
 
Use TF1, TF2, TF3 functions as RooFit objects.
 
const Float_t * GetArray() const
 
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
 
virtual TH1 * GetHistogram() const
Return a pointer to the histogram used to visualise the function Note that this histogram is managed ...
 
virtual Int_t GetQuantiles(Int_t n, Double_t *xp, const Double_t *p)
Compute Quantiles for density distribution of this function.
 
virtual Int_t GetNpx() const
 
1-D histogram with a double per channel (see TH1 documentation)
 
TH1 is the base class of all histogram classes in ROOT.
 
virtual Double_t GetSumOfWeights() const
Return the sum of weights across all bins excluding under/overflows.
 
virtual Double_t GetBinLowEdge(Int_t bin) const
Return bin lower edge for 1D histogram.
 
void SetName(const char *name) override
Change the name of this histogram.
 
const char * GetName() const override
Returns name of object.
 
void ToUpper()
Change string to upper case.
 
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
 
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
 
RooCmdArg Constrain(const RooArgSet ¶ms)
 
RooCmdArg GlobalObservables(Args_t &&... argsOrArgSet)
 
RooCmdArg ConditionalObservables(Args_t &&... argsOrArgSet)
Create a RooCmdArg to declare conditional observables.
 
RooCmdArg FillColor(TColorNumber color)
 
RooCmdArg Precision(double prec)
 
RooCmdArg DrawOption(const char *opt)
 
RooCmdArg Range(const char *rangeName, bool adjustNorm=true)
 
Namespace for new Math classes and functions.
 
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
 
Namespace for the RooStats classes.
 
void RemoveConstantParameters(RooArgSet *set)
 
const ROOT::Math::RootFinder::EType kRootFinderType
 
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Sort the n elements of the array a of generic templated type Element.
 
void SetPrior(RooFunctor *prior)
 
LikelihoodFunction(RooFunctor &f, RooFunctor *prior=nullptr, double offset=0)
 
double operator()(const double *x) const
 
static uint64_t sum(uint64_t i)