{
"cells": [
{
"cell_type": "markdown",
"id": "ac935bd2",
"metadata": {},
"source": [
"# pdf013_Vavilov\n",
"Test of the TMath::Vavilov distribution\n",
"\n",
"\n",
"\n",
"\n",
"**Author:** Anna Kreshuk \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:27 PM."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "8c63b426",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:27:03.354236Z",
"iopub.status.busy": "2026-05-19T20:27:03.354126Z",
"iopub.status.idle": "2026-05-19T20:27:03.823874Z",
"shell.execute_reply": "2026-05-19T20:27:03.823237Z"
}
},
"outputs": [],
"source": [
"Int_t n = 1000;\n",
"Double_t *xvalues = new Double_t[n];\n",
"Double_t *yvalues1 = new Double_t[n];\n",
"Double_t *yvalues2 = new Double_t[n];\n",
"Double_t *yvalues3 = new Double_t[n];\n",
"Double_t *yvalues4 = new Double_t[n];\n",
"\n",
"TRandom r;\n",
"for (Int_t i=0; iSetGrid();\n",
"c1->SetHighLightColor(19);\n",
"TGraph *gr1 = new TGraph(n, xvalues, yvalues1);\n",
"TGraph *gr2 = new TGraph(n, xvalues, yvalues2);\n",
"TGraph *gr3 = new TGraph(n, xvalues, yvalues3);\n",
"TGraph *gr4 = new TGraph(n, xvalues, yvalues4);\n",
"gr1->SetTitle(\"TMath::Vavilov density\");\n",
"gr1->Draw(\"ap\");\n",
"gr2->Draw(\"psame\");\n",
"gr2->SetMarkerColor(kRed);\n",
"gr3->Draw(\"psame\");\n",
"gr3->SetMarkerColor(kBlue);\n",
"gr4->Draw(\"psame\");\n",
"gr4->SetMarkerColor(kGreen);\n",
"\n",
"TF1 *f1 = new TF1(\"f1\", \"TMath::Vavilov(x, 0.3, 0.5)\", -2, 10);\n",
"\n",
"TH1F *hist = new TH1F(\"vavilov\", \"vavilov\", 100, -2, 10);\n",
"for (int i=0; i<10000; i++) {\n",
" hist->Fill(f1->GetRandom());\n",
"}\n",
"hist->Scale(1/1200.);\n",
"hist->Draw(\"same\");"
]
},
{
"cell_type": "markdown",
"id": "c173a788",
"metadata": {},
"source": [
"Draw all canvases "
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "faeb0e9f",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:27:03.826267Z",
"iopub.status.busy": "2026-05-19T20:27:03.826145Z",
"iopub.status.idle": "2026-05-19T20:27:04.033345Z",
"shell.execute_reply": "2026-05-19T20:27:04.032497Z"
}
},
"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
}