{
"cells": [
{
"cell_type": "markdown",
"id": "7a82fbcc",
"metadata": {},
"source": [
"# StandardBayesianMCMCDemo\n",
"Standard demo of the Bayesian MCMC calculator\n",
"\n",
"This is a standard demo that can be used with any ROOT file\n",
"prepared in the standard way. You specify:\n",
" - name for input ROOT file\n",
" - name of workspace inside ROOT file that holds model and data\n",
" - name of ModelConfig that specifies details for calculator tools\n",
" - name of dataset\n",
"\n",
"With default parameters the macro will attempt to run the\n",
"standard hist2workspace example and read the ROOT file\n",
"that it produces.\n",
"\n",
"The actual heart of the demo is only about 10 lines long.\n",
"\n",
"The MCMCCalculator is a Bayesian tool that uses\n",
"the Metropolis-Hastings algorithm to efficiently integrate\n",
"in many dimensions. It is not as accurate as the BayesianCalculator\n",
"for simple problems, but it scales to much more complicated cases.\n",
"\n",
"\n",
"\n",
"\n",
"**Author:** Kyle Cranmer \n",
"This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, May 19, 2026 at 08:36 PM."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "59268691",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:15.486229Z",
"iopub.status.busy": "2026-05-19T20:36:15.486099Z",
"iopub.status.idle": "2026-05-19T20:36:15.534266Z",
"shell.execute_reply": "2026-05-19T20:36:15.529492Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"\n",
"#include \"TFile.h\"\n",
"#include \"TROOT.h\"\n",
"#include \"TCanvas.h\"\n",
"#include \"TMath.h\"\n",
"#include \"TSystem.h\"\n",
"#include \"RooWorkspace.h\"\n",
"#include \"RooAbsData.h\"\n",
"\n",
"#include \"RooStats/ModelConfig.h\"\n",
"#include \"RooStats/MCMCCalculator.h\"\n",
"#include \"RooStats/MCMCInterval.h\"\n",
"#include \"RooStats/MCMCIntervalPlot.h\"\n",
"#include \"RooStats/SequentialProposal.h\"\n",
"#include \"RooStats/ProposalHelper.h\"\n",
"#include \"RooStats/ProposalHelper.h\"\n",
"#include \"RooFitResult.h\"\n",
"\n",
"using namespace RooFit;\n",
"using namespace RooStats;\n",
"\n",
"struct BayesianMCMCOptions {\n",
"\n",
" double confLevel = 0.95;\n",
" int intervalType = 2; // type of interval (0 is shortest, 1 central, 2 upper limit)\n",
" double maxPOI = -999; // force different values of POI for doing the scan (default is given value)\n",
" double minPOI = -999;\n",
" int numIters = 100000; // number of iterations\n",
" int numBurnInSteps = 100; // number of burn in steps to be ignored\n",
"};\n",
"\n",
"BayesianMCMCOptions optMCMC;"
]
},
{
"cell_type": "markdown",
"id": "b0bc3f1e",
"metadata": {},
"source": [
" Arguments are defined. "
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "c9c81581",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:15.555515Z",
"iopub.status.busy": "2026-05-19T20:36:15.555371Z",
"iopub.status.idle": "2026-05-19T20:36:15.909285Z",
"shell.execute_reply": "2026-05-19T20:36:15.908913Z"
}
},
"outputs": [],
"source": [
"const char *infile = \"\";\n",
"const char *workspaceName = \"combined\";\n",
"const char *modelConfigName = \"ModelConfig\";\n",
"const char *dataName = \"obsData\";"
]
},
{
"cell_type": "markdown",
"id": "80f556c4",
"metadata": {},
"source": [
"-------------------------------------------------------\n",
"First part is just to access a user-defined file\n",
"or create the standard example file if it doesn't exist"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "b34ac8f7",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:15.923391Z",
"iopub.status.busy": "2026-05-19T20:36:15.923256Z",
"iopub.status.idle": "2026-05-19T20:36:16.136089Z",
"shell.execute_reply": "2026-05-19T20:36:16.135681Z"
}
},
"outputs": [],
"source": [
"const char *filename = \"\";\n",
"if (!strcmp(infile, \"\")) {\n",
" filename = \"results/example_combined_GaussExample_model.root\";\n",
" bool fileExist = !gSystem->AccessPathName(filename); // note opposite return code\n",
" // if file does not exists generate with histfactory\n",
" if (!fileExist) {\n",
" // Normally this would be run on the command line\n",
" cout << \"will run standard hist2workspace example\" << endl;\n",
" gROOT->ProcessLine(\".! prepareHistFactory .\");\n",
" gROOT->ProcessLine(\".! hist2workspace config/example.xml\");\n",
" cout << \"\\n\\n---------------------\" << endl;\n",
" cout << \"Done creating example input\" << endl;\n",
" cout << \"---------------------\\n\\n\" << endl;\n",
" }\n",
"\n",
"} else\n",
" filename = infile;"
]
},