Created
October 1, 2025 08:32
-
-
Save andrzejnovak/95fbf2b9b39da491c090d18f4e00df1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 2, | |
| "id": "a3ac97cf-6eb5-4a2e-b11e-d8bc1014186f", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "import os, ROOT\n", | |
| "import cmsstyle\n", | |
| "%jsroot" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 5, | |
| "id": "c78b421d-ec80-4b7e-9994-0bf1697458d8", | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "'6.34.04'" | |
| ] | |
| }, | |
| "execution_count": 5, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "ROOT.__version__" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 6, | |
| "id": "d14cf862-51d4-491e-bdf7-4b3b1d68a7cb", | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "ename": "AttributeError", | |
| "evalue": "module 'cmsstyle' has no attribute '__version__'", | |
| "output_type": "error", | |
| "traceback": [ | |
| "\u001b[31m---------------------------------------------------------------------------\u001b[39m", | |
| "\u001b[31mAttributeError\u001b[39m Traceback (most recent call last)", | |
| "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[6]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[43mcmsstyle\u001b[49m\u001b[43m.\u001b[49m\u001b[43m__version__\u001b[49m\n", | |
| "\u001b[31mAttributeError\u001b[39m: module 'cmsstyle' has no attribute '__version__'" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "cmsstyle.__version__" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 7, | |
| "id": "b42667cf-27ed-4ad8-bede-9fec4bb711c9", | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "Name: cmsstyle\n", | |
| "Version: 0.5.0rc1\n", | |
| "Summary: \n", | |
| "Home-page: https://github.com/cms-cat/cms-root-style\n", | |
| "Author: \n", | |
| "Author-email: Andrzej Novak <[email protected]>, Tommaso Tedeschi <[email protected]>, Clemens Lange <[email protected]>, Piergiulio Lenzi <[email protected]>, Andrea Malara <[email protected]>\n", | |
| "License: \n", | |
| "Location: /home/novak/software/miniforge3/envs/def/lib/python3.12/site-packages\n", | |
| "Requires: typing-extensions\n", | |
| "Required-by: \n" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "!pip show cmsstyle" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "id": "590901e6-4bb1-45d6-a184-1c075e90c40d", | |
| "metadata": {}, | |
| "source": [ | |
| "### Baseline" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 8, | |
| "id": "58782e22-5cf8-48c5-9832-aae9949c5f2c", | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stderr", | |
| "output_type": "stream", | |
| "text": [ | |
| "Warning in <TCanvas::Constructor>: Deleting canvas with same name: c\n", | |
| "Warning in <TROOT::Append>: Replacing existing TH1: h (Potential memory leak).\n" | |
| ] | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "\n", | |
| "\n", | |
| "<div id=\"root_plot_1759307368024\" style=\"width: 800px; height: 600px; position: relative\">\n", | |
| "</div>\n", | |
| "\n", | |
| "<script>\n", | |
| "\n", | |
| "function display_root_plot_1759307368024(Core) {\n", | |
| " let obj = Core.parse({\"_typename\":\"TCanvasWebSnapshot\",\"fUniqueID\":0,\"fBits\":0,\"fObjectID\":\"\",\"fOption\":\"\",\"fKind\":3,\"fSnapshot\":{\"_typename\":\"TCanvas\",\"fUniqueID\":0,\"fBits\":3342344,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":1001,\"fLeftMargin\":0.1,\"fRightMargin\":0.1,\"fBottomMargin\":0.1,\"fTopMargin\":0.1,\"fXfile\":2,\"fYfile\":2,\"fAfile\":1,\"fXstat\":0.99,\"fYstat\":0.99,\"fAstat\":2,\"fFrameFillColor\":0,\"fFrameLineColor\":1,\"fFrameFillStyle\":1001,\"fFrameLineStyle\":1,\"fFrameLineWidth\":1,\"fFrameBorderSize\":1,\"fFrameBorderMode\":0,\"fX1\":-1.25000009313226,\"fY1\":-54.4687540582384,\"fX2\":11.2500000931323,\"fY2\":490.218754058238,\"fXtoAbsPixelk\":79.6000047445299,\"fXtoPixelk\":79.6000047445299,\"fXtoPixel\":63.679999051094,\"fYtoAbsPixelk\":514.799996590614,\"fYtoPixelk\":514.799996590614,\"fYtoPixel\":-1.05014341521797,\"fUtoAbsPixelk\":0,\"fUtoPixelk\":0,\"fUtoPixel\":796,\"fVtoAbsPixelk\":572,\"fVtoPixelk\":572,\"fVtoPixel\":-572,\"fAbsPixeltoXk\":-1.25000009313226,\"fPixeltoXk\":-1.25000009313226,\"fPixeltoX\":0.0157035178219404,\"fAbsPixeltoYk\":490.218754058238,\"fPixeltoYk\":-54.4687540582384,\"fPixeltoY\":-0.952250888315519,\"fXlowNDC\":0,\"fYlowNDC\":0,\"fXUpNDC\":1,\"fYUpNDC\":1,\"fWNDC\":1,\"fHNDC\":1,\"fAbsXlowNDC\":0,\"fAbsYlowNDC\":0,\"fAbsWNDC\":1,\"fAbsHNDC\":1,\"fUxmin\":0,\"fUymin\":0,\"fUxmax\":10,\"fUymax\":435.75,\"fTheta\":30,\"fPhi\":30,\"fAspectRatio\":0,\"fNumber\":0,\"fTickx\":0,\"fTicky\":0,\"fLogx\":0,\"fLogy\":0,\"fLogz\":0,\"fPadPaint\":0,\"fCrosshair\":0,\"fCrosshairPos\":0,\"fBorderSize\":2,\"fBorderMode\":0,\"fModified\":false,\"fGridx\":false,\"fGridy\":false,\"fAbsCoord\":false,\"fEditable\":true,\"fFixedAspectRatio\":false,\"fPrimitives\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[],\"opt\":[]},\"fExecs\":null,\"fName\":\"c\",\"fTitle\":\"Basic ROOT Plot\",\"fNumPaletteColor\":0,\"fNextPaletteColor\":0,\"fDISPLAY\":\"$DISPLAY\",\"fDoubleBuffer\":0,\"fRetained\":true,\"fXsizeUser\":0,\"fYsizeUser\":0,\"fXsizeReal\":20,\"fYsizeReal\":15,\"fWindowTopX\":0,\"fWindowTopY\":0,\"fWindowWidth\":0,\"fWindowHeight\":0,\"fCw\":796,\"fCh\":572,\"fCatt\":{\"_typename\":\"TAttCanvas\",\"fXBetween\":2,\"fYBetween\":2,\"fTitleFromTop\":1.2,\"fXdate\":0.2,\"fYdate\":0.3,\"fAdate\":1},\"kMoveOpaque\":true,\"kResizeOpaque\":true,\"fHighLightColor\":2,\"fBatch\":true,\"kShowEventStatus\":false,\"kAutoExec\":true,\"kMenuBar\":true},\"fActive\":false,\"fReadOnly\":true,\"fWithoutPrimitives\":false,\"fHasExecs\":false,\"fPrimitives\":[{\"_typename\":\"TWebSnapshot\",\"fUniqueID\":0,\"fBits\":0,\"fObjectID\":\"\",\"fOption\":\"\",\"fKind\":4,\"fSnapshot\":{\"_typename\":\"TWebPainting\",\"fUniqueID\":0,\"fBits\":0,\"fOper\":\"0:255,255,255;1:0,0,0;2:255,0,0;3:0,255,0;4:0,0,255;5:255,255,0;6:255,0,255;7:0,255,255;8:89,211,84;9:89,84,216;10:254,254,254;11:192,182,172;12:76,76,76;13:102,102,102;14:127,127,127;15:153,153,153;16:178,178,178;17:204,204,204;18:229,229,229;19:242,242,242;20:204,198,170;21:204,198,170;22:193,191,168;23:186,181,163;24:178,165,150;25:183,163,155;26:173,153,140;27:155,142,130;28:135,102,86;29:175,206,198;30:132,193,163;31:137,168,160;32:130,158,140;33:173,188,198;34:122,142,153;35:117,137,145;36:104,130,150;37:109,122,132;38:124,153,209;39:127,127,155;40:170,165,191;41:211,206,135;42:221,186,135;43:188,158,130;44:198,153,124;45:191,130,119;46:206,94,96;47:170,142,147;48:165,119,122;49:147,104,112;50:211,89,84;51:146,0,255;52:122,0,255;53:98,0,255;54:74,0,255;55:51,0,255;56:27,0,255;57:3,0,255;58:0,20,255;59:0,44,255;60:0,68,255;61:0,91,255;62:0,115,255;63:0,139,255;64:0,163,255;65:0,187,255;66:0,210,255;67:0,234,255;68:0,255,251;69:0,255,227;70:0,255,204;71:0,255,180;72:0,255,156;73:0,255,132;74:0,255,108;75:0,255,85;76:0,255,61;77:0,255,37;78:0,255,13;79:10,255,0;80:34,255,0;81:57,255,0;82:81,255,0;83:105,255,0;84:129,255,0;85:153,255,0;86:176,255,0;87:200,255,0;88:224,255,0;89:248,255,0;90:255,238,0;91:255,214,0;92:255,190,0;93:255,166,0;94:255,142,0;95:255,119,0;96:255,95,0;97:255,71,0;98:255,47,0;99:255,23,0;100:111,45,168;101:165,42,42;102:178,190,181;103:87,144,252;104:248,156,32;105:228,37,54;106:150,74,139;107:156,156,161;108:122,33,221;109:24,69,251;110:255,94,2;111:201,31,22;112:200,73,169;113:173,173,125;114:134,200,221;115:87,141,255;116:101,99,100;117:63,144,218;118:255,169,14;119:189,31,1;120:148,164,162;121:131,45,182;122:169,107,89;123:231,99,0;124:185,172,112;125:113,117,129;126:146,218,221;127:178,178,178;201:91,91,91;202:122,122,122;203:183,183,183;204:214,214,214;205:137,15,15;206:183,20,20;207:234,71,71;208:239,117,117;209:15,137,15;210:20,183,20;211:71,234,71;212:117,239,117;213:15,15,137;214:20,20,183;215:71,71,234;216:117,117,239;217:137,137,15;218:183,183,20;219:234,234,71;220:239,239,117;221:137,15,137;222:183,20,183;223:234,71,234;224:239,117,239;225:15,137,137;226:20,183,183;227:71,234,234;228:117,239,239;390:255,255,204;391:255,255,153;392:204,204,153;393:255,255,102;394:204,204,102;395:153,153,102;396:255,255,51;397:204,204,51;398:153,153,51;399:102,102,51;400:255,255,0;401:204,204,0;402:153,153,0;403:102,102,0;404:51,51,0;406:204,255,204;407:153,255,153;408:153,204,153;409:102,255,102;410:102,204,102;411:102,153,102;412:51,255,51;413:51,204,51;414:51,153,51;415:51,102,51;416:0,255,0;417:0,204,0;418:0,153,0;419:0,102,0;420:0,51,0;422:204,255,255;423:153,255,255;424:153,204,204;425:102,255,255;426:102,204,204;427:102,153,153;428:51,255,255;429:51,204,204;430:51,153,153;431:51,102,102;432:0,255,255;433:0,204,204;434:0,153,153;435:0,102,102;436:0,51,51;590:204,204,255;591:153,153,255;592:153,153,204;593:102,102,255;594:102,102,204;595:102,102,153;596:51,51,255;597:51,51,204;598:51,51,153;599:51,51,102;600:0,0,255;601:0,0,204;602:0,0,153;603:0,0,102;604:0,0,51;606:255,204,255;607:255,153,255;608:204,153,204;609:255,102,255;610:204,102,204;611:153,102,153;612:255,51,255;613:204,51,204;614:153,51,153;615:102,51,102;616:255,0,255;617:204,0,204;618:153,0,153;619:102,0,102;620:51,0,51;622:255,204,204;623:255,153,153;624:204,153,153;625:255,102,102;626:204,102,102;627:153,102,102;628:255,51,51;629:204,51,51;630:153,51,51;631:102,51,51;632:255,0,0;633:204,0,0;634:153,0,0;635:102,0,0;636:51,0,0;791:255,204,153;792:204,153,102;793:153,102,51;794:153,102,0;795:204,153,51;796:255,204,102;797:255,153,0;798:255,204,51;799:204,153,0;800:255,204,0;801:255,153,51;802:204,102,0;803:102,51,0;804:153,51,0;805:204,102,51;806:255,153,102;807:255,102,0;808:255,102,51;809:204,51,0;810:255,51,0;811:153,255,51;812:102,204,0;813:51,102,0;814:51,153,0;815:102,204,51;816:153,255,102;817:102,255,0;818:102,255,51;819:51,204,0;820:51,255,0;821:204,255,153;822:153,204,102;823:102,153,51;824:102,153,0;825:153,204,51;826:204,255,102;827:153,255,0;828:204,255,51;829:153,204,0;830:204,255,0;831:153,255,204;832:102,204,153;833:51,153,102;834:0,153,102;835:51,204,153;836:102,255,204;837:0,255,102;838:51,255,204;839:0,204,153;840:0,255,204;841:51,255,153;842:0,204,102;843:0,102,51;844:0,153,51;845:51,204,102;846:102,255,153;847:0,255,153;848:51,255,102;849:0,204,51;850:0,255,51;851:153,204,255;852:102,153,204;853:51,102,153;854:0,51,153;855:51,102,204;856:102,153,255;857:0,102,255;858:51,102,255;859:0,51,204;860:0,51,255;861:51,153,255;862:0,102,204;863:0,51,102;864:0,102,153;865:51,153,204;866:102,204,255;867:0,153,255;868:51,204,255;869:0,153,204;870:0,204,255;871:204,153,255;872:153,102,204;873:102,51,153;874:102,0,153;875:153,51,204;876:204,102,255;877:153,0,255;878:204,51,255;879:153,0,204;880:204,0,255;881:153,51,255;882:102,0,204;883:51,0,102;884:51,0,153;885:102,51,204;886:153,102,255;887:102,0,255;888:102,51,255;889:51,0,204;890:51,0,255;891:255,51,153;892:204,0,102;893:102,0,51;894:153,0,51;895:204,51,102;896:255,102,153;897:255,0,102;898:255,51,102;899:204,0,51;900:255,0,51;901:255,153,204;902:204,102,153;903:153,51,102;904:153,0,102;905:204,51,153;906:255,102,204;907:255,0,153;908:204,0,153;909:255,51,204;910:255,0,153;920:204,204,204;921:153,153,153;922:102,102,102;923:51,51,51;924:53,42,134;925:51,44,137;926:50,45,140;927:49,47,143;928:48,48,146;929:46,50,148;930:45,51,151;931:44,53,154;932:43,55,157;933:42,56,160;934:40,58,162;935:39,59,165;936:38,61,168;937:37,63,171;938:35,64,174;939:34,66,176;940:33,67,179;941:32,69,182;942:31,71,185;943:29,72,187;944:28,74,190;945:27,75,193;946:26,77,196;947:24,79,199;948:23,80,201;949:22,82,204;950:21,83,207;951:19,85,210;952:18,86,213;953:17,88,215;954:16,90,218;955:15,91,221;956:15,92,221;957:15,94,220;958:15,95,220;959:15,96,220;960:15,97,220;961:15,98,220;962:16,99,219;963:16,100,219;964:16,102,219;965:16,103,219;966:16,104,218;967:16,105,218;968:17,106,218;969:17,107,218;970:17,109,217;971:17,110,217;972:17,111,217;973:17,112,217;974:17,113,216;975:18,114,216;976:18,115,216;977:18,117,216;978:18,118,215;979:18,119,215;980:18,120,215;981:18,121,215;982:19,122,215;983:19,123,214;984:19,125,214;985:19,126,214;986:19,127,214;987:19,128,213;988:19,129,213;989:19,130,213;990:18,131,212;991:18,132,212;992:17,134,211;993:17,135,211;994:16,136,211;995:16,137,210;996:15,138,210;997:15,139,210;998:15,140,209;999:14,141,209;1000:14,142,208;1001:13,143,208;1002:13,145,208;1003:12,146,207;1004:12,147,207;1005:12,148,207;1006:11,149,206;1007:11,150,206;1008:10,151,205;1009:10,152,205;1010:9,153,205;1011:9,154,204;1012:8,155,204;1013:8,157,204;1014:8,158,203;1015:7,159,203;1016:7,160,202;1017:6,161,202;1018:6,162,202;1019:5,163,201;1020:7,164,200;1021:8,164,199;1022:9,165,198;1023:10,166,197;1024:12,166,195;1025:13,167,194;1026:14,167,193;1027:15,168,192;1028:17,169,191;1029:18,169,189;1030:19,170,188;1031:20,170,187;1032:22,171,186;1033:23,172,185;1034:24,172,184;1035:25,173,182;1036:27,173,181;1037:28,174,180;1038:29,175,179;1039:30,175,178;1040:32,176,176;1041:33,176,175;1042:34,177,174;1043:35,178,173;1044:37,178,172;1045:38,179,170;1046:39,180,169;1047:40,180,168;1048:42,181,167;1049:43,181,166;1050:44,182,165;1051:45,183,163;1052:48,183,162;1053:51,183,161;1054:54,183,159;1055:57,184,158;1056:59,184,156;1057:62,184,155;1058:65,184,154;1059:68,185,152;1060:71,185,151;1061:73,185,149;1062:76,185,148;1063:79,186,146;1064:82,186,145;1065:84,186,144;1066:87,186,142;1067:90,187,141;1068:93,187,139;1069:96,187,138;1070:98,187,137;1071:101,188,135;1072:104,188,134;1073:107,188,132;1074:110,188,131;1075:112,189,130;1076:115,189,128;1077:118,189,127;1078:121,189,125;1079:124,190,124;1080:126,190,123;1081:129,190,121;1082:132,190,120;1083:135,191,118;1084:137,190,117;1085:139,190,117;1086:142,190,116;1087:144,190,115;1088:146,190,114;1089:148,190,113;1090:151,190,112;1091:153,190,111;1092:155,189,110;1093:158,189,109;1094:160,189,108;1095:162,189,107;1096:165,189,106;1097:167,189,105;1098:169,189,104;1099:171,188,104;1100:174,188,103;1101:176,188,102;1102:178,188,101;1103:181,188,100;1104:183,188,99;1105:185,188,98;1106:188,188,97;1107:190,187,96;1108:192,187,95;1109:194,187,94;1110:197,187,93;1111:199,187,92;1112:201,187,92;1113:204,187,91;1114:206,186,90;1115:208,186,89;1116:210,187,88;1117:211,187,86;1118:212,188,85;1119:214,188,84;1120:215,188,83;1121:217,189,81;1122:218,189,80;1123:220,190,79;1124:221,190,78;1125:222,191,77;1126:224,191,75;1127:225,191,74;1128:227,192,73;1129:228,192,72;1130:229,193,70;1131:231,193,69;1132:232,194,68;1133:234,194,67;1134:235,194,66;1135:236,195,64;1136:238,195,63;1137:239,196,62;1138:241,196,61;1139:242,197,59;1140:244,197,58;1141:245,197,57;1142:246,198,56;1143:248,198,55;1144:249,199,53;1145:251,199,52;1146:252,200,51;1147:253,200,50;1148:253,202,49;1149:253,203,47;1150:253,205,46;1151:253,206,45;1152:253,208,44;1153:252,209,43;1154:252,211,42;1155:252,213,41;1156:252,214,39;1157:252,216,38;1158:252,217,37;1159:252,219,36;1160:251,220,35;1161:251,222,34;1162:251,224,33;1163:251,225,31;1164:251,227,30;1165:251,228,29;1166:250,230,28;1167:250,231,27;1168:250,233,26;1169:250,235,25;1170:250,236,23;1171:250,238,22;1172:250,239,21;1173:249,241,20;1174:249,242,19;1175:249,244,18;1176:249,246,17;1177:249,247,16;1178:249,249,14;1179:96,118,65;1180:245,187,84;1181:133,209,251;1182:255,223,127\",\"fBuf\":{\"$arr\":\"Float32\",\"len\":255,\"v\":[924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178]}}},{\"_typename\":\"TWebSnapshot\",\"fUniqueID\":0,\"fBits\":0,\"fObjectID\":\"\",\"fOption\":\"\",\"fKind\":5,\"fSnapshot\":{\"_typename\":\"TStyle\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"Modern\",\"fTitle\":\"Modern Style\",\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":19,\"fFillStyle\":1001,\"fMarkerColor\":1,\"fMarkerStyle\":1,\"fMarkerSize\":1,\"fTextAngle\":0,\"fTextSize\":0.05,\"fTextAlign\":11,\"fTextColor\":1,\"fTextFont\":62,\"fXaxis\":{\"_typename\":\"TAttAxis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42},\"fYaxis\":{\"_typename\":\"TAttAxis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":0,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42},\"fZaxis\":{\"_typename\":\"TAttAxis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42},\"fBarWidth\":1,\"fBarOffset\":0,\"fColorModelPS\":0,\"fDrawBorder\":0,\"fOptLogx\":0,\"fOptLogy\":0,\"fOptLogz\":0,\"fOptDate\":0,\"fOptStat\":1111,\"fOptTitle\":1,\"fOptFile\":0,\"fOptFit\":0,\"fShowEventStatus\":0,\"fShowEditor\":0,\"fShowToolBar\":0,\"fNumberContours\":20,\"fAttDate\":{\"_typename\":\"TAttText\",\"fTextAngle\":0,\"fTextSize\":0.025,\"fTextAlign\":11,\"fTextColor\":1,\"fTextFont\":62},\"fDateX\":0.01,\"fDateY\":0.01,\"fEndErrorSize\":2,\"fErrorX\":0.5,\"fFuncColor\":2,\"fFuncStyle\":1,\"fFuncWidth\":2,\"fGridColor\":0,\"fGridStyle\":3,\"fGridWidth\":1,\"fLegendBorderSize\":1,\"fLegendFillColor\":0,\"fLegendFillStyle\":1001,\"fLegendFont\":42,\"fLegendTextSize\":0,\"fHatchesLineWidth\":1,\"fHatchesSpacing\":1,\"fFrameFillColor\":0,\"fFrameLineColor\":1,\"fFrameFillStyle\":1001,\"fFrameLineStyle\":1,\"fFrameLineWidth\":1,\"fFrameBorderSize\":1,\"fFrameBorderMode\":0,\"fHistFillColor\":0,\"fHistLineColor\":602,\"fHistFillStyle\":1001,\"fHistLineStyle\":1,\"fHistLineWidth\":1,\"fHistMinimumZero\":false,\"fHistTopMargin\":0.05,\"fCanvasPreferGL\":false,\"fCanvasColor\":0,\"fCanvasBorderSize\":2,\"fCanvasBorderMode\":0,\"fCanvasDefH\":500,\"fCanvasDefW\":700,\"fCanvasDefX\":10,\"fCanvasDefY\":10,\"fPadColor\":0,\"fPadBorderSize\":2,\"fPadBorderMode\":0,\"fPadBottomMargin\":0.1,\"fPadTopMargin\":0.1,\"fPadLeftMargin\":0.1,\"fPadRightMargin\":0.1,\"fPadGridX\":false,\"fPadGridY\":false,\"fPadTickX\":0,\"fPadTickY\":0,\"fPaperSizeX\":20,\"fPaperSizeY\":26,\"fScreenFactor\":1,\"fStatColor\":0,\"fStatTextColor\":1,\"fStatBorderSize\":1,\"fStatFont\":42,\"fStatFontSize\":0,\"fStatStyle\":1001,\"fStatFormat\":\"6.4g\",\"fStatX\":0.98,\"fStatY\":0.935,\"fStatW\":0.2,\"fStatH\":0.16,\"fStripDecimals\":true,\"fTitleAlign\":23,\"fTitleColor\":0,\"fTitleTextColor\":1,\"fTitleBorderSize\":0,\"fTitleFont\":42,\"fTitleFontSize\":0.05,\"fTitleStyle\":0,\"fTitleX\":0.5,\"fTitleY\":0.995,\"fTitleW\":0,\"fTitleH\":0,\"fLegoInnerR\":0.5,\"fLineStyles\":[\"\",\" \",\" 12 12\",\" 4 8\",\" 12 16 4 16\",\" 20 12 4 12\",\" 20 12 4 12 4 12 4 12\",\" 20 20\",\" 20 12 4 12 4 12\",\" 80 20\",\" 80 40 4 40\",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \"],\"fHeaderPS\":\"\",\"fTitlePS\":\"\",\"fFitFormat\":\"5.4g\",\"fPaintTextFormat\":\"g\",\"fLineScalePS\":3,\"fJoinLinePS\":0,\"fCapLinePS\":0,\"fTimeOffset\":788918400,\"fImageScaling\":1,\"fCandleWhiskerRange\":1,\"fCandleBoxRange\":0.5,\"fCandleScaled\":false,\"fViolinScaled\":true,\"fXAxisExpXOffset\":0,\"fXAxisExpYOffset\":0,\"fYAxisExpXOffset\":0,\"fYAxisExpYOffset\":0,\"fAxisMaxDigits\":5,\"fOrthoCamera\":false}},{\"_typename\":\"TWebSnapshot\",\"fUniqueID\":0,\"fBits\":0,\"fObjectID\":\"\",\"fOption\":\"\",\"fKind\":1,\"fSnapshot\":{\"_typename\":\"TFrame\",\"fUniqueID\":0,\"fBits\":8,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":1001,\"fX1\":0,\"fY1\":0,\"fX2\":10,\"fY2\":435.75,\"fBorderSize\":1,\"fBorderMode\":0}},{\"_typename\":\"TWebSnapshot\",\"fUniqueID\":0,\"fBits\":0,\"fObjectID\":\"\",\"fOption\":\"\",\"fKind\":1,\"fSnapshot\":{\"_typename\":\"TH1F\",\"fUniqueID\":0,\"fBits\":8,\"fName\":\"h\",\"fTitle\":\"Example Histogram\",\"fLineColor\":602,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":1001,\"fMarkerColor\":1,\"fMarkerStyle\":1,\"fMarkerSize\":1,\"fNcells\":102,\"fXaxis\":{\"_typename\":\"TAxis\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"xaxis\",\"fTitle\":\"X axis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42,\"fNbins\":100,\"fXmin\":0,\"fXmax\":10,\"fXbins\":[],\"fFirst\":0,\"fLast\":0,\"fBits2\":0,\"fTimeDisplay\":false,\"fTimeFormat\":\"\",\"fLabels\":null,\"fModLabs\":null},\"fYaxis\":{\"_typename\":\"TAxis\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"yaxis\",\"fTitle\":\"Entries\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":0,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42,\"fNbins\":1,\"fXmin\":0,\"fXmax\":1,\"fXbins\":[],\"fFirst\":0,\"fLast\":0,\"fBits2\":0,\"fTimeDisplay\":false,\"fTimeFormat\":\"\",\"fLabels\":null,\"fModLabs\":null},\"fZaxis\":{\"_typename\":\"TAxis\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"zaxis\",\"fTitle\":\"\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42,\"fNbins\":1,\"fXmin\":0,\"fXmax\":1,\"fXbins\":[],\"fFirst\":0,\"fLast\":0,\"fBits2\":0,\"fTimeDisplay\":false,\"fTimeFormat\":\"\",\"fLabels\":null,\"fModLabs\":null},\"fBarOffset\":0,\"fBarWidth\":1000,\"fEntries\":10000,\"fTsumw\":10000,\"fTsumw2\":10000,\"fTsumwx\":49982.4026190762,\"fTsumwx2\":259855.495512337,\"fMaximum\":-1111,\"fMinimum\":-1111,\"fNormFactor\":0,\"fContour\":[],\"fSumw2\":[],\"fOption\":\"\",\"fFunctions\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TPaveStats\",\"fUniqueID\":0,\"fBits\":9,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":1001,\"fX1\":8.50000025331975,\"fY1\":367.664067978622,\"fX2\":11.0000003278256,\"fY2\":454.814067329304,\"fX1NDC\":0.780000016093254,\"fY1NDC\":0.775000005960464,\"fX2NDC\":0.980000019073486,\"fY2NDC\":0.935000002384186,\"fBorderSize\":1,\"fInit\":1,\"fShadowColor\":1,\"fCornerRadius\":0,\"fOption\":\"brNDC\",\"fName\":\"stats\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":12,\"fTextColor\":1,\"fTextFont\":42,\"fLabel\":\"\",\"fLongest\":18,\"fMargin\":0.05,\"fLines\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"h\",\"fTextAngle\":0,\"fTextSize\":0.0368,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.0368000008165836},{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Entries = 10000 \",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.04},{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Mean = 4.998\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.04},{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Std Dev = 1.002\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.04}],\"opt\":[\"\",\"\",\"\",\"\"]},\"fOptFit\":0,\"fOptStat\":1111,\"fFitFormat\":\"5.4g\",\"fStatFormat\":\"6.4g\",\"fParent\":{\"$ref\":15}}],\"opt\":[\"brNDC\"]},\"fBufferSize\":0,\"fBuffer\":[],\"fBinStatErrOpt\":0,\"fStatOverflows\":2,\"fArray\":{\"$arr\":\"Float32\",\"len\":102,\"p\":16,\"v\":[1,3,2,3,4,4,9,3,9,17,18,26,35,40,59,57,76,85,105,115,131,157,179,219,236,265,257,292,324,338,379,396,400,387,375,415,406,397,373,350,337,331,295,267,266,220,203,184,152,128,110,103,75,57,65,48,44,36,35,21,20,19,10,7,7,5,2,2,0,0,2,0,0,1,1]}}},{\"_typename\":\"TWebSnapshot\",\"fUniqueID\":0,\"fBits\":0,\"fObjectID\":\"\",\"fOption\":\"blNDC\",\"fKind\":1,\"fSnapshot\":{\"_typename\":\"TPaveText\",\"fUniqueID\":0,\"fBits\":9,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":0,\"fX1\":2.76287685108638,\"fY1\":454.356988201548,\"fX2\":7.23712314891362,\"fY2\":487.495319114928,\"fX1NDC\":0.321030150753769,\"fY1NDC\":0.934160843929211,\"fX2NDC\":0.678969849246231,\"fY2NDC\":0.995000004768372,\"fBorderSize\":0,\"fInit\":1,\"fShadowColor\":1,\"fCornerRadius\":0,\"fOption\":\"blNDC\",\"fName\":\"title\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":22,\"fTextColor\":1,\"fTextFont\":42,\"fLabel\":\"\",\"fLongest\":17,\"fMargin\":0.05,\"fLines\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Example Histogram\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.0517132878303528}],\"opt\":[\"\"]}}}],\"fScripts\":\"\",\"fHighlightConnect\":false,\"fFixedSize\":false});\n", | |
| " Core.settings.HandleKeys = false;\n", | |
| " Core.draw(\"root_plot_1759307368024\", obj, \"\");\n", | |
| "}\n", | |
| "\n", | |
| "function script_load_root_plot_1759307368024(src, on_error) {\n", | |
| " let script = document.createElement('script');\n", | |
| " script.src = src;\n", | |
| " script.onload = function() { display_root_plot_1759307368024(JSROOT); };\n", | |
| " script.onerror = function() { script.remove(); on_error(); };\n", | |
| " document.head.appendChild(script);\n", | |
| "}\n", | |
| "\n", | |
| "if (typeof requirejs !== 'undefined') {\n", | |
| "\n", | |
| " // We are in jupyter notebooks, use require.js which should be configured already\n", | |
| " requirejs.config({\n", | |
| " paths: { 'JSRootCore' : [ 'build/jsroot', 'https://root.cern/js/7.7.4/build/jsroot', 'https://jsroot.gsi.de/7.7.4/build/jsroot' ] }\n", | |
| " })(['JSRootCore'], function(Core) {\n", | |
| " display_root_plot_1759307368024(Core);\n", | |
| " });\n", | |
| "\n", | |
| "} else if (typeof JSROOT !== 'undefined') {\n", | |
| "\n", | |
| " // JSROOT already loaded, just use it\n", | |
| " display_root_plot_1759307368024(JSROOT);\n", | |
| "\n", | |
| "} else {\n", | |
| "\n", | |
| " // We are in jupyterlab without require.js, directly loading jsroot\n", | |
| " // Jupyterlab might be installed in a different base_url so we need to know it.\n", | |
| " try {\n", | |
| " var base_url = JSON.parse(document.getElementById('jupyter-config-data').innerHTML).baseUrl;\n", | |
| " } catch(_) {\n", | |
| " var base_url = '/';\n", | |
| " }\n", | |
| "\n", | |
| " // Try loading a local version of requirejs and fallback to cdn if not possible.\n", | |
| " script_load_root_plot_1759307368024(base_url + 'static/build/jsroot.js', function(){\n", | |
| " console.error('Fail to load JSROOT locally, please check your jupyter_notebook_config.py file');\n", | |
| " script_load_root_plot_1759307368024('https://root.cern/js/7.7.4/build/jsroot.js', function(){\n", | |
| " document.getElementById(\"root_plot_1759307368024\").innerHTML = \"Failed to load JSROOT\";\n", | |
| " });\n", | |
| " });\n", | |
| "}\n", | |
| "\n", | |
| "</script>\n" | |
| ], | |
| "text/plain": [ | |
| "<IPython.core.display.HTML object>" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| } | |
| ], | |
| "source": [ | |
| "# Create a canvas\n", | |
| "c = ROOT.TCanvas(\"c\", \"Basic ROOT Plot\", 800, 600)\n", | |
| "\n", | |
| "# Create a histogram with 100 bins from 0 to 10\n", | |
| "h = ROOT.TH1F(\"h\", \"Example Histogram;X axis;Entries\", 100, 0, 10)\n", | |
| "\n", | |
| "# Fill histogram with random Gaussian numbers\n", | |
| "for _ in range(10000):\n", | |
| " h.Fill(ROOT.gRandom.Gaus(5, 1))\n", | |
| "\n", | |
| "# Draw the histogram\n", | |
| "h.Draw()\n", | |
| "\n", | |
| "# Show canvas inline in Jupyter\n", | |
| "c.Draw()\n" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "id": "56c2b3b6-763a-49a8-8c5c-13b7269b4b2d", | |
| "metadata": {}, | |
| "source": [ | |
| "### CMS-style" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 11, | |
| "id": "ef9cc766-9022-4f35-a577-b92bad2da081", | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "Error in callback <bound method CaptureDrawnPrimitives._post_execute of <JupyROOT.helpers.utils.CaptureDrawnPrimitives object at 0x7c03e789fbf0>> (for post_execute), with arguments args (),kwargs {}:\n" | |
| ] | |
| }, | |
| { | |
| "name": "stderr", | |
| "output_type": "stream", | |
| "text": [ | |
| "Warning in <TCanvas::Constructor>: Deleting canvas with same name: c\n", | |
| "Warning in <TROOT::Append>: Replacing existing TH1: h (Potential memory leak).\n", | |
| " *** Break *** segmentation violation\n", | |
| " Generating stack trace...\n", | |
| " 0x00007c040e4a9788 in TBufferJSON::JsonWriteObject(void const*, TClass const*, bool) + 0x518 from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e48143a in TBufferIO::WriteObjectAny(void const*, TClass const*, bool) at TBufferIO.cxx:? from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e4c49a5 in TBufferJSON::WriteFastArray(void**, TClass const*, long long, bool, TMemberStreamer*) + 0x185 from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e71ad5f in int TStreamerInfo::WriteBufferAux<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) + 0x39ff from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e55f4b1 in TStreamerInfoActions::GenericWriteAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) + 0x51 from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e47ed2f in TBufferText::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) + 0xcf from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e47f6c5 in TBufferText::WriteClassBuffer(TClass const*, void*) + 0x75 from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040eccaec6 in TClass::WriteBuffer(TBuffer&, void*, char const*) + 0x16 from /home/novak/software/miniforge3/envs/def/lib/python3.12/lib-dynload/../../libCore.so.6.34\n", | |
| " 0x00007c040ed0c450 in TStreamerBase::WriteBuffer(TBuffer&, char*) + 0x170 from /home/novak/software/miniforge3/envs/def/lib/python3.12/lib-dynload/../../libCore.so.6.34\n", | |
| " 0x00007c040e557c1f in <unknown> from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e47ed2f in TBufferText::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) + 0xcf from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e47f6c5 in TBufferText::WriteClassBuffer(TClass const*, void*) + 0x75 from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040eccaec6 in TClass::WriteBuffer(TBuffer&, void*, char const*) + 0x16 from /home/novak/software/miniforge3/envs/def/lib/python3.12/lib-dynload/../../libCore.so.6.34\n", | |
| " 0x00007c040ed0c450 in TStreamerBase::WriteBuffer(TBuffer&, char*) + 0x170 from /home/novak/software/miniforge3/envs/def/lib/python3.12/lib-dynload/../../libCore.so.6.34\n", | |
| " 0x00007c040e557c1f in <unknown> from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e47ed2f in TBufferText::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) + 0xcf from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e47f6c5 in TBufferText::WriteClassBuffer(TClass const*, void*) + 0x75 from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e4a9788 in TBufferJSON::JsonWriteObject(void const*, TClass const*, bool) + 0x518 from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e4aad86 in TBufferJSON::StoreObject(void const*, TClass const*) + 0x46 from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c040e4b082b in TBufferJSON::ConvertToJSON(void const*, TClass const*, int, char const*) + 0x15b from /home/novak/software/miniforge3/envs/def/lib/libRIO.so\n", | |
| " 0x00007c03e5fc1ee2 in <unknown> from /home/novak/software/miniforge3/envs/def/lib/libWebGui6.so.6.34.04\n", | |
| " 0x00007c03e5fc9e68 in TWebCanvas::CreatePadSnapshot(TPadWebSnapshot&, TPad*, long long, std::function<void (TPadWebSnapshot*)>) at TWebCanvas.cxx:? from /home/novak/software/miniforge3/envs/def/lib/libWebGui6.so.6.34.04\n", | |
| " 0x00007c03e5fcea73 in TWebCanvas::CreateCanvasJSON(TCanvas*, int, bool) + 0x283 from /home/novak/software/miniforge3/envs/def/lib/libWebGui6.so.6.34.04\n", | |
| " 0x00007c042c186e4d in <unknown> from /home/novak/software/miniforge3/envs/def/lib/python3.12/lib-dynload/../../libcppyy_backend.so\n", | |
| " 0x00007c042c18815a in Cppyy::CallO(long, void*, unsigned long, void*, unsigned long) + 0x8a from /home/novak/software/miniforge3/envs/def/lib/python3.12/lib-dynload/../../libcppyy_backend.so\n", | |
| " 0x00007c03e797ad2b in <unknown> from /home/novak/software/miniforge3/envs/def/lib/python3.12/site-packages/libcppyy.so\n", | |
| " 0x00007c03e795d74a in <unknown> from /home/novak/software/miniforge3/envs/def/lib/python3.12/site-packages/libcppyy.so\n", | |
| " 0x00007c03e795d8f8 in <unknown> from /home/novak/software/miniforge3/envs/def/lib/python3.12/site-packages/libcppyy.so\n", | |
| " 0x00007c03e795da86 in CPyCppyy::CPPMethod::Execute(void*, long, CPyCppyy::CallContext*) + 0x26 from /home/novak/software/miniforge3/envs/def/lib/python3.12/site-packages/libcppyy.so\n", | |
| " 0x00007c03e7966478 in <unknown> from /home/novak/software/miniforge3/envs/def/lib/python3.12/site-packages/libcppyy.so\n", | |
| " 0x0000623047940dde in PyObject_Vectorcall + 0x2e from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047841b23 in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x000062304797423c in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047973dd0 in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00006230478426f0 in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x000062304797423c in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047973d9e in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x000062304795c11b in _PyObject_Call + 0x12b from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00006230478426f0 in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00006230479f37ff in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00007c04326a3274 in <unknown> from /home/novak/software/miniforge3/envs/def/lib/python3.12/lib-dynload/_asyncio.cpython-312-x86_64-linux-gnu.so\n", | |
| " 0x00007c04326a3a63 in <unknown> from /home/novak/software/miniforge3/envs/def/lib/python3.12/lib-dynload/_asyncio.cpython-312-x86_64-linux-gnu.so\n", | |
| " 0x000062304794a518 in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047a75abc in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00006230478ef105 in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047940f0b in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00006230478426f0 in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00006230479df1a1 in PyEval_EvalCode + 0xa1 from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00006230479fb97c in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047940f0b in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047940dde in PyObject_Vectorcall + 0x2e from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047841b23 in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047a0eb98 in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x0000623047a0dd1d in Py_RunMain + 0x20d from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00006230479c9247 in Py_BytesMain + 0x37 from /home/novak/software/miniforge3/envs/def/bin/python\n", | |
| " 0x00007c0433a2a1ca in <unknown> from /lib/x86_64-linux-gnu/libc.so.6\n", | |
| " 0x00007c0433a2a28b in __libc_start_main + 0x8b from /lib/x86_64-linux-gnu/libc.so.6\n", | |
| " 0x00006230479c90ed in <unknown> from /home/novak/software/miniforge3/envs/def/bin/python\n" | |
| ] | |
| }, | |
| { | |
| "ename": "SegmentationViolation", | |
| "evalue": "static TString TWebCanvas::CreateCanvasJSON(TCanvas* c, Int_t json_compression = 0, Bool_t batchmode = kFALSE) =>\n SegmentationViolation: segfault in C++; program state was reset", | |
| "output_type": "error", | |
| "traceback": [ | |
| "\u001b[31m---------------------------------------------------------------------------\u001b[39m", | |
| "\u001b[31mSegmentationViolation\u001b[39m Traceback (most recent call last)", | |
| "\u001b[36mFile \u001b[39m\u001b[32m~/software/miniforge3/envs/def/lib/python3.12/site-packages/JupyROOT/helpers/utils.py:471\u001b[39m, in \u001b[36mCaptureDrawnPrimitives._post_execute\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 470\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_post_execute\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[32m--> \u001b[39m\u001b[32m471\u001b[39m \u001b[43mNotebookDraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", | |
| "\u001b[36mFile \u001b[39m\u001b[32m~/software/miniforge3/envs/def/lib/python3.12/site-packages/JupyROOT/helpers/utils.py:460\u001b[39m, in \u001b[36mNotebookDraw\u001b[39m\u001b[34m()\u001b[39m\n\u001b[32m 458\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mNotebookDraw\u001b[39m():\n\u001b[32m 459\u001b[39m DrawGeometry()\n\u001b[32m--> \u001b[39m\u001b[32m460\u001b[39m \u001b[43mDrawCanvases\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 461\u001b[39m DrawRCanvases()\n", | |
| "\u001b[36mFile \u001b[39m\u001b[32m~/software/miniforge3/envs/def/lib/python3.12/site-packages/JupyROOT/helpers/utils.py:451\u001b[39m, in \u001b[36mDrawCanvases\u001b[39m\u001b[34m()\u001b[39m\n\u001b[32m 449\u001b[39m drawers = GetCanvasDrawers()\n\u001b[32m 450\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m drawer \u001b[38;5;129;01min\u001b[39;00m drawers:\n\u001b[32m--> \u001b[39m\u001b[32m451\u001b[39m \u001b[43mdrawer\u001b[49m\u001b[43m.\u001b[49m\u001b[43mDraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", | |
| "\u001b[36mFile \u001b[39m\u001b[32m~/software/miniforge3/envs/def/lib/python3.12/site-packages/JupyROOT/helpers/utils.py:647\u001b[39m, in \u001b[36mNotebookDrawer.Draw\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 646\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mDraw\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[32m--> \u001b[39m\u001b[32m647\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_display\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 648\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[32m0\u001b[39m\n", | |
| "\u001b[36mFile \u001b[39m\u001b[32m~/software/miniforge3/envs/def/lib/python3.12/site-packages/JupyROOT/helpers/utils.py:633\u001b[39m, in \u001b[36mNotebookDrawer._display\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 631\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 632\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m._canJsDisplay():\n\u001b[32m--> \u001b[39m\u001b[32m633\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_jsDisplay\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 634\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 635\u001b[39m \u001b[38;5;28mself\u001b[39m._pngDisplay()\n", | |
| "\u001b[36mFile \u001b[39m\u001b[32m~/software/miniforge3/envs/def/lib/python3.12/site-packages/JupyROOT/helpers/utils.py:597\u001b[39m, in \u001b[36mNotebookDrawer._jsDisplay\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 595\u001b[39m name = \u001b[38;5;28mself\u001b[39m._getDrawId()\n\u001b[32m 596\u001b[39m updated = \u001b[38;5;28mself\u001b[39m._getUpdated()\n\u001b[32m--> \u001b[39m\u001b[32m597\u001b[39m jsdiv = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_getJsDiv\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 598\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m name \u001b[38;5;129;01mand\u001b[39;00m (name \u001b[38;5;129;01min\u001b[39;00m _canvasHandles) \u001b[38;5;129;01mand\u001b[39;00m updated:\n\u001b[32m 599\u001b[39m _canvasHandles[name].update(jsdiv)\n", | |
| "\u001b[36mFile \u001b[39m\u001b[32m~/software/miniforge3/envs/def/lib/python3.12/site-packages/JupyROOT/helpers/utils.py:576\u001b[39m, in \u001b[36mNotebookDrawer._getJsDiv\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 575\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_getJsDiv\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[32m--> \u001b[39m\u001b[32m576\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m display.HTML(\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_getJsCode\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m)\n", | |
| "\u001b[36mFile \u001b[39m\u001b[32m~/software/miniforge3/envs/def/lib/python3.12/site-packages/JupyROOT/helpers/utils.py:550\u001b[39m, in \u001b[36mNotebookDrawer._getJsCode\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 548\u001b[39m json = \u001b[38;5;28mself\u001b[39m.drawableObject.CreateJSON()\n\u001b[32m 549\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m550\u001b[39m json = \u001b[43mproduceCanvasJson\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mdrawableObject\u001b[49m\u001b[43m)\u001b[49m.Data()\n\u001b[32m 552\u001b[39m divId = \u001b[38;5;28mself\u001b[39m._getUniqueDivId()\n\u001b[32m 554\u001b[39m width = _jsCanvasWidth\n", | |
| "\u001b[36mFile \u001b[39m\u001b[32m~/software/miniforge3/envs/def/lib/python3.12/site-packages/JupyROOT/helpers/utils.py:302\u001b[39m, in \u001b[36mproduceCanvasJson\u001b[39m\u001b[34m(canvas)\u001b[39m\n\u001b[32m 299\u001b[39m canvas.Draw()\n\u001b[32m 301\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m TWebCanvasAvailable():\n\u001b[32m--> \u001b[39m\u001b[32m302\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mROOT\u001b[49m\u001b[43m.\u001b[49m\u001b[43mTWebCanvas\u001b[49m\u001b[43m.\u001b[49m\u001b[43mCreateCanvasJSON\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcanvas\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[32;43m23\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[32m 304\u001b[39m \u001b[38;5;66;03m# Add extra primitives to canvas with custom colors, palette, gStyle\u001b[39;00m\n\u001b[32m 306\u001b[39m prim = canvas.GetListOfPrimitives()\n", | |
| "\u001b[31mSegmentationViolation\u001b[39m: static TString TWebCanvas::CreateCanvasJSON(TCanvas* c, Int_t json_compression = 0, Bool_t batchmode = kFALSE) =>\n SegmentationViolation: segfault in C++; program state was reset" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "cmsstyle.setCMSStyle()\n", | |
| "\n", | |
| "# Create a canvas\n", | |
| "c = ROOT.TCanvas(\"c\", \"Basic ROOT Plot\", 800, 600)\n", | |
| "\n", | |
| "# Create a histogram with 100 bins from 0 to 10\n", | |
| "h = ROOT.TH1F(\"h\", \"Example Histogram;X axis;Entries\", 100, 0, 10)\n", | |
| "\n", | |
| "# Fill histogram with random Gaussian numbers\n", | |
| "for _ in range(10000):\n", | |
| " h.Fill(ROOT.gRandom.Gaus(5, 1))\n", | |
| "\n", | |
| "# Draw the histogram\n", | |
| "h.Draw()\n", | |
| "\n", | |
| "# Show canvas inline in Jupyter\n", | |
| "c.Draw()\n" | |
| ] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python [conda env:miniforge3-def] *", | |
| "language": "python", | |
| "name": "conda-env-miniforge3-def-py" | |
| }, | |
| "language_info": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 3 | |
| }, | |
| "file_extension": ".py", | |
| "mimetype": "text/x-python", | |
| "name": "python", | |
| "nbconvert_exporter": "python", | |
| "pygments_lexer": "ipython3", | |
| "version": "3.12.11" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 5 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment