{
"cells": [
{
"cell_type": "markdown",
"id": "5f920511",
"metadata": {},
"source": [
"# TwoHistoFit2D\n",
"Example to fit two histograms at the same time.\n",
"\n",
"\n",
"\n",
"\n",
"**Author:** Rene Brun \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:25 PM."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "4761c675",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:21.176479Z",
"iopub.status.busy": "2026-05-19T20:25:21.176340Z",
"iopub.status.idle": "2026-05-19T20:25:21.507050Z",
"shell.execute_reply": "2026-05-19T20:25:21.503513Z"
}
},
"outputs": [],
"source": [
"std::vector > coords;\n",
"std::vector values;\n",
"std::vector errors;\n",
"\n",
"TRandom3 rndm;"
]
},
{
"cell_type": "markdown",
"id": "c04ca417",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "99540d95",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:21.509064Z",
"iopub.status.busy": "2026-05-19T20:25:21.508938Z",
"iopub.status.idle": "2026-05-19T20:25:21.513168Z",
"shell.execute_reply": "2026-05-19T20:25:21.512574Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"\n",
"#include \"TH2D.h\"\n",
"#include \"TF2.h\"\n",
"#include \"TCanvas.h\"\n",
"#include \"TStyle.h\"\n",
"#include \"TRandom3.h\"\n",
"#include \"TVirtualFitter.h\"\n",
"#include \"TList.h\"\n",
"\n",
"#include \n",
"#include