
{
"cell_type": "markdown",
"id": "21590670",
"metadata": {},
"source": [
"Try to open the file"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "b8a2f055",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:16.157108Z",
"iopub.status.busy": "2026-05-19T20:36:16.156967Z",
"iopub.status.idle": "2026-05-19T20:36:16.510125Z",
"shell.execute_reply": "2026-05-19T20:36:16.506282Z"
}
},
"outputs": [],
"source": [
"TFile *file = TFile::Open(filename);"
]
},
{
"cell_type": "markdown",
"id": "8e5fc4ec",
"metadata": {},
"source": [
"if input file was specified but not found, quit"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "3993f832",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:16.540644Z",
"iopub.status.busy": "2026-05-19T20:36:16.540455Z",
"iopub.status.idle": "2026-05-19T20:36:16.742902Z",
"shell.execute_reply": "2026-05-19T20:36:16.742451Z"
}
},
"outputs": [],
"source": [
"if (!file) {\n",
" cout << \"StandardRooStatsDemoMacro: Input file \" << filename << \" is not found\" << endl;\n",
" return;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "48ff7612",
"metadata": {},
"source": [
"-------------------------------------------------------\n",
"Tutorial starts here\n",
"-------------------------------------------------------"
]
},
{
"cell_type": "markdown",
"id": "6b97ae6f",
"metadata": {},
"source": [
"get the workspace out of the file"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "a51bdac0",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:16.764255Z",
"iopub.status.busy": "2026-05-19T20:36:16.764107Z",
"iopub.status.idle": "2026-05-19T20:36:17.148294Z",
"shell.execute_reply": "2026-05-19T20:36:17.147656Z"
}
},
"outputs": [],
"source": [
"RooWorkspace *w = (RooWorkspace *)file->Get(workspaceName);\n",
"if (!w) {\n",
" cout << \"workspace not found\" << endl;\n",
" return;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "0517b934",
"metadata": {},
"source": [
"get the modelConfig out of the file"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "f89f0381",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:17.157718Z",
"iopub.status.busy": "2026-05-19T20:36:17.157550Z",
"iopub.status.idle": "2026-05-19T20:36:17.384806Z",
"shell.execute_reply": "2026-05-19T20:36:17.384217Z"
}
},
"outputs": [],
"source": [
"ModelConfig *mc = (ModelConfig *)w->obj(modelConfigName);"
]
},
{
"cell_type": "markdown",
"id": "89dd840b",
"metadata": {},
"source": [
"get the modelConfig out of the file"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "ca18ffb0",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:17.394979Z",
"iopub.status.busy": "2026-05-19T20:36:17.394852Z",
"iopub.status.idle": "2026-05-19T20:36:17.606132Z",
"shell.execute_reply": "2026-05-19T20:36:17.605315Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"input_line_76:2:2: warning: 'data' shadows a declaration with the same name in the 'std' namespace; use '::data' to reference this declaration\n",
" RooAbsData *data = w->data(dataName);\n",
" ^\n"
]
}
],
"source": [
"RooAbsData *data = w->data(dataName);"
]
},