{ "cells": [ { "cell_type": "markdown", "id": "4a88b06c", "metadata": {}, "source": [ "# file\n", "This macro displays the physical ROOT file structure\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:13 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "8453a17a", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:13:43.448586Z", "iopub.status.busy": "2026-05-19T20:13:43.448471Z", "iopub.status.idle": "2026-05-19T20:13:43.792442Z", "shell.execute_reply": "2026-05-19T20:13:43.791633Z" } }, "outputs": [], "source": [ "TCanvas *c1 = new TCanvas(\"c1\",\"ROOT File description\",200,10,700,550);\n", "\n", "c1->Range(0,-0.25,21,14);\n", "TPaveLabel *title = new TPaveLabel(5,12,15,13.7,c1->GetTitle());\n", "title->SetFillColor(16);\n", "title->Draw();" ] }, { "cell_type": "markdown", "id": "a315bcd1", "metadata": {}, "source": [ "horizontal file layout" ] }, { "cell_type": "code", "execution_count": 2, "id": "dce8b8a0", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:13:43.794402Z", "iopub.status.busy": "2026-05-19T20:13:43.794279Z", "iopub.status.idle": "2026-05-19T20:13:43.997773Z", "shell.execute_reply": "2026-05-19T20:13:43.997300Z" } }, "outputs": [], "source": [ "TPave *file = new TPave(1,8.5,20,11);\n", "file->SetFillColor(11);\n", "file->Draw();\n", "TPave *fileh = new TPave(1,8.5,2.5,11);\n", "fileh->SetFillColor(44);\n", "fileh->Draw();\n", "TPave *lrh = new TPave(2.5,8.5,3.3,11,1);\n", "lrh->SetFillColor(33);\n", "lrh->Draw();\n", "lrh->DrawPave(6.9,8.5,7.7,11,1);\n", "lrh->DrawPave(10.5,8.5,11.3,11,1);\n", "lrh->DrawPave(14.5,8.5,15.3,11,1);\n", "TLine *ldot = new TLine(1,8.5,0.5,6.5);\n", "ldot->SetLineStyle(kDashed);\n", "ldot->Draw();\n", "ldot->DrawLine(2.5, 8.5, 9.4, 6.5);\n", "ldot->DrawLine(10.5, 8.5, 10, 6.5);\n", "ldot->DrawLine(11.3, 8.5, 19.5, 6.5);\n", "TLine *line = new TLine(2.6,11,2.6,11.5);\n", "line->Draw();\n", "line->DrawLine(2.6,11.5,7,11.5);\n", "TArrow *arrow = new TArrow(7,11.5,7,11.1,0.01,\"|>\");\n", "arrow->SetFillStyle(1001);\n", "arrow->Draw();\n", "line->DrawLine( 7, 8.5, 7, 8.0);\n", "line->DrawLine( 7, 8.0, 10.6, 8);\n", "arrow->DrawArrow( 10.6,8, 10.6, 8.4,0.01,\"|>\");\n", "line->DrawLine( 10.6, 11, 10.6, 11.5);\n", "line->DrawLine( 10.6, 11.5, 14.6, 11.5);\n", "arrow->DrawArrow( 14.6,11.5, 14.6,11.1,0.01,\"|>\");\n", "line->DrawLine( 14.6, 8.5, 14.6, 8.0);\n", "line->DrawLine( 14.6, 8.0, 16, 8);\n", "ldot->DrawLine(16, 8, 19, 8);\n", "TText *vert = new TText(1.5,9.75,\"File\");\n", "vert->SetTextAlign(21);\n", "vert->SetTextAngle(90);\n", "vert->SetTextSize(0.025);\n", "vert->Draw();\n", "vert->DrawText(2.0, 9.75,\"Header\");\n", "vert->DrawText(2.9, 9.75,\"Logical Record\");\n", "vert->DrawText(3.2, 9.75,\"Header\");\n", "vert->DrawText(7.3, 9.75,\"Logical Record\");\n", "vert->DrawText(7.6, 9.75,\"Header\");\n", "vert->DrawText(10.9,9.75,\"Logical Record\");\n", "vert->DrawText(11.2,9.75,\"Header\");\n", "vert->DrawText(14.9,9.75,\"Logical Record\");\n", "vert->DrawText(15.2,9.75,\"Header\");\n", "TText *hori = new TText(4.75,10,\"Object\");\n", "hori->SetTextAlign(22);\n", "hori->SetTextSize(0.035);\n", "hori->Draw();\n", "hori->DrawText(4.75, 9.5,\"Data\");\n", "hori->DrawText(9.2, 10,\"Deleted\");\n", "hori->DrawText(9.2, 9.5,\"Object\");\n", "line->DrawLine( 6.9, 8.5, 10.5, 11);\n", "line->DrawLine( 6.9, 11, 10.5, 8.5);\n", "TText *tbig = new TText(17,9.75,\"............\");\n", "tbig->SetTextAlign(22);\n", "tbig->SetTextSize(0.03);\n", "tbig->Draw();\n", "tbig->DrawText(2.6, 7, \"fBEGIN\");\n", "tbig->DrawText(20., 7, \"fEND\");\n", "arrow->DrawArrow( 2.6,7, 2.6,8.4,0.01,\"|>\");\n", "arrow->DrawArrow( 20,7, 20,8.4,0.01,\"|>\");" ] }, { "cell_type": "markdown", "id": "df0c6935", "metadata": {}, "source": [ "file header" ] }, { "cell_type": "code", "execution_count": 3, "id": "6ac2975b", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:13:44.000972Z", "iopub.status.busy": "2026-05-19T20:13:44.000839Z", "iopub.status.idle": "2026-05-19T20:13:44.204435Z", "shell.execute_reply": "2026-05-19T20:13:44.203838Z" } }, "outputs": [], "source": [ "TPaveText *header = new TPaveText(0.5,.2,9.4,6.5);\n", "header->SetFillColor(44);\n", "header->Draw();\n", "TText *fh=header->AddText(\"File Header\");\n", "fh->SetTextAlign(22);\n", "fh->SetTextSize(0.04);\n", "header->SetTextSize(0.027);\n", "header->SetTextAlign(12);\n", "header->AddText(\" \");\n", "header->AddLine(0,0,0,0);\n", "header->AddText(\"\\\"root\\\": Root File Identifier\");\n", "header->AddText(\"fVersion: File version identifier\");\n", "header->AddText(\"fBEGIN: Pointer to first data record\");\n", "header->AddText(\"fEND: Pointer to first free word at EOF\");\n", "header->AddText(\"fSeekFree: Pointer to FREE data record\");\n", "header->AddText(\"fNbytesFree: Number of bytes in FREE\");\n", "header->AddText(\"fNfree: Number of free data records\");\n", "header->AddText(\"fNbytesName: Number of bytes in name/title\");\n", "header->AddText(\"fUnits: Number of bytes for pointers\");\n", "header->AddText(\"fCompress: Compression level\");" ] }, { "cell_type": "markdown", "id": "66fd1f08", "metadata": {}, "source": [ "logical record header" ] }, { "cell_type": "code", "execution_count": 4, "id": "16c95da6", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:13:44.206695Z", "iopub.status.busy": "2026-05-19T20:13:44.206556Z", "iopub.status.idle": "2026-05-19T20:13:44.410336Z", "shell.execute_reply": "2026-05-19T20:13:44.409632Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "Info in : png file file.png has been created\n" ] } ], "source": [ "TPaveText *lrecord = new TPaveText(10,0.2,19.5,6.5);\n", "lrecord->SetFillColor(33);\n", "lrecord->Draw();\n", "TText *tlrh = lrecord->AddText(\"Logical Record Header (TKEY)\");\n", "tlrh->SetTextAlign(22);\n", "tlrh->SetTextSize(0.04);\n", "lrecord->SetTextSize(0.027);\n", "lrecord->SetTextAlign(12);\n", "lrecord->AddText(\" \");\n", "lrecord->AddLine(0,0,0,0);\n", "lrecord->AddText(\"fNbytes: Length of compressed object\");\n", "lrecord->AddText(\"fVersion: Key version identifier\");\n", "lrecord->AddText(\"fObjLen: Length of uncompressed object\");\n", "lrecord->AddText(\"fDatime: Date/Time when written to store\");\n", "lrecord->AddText(\"fKeylen: Number of bytes for the key\");\n", "lrecord->AddText(\"fCycle : Cycle number\");\n", "lrecord->AddText(\"fSeekKey: Pointer to object on file\");\n", "lrecord->AddText(\"fSeekPdir: Pointer to directory on file\");\n", "lrecord->AddText(\"fClassName: class name of the object\");\n", "lrecord->AddText(\"fName: name of the object\");\n", "lrecord->AddText(\"fTitle: title of the object\");\n", "\n", "c1->Update();\n", "c1->Print(\"file.png\");" ] }, { "cell_type": "markdown", "id": "e068618f", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 5, "id": "61d2c585", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:13:44.411875Z", "iopub.status.busy": "2026-05-19T20:13:44.411755Z", "iopub.status.idle": "2026-05-19T20:13:44.616506Z", "shell.execute_reply": "2026-05-19T20:13:44.615683Z" } }, "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 }