{
"cells": [
{
"cell_type": "markdown",
"id": "03a2fadf",
"metadata": {},
"source": [
"# testUnfold4\n",
"Test program for the class TUnfoldSys.\n",
"\n",
"Simple toy tests of the TUnfold package\n",
"\n",
"Pseudo data (5000 events) are unfolded into three components\n",
"The unfolding is performed once without and once with area constraint\n",
"\n",
"Ideally, the pulls may show that the result is biased if no constraint\n",
"is applied. This is expected because the true data errors are not known,\n",
"and instead the sqrt(data) errors are used.\n",
"\n",
"\n",
" **Version 17.6, in parallel to changes in TUnfold**\n",
"\n",
"#### History:\n",
" - Version 17.5, in parallel to changes in TUnfold\n",
" - Version 17.4, in parallel to changes in TUnfold\n",
" - Version 17.3, in parallel to changes in TUnfold\n",
" - Version 17.2, in parallel to changes in TUnfold\n",
" - Version 17.1, in parallel to changes in TUnfold\n",
" - Version 16.1, parallel to changes in TUnfold\n",
" - Version 16.0, parallel to changes in TUnfold\n",
" - Version 15, use L-curve scan to scan the average correlation\n",
"\n",
" This file is part of TUnfold.\n",
"\n",
" TUnfold is free software: you can redistribute it and/or modify\n",
" it under the terms of the GNU General Public License as published by\n",
" the Free Software Foundation, either version 3 of the License, or\n",
" (at your option) any later version.\n",
"\n",
" TUnfold is distributed in the hope that it will be useful,\n",
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n",
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n",
" GNU General Public License for more details.\n",
"\n",
" You should have received a copy of the GNU General Public License\n",
" along with TUnfold. If not, see .\n",
"\n",
"\n",
"\n",
"**Author:** Stefan Schmitt DESY, 14.10.2008 \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:11 PM."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "26217aa2",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:23.360537Z",
"iopub.status.busy": "2026-05-19T20:11:23.360416Z",
"iopub.status.idle": "2026-05-19T20:11:23.368346Z",
"shell.execute_reply": "2026-05-19T20:11:23.367863Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"#include \n",
"#include \n",
"#include \n",
"#include \n",
"#include \n",
"#include \n",
"#include \n",
"#include \n",
"\n",
"#include \"TUnfoldDensity.h\"\n",
"\n",
"using std::cout;\n",
"\n",
"TRandom *rnd=nullptr;"
]
},
{
"cell_type": "markdown",
"id": "01ce9aa5",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "d3100c2e",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:23.370180Z",
"iopub.status.busy": "2026-05-19T20:11:23.370058Z",
"iopub.status.idle": "2026-05-19T20:11:23.374935Z",
"shell.execute_reply": "2026-05-19T20:11:23.374371Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"Int_t GenerateGenEvent(Int_t nmax,const Double_t *probability) {\n",
" // choose an integer random number in the range [0,nmax]\n",
" // (the generator level bin)\n",
" // depending on the probabilities\n",
" // probability[0],probability[1],...probability[nmax-1]\n",
" Double_t f=rnd->Rndm();\n",
" Int_t r=0;\n",
" while((r=probability[r])) {\n",
" f -= probability[r];\n",
" r++;\n",
" }\n",
" return r;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "643a11a9",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "7f9a54c2",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:23.376568Z",
"iopub.status.busy": "2026-05-19T20:11:23.376448Z",
"iopub.status.idle": "2026-05-19T20:11:23.379581Z",
"shell.execute_reply": "2026-05-19T20:11:23.379164Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"Double_t GenerateRecEvent(const Double_t *shapeParm) {\n",
" // return a coordinate (the reconstructed variable)\n",
" // depending on shapeParm[]\n",
" // shapeParm[0]: fraction of events with Gaussian distribution\n",
" // shapeParm[1]: mean of Gaussian\n",
" // shapeParm[2]: width of Gaussian\n",
" // (1-shapeParm[0]): fraction of events with flat distribution\n",
" // shapeParm[3]: minimum of flat component\n",
" // shapeParm[4]: maximum of flat component\n",
" Double_t f=rnd->Rndm();\n",
" Double_t r;\n",
" if(fGaus(shapeParm[1],shapeParm[2]);\n",
" } else {\n",
" r=rnd->Rndm()*(shapeParm[4]-shapeParm[3])+shapeParm[3];\n",
" }\n",
" return r;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "8831df08",
"metadata": {},
"source": [
" Arguments are defined. "
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "6cb15ed4",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:23.381336Z",
"iopub.status.busy": "2026-05-19T20:11:23.381213Z",
"iopub.status.idle": "2026-05-19T20:11:23.710268Z",
"shell.execute_reply": "2026-05-19T20:11:23.709911Z"
}
},
"outputs": [],
"source": [
"bool printInfo = false;"
]
},