
{
"cell_type": "markdown",
"id": "586103ef",
"metadata": {},
"source": [
"make sure ingredients are found"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "0fc0ccfc",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:17.607707Z",
"iopub.status.busy": "2026-05-19T20:36:17.607571Z",
"iopub.status.idle": "2026-05-19T20:36:17.811245Z",
"shell.execute_reply": "2026-05-19T20:36:17.810740Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"input_line_77:2:7: error: reference to 'data' is ambiguous\n",
" if (!data || !mc) {\n",
" ^\n",
"input_line_76:2:14: note: candidate found by name lookup is 'data'\n",
" RooAbsData *data = w->data(dataName);\n",
" ^\n",
"/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/range_access.h:344:5: note: candidate found by name lookup is 'std::data'\n",
" data(initializer_list<_Tp> __il) noexcept\n",
" ^\n",
"/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/range_access.h:312:5: note: candidate found by name lookup is 'std::data'\n",
" data(_Container& __cont) noexcept(noexcept(__cont.data()))\n",
" ^\n",
"/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/range_access.h:323:5: note: candidate found by name lookup is 'std::data'\n",
" data(const _Container& __cont) noexcept(noexcept(__cont.data()))\n",
" ^\n",
"/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/range_access.h:334:5: note: candidate found by name lookup is 'std::data'\n",
" data(_Tp (&__array)[_Nm]) noexcept\n",
" ^\n"
]
}
],
"source": [
"if (!data || !mc) {\n",
" w->Print();\n",
" cout << \"data or ModelConfig was not found\" << endl;\n",
" return;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "19afb59d",
"metadata": {},
"source": [
"Want an efficient proposal function\n",
"default is uniform."
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "d54ed71c",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:17.812947Z",
"iopub.status.busy": "2026-05-19T20:36:17.812822Z",
"iopub.status.idle": "2026-05-19T20:36:18.052841Z",
"shell.execute_reply": "2026-05-19T20:36:18.034422Z"
}
},
"outputs": [],
"source": [
"/*"
]
},
{
"cell_type": "markdown",
"id": "2c2b4ea2",
"metadata": {},
"source": [
"this one is based on the covariance matrix of fit"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "d9c5724e",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:18.055160Z",
"iopub.status.busy": "2026-05-19T20:36:18.055031Z",
"iopub.status.idle": "2026-05-19T20:36:18.264057Z",
"shell.execute_reply": "2026-05-19T20:36:18.263522Z"
}
},
"outputs": [],
"source": [
"RooFitResult* fit = mc->GetPdf()->fitTo(*data,Save());\n",
"ProposalHelper ph;\n",
"ph.SetVariables((RooArgSet&)fit->floatParsFinal());\n",
"ph.SetCovMatrix(fit->covarianceMatrix());\n",
"ph.SetUpdateProposalParameters(True); // auto-create mean vars and add mappings\n",
"ph.SetCacheSize(100);\n",
"ProposalFunction* pf = ph.GetProposalFunction();\n",
"*/"
]
},
{
"cell_type": "markdown",
"id": "fb7c62da",
"metadata": {},
"source": [
"this proposal function seems fairly robust"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "33d173d1",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:18.266162Z",
"iopub.status.busy": "2026-05-19T20:36:18.266051Z",
"iopub.status.idle": "2026-05-19T20:36:18.486260Z",
"shell.execute_reply": "2026-05-19T20:36:18.485657Z"
}
},
"outputs": [],
"source": [
"SequentialProposal sp(0.1);"
]
},
{
"cell_type": "markdown",
"id": "e6a21404",
"metadata": {},
"source": [
"-------------------------------------------------------\n",
"create and use the MCMCCalculator\n",
"to find and plot the 95% credible interval\n",
"on the parameter of interest as specified\n",
"in the model config"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "01766beb",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:18.488156Z",
"iopub.status.busy": "2026-05-19T20:36:18.488034Z",
"iopub.status.idle": "2026-05-19T20:36:18.695856Z",
"shell.execute_reply": "2026-05-19T20:36:18.694995Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"input_line_80:2:23: error: reference to 'data' is ambiguous\n",
" MCMCCalculator mcmc(*data, *mc);\n",
" ^\n",
"input_line_76:2:14: note: candidate found by name lookup is 'data'\n",
" RooAbsData *data = w->data(dataName);\n",
" ^\n",
"/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/range_access.h:344:5: note: candidate found by name lookup is 'std::data'\n",
" data(initializer_list<_Tp> __il) noexcept\n",
" ^\n",
"/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/range_access.h:312:5: note: candidate found by name lookup is 'std::data'\n",
" data(_Container& __cont) noexcept(noexcept(__cont.data()))\n",
" ^\n",
"/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/range_access.h:323:5: note: candidate found by name lookup is 'std::data'\n",
" data(const _Container& __cont) noexcept(noexcept(__cont.data()))\n",
" ^\n",
"/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/range_access.h:334:5: note: candidate found by name lookup is 'std::data'\n",
" data(_Tp (&__array)[_Nm]) noexcept\n",
" ^\n"
]
}
],
"source": [
"MCMCCalculator mcmc(*data, *mc);\n",
"mcmc.SetConfidenceLevel(optMCMC.confLevel); // 95% interval"
]
},
{
"cell_type": "markdown",
"id": "9f4dab8d",
"metadata": {},
"source": [
"mcmc.SetProposalFunction(*pf);"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "ed656e93",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:18.697181Z",
"iopub.status.busy": "2026-05-19T20:36:18.697066Z",
"iopub.status.idle": "2026-05-19T20:36:18.902861Z",
"shell.execute_reply": "2026-05-19T20:36:18.902480Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"input_line_82:2:3: error: use of undeclared identifier 'mcmc'\n",
" (mcmc.SetProposalFunction(((*(SequentialProposal*)0x7fdfe1834000))))\n",
" ^\n",
"Error in : Error evaluating expression (mcmc.SetProposalFunction(((*(SequentialProposal*)0x7fdfe1834000))))\n",
"Execution of your code was aborted.\n"
]
}
],
"source": [
"mcmc.SetProposalFunction(sp);\n",
"mcmc.SetNumIters(optMCMC.numIters); // Metropolis-Hastings algorithm iterations\n",
"mcmc.SetNumBurnInSteps(optMCMC.numBurnInSteps); // first N steps to be ignored as burn-in"
]
},
{
"cell_type": "markdown",
"id": "1f01abec",
"metadata": {},
"source": [
"default is the shortest interval."
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "a3d94f5e",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:18.912574Z",
"iopub.status.busy": "2026-05-19T20:36:18.912452Z",
"iopub.status.idle": "2026-05-19T20:36:19.122353Z",
"shell.execute_reply": "2026-05-19T20:36:19.121958Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"input_line_83:3:25: error: cannot take the address of an rvalue of type 'RooStats::MCMCInterval::IntervalType'\n",
" mcmc.SetIntervalType(MCMCInterval::kShortest); // for shortest interval (not really needed)\n",
" ^~~~~~~~~~~~~~~~~~~~~~~\n",
"Error while creating dynamic expression for:\n",
" mcmc.SetIntervalType(MCMCInterval::kShortest)\n"
]
}
],
"source": [
"if (optMCMC.intervalType == 0)\n",
" mcmc.SetIntervalType(MCMCInterval::kShortest); // for shortest interval (not really needed)\n",
"if (optMCMC.intervalType == 1)\n",
" mcmc.SetLeftSideTailFraction(0.5); // for central interval\n",
"if (optMCMC.intervalType == 2)\n",
" mcmc.SetLeftSideTailFraction(0.); // for upper limit\n",
"\n",
"RooRealVar *firstPOI = (RooRealVar *)mc->GetParametersOfInterest()->first();\n",
"if (optMCMC.minPOI != -999)\n",
" firstPOI->setMin(optMCMC.minPOI);\n",
"if (optMCMC.maxPOI != -999)\n",
" firstPOI->setMax(optMCMC.maxPOI);\n",
"\n",
"MCMCInterval *interval = mcmc.GetInterval();"
]
},