
{
"cell_type": "markdown",
"id": "4c736d38",
"metadata": {},
"source": [
"switch off printing Info messages"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "487275a5",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:23.721883Z",
"iopub.status.busy": "2026-05-19T20:11:23.721752Z",
"iopub.status.idle": "2026-05-19T20:11:23.925044Z",
"shell.execute_reply": "2026-05-19T20:11:23.924684Z"
}
},
"outputs": [],
"source": [
" if (!printInfo) gErrorIgnoreLevel = kWarning;"
]
},
{
"cell_type": "markdown",
"id": "06555492",
"metadata": {},
"source": [
"switch on histogram errors"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "41843014",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:23.931418Z",
"iopub.status.busy": "2026-05-19T20:11:23.931292Z",
"iopub.status.idle": "2026-05-19T20:11:24.134782Z",
"shell.execute_reply": "2026-05-19T20:11:24.134126Z"
}
},
"outputs": [],
"source": [
"TH1::SetDefaultSumw2();"
]
},
{
"cell_type": "markdown",
"id": "edbd9eb2",
"metadata": {},
"source": [
"random generator"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "b20436b3",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:24.136739Z",
"iopub.status.busy": "2026-05-19T20:11:24.136581Z",
"iopub.status.idle": "2026-05-19T20:11:24.339848Z",
"shell.execute_reply": "2026-05-19T20:11:24.339430Z"
}
},
"outputs": [],
"source": [
"rnd=new TRandom3();"
]
},
{
"cell_type": "markdown",
"id": "0a438a29",
"metadata": {},
"source": [
"data and MC number of events"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "2a0a6eb5",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:24.341743Z",
"iopub.status.busy": "2026-05-19T20:11:24.341593Z",
"iopub.status.idle": "2026-05-19T20:11:24.544989Z",
"shell.execute_reply": "2026-05-19T20:11:24.544454Z"
}
},
"outputs": [],
"source": [
"Double_t const nData0= 500.0;\n",
"Double_t const nMC0 = 50000.0;"
]
},
{
"cell_type": "markdown",
"id": "b6f215a3",
"metadata": {},
"source": [
"Binning\n",
"reconstructed variable (0-10)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "41e030c0",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:24.546835Z",
"iopub.status.busy": "2026-05-19T20:11:24.546710Z",
"iopub.status.idle": "2026-05-19T20:11:24.750040Z",
"shell.execute_reply": "2026-05-19T20:11:24.749541Z"
}
},
"outputs": [],
"source": [
"Int_t const nDet=15;\n",
"Double_t const xminDet=0.0;\n",
"Double_t const xmaxDet=15.0;"
]
},
{
"cell_type": "markdown",
"id": "66624747",
"metadata": {},
"source": [
"signal binning (three shapes: 0,1,2)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "adb1d9ae",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:24.751761Z",
"iopub.status.busy": "2026-05-19T20:11:24.751627Z",
"iopub.status.idle": "2026-05-19T20:11:24.955066Z",
"shell.execute_reply": "2026-05-19T20:11:24.954381Z"
}
},
"outputs": [],
"source": [
"Int_t const nGen=3;\n",
"Double_t const xminGen=-0.5;\n",
"Double_t const xmaxGen= 2.5;"
]
},