
{
"cell_type": "markdown",
"id": "9ce6ee8f",
"metadata": {},
"source": [
"make a plot\n",
"TCanvas* c1 ="
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "ecba4d21",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:19.123836Z",
"iopub.status.busy": "2026-05-19T20:36:19.123709Z",
"iopub.status.idle": "2026-05-19T20:36:19.423022Z",
"shell.execute_reply": "2026-05-19T20:36:19.422357Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"input_line_84:7:1: warning: 'list' shadows a declaration with the same name in the 'std' namespace; use '::list' to reference this declaration\n",
"const RooArgSet *list = mc->GetNuisanceParameters();\n",
"^\n",
"[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { _ZN12__cling_N53216__cling_Un1Qu338EPv, _ZN5TMath8CeilNintEd, _ZN5TMath4NintIdEEiT_, cling_module_439_, _ZN7TObjectnwEm, cling_module_439_.18, _ZN12__cling_N53224__dynamic__cling_Un1Qu30E, $.cling-module-439.__inits.0, _ZN12__cling_N5324listE, cling_module_439_.20, _Z30__fd_init_order__cling_Un1Qu34v, cling_module_439_.21, cling_module_439_.19, _ZNKSt6vectorIP9RooAbsArgSaIS1_EE4sizeEv, _ZN12__cling_N5324plotE, _ZNK8RooStats11ModelConfig21GetNuisanceParametersEv, __vd_init_order__cling_Un1Qu35, _ZN12__cling_N5322c2E, _ZN13RooStringViewC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, _ZN13RooStringViewC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, cling_module_439_.17, __orc_init_func.cling-module-439, _ZNK16RooAbsCollection7getSizeEv, _ZNK5cling7runtime8internal15LifetimeHandler9getMemoryEv, _ZN12__cling_N5322c1E, _GLOBAL__sub_I_cling_module_439 }) }\n",
"IncrementalExecutor::executeFunction: symbol '_ZN5cling7runtime8internal15LifetimeHandlerC1EPNS1_15DynamicExprInfoEPN5clang11DeclContextEPKcPNS_11InterpreterE' unresolved while linking [cling interface function]!\n",
"You are probably missing the definition of cling::runtime::internal::LifetimeHandler::LifetimeHandler(cling::runtime::internal::DynamicExprInfo*, clang::DeclContext*, char const*, cling::Interpreter*)\n",
"Maybe you need to load the corresponding shared library?\n",
"IncrementalExecutor::executeFunction: symbol '_ZN5cling7runtime8internal15LifetimeHandlerD1Ev' unresolved while linking [cling interface function]!\n",
"You are probably missing the definition of cling::runtime::internal::LifetimeHandler::~LifetimeHandler()\n",
"Maybe you need to load the corresponding shared library?\n"
]
}
],
"source": [
"auto c1 = new TCanvas(\"IntervalPlot\");\n",
"MCMCIntervalPlot plot(*interval);\n",
"plot.Draw();\n",
"\n",
"TCanvas *c2 = new TCanvas(\"extraPlots\");\n",
"const RooArgSet *list = mc->GetNuisanceParameters();\n",
"if (list->getSize() > 1) {\n",
" double n = list->getSize();\n",
" int ny = TMath::CeilNint(sqrt(n));\n",
" int nx = TMath::CeilNint(double(n) / ny);\n",
" c2->Divide(nx, ny);\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "2cc1e099",
"metadata": {},
"source": [
"draw a scatter plot of chain results for poi vs each nuisance parameters"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "5d84e763",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:19.443263Z",
"iopub.status.busy": "2026-05-19T20:36:19.443122Z",
"iopub.status.idle": "2026-05-19T20:36:19.645612Z",
"shell.execute_reply": "2026-05-19T20:36:19.645005Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { __orc_init_func.cling-module-439 }) }\n",
"cling JIT session error: Failed to materialize symbols: { (main, { _ZN12__cling_N5324plotE }) }\n"
]
}
],
"source": [
"int iPad = 1; // iPad, that's funny\n",
"for (auto *nuis : static_range_cast(*mc->GetNuisanceParameters())) {\n",
" c2->cd(iPad++);\n",
" plot.DrawChainScatter(*firstPOI, *nuis);\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "4e6416a4",
"metadata": {},
"source": [
"print out the interval on the first Parameter of Interest"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "91b5f198",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:19.647078Z",
"iopub.status.busy": "2026-05-19T20:36:19.646958Z",
"iopub.status.idle": "2026-05-19T20:36:19.856256Z",
"shell.execute_reply": "2026-05-19T20:36:19.855677Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"cling JIT session error: Failed to materialize symbols: { (main, { _ZN12__cling_N5322c1E }) }\n"
]
}
],
"source": [
"cout << \"\\n>>>> RESULT : \" << optMCMC.confLevel * 100 << \"% interval on \" << firstPOI->GetName() << \" is : [\"\n",
" << interval->LowerLimit(*firstPOI) << \", \" << interval->UpperLimit(*firstPOI) << \"] \" << endl;\n",
"\n",
"gPad = c1;"
]
},
{
"cell_type": "markdown",
"id": "e13d4c11",
"metadata": {},
"source": [
"Draw all canvases "
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "1057fab2",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:36:19.858013Z",
"iopub.status.busy": "2026-05-19T20:36:19.857893Z",
"iopub.status.idle": "2026-05-19T20:36:20.090510Z",
"shell.execute_reply": "2026-05-19T20:36:20.089861Z"
}
},
"outputs": [],
"source": [
"%jsroot on\n",
"gROOT->GetListOfCanvases()->Draw()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "ROOT C++",
"language": "c++",
"name": "root"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".C",
"mimetype": " text/x-c++src",
"name": "c++"
}
},
"nbformat": 4,
"nbformat_minor": 5
}