
{
"cell_type": "markdown",
"id": "fb2c8d68",
"metadata": {},
"source": [
"parameters\n",
"fraction of events per signal shape"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "bdcd0f87",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:24.968844Z",
"iopub.status.busy": "2026-05-19T20:11:24.968684Z",
"iopub.status.idle": "2026-05-19T20:11:25.180427Z",
"shell.execute_reply": "2026-05-19T20:11:25.177917Z"
}
},
"outputs": [],
"source": [
"static const Double_t genFrac[]={0.3,0.6,0.1};"
]
},
{
"cell_type": "markdown",
"id": "9a5706c1",
"metadata": {},
"source": [
"signal shapes"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "e07963b7",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:25.182124Z",
"iopub.status.busy": "2026-05-19T20:11:25.181965Z",
"iopub.status.idle": "2026-05-19T20:11:25.385721Z",
"shell.execute_reply": "2026-05-19T20:11:25.384703Z"
}
},
"outputs": [],
"source": [
"static const Double_t genShape[][5]=\n",
" {{1.0,2.0,1.5,0.,15.},\n",
" {1.0,7.0,2.5,0.,15.},\n",
" {0.0,0.0,0.0,0.,15.}};"
]
},
{
"cell_type": "markdown",
"id": "1422eb2f",
"metadata": {},
"source": [
"define DATA histograms\n",
"observed data distribution"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "55e277db",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:25.387247Z",
"iopub.status.busy": "2026-05-19T20:11:25.387123Z",
"iopub.status.idle": "2026-05-19T20:11:25.590567Z",
"shell.execute_reply": "2026-05-19T20:11:25.590133Z"
}
},
"outputs": [],
"source": [
"TH1D *histDetDATA=new TH1D(\"Yrec\",\";DATA(Yrec)\",nDet,xminDet,xmaxDet);"
]
},
{
"cell_type": "markdown",
"id": "f1545c4c",
"metadata": {},
"source": [
"define MC histograms\n",
"matrix of migrations"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "b07a7e1c",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:25.612450Z",
"iopub.status.busy": "2026-05-19T20:11:25.612299Z",
"iopub.status.idle": "2026-05-19T20:11:25.814648Z",
"shell.execute_reply": "2026-05-19T20:11:25.813858Z"
}
},
"outputs": [],
"source": [
"TH2D *histGenDetMC=new TH2D(\"Yrec%Xgen\",\"MC(Xgen,Yrec)\",\n",
" nGen,xminGen,xmaxGen,nDet,xminDet,xmaxDet);\n",
"\n",
"TH1D *histUnfold=new TH1D(\"Xgen\",\";DATA(Xgen)\",nGen,xminGen,xmaxGen);\n",
"\n",
"TH1D **histPullNC=new TH1D* [nGen];\n",
"TH1D **histPullArea=new TH1D* [nGen];\n",
"for(int i=0;i\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"TUnfold version is V17.9\n",
"toy iteration: 0\n",
"toy iteration: 10\n",
"toy iteration: 20\n",
"toy iteration: 30\n",
"toy iteration: 40\n",
"toy iteration: 50\n",
"toy iteration: 60\n",
"toy iteration: 70\n",
"toy iteration: 80\n",
"toy iteration: 90\n",
"toy iteration: 100\n",
"toy iteration: 110\n",
"toy iteration: 120\n",
"toy iteration: 130\n",
"toy iteration: 140\n",
"toy iteration: 150\n",
"toy iteration: 160\n",
"toy iteration: 170\n",
"toy iteration: 180\n",
"toy iteration: 190\n",
"toy iteration: 200\n",
"toy iteration: 210\n",
"toy iteration: 220\n",
"toy iteration: 230\n",
"toy iteration: 240\n",
"toy iteration: 250\n",
"toy iteration: 260\n",
"toy iteration: 270\n",
"toy iteration: 280\n",
"toy iteration: 290\n",
"toy iteration: 300\n",
"toy iteration: 310\n",
"toy iteration: 320\n",
"toy iteration: 330\n",
"toy iteration: 340\n",
"toy iteration: 350\n",
"toy iteration: 360\n",
"toy iteration: 370\n",
"toy iteration: 380\n",
"toy iteration: 390\n",
"toy iteration: 400\n",
"toy iteration: 410\n",
"toy iteration: 420\n",
"toy iteration: 430\n",
"toy iteration: 440\n",
"toy iteration: 450\n",
"toy iteration: 460\n",
"toy iteration: 470\n",
"toy iteration: 480\n",
"toy iteration: 490\n",
"toy iteration: 500\n",
"toy iteration: 510\n",
"toy iteration: 520\n",
"toy iteration: 530\n",
"toy iteration: 540\n",
"toy iteration: 550\n",
"toy iteration: 560\n",
"toy iteration: 570\n",
"toy iteration: 580\n",
"toy iteration: 590\n",
"toy iteration: 600\n",
"toy iteration: 610\n",
"toy iteration: 620\n",
"toy iteration: 630\n",
"toy iteration: 640\n",
"toy iteration: 650\n",
"toy iteration: 660\n",
"toy iteration: 670\n",
"toy iteration: 680\n",
"toy iteration: 690\n",
"toy iteration: 700\n",
"toy iteration: 710\n",
"toy iteration: 720\n",
"toy iteration: 730\n",
"toy iteration: 740\n",
"toy iteration: 750\n",
"toy iteration: 760\n",
"toy iteration: 770\n",
"toy iteration: 780\n",
"toy iteration: 790\n",
"toy iteration: 800\n",
"toy iteration: 810\n",
"toy iteration: 820\n",
"toy iteration: 830\n",
"toy iteration: 840\n",
"toy iteration: 850\n",
"toy iteration: 860\n",
"toy iteration: 870\n",
"toy iteration: 880\n",
"toy iteration: 890\n",
"toy iteration: 900\n",
"toy iteration: 910\n",
"toy iteration: 920\n",
"toy iteration: 930\n",
"toy iteration: 940\n",
"toy iteration: 950\n",
"toy iteration: 960\n",
"toy iteration: 970\n",
"toy iteration: 980\n",
"toy iteration: 990\n",
"****************************************\n",
"Minimizer is Minuit2 / Migrad\n",
"Chi2 = 17.3145\n",
"NDf = 12\n",
"Edm = 7.81966e-06\n",
"NCalls = 52\n",
"Constant = 153.648 +/- 6.05711 \n",
"Mean = -0.121307 +/- 0.0338681 \n",
"Sigma = 1.0209 +/- 0.0243688 \t (limited)\n",
"****************************************\n",
"Minimizer is Minuit2 / Migrad\n",
"Chi2 = 8.19808\n",
"NDf = 12\n",
"Edm = 2.68037e-06\n",
"NCalls = 53\n",
"Constant = 149.692 +/- 5.79204 \n",
"Mean = -0.259587 +/- 0.0346952 \n",
"Sigma = 1.05667 +/- 0.0243581 \t (limited)\n",
"****************************************\n",
"Minimizer is Minuit2 / Migrad\n",
"Chi2 = 59.2962\n",
"NDf = 12\n",
"Edm = 3.6247e-07\n",
"NCalls = 61\n",
"Constant = 127.75 +/- 5.41128 \n",
"Mean = -0.482115 +/- 0.0490259 \n",
"Sigma = 1.09744 +/- 0.0308576 \t (limited)\n",
"****************************************\n",
"Minimizer is Minuit2 / Migrad\n",
"Chi2 = 24.0114\n",
"NDf = 12\n",
"Edm = 3.60094e-06\n",
"NCalls = 53\n",
"Constant = 147.382 +/- 5.80116 \n",
"Mean = 0.189905 +/- 0.0351528 \n",
"Sigma = 1.05774 +/- 0.0251621 \t (limited)\n",
"****************************************\n",
"Minimizer is Minuit2 / Migrad\n",
"Chi2 = 17.3474\n",
"NDf = 12\n",
"Edm = 7.55094e-06\n",
"NCalls = 53\n",
"Constant = 149.977 +/- 5.77475 \n",
"Mean = 0.201466 +/- 0.034281 \n",
"Sigma = 1.04379 +/- 0.0232952 \t (limited)\n",
"****************************************\n",
"Minimizer is Minuit2 / Migrad\n",
"Chi2 = 66.0535\n",
"NDf = 12\n",
"Edm = 1.27624e-06\n",
"NCalls = 61\n",
"Constant = 124.004 +/- 5.38123 \n",
"Mean = -0.412836 +/- 0.0498374 \n",
"Sigma = 1.12618 +/- 0.0336756 \t (limited)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n",
"Warning in : One input bin has zero error, 1/error set to 1.000000.\n"
]
}
],
"source": [
"cout<<\"TUnfold version is \"<Reset();\n",
" histGenDetMC->Reset();\n",
"\n",
" Int_t nData=rnd->Poisson(nData0);\n",
" for(Int_t i=0;iFill(yObs);\n",
" }\n",
"\n",
" Int_t nMC=rnd->Poisson(nMC0);\n",
" for(Int_t i=0;iFill(iGen,yObs);\n",
" }\n",
" /* for(Int_t ix=0;ix<=histGenDetMC->GetNbinsX()+1;ix++) {\n",
" for(Int_t iy=0;iy<=histGenDetMC->GetNbinsY()+1;iy++) {\n",
" cout<GetBinContent(ix,iy)<<\"\\n\";\n",
" }\n",
" } */\n",
" //========================\n",
" // unfolding\n",
"\n",
" TUnfoldSys unfold(histGenDetMC,TUnfold::kHistMapOutputHoriz,\n",
" TUnfold::kRegModeSize,TUnfold::kEConstraintNone);\n",
" // define the input vector (the measured data distribution)\n",
" unfold.SetInput(histDetDATA,0.0,1.0);\n",
"\n",
" // run the unfolding\n",
" unfold.ScanLcurve(50,0.,0.,nullptr,nullptr,nullptr);\n",
"\n",
" // fill pull distributions without constraint\n",
" unfold.GetOutput(histUnfold);\n",
"\n",
" for(int i=0;iFill((histUnfold->GetBinContent(i+1)-genFrac[i]*nData0)/\n",
" histUnfold->GetBinError(i+1));\n",
" }\n",
"\n",
" // repeat unfolding on the same data, now with Area constraint\n",
" unfold.SetConstraint(TUnfold::kEConstraintArea);\n",
"\n",
" // run the unfolding\n",
" unfold.ScanLcurve(50,0.,0.,nullptr,nullptr,nullptr);\n",
"\n",
" // fill pull distributions with constraint\n",
" unfold.GetOutput(histUnfold);\n",
"\n",
" for(int i=0;iFill((histUnfold->GetBinContent(i+1)-genFrac[i]*nData0)/\n",
" histUnfold->GetBinError(i+1));\n",
" }\n",
"\n",
"}\n",
"TCanvas output;\n",
"output.Divide(3,2);\n",
"\n",
"gStyle->SetOptFit(1111);\n",
"\n",
"for(int i=0;iFit(\"gaus\");\n",
" histPullNC[i]->Draw();\n",
"}\n",
"for(int i=0;iFit(\"gaus\");\n",
" histPullArea[i]->Draw();\n",
"}\n",
"output.SaveAs(\"testUnfold4.ps\");"
]
},
{
"cell_type": "markdown",
"id": "40644455",
"metadata": {},
"source": [
"Draw all canvases "
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "8f1a0d3a",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:11:30.961072Z",
"iopub.status.busy": "2026-05-19T20:11:30.960960Z",
"iopub.status.idle": "2026-05-19T20:11:31.165084Z",
"shell.execute_reply": "2026-05-19T20:11:31.164068Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"\n",
"
\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"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
}