From 432f5e3d6fbed323f2b423699c9cf85be7fed4e7 Mon Sep 17 00:00:00 2001 From: Monica Dessole Date: Wed, 26 Mar 2025 15:00:36 +0100 Subject: [PATCH 1/4] [tutorial] Change path --- tutorials/CMakeLists.txt | 11 +++++------ .../webgui/browserv7}/browser.cxx | 4 ++-- .../webgui/browserv7}/filedialog.cxx | 10 +++++----- .../webgui/fitpanelv7}/fitpanel6.cxx | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) rename tutorials/{experimental => visualisation/webgui/browserv7}/browser.cxx (87%) rename tutorials/{experimental => visualisation/webgui/browserv7}/filedialog.cxx (89%) rename tutorials/{experimental => visualisation/webgui/fitpanelv7}/fitpanel6.cxx (97%) diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 4c597d4964271..fc13ef7ad8065 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -374,10 +374,9 @@ endif() if(root7) set(root7_veto analysis/dataframe/df013_InspectAnalysis.C - experimental/browser.cxx - experimental/filedialog.cxx - experimental/fitpanel.cxx - experimental/fitpanel6.cxx + tutorials/visualisation/webgui/browserv7/browser.cxx + tutorials/visualisation/webgui/browserv7/filedialog.cxx + tutorials/visualisation/webgui/fitpanelv7/fitpanel6.cxx ) if(NOT davix) list(APPEND root7_veto io/ntuple/ntpl004_dimuon.C) @@ -401,7 +400,7 @@ else() if(MSVC AND NOT win_broken_tests) list(APPEND root7_veto analysis/dataframe/df013_InspectAnalysis.C) endif() - file(GLOB v7_veto_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ experimental/*.py experimental/*.cxx experimental/*/*.cxx experimental/*.C experimental/*/*.C experimental/rcanvas/*.py experimental/rcanvas/*.cxx) + file(GLOB v7_veto_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ tutorials/visualisation/webgui/browserv7/*.cxx tutorials/visualisation/webgui/fitpanelv7/*.cxx experimental/rcanvas/*.py experimental/rcanvas/*.cxx) list(APPEND root7_veto ${v7_veto_files}) # This depends on ntupleutil list(APPEND root7_veto io/ntuple/ntpl008_import.C) @@ -512,7 +511,7 @@ if(webgui) list(APPEND tutorials ${visualisation/tutorials_webcanv}) endif() if(root7 AND webgui) - file(GLOB_RECURSE tutorials_exp RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} experimental/*.cxx) + file(GLOB_RECURSE tutorials_exp RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} experimental/*.cxx tutorials/visualisation/webgui/browserv7/*.cxx tutorials/visualisation/webgui/fitpanelv7/*.cxx) list(APPEND tutorials ${tutorials_exp}) endif() file(GLOB tutorials_veto RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${all_veto}) diff --git a/tutorials/experimental/browser.cxx b/tutorials/visualisation/webgui/browserv7/browser.cxx similarity index 87% rename from tutorials/experimental/browser.cxx rename to tutorials/visualisation/webgui/browserv7/browser.cxx index d99bbf36791fd..5d421e3252f0b 100644 --- a/tutorials/experimental/browser.cxx +++ b/tutorials/visualisation/webgui/browserv7/browser.cxx @@ -1,10 +1,10 @@ /// \file -/// \ingroup tutorial_exp +/// \ingroup tutorial_webgui /// +/// Example showing RBrowser, web-based ROOT files and objects browser. /// \macro_code /// /// \date 2019-05-29 -/// \warning This is part of the experimental API, which might change in the future. Feedback is welcome! /// \authors Bertrand Bellenot , Sergey Linev /************************************************************************* diff --git a/tutorials/experimental/filedialog.cxx b/tutorials/visualisation/webgui/browserv7/filedialog.cxx similarity index 89% rename from tutorials/experimental/filedialog.cxx rename to tutorials/visualisation/webgui/browserv7/filedialog.cxx index 7ceaa6b5b9bfc..7ee7ce6f2795c 100644 --- a/tutorials/experimental/filedialog.cxx +++ b/tutorials/visualisation/webgui/browserv7/filedialog.cxx @@ -1,10 +1,10 @@ /// \file -/// \ingroup tutorial_exp +/// \ingroup tutorial_webgui /// +/// Example showing how RFileDialog can be used in sync and async modes. /// \macro_code /// /// \date 2019-11-01 -/// \warning This is part of the experimental API, which might change in the future. Feedback is welcome! /// \author Sergey Linev /************************************************************************* @@ -15,11 +15,11 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ -// Show how RFileDialog can be used in sync and async modes -// Normally file dialogs will be used inside other widgets as ui5 dialogs + +// Normally file dialogs will be used inside other widgets as ui5 dialogs. // By default, dialog starts in async mode - means macro immediately returns to command line // To start OpenFile dialog in sync mode, call `root "filedialog.cxx(1)" -q`. -// Once file is selected, root execution will be stopped +// Once file is selected, root execution will be stopped. // macro must be here to let macro work on Windows diff --git a/tutorials/experimental/fitpanel6.cxx b/tutorials/visualisation/webgui/fitpanelv7/fitpanel6.cxx similarity index 97% rename from tutorials/experimental/fitpanel6.cxx rename to tutorials/visualisation/webgui/fitpanelv7/fitpanel6.cxx index 5965d086932e7..b53e8efd69ec1 100644 --- a/tutorials/experimental/fitpanel6.cxx +++ b/tutorials/visualisation/webgui/fitpanelv7/fitpanel6.cxx @@ -1,5 +1,5 @@ /// \file -/// \ingroup tutorial_exp +/// \ingroup tutorial_webgui /// /// \macro_code /// From 1b313ecafe84ef40d36780f00f7609f4adef9d82 Mon Sep 17 00:00:00 2001 From: Monica Dessole Date: Wed, 26 Mar 2025 15:01:09 +0100 Subject: [PATCH 2/4] Remove ROOT7 warning --- gui/browserv7/inc/ROOT/RBrowser.hxx | 1 - gui/browserv7/inc/ROOT/RBrowserData.hxx | 1 - gui/browserv7/inc/ROOT/RBrowserReply.hxx | 1 - gui/browserv7/inc/ROOT/RBrowserRequest.hxx | 1 - gui/browserv7/inc/ROOT/RFileDialog.hxx | 1 - gui/browserv7/inc/ROOT/RWebBrowserImp.hxx | 1 - 6 files changed, 6 deletions(-) diff --git a/gui/browserv7/inc/ROOT/RBrowser.hxx b/gui/browserv7/inc/ROOT/RBrowser.hxx index 40ea9c32acf40..e44a87938ab1c 100644 --- a/gui/browserv7/inc/ROOT/RBrowser.hxx +++ b/gui/browserv7/inc/ROOT/RBrowser.hxx @@ -1,6 +1,5 @@ // Authors: Bertrand Bellenot Sergey Linev // Date: 2019-02-28 -// Warning: This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome! /************************************************************************* * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. * diff --git a/gui/browserv7/inc/ROOT/RBrowserData.hxx b/gui/browserv7/inc/ROOT/RBrowserData.hxx index 7412ef863582d..08d9d2e566cc9 100644 --- a/gui/browserv7/inc/ROOT/RBrowserData.hxx +++ b/gui/browserv7/inc/ROOT/RBrowserData.hxx @@ -1,6 +1,5 @@ // Author: Sergey Linev // Date: 2019-10-14 -// Warning: This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome! /************************************************************************* * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * diff --git a/gui/browserv7/inc/ROOT/RBrowserReply.hxx b/gui/browserv7/inc/ROOT/RBrowserReply.hxx index 2857fdd94c499..1d488c9a70e77 100644 --- a/gui/browserv7/inc/ROOT/RBrowserReply.hxx +++ b/gui/browserv7/inc/ROOT/RBrowserReply.hxx @@ -1,6 +1,5 @@ // Authors: Bertrand Bellenot Sergey Linev // Date: 2019-02-28 -// Warning: This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome! /************************************************************************* * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * diff --git a/gui/browserv7/inc/ROOT/RBrowserRequest.hxx b/gui/browserv7/inc/ROOT/RBrowserRequest.hxx index 0bd2ab0cf48cf..8f2fb906e0f4c 100644 --- a/gui/browserv7/inc/ROOT/RBrowserRequest.hxx +++ b/gui/browserv7/inc/ROOT/RBrowserRequest.hxx @@ -1,6 +1,5 @@ // Authors: Bertrand Bellenot Sergey Linev // Date: 2019-02-28 -// Warning: This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome! /************************************************************************* * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * diff --git a/gui/browserv7/inc/ROOT/RFileDialog.hxx b/gui/browserv7/inc/ROOT/RFileDialog.hxx index 2fe0ca2696b5b..0a46d866589c5 100644 --- a/gui/browserv7/inc/ROOT/RFileDialog.hxx +++ b/gui/browserv7/inc/ROOT/RFileDialog.hxx @@ -1,6 +1,5 @@ // Author: Sergey Linev // Date: 2019-10-31 -// Warning: This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome! /************************************************************************* * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * diff --git a/gui/browserv7/inc/ROOT/RWebBrowserImp.hxx b/gui/browserv7/inc/ROOT/RWebBrowserImp.hxx index bc36359fc16d1..e500dd4479f77 100644 --- a/gui/browserv7/inc/ROOT/RWebBrowserImp.hxx +++ b/gui/browserv7/inc/ROOT/RWebBrowserImp.hxx @@ -1,6 +1,5 @@ // Author: Sergey Linev // Date: 2021-02-11 -// Warning: This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome! /************************************************************************* * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. * From 578a3706813a4ed6ad4a8155ae81c50f09596315 Mon Sep 17 00:00:00 2001 From: Monica Dessole Date: Wed, 26 Mar 2025 15:38:15 +0100 Subject: [PATCH 3/4] [tutorial] Move RCanvas tutorials to Visualization --- tutorials/CMakeLists.txt | 22 +++++++++--------- tutorials/experimental/index.md | 11 --------- tutorials/visualisation/index.md | 4 ++++ .../rcanvas/comic.woff2 | Bin .../rcanvas/df104.py | 0 .../rcanvas/df105.py | 0 .../rcanvas/raxis.cxx | 0 .../rcanvas/rbox.cxx | 0 .../rcanvas/rbox.py | 0 .../rcanvas/rcanvas_mt.cxx | 0 .../rcanvas/rcanvas_update.cxx | 0 .../rcanvas/rframe.cxx | 0 .../rcanvas/rline.cxx | 0 .../rcanvas/rline_style.cxx | 0 .../rcanvas/rline_width.cxx | 0 .../rcanvas/rmarker.cxx | 0 .../rcanvas/rpad.cxx | 0 .../rcanvas/rpave.cxx | 0 .../rcanvas/rstyle.cxx | 0 .../rcanvas/rtext_align.cxx | 0 .../rcanvas/rtext_angle.cxx | 0 .../rcanvas/rtext_font.cxx | 0 .../rcanvas/symlog.cxx | 0 .../rcanvas/th1_twoscales.cxx | 0 .../rcanvas/tobject.cxx | 0 25 files changed, 15 insertions(+), 22 deletions(-) delete mode 100644 tutorials/experimental/index.md rename tutorials/{experimental => visualisation}/rcanvas/comic.woff2 (100%) rename tutorials/{experimental => visualisation}/rcanvas/df104.py (100%) rename tutorials/{experimental => visualisation}/rcanvas/df105.py (100%) rename tutorials/{experimental => visualisation}/rcanvas/raxis.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rbox.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rbox.py (100%) rename tutorials/{experimental => visualisation}/rcanvas/rcanvas_mt.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rcanvas_update.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rframe.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rline.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rline_style.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rline_width.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rmarker.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rpad.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rpave.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rstyle.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rtext_align.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rtext_angle.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/rtext_font.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/symlog.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/th1_twoscales.cxx (100%) rename tutorials/{experimental => visualisation}/rcanvas/tobject.cxx (100%) diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index fc13ef7ad8065..a8bb469a66472 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -193,8 +193,8 @@ if(NOT xrootd) analysis/dataframe/df106_HiggsToFourLeptons.py analysis/dataframe/df107_SingleTopAnalysis.py roofit/roofit/rf618_mixture_models.py # depends on df106_HiggsToFourLeptons.py - experimental/rcanvas/df104.py - experimental/rcanvas/df105.py + visualisation/rcanvas/df104.py + visualisation/rcanvas/df105.py ) endif() @@ -293,7 +293,7 @@ set(gui_veto math/fit/fitpanel_playback.C visualisation/webgui/panel/webpanel.cxx visualisation/webgui/webwindow/webwindow.cxx) if (NOT webgui) - list(APPEND gui_veto visualisation/graphics/save_batch.C experimental/rcanvas/df104.py experimental/rcanvas/df105.py) + list(APPEND gui_veto visualisation/graphics/save_batch.C visualisation/rcanvas/df104.py visualisation/rcanvas/df105.py) endif() if (NOT ROOT_tmva_FOUND) @@ -387,20 +387,20 @@ if(root7) list(APPEND root7_veto io/ntuple/ntpl011_global_temperatures.C) list(APPEND root7_veto io/ntuple/ntpl004_dimuon.C) list(APPEND root7_veto io/ntuple/ntpl008_import.C) - list(APPEND root7_veto experimental/rcanvas/df104.py) - list(APPEND root7_veto experimental/rcanvas/df105.py) + list(APPEND root7_veto visualisation/rcanvas/df104.py) + list(APPEND root7_veto visualisation/rcanvas/df105.py) endif() if(MSVC AND NOT win_broken_tests) #---EOS is not supported on Windows - list(APPEND root7_veto experimental/rcanvas/df104.py) - list(APPEND root7_veto experimental/rcanvas/df105.py) - list(APPEND root7_veto experimental/rcanvas/rbox.py) + list(APPEND root7_veto visualisation/rcanvas/df104.py) + list(APPEND root7_veto visualisation/rcanvas/df105.py) + list(APPEND root7_veto visualisation/rcanvas/rbox.py) endif() else() if(MSVC AND NOT win_broken_tests) list(APPEND root7_veto analysis/dataframe/df013_InspectAnalysis.C) endif() - file(GLOB v7_veto_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ tutorials/visualisation/webgui/browserv7/*.cxx tutorials/visualisation/webgui/fitpanelv7/*.cxx experimental/rcanvas/*.py experimental/rcanvas/*.cxx) + file(GLOB v7_veto_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ visualisation/webgui/browserv7/*.cxx visualisation/webgui/fitpanelv7/*.cxx visualisation/rcanvas/*.py visualisation/rcanvas/*.cxx) list(APPEND root7_veto ${v7_veto_files}) # This depends on ntupleutil list(APPEND root7_veto io/ntuple/ntpl008_import.C) @@ -511,7 +511,7 @@ if(webgui) list(APPEND tutorials ${visualisation/tutorials_webcanv}) endif() if(root7 AND webgui) - file(GLOB_RECURSE tutorials_exp RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} experimental/*.cxx tutorials/visualisation/webgui/browserv7/*.cxx tutorials/visualisation/webgui/fitpanelv7/*.cxx) + file(GLOB_RECURSE tutorials_exp RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} visualisation/rcanvas/*.cxx tutorials/visualisation/webgui/browserv7/*.cxx tutorials/visualisation/webgui/fitpanelv7/*.cxx) list(APPEND tutorials ${tutorials_exp}) endif() file(GLOB tutorials_veto RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${all_veto}) @@ -639,7 +639,7 @@ file(GLOB long_running RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${long_running}) set(NProcessors 4) set (multithreaded_all_cores analysis/dataframe/df10[2-7]* - experimental/rcanvas/df10* + visualisation/rcanvas/df10* ) set (multithreaded ${multithreaded_all_cores} diff --git a/tutorials/experimental/index.md b/tutorials/experimental/index.md deleted file mode 100644 index 45bd69092c049..0000000000000 --- a/tutorials/experimental/index.md +++ /dev/null @@ -1,11 +0,0 @@ -\addtogroup tutorial_exp - -@{ - -\warning This is part of the experimental API, which might change in the future. Feedback is welcome! - -@} - -\defgroup tutorial_rcanvas RCanvas examples -\ingroup tutorial_exp -\brief These are RCanvas examples. diff --git a/tutorials/visualisation/index.md b/tutorials/visualisation/index.md index 79059d976284f..b4658aa805586 100644 --- a/tutorials/visualisation/index.md +++ b/tutorials/visualisation/index.md @@ -32,6 +32,10 @@ \ingroup tutorial_visualisation \brief Various examples showing the OpenGL graphics in ROOT. +\defgroup tutorial_rcanvas RCanvas examples +\ingroup tutorial_visualisation +\brief These are RCanvas examples. + \defgroup tutorial_cocoa Tutorials specific to Mac/Cocoa \ingroup tutorial_visualisation \brief Various examples showing graphics done with the Mac graphics system Cocoa. diff --git a/tutorials/experimental/rcanvas/comic.woff2 b/tutorials/visualisation/rcanvas/comic.woff2 similarity index 100% rename from tutorials/experimental/rcanvas/comic.woff2 rename to tutorials/visualisation/rcanvas/comic.woff2 diff --git a/tutorials/experimental/rcanvas/df104.py b/tutorials/visualisation/rcanvas/df104.py similarity index 100% rename from tutorials/experimental/rcanvas/df104.py rename to tutorials/visualisation/rcanvas/df104.py diff --git a/tutorials/experimental/rcanvas/df105.py b/tutorials/visualisation/rcanvas/df105.py similarity index 100% rename from tutorials/experimental/rcanvas/df105.py rename to tutorials/visualisation/rcanvas/df105.py diff --git a/tutorials/experimental/rcanvas/raxis.cxx b/tutorials/visualisation/rcanvas/raxis.cxx similarity index 100% rename from tutorials/experimental/rcanvas/raxis.cxx rename to tutorials/visualisation/rcanvas/raxis.cxx diff --git a/tutorials/experimental/rcanvas/rbox.cxx b/tutorials/visualisation/rcanvas/rbox.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rbox.cxx rename to tutorials/visualisation/rcanvas/rbox.cxx diff --git a/tutorials/experimental/rcanvas/rbox.py b/tutorials/visualisation/rcanvas/rbox.py similarity index 100% rename from tutorials/experimental/rcanvas/rbox.py rename to tutorials/visualisation/rcanvas/rbox.py diff --git a/tutorials/experimental/rcanvas/rcanvas_mt.cxx b/tutorials/visualisation/rcanvas/rcanvas_mt.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rcanvas_mt.cxx rename to tutorials/visualisation/rcanvas/rcanvas_mt.cxx diff --git a/tutorials/experimental/rcanvas/rcanvas_update.cxx b/tutorials/visualisation/rcanvas/rcanvas_update.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rcanvas_update.cxx rename to tutorials/visualisation/rcanvas/rcanvas_update.cxx diff --git a/tutorials/experimental/rcanvas/rframe.cxx b/tutorials/visualisation/rcanvas/rframe.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rframe.cxx rename to tutorials/visualisation/rcanvas/rframe.cxx diff --git a/tutorials/experimental/rcanvas/rline.cxx b/tutorials/visualisation/rcanvas/rline.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rline.cxx rename to tutorials/visualisation/rcanvas/rline.cxx diff --git a/tutorials/experimental/rcanvas/rline_style.cxx b/tutorials/visualisation/rcanvas/rline_style.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rline_style.cxx rename to tutorials/visualisation/rcanvas/rline_style.cxx diff --git a/tutorials/experimental/rcanvas/rline_width.cxx b/tutorials/visualisation/rcanvas/rline_width.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rline_width.cxx rename to tutorials/visualisation/rcanvas/rline_width.cxx diff --git a/tutorials/experimental/rcanvas/rmarker.cxx b/tutorials/visualisation/rcanvas/rmarker.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rmarker.cxx rename to tutorials/visualisation/rcanvas/rmarker.cxx diff --git a/tutorials/experimental/rcanvas/rpad.cxx b/tutorials/visualisation/rcanvas/rpad.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rpad.cxx rename to tutorials/visualisation/rcanvas/rpad.cxx diff --git a/tutorials/experimental/rcanvas/rpave.cxx b/tutorials/visualisation/rcanvas/rpave.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rpave.cxx rename to tutorials/visualisation/rcanvas/rpave.cxx diff --git a/tutorials/experimental/rcanvas/rstyle.cxx b/tutorials/visualisation/rcanvas/rstyle.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rstyle.cxx rename to tutorials/visualisation/rcanvas/rstyle.cxx diff --git a/tutorials/experimental/rcanvas/rtext_align.cxx b/tutorials/visualisation/rcanvas/rtext_align.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rtext_align.cxx rename to tutorials/visualisation/rcanvas/rtext_align.cxx diff --git a/tutorials/experimental/rcanvas/rtext_angle.cxx b/tutorials/visualisation/rcanvas/rtext_angle.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rtext_angle.cxx rename to tutorials/visualisation/rcanvas/rtext_angle.cxx diff --git a/tutorials/experimental/rcanvas/rtext_font.cxx b/tutorials/visualisation/rcanvas/rtext_font.cxx similarity index 100% rename from tutorials/experimental/rcanvas/rtext_font.cxx rename to tutorials/visualisation/rcanvas/rtext_font.cxx diff --git a/tutorials/experimental/rcanvas/symlog.cxx b/tutorials/visualisation/rcanvas/symlog.cxx similarity index 100% rename from tutorials/experimental/rcanvas/symlog.cxx rename to tutorials/visualisation/rcanvas/symlog.cxx diff --git a/tutorials/experimental/rcanvas/th1_twoscales.cxx b/tutorials/visualisation/rcanvas/th1_twoscales.cxx similarity index 100% rename from tutorials/experimental/rcanvas/th1_twoscales.cxx rename to tutorials/visualisation/rcanvas/th1_twoscales.cxx diff --git a/tutorials/experimental/rcanvas/tobject.cxx b/tutorials/visualisation/rcanvas/tobject.cxx similarity index 100% rename from tutorials/experimental/rcanvas/tobject.cxx rename to tutorials/visualisation/rcanvas/tobject.cxx From 4f0a24bd9077ac3a2d5183be63fb481b6ea6890e Mon Sep 17 00:00:00 2001 From: mdessole Date: Wed, 23 Apr 2025 14:30:05 +0200 Subject: [PATCH 4/4] Apply formatting --- tutorials/visualisation/rcanvas/df104.py | 68 +++++++---- tutorials/visualisation/rcanvas/df105.py | 110 ++++++++++++------ tutorials/visualisation/rcanvas/raxis.cxx | 10 +- tutorials/visualisation/rcanvas/rbox.cxx | 10 +- tutorials/visualisation/rcanvas/rbox.py | 4 +- .../visualisation/rcanvas/rcanvas_mt.cxx | 4 +- .../visualisation/rcanvas/rcanvas_update.cxx | 13 ++- tutorials/visualisation/rcanvas/rframe.cxx | 19 +-- tutorials/visualisation/rcanvas/rline.cxx | 22 ++-- .../visualisation/rcanvas/rline_style.cxx | 2 +- .../visualisation/rcanvas/rline_width.cxx | 6 +- tutorials/visualisation/rcanvas/rmarker.cxx | 12 +- tutorials/visualisation/rcanvas/rpad.cxx | 2 +- tutorials/visualisation/rcanvas/rpave.cxx | 10 +- tutorials/visualisation/rcanvas/rstyle.cxx | 10 +- .../visualisation/rcanvas/rtext_align.cxx | 2 +- .../visualisation/rcanvas/rtext_angle.cxx | 4 +- .../visualisation/rcanvas/rtext_font.cxx | 7 +- tutorials/visualisation/rcanvas/symlog.cxx | 11 +- .../visualisation/rcanvas/th1_twoscales.cxx | 19 +-- tutorials/visualisation/rcanvas/tobject.cxx | 16 +-- .../webgui/browserv7/browser.cxx | 1 - .../webgui/browserv7/filedialog.cxx | 13 +-- .../webgui/fitpanelv7/fitpanel6.cxx | 3 +- 24 files changed, 229 insertions(+), 149 deletions(-) diff --git a/tutorials/visualisation/rcanvas/df104.py b/tutorials/visualisation/rcanvas/df104.py index 906dc1734981a..f50a86e87ba00 100644 --- a/tutorials/visualisation/rcanvas/df104.py +++ b/tutorials/visualisation/rcanvas/df104.py @@ -21,7 +21,18 @@ import ROOT import os -from ROOT.Experimental import RCanvas, RText, RAttrText, RAttrFont, RAttrFill, RAttrLine, RLegend, RPadPos, RPadExtent, TObjectDrawable +from ROOT.Experimental import ( + RCanvas, + RText, + RAttrText, + RAttrFont, + RAttrFill, + RAttrLine, + RLegend, + RPadPos, + RPadExtent, + TObjectDrawable, +) # Enable multi-threading ROOT.ROOT.EnableImplicitMT() @@ -29,15 +40,16 @@ # Create a ROOT dataframe for each dataset path = "root://eospublic.cern.ch//eos/opendata/atlas/OutreachDatasets/2020-01-22" df = {} -df["data"] = ROOT.RDataFrame("mini", (os.path.join(path, "GamGam/Data/data_{}.GamGam.root".format(x)) for x in ("A", "B", "C", "D"))) +df["data"] = ROOT.RDataFrame( + "mini", (os.path.join(path, "GamGam/Data/data_{}.GamGam.root".format(x)) for x in ("A", "B", "C", "D")) +) df["ggH"] = ROOT.RDataFrame("mini", os.path.join(path, "GamGam/MC/mc_343981.ggH125_gamgam.GamGam.root")) df["VBF"] = ROOT.RDataFrame("mini", os.path.join(path, "GamGam/MC/mc_345041.VBFH125_gamgam.GamGam.root")) processes = list(df.keys()) # Apply scale factors and MC weight for simulated events and a weight of 1 for the data for p in ["ggH", "VBF"]: - df[p] = df[p].Define("weight", - "scaleFactor_PHOTON * scaleFactor_PhotonTRIGGER * scaleFactor_PILEUP * mcWeight"); + df[p] = df[p].Define("weight", "scaleFactor_PHOTON * scaleFactor_PhotonTRIGGER * scaleFactor_PILEUP * mcWeight") df["data"] = df["data"].Define("weight", "1.0") # Select the events for the analysis @@ -46,39 +58,55 @@ df[p] = df[p].Filter("trigP") # Find two good muons with tight ID, pt > 25 GeV and not in the transition region between barrel and encap - df[p] = df[p].Define("goodphotons", "photon_isTightID && (photon_pt > 25000) && (abs(photon_eta) < 2.37) && ((abs(photon_eta) < 1.37) || (abs(photon_eta) > 1.52))")\ - .Filter("Sum(goodphotons) == 2") + df[p] = ( + df[p] + .Define( + "goodphotons", + "photon_isTightID && (photon_pt > 25000) && (abs(photon_eta) < 2.37) && ((abs(photon_eta) < 1.37) || (abs(photon_eta) > 1.52))", + ) + .Filter("Sum(goodphotons) == 2") + ) # Take only isolated photons - df[p] = df[p].Filter("Sum(photon_ptcone30[goodphotons] / photon_pt[goodphotons] < 0.065) == 2")\ - .Filter("Sum(photon_etcone20[goodphotons] / photon_pt[goodphotons] < 0.065) == 2") + df[p] = ( + df[p] + .Filter("Sum(photon_ptcone30[goodphotons] / photon_pt[goodphotons] < 0.065) == 2") + .Filter("Sum(photon_etcone20[goodphotons] / photon_pt[goodphotons] < 0.065) == 2") + ) # Compile a function to compute the invariant mass of the diphoton system ROOT.gInterpreter.Declare( -""" + """ using Vec_t = const ROOT::VecOps::RVec; float ComputeInvariantMass(Vec_t& pt, Vec_t& eta, Vec_t& phi, Vec_t& e) { ROOT::Math::PtEtaPhiEVector p1(pt[0], eta[0], phi[0], e[0]); ROOT::Math::PtEtaPhiEVector p2(pt[1], eta[1], phi[1], e[1]); return (p1 + p2).mass() / 1000.0; } -""") +""" +) # Define a new column with the invariant mass and perform final event selection hists = {} for p in processes: # Make four vectors and compute invariant mass - df[p] = df[p].Define("m_yy", "ComputeInvariantMass(photon_pt[goodphotons], photon_eta[goodphotons], photon_phi[goodphotons], photon_E[goodphotons])") + df[p] = df[p].Define( + "m_yy", + "ComputeInvariantMass(photon_pt[goodphotons], photon_eta[goodphotons], photon_phi[goodphotons], photon_E[goodphotons])", + ) # Make additional kinematic cuts and select mass window - df[p] = df[p].Filter("photon_pt[goodphotons][0] / 1000.0 / m_yy > 0.35")\ - .Filter("photon_pt[goodphotons][1] / 1000.0 / m_yy > 0.25")\ - .Filter("m_yy > 105 && m_yy < 160") + df[p] = ( + df[p] + .Filter("photon_pt[goodphotons][0] / 1000.0 / m_yy > 0.35") + .Filter("photon_pt[goodphotons][1] / 1000.0 / m_yy > 0.25") + .Filter("m_yy > 105 && m_yy < 160") + ) # Book histogram of the invariant mass with this selection hists[p] = df[p].Histo1D( - ROOT.RDF.TH1DModel(p, "Diphoton invariant mass; m_{#gamma#gamma} [GeV];Events", 30, 105, 160), - "m_yy", "weight") + ROOT.RDF.TH1DModel(p, "Diphoton invariant mass; m_{#gamma#gamma} [GeV];Events", 30, 105, 160), "m_yy", "weight" + ) # Run the event loop @@ -100,8 +128,8 @@ # Create canvas with pads for main plot and data/MC ratio c = RCanvas.Create("df104_HiggsToTwoPhotons") -lower_pad = c.AddPad(RPadPos(0,0.65), RPadExtent(1, 0.35)) -upper_pad = c.AddPad(RPadPos(0,0), RPadExtent(1, 0.65)) +lower_pad = c.AddPad(RPadPos(0, 0.65), RPadExtent(1, 0.35)) +upper_pad = c.AddPad(RPadPos(0, 0), RPadExtent(1, 0.65)) upper_frame = upper_pad.AddFrame() upper_frame.margins.bottom = 0 @@ -239,5 +267,5 @@ c.Show() # Save plot in PNG file -if c.SaveAs("df104.png") : - print("Saved figure to df104.png") +if c.SaveAs("df104.png"): + print("Saved figure to df104.png") diff --git a/tutorials/visualisation/rcanvas/df105.py b/tutorials/visualisation/rcanvas/df105.py index 5be1073b0b8cc..c78a507ecdea2 100644 --- a/tutorials/visualisation/rcanvas/df105.py +++ b/tutorials/visualisation/rcanvas/df105.py @@ -29,29 +29,48 @@ # Argument parsing parser = argparse.ArgumentParser() -parser.add_argument("--lumi-scale", type=float, default=0.001, - help="Run only on a fraction of the total available 10 fb^-1 (only usable together with --full-dataset)") -parser.add_argument("--full-dataset", action="store_true", default=False, - help="Use the full dataset (use --lumi-scale to run only on a fraction of it)") +parser.add_argument( + "--lumi-scale", + type=float, + default=0.001, + help="Run only on a fraction of the total available 10 fb^-1 (only usable together with --full-dataset)", +) +parser.add_argument( + "--full-dataset", + action="store_true", + default=False, + help="Use the full dataset (use --lumi-scale to run only on a fraction of it)", +) parser.add_argument("-b", action="store_true", default=False, help="Use ROOT batch mode") -parser.add_argument("-t", action="store_true", default=False, help="Use implicit multi threading (for the full dataset only possible with --lumi-scale 1.0)") -if 'df105.py' in sys.argv[0]: +parser.add_argument( + "-t", + action="store_true", + default=False, + help="Use implicit multi threading (for the full dataset only possible with --lumi-scale 1.0)", +) +if "df105.py" in sys.argv[0]: # Script args = parser.parse_args() else: # Notebook args = parser.parse_args(args=[]) -if args.b: ROOT.gROOT.SetBatch(True) -if args.t: ROOT.EnableImplicitMT() +if args.b: + ROOT.gROOT.SetBatch(True) +if args.t: + ROOT.EnableImplicitMT() -if not args.full_dataset: lumi_scale = 0.001 # The preskimmed dataset contains only 0.01 fb^-1 -else: lumi_scale = args.lumi_scale +if not args.full_dataset: + lumi_scale = 0.001 # The preskimmed dataset contains only 0.01 fb^-1 +else: + lumi_scale = args.lumi_scale lumi = 10064.0 -print('Run on data corresponding to {:.2f} fb^-1 ...'.format(lumi * lumi_scale / 1000.0)) +print("Run on data corresponding to {:.2f} fb^-1 ...".format(lumi * lumi_scale / 1000.0)) -if args.full_dataset: dataset_path = "root://eospublic.cern.ch//eos/opendata/atlas/OutreachDatasets/2020-01-22" -else: dataset_path = "root://eospublic.cern.ch//eos/root-eos/reduced_atlas_opendata/w" +if args.full_dataset: + dataset_path = "root://eospublic.cern.ch//eos/opendata/atlas/OutreachDatasets/2020-01-22" +else: + dataset_path = "root://eospublic.cern.ch//eos/root-eos/reduced_atlas_opendata/w" # Create a ROOT dataframe for each dataset # Note that we load the filenames from the external json file placed in the same folder than this script. @@ -64,11 +83,11 @@ for p in processes: for d in files[p]: # Construct the dataframes - folder = d[0] # Folder name - sample = d[1] # Sample name - xsecs[sample] = d[2] # Cross-section - sumws[sample] = d[3] # Sum of weights - num_events = d[4] # Number of events + folder = d[0] # Folder name + sample = d[1] # Sample name + xsecs[sample] = d[2] # Cross-section + sumws[sample] = d[3] # Sum of weights + num_events = d[4] # Number of events samples.append(sample) df[sample] = ROOT.RDataFrame("mini", "{}/1lep/{}/{}.1lep.root".format(dataset_path, folder, sample)) @@ -98,23 +117,37 @@ for s in samples: # Select events with a muon or electron trigger and with a missing transverse energy larger than 30 GeV - df[s] = df[s].Filter("trigE || trigM")\ - .Filter("met_et > 30000") + df[s] = df[s].Filter("trigE || trigM").Filter("met_et > 30000") # Find events with exactly one good lepton - df[s] = df[s].Define("good_lep", "lep_isTightID && lep_pt > 35000 && lep_ptcone30 / lep_pt < 0.1 && lep_etcone20 / lep_pt < 0.1")\ - .Filter("ROOT::VecOps::Sum(good_lep) == 1") + df[s] = ( + df[s] + .Define( + "good_lep", "lep_isTightID && lep_pt > 35000 && lep_ptcone30 / lep_pt < 0.1 && lep_etcone20 / lep_pt < 0.1" + ) + .Filter("ROOT::VecOps::Sum(good_lep) == 1") + ) # Apply additional cuts in case the lepton is an electron or muon - df[s] = df[s].Define("idx", "ROOT::VecOps::ArgMax(good_lep)")\ - .Filter("GoodElectronOrMuon(lep_type[idx], lep_pt[idx], lep_eta[idx], lep_phi[idx], lep_E[idx], lep_trackd0pvunbiased[idx], lep_tracksigd0pvunbiased[idx], lep_z0[idx])") + df[s] = ( + df[s] + .Define("idx", "ROOT::VecOps::ArgMax(good_lep)") + .Filter( + "GoodElectronOrMuon(lep_type[idx], lep_pt[idx], lep_eta[idx], lep_phi[idx], lep_E[idx], lep_trackd0pvunbiased[idx], lep_tracksigd0pvunbiased[idx], lep_z0[idx])" + ) + ) # Apply luminosity, scale factors and MC weights for simulated events for s in samples: if "data" in s: df[s] = df[s].Define("weight", "1.0") else: - df[s] = df[s].Define("weight", "scaleFactor_ELE * scaleFactor_MUON * scaleFactor_LepTRIGGER * scaleFactor_PILEUP * mcWeight * {} / {} * {}".format(xsecs[s], sumws[s], lumi)) + df[s] = df[s].Define( + "weight", + "scaleFactor_ELE * scaleFactor_MUON * scaleFactor_LepTRIGGER * scaleFactor_PILEUP * mcWeight * {} / {} * {}".format( + xsecs[s], sumws[s], lumi + ), + ) # Compute transverse mass of the W boson using the lepton and the missing transverse energy and make a histogram ROOT.gInterpreter.Declare(""" @@ -128,7 +161,9 @@ histos = {} for s in samples: - df[s] = df[s].Define("mt_w", "ComputeTransverseMass(met_et, met_phi, lep_pt[idx], lep_eta[idx], lep_phi[idx], lep_E[idx])") + df[s] = df[s].Define( + "mt_w", "ComputeTransverseMass(met_et, met_phi, lep_pt[idx], lep_eta[idx], lep_phi[idx], lep_E[idx])" + ) histos[s] = df[s].Histo1D(ROOT.RDF.TH1DModel(s, "mt_w", 24, 60, 180), "mt_w", "weight") # Run the event loop and merge histograms of the respective processes @@ -139,15 +174,19 @@ # because not enough data is available. ROOT.RDF.RunGraphs([histos[s] for s in samples]) + def merge_histos(label): h = None for i, d in enumerate(files[label]): t = histos[d[1]].GetValue() - if i == 0: h = t.Clone() - else: h.Add(t) + if i == 0: + h = t.Clone() + else: + h.Add(t) h.SetNameTitle(label, label) return h + data = merge_histos("data") wjets = merge_histos("wjets") zjets = merge_histos("zjets") @@ -178,7 +217,7 @@ def merge_histos(label): frame.x.labels.size = 0.04 frame.y.min = 1 -frame.y.max = 1e10*args.lumi_scale +frame.y.max = 1e10 * args.lumi_scale frame.y.log = 10 frame.y.title.value = "Events" frame.y.title.size = 0.045 @@ -190,8 +229,9 @@ def merge_histos(label): # Draw stack with MC contributions stack = ROOT.THStack() for h, color in zip( - [singletop, diboson, ttbar, zjets, wjets], - [(0.82, 0.94, 0.76), (0.76, 0.54, 0.57), (0.61, 0.6, 0.8), (0.97, 0.81, 0.41), (0.87, 0.35, 0.42)]): + [singletop, diboson, ttbar, zjets, wjets], + [(0.82, 0.94, 0.76), (0.76, 0.54, 0.57), (0.61, 0.6, 0.8), (0.97, 0.81, 0.41), (0.87, 0.35, 0.42)], +): h.SetLineWidth(1) h.SetLineColor("black") h.SetFillColor(ROOT.TColor.GetColor(*color)) @@ -214,7 +254,7 @@ def merge_histos(label): legend.SetBorderSize(0) legend.SetTextSize(0.04) legend.SetTextAlign(32) -legend.AddEntry(data, "Data" ,"lep") +legend.AddEntry(data, "Data", "lep") legend.AddEntry(wjets, "W+jets", "f") legend.AddEntry(zjets, "Z+jets", "f") legend.AddEntry(ttbar, "t#bar{t}", "f") @@ -233,7 +273,9 @@ def merge_histos(label): lbl2.text.font = RAttrFont.kArial lbl2.text.size = 0.04 lbl2.text.align = RAttrText.kLeftBottom -lbl3 = c.Add[RText](RPadPos(0.05, 0.82), "#sqrt{{s}} = 13 TeV, {:.2f} fb^{{-1}}".format(lumi * args.lumi_scale / 1000.0)) +lbl3 = c.Add[RText]( + RPadPos(0.05, 0.82), "#sqrt{{s}} = 13 TeV, {:.2f} fb^{{-1}}".format(lumi * args.lumi_scale / 1000.0) +) lbl3.onFrame = True lbl3.text.font = RAttrFont.kArial lbl3.text.size = 0.03 @@ -244,5 +286,5 @@ def merge_histos(label): c.Show() # Save the plot -if c.SaveAs("df105.png") : +if c.SaveAs("df105.png"): print("Saved figure to df105.png") diff --git a/tutorials/visualisation/rcanvas/raxis.cxx b/tutorials/visualisation/rcanvas/raxis.cxx index 2fddab9b2bc4d..d316262940e0d 100644 --- a/tutorials/visualisation/rcanvas/raxis.cxx +++ b/tutorials/visualisation/rcanvas/raxis.cxx @@ -26,7 +26,7 @@ void raxis() auto x1 = 0.08_normal, w1 = 0.36_normal, x2 = 0.57_normal, w2 = 0.36_normal; - auto draw0 = canvas->Draw(RPadPos(0.03_normal,0.1_normal), true, 0.8_normal); + auto draw0 = canvas->Draw(RPadPos(0.03_normal, 0.1_normal), true, 0.8_normal); draw0->axis.ticks.SetInvert(); draw0->axis.ticks.size = 0.02_normal; draw0->axis.title = "vertical"; @@ -46,8 +46,8 @@ void raxis() draw3->axis.labels.center = true; auto draw4 = canvas->Draw(RPadPos(x1, 0.3_normal), false, w1); - draw4->axis.min = TDatime(2020,11,12,9,0,0).Convert(); - draw4->axis.max = TDatime(2020,11,12,12,0,0).Convert(); + draw4->axis.min = TDatime(2020, 11, 12, 9, 0, 0).Convert(); + draw4->axis.max = TDatime(2020, 11, 12, 12, 0, 0).Convert(); draw4->axis.SetTimeDisplay("%d/%m/%y %H:%M"); draw4->axis.title = "time display"; draw4->axis.labels.size = 0.01; @@ -60,7 +60,7 @@ void raxis() draw5->axis.title = "labels, swap ticks side"; draw5->axis.title.SetLeft(); - auto draw6 = canvas->Draw(RPadPos(0.5_normal,0.9_normal), true, -0.8_normal); + auto draw6 = canvas->Draw(RPadPos(0.5_normal, 0.9_normal), true, -0.8_normal); draw6->axis.min = 0; draw6->axis.max = 10; draw6->axis.ending.SetArrow(); @@ -90,7 +90,7 @@ void raxis() draw9->axis.title = "ln scale"; draw9->axis.title.SetCenter(); - auto draw10 = canvas->Draw(RPadPos(x2+w2, 0.3_normal), false, -w2); + auto draw10 = canvas->Draw(RPadPos(x2 + w2, 0.3_normal), false, -w2); draw10->axis.ending.SetArrow(); draw10->axis.title = "horizontal negative length"; draw10->axis.title.SetCenter(); diff --git a/tutorials/visualisation/rcanvas/rbox.cxx b/tutorials/visualisation/rcanvas/rbox.cxx index 0d1151384389e..cc477d0a6265b 100644 --- a/tutorials/visualisation/rcanvas/rbox.cxx +++ b/tutorials/visualisation/rcanvas/rbox.cxx @@ -25,28 +25,28 @@ void rbox() // Create a canvas to be displayed. auto canvas = RCanvas::Create("RBox drawing"); - auto box1 = canvas->Draw(RPadPos(0.1_normal, 0.3_normal), RPadPos(0.3_normal,0.6_normal)); + auto box1 = canvas->Draw(RPadPos(0.1_normal, 0.3_normal), RPadPos(0.3_normal, 0.6_normal)); box1->border.color = RColor::kBlue; box1->border.width = 5; box1->fill.color = RColor(0, 255, 0, 127); // 50% opaque box1->fill.style = RAttrFill::kSolid; - auto box2 = canvas->Draw(RPadPos(0.4_normal, 0.2_normal), RPadPos(0.6_normal,0.7_normal)); + auto box2 = canvas->Draw(RPadPos(0.4_normal, 0.2_normal), RPadPos(0.6_normal, 0.7_normal)); box2->border.color = RColor::kRed; box2->border.width = 10.f; box2->border.style = RAttrLine::kDashed; box2->fill.color = RColor(0, 0, 255, 179); // 70% opaque box2->fill.style = RAttrFill::kSolid; - auto box3 = canvas->Draw(RPadPos(0.7_normal, 0.4_normal), RPadPos(0.9_normal,0.6_normal)); + auto box3 = canvas->Draw(RPadPos(0.7_normal, 0.4_normal), RPadPos(0.9_normal, 0.6_normal)); box3->border.width = 3; box3->fill.color = RColor::kBlue; box3->fill.style = RAttrFill::kSolid; - auto box4 = canvas->Draw(RPadPos(0.7_normal, 0.7_normal), RPadPos(0.9_normal,0.9_normal)); + auto box4 = canvas->Draw(RPadPos(0.7_normal, 0.7_normal), RPadPos(0.9_normal, 0.9_normal)); box4->border.width = 4; - auto box5 = canvas->Draw(RPadPos(0.7_normal, 0.1_normal), RPadPos(0.9_normal,0.3_normal)); + auto box5 = canvas->Draw(RPadPos(0.7_normal, 0.1_normal), RPadPos(0.9_normal, 0.3_normal)); box5->border.rx = 10; box5->border.ry = 10; box5->border.width = 2; diff --git a/tutorials/visualisation/rcanvas/rbox.py b/tutorials/visualisation/rcanvas/rbox.py index 90e86fef8ed5c..a2abe1875a1fd 100644 --- a/tutorials/visualisation/rcanvas/rbox.py +++ b/tutorials/visualisation/rcanvas/rbox.py @@ -23,14 +23,14 @@ box1 = canvas.Draw[RBox](RPadPos(0.1, 0.1), RPadPos(0.3, 0.6)) box1.border.color = RColor.kBlue box1.border.width = 5 -box1.fill.color = RColor(0, 255, 0, 127) # 50% opaque +box1.fill.color = RColor(0, 255, 0, 127) # 50% opaque box1.fill.style = RAttrFill.kSolid box2 = canvas.Draw[RBox](RPadPos(0.4, 0.2), RPadPos(0.6, 0.7)) box2.border.color = RColor.kRed box2.border.width = 10 box2.border.style = RAttrLine.kDashed -box2.fill.color = RColor(0, 0, 255, 179) # 70% opaque +box2.fill.color = RColor(0, 0, 255, 179) # 70% opaque box2.fill.style = RAttrFill.kSolid box3 = canvas.Draw[RBox](RPadPos(0.7, 0.4), RPadPos(0.9, 0.6)) diff --git a/tutorials/visualisation/rcanvas/rcanvas_mt.cxx b/tutorials/visualisation/rcanvas/rcanvas_mt.cxx index 6352a1c3e54c9..2f92c05f81410 100644 --- a/tutorials/visualisation/rcanvas/rcanvas_mt.cxx +++ b/tutorials/visualisation/rcanvas/rcanvas_mt.cxx @@ -65,7 +65,7 @@ void draw_canvas(const std::string &title, Int_t col1) canvas->Show(); - std::cout << title << " started" <SaveAs(title + "_last.png"); } - std::cout << title << " completed" <Remove(); diff --git a/tutorials/visualisation/rcanvas/rcanvas_update.cxx b/tutorials/visualisation/rcanvas/rcanvas_update.cxx index 304adf919247f..3fc5a86be8ef9 100644 --- a/tutorials/visualisation/rcanvas/rcanvas_update.cxx +++ b/tutorials/visualisation/rcanvas/rcanvas_update.cxx @@ -2,7 +2,8 @@ /// \ingroup tutorial_rcanvas /// /// This macro shows how ROOT RCanvas::Update method is working. -/// One can do sync and/or async depending how important is that graphics is updated before next action will be performed +/// One can do sync and/or async depending how important is that graphics is updated before next action will be +/// performed /// /// \macro_image (rcanvas_js) /// \macro_code @@ -31,8 +32,8 @@ using namespace ROOT::Experimental; void rcanvas_update() { static constexpr int npoints = 10; - double x[npoints] = { 1., 2., 3., 4., 5., 6., 7., 8., 9., 10. }; - double y[npoints] = { .1, .2, .3, .2, .1, .2, .3, .2, .1, .2 }; + double x[npoints] = {1., 2., 3., 4., 5., 6., 7., 8., 9., 10.}; + double y[npoints] = {.1, .2, .3, .2, .1, .2, .3, .2, .1, .2}; auto gr = new TGraph(npoints, x, y); auto canvas = RCanvas::Create("Demo of RCanvas update"); @@ -43,7 +44,8 @@ void rcanvas_update() canvas->Show(); // synchronous, wait until drawing is really finished - canvas->Update(false, [](bool res) { std::cout << "First sync update done = " << (res ? "true" : "false") << std::endl; }); + canvas->Update(false, + [](bool res) { std::cout << "First sync update done = " << (res ? "true" : "false") << std::endl; }); // modify TGraph making different form gr->SetPoint(1, 1., .3); @@ -56,7 +58,8 @@ void rcanvas_update() canvas->Modified(); // call Update again, return before actual drawing will be performed by the browser - canvas->Update(true, [](bool res) { std::cout << "Second async update done = " << (res ? "true" : "false") << std::endl; }); + canvas->Update( + true, [](bool res) { std::cout << "Second async update done = " << (res ? "true" : "false") << std::endl; }); std::cout << "This message appear normally before second async update" << std::endl; } diff --git a/tutorials/visualisation/rcanvas/rframe.cxx b/tutorials/visualisation/rcanvas/rframe.cxx index 5742104db6ca4..124e0eb24703a 100644 --- a/tutorials/visualisation/rcanvas/rframe.cxx +++ b/tutorials/visualisation/rcanvas/rframe.cxx @@ -31,9 +31,9 @@ using namespace ROOT::Experimental; auto rframe_style = RStyle::Parse("frame { x_ticks_width: 3; y_ticks_width: 3; }" - "title { margin: 0.02; height: 0.1; text_color: blue; text_size: 0.07; }" - "line { line_width: 2; }" - "text { text_align: 13; text_size: 0.03; }"); + "title { margin: 0.02; height: 0.1; text_color: blue; text_size: 0.07; }" + "line { line_width: 2; }" + "text { text_align: 13; text_size: 0.03; }"); void rframe() { @@ -70,7 +70,7 @@ void rframe() title->height = 0.1_normal; // draw line over the frame - auto line0 = canvas->Draw(RPadPos(100_px, .9_normal), RPadPos(900_px , .9_normal)); + auto line0 = canvas->Draw(RPadPos(100_px, .9_normal), RPadPos(900_px, .9_normal)); auto text0 = canvas->Draw(RPadPos(100_px, .9_normal + 5_px), "Line drawn on pad, fix pixel length"); text0->text.align = RAttrText::kLeftBottom; @@ -79,11 +79,12 @@ void rframe() auto text1 = canvas->Draw(RPadPos(.1_normal, .1_normal), "Line drawn on pad, normalized coordinates"); // draw on left size of frame, but bound to frame, moved with frame - auto line2 = canvas->Draw(RPadPos(-.2_normal, -.1_normal), RPadPos(-.2_normal , 1.1_normal)); + auto line2 = canvas->Draw(RPadPos(-.2_normal, -.1_normal), RPadPos(-.2_normal, 1.1_normal)); line2->onFrame = true; // or via CSS "onFrame: true;" line2->line.color = RColor::kRed; - auto text2 = canvas->Draw(RPadPos(-.2_normal - 5_px, -.1_normal), "Line drawn on frame, normalized coordinates"); + auto text2 = + canvas->Draw(RPadPos(-.2_normal - 5_px, -.1_normal), "Line drawn on frame, normalized coordinates"); text2->onFrame = true; // or via CSS "onFrame: true;" text2->text.angle = 90; text2->text.align = RAttrText::kLeftBottom; @@ -102,15 +103,15 @@ void rframe() box4->fill.color = RColor::kBlue; box4->fill.style = RAttrFill::kSolid; box4->clipping = true; // or via CSS "clipping: true;" - box4->onFrame = true; // or via CSS "onFrame: true;" + box4->onFrame = true; // or via CSS "onFrame: true;" // draw line in the frame, allowed to set user coordinate auto line4 = canvas->Draw(RPadPos(20_user, 20_user), RPadPos(80_user, 80_user)); line4->clipping = true; // or via CSS "clipping: true;" - line4->onFrame = true; // or via CSS "onFrame: true;" + line4->onFrame = true; // or via CSS "onFrame: true;" auto text4 = canvas->Draw(RPadPos(20_user, 20_user), "clipping on"); - text4->onFrame = true; // or via CSS "onFrame: true;" + text4->onFrame = true; // or via CSS "onFrame: true;" text4->clipping = true; // or via CSS "clipping: true;" // draw box before line at same position as line ending with 40x40 px size diff --git a/tutorials/visualisation/rcanvas/rline.cxx b/tutorials/visualisation/rcanvas/rline.cxx index c7041d44b4049..edab2d5dc67a5 100644 --- a/tutorials/visualisation/rcanvas/rline.cxx +++ b/tutorials/visualisation/rcanvas/rline.cxx @@ -26,21 +26,21 @@ void rline() // Create a canvas to be displayed. auto canvas = RCanvas::Create("RLine example"); - for (double i = 0; i < 360; i+=1) { + for (double i = 0; i < 360; i += 1) { double angle = i * TMath::Pi() / 180; - RColor col( 50 + (int) i/360*200, 0, 0); + RColor col(50 + (int)i / 360 * 200, 0, 0); auto draw = canvas->Draw(); draw->SetP1({0.5_normal, 0.5_normal}); - draw->SetP2({0.5_normal + 0.3_normal*TMath::Cos(angle), 0.5_normal + 0.3_normal*TMath::Sin(angle)}); + draw->SetP2({0.5_normal + 0.3_normal * TMath::Cos(angle), 0.5_normal + 0.3_normal * TMath::Sin(angle)}); draw->line.color = col; - } - - canvas->Draw()->SetP1({0.0_normal, 0.0_normal}).SetP2({1.0_normal,1.0_normal}); - canvas->Draw()->SetP1({0.1_normal, 0.1_normal}).SetP2({0.9_normal,0.1_normal}); - canvas->Draw()->SetP1({0.9_normal, 0.1_normal}).SetP2({0.9_normal,0.9_normal}); - canvas->Draw()->SetP1({0.9_normal, 0.9_normal}).SetP2({0.1_normal,0.9_normal}); - canvas->Draw()->SetP1({0.1_normal, 0.1_normal}).SetP2({0.1_normal,0.9_normal}); - canvas->Draw()->SetP1({0.0_normal, 1.0_normal}).SetP2({1.0_normal,0.0_normal}); + } + + canvas->Draw()->SetP1({0.0_normal, 0.0_normal}).SetP2({1.0_normal, 1.0_normal}); + canvas->Draw()->SetP1({0.1_normal, 0.1_normal}).SetP2({0.9_normal, 0.1_normal}); + canvas->Draw()->SetP1({0.9_normal, 0.1_normal}).SetP2({0.9_normal, 0.9_normal}); + canvas->Draw()->SetP1({0.9_normal, 0.9_normal}).SetP2({0.1_normal, 0.9_normal}); + canvas->Draw()->SetP1({0.1_normal, 0.1_normal}).SetP2({0.1_normal, 0.9_normal}); + canvas->Draw()->SetP1({0.0_normal, 1.0_normal}).SetP2({1.0_normal, 0.0_normal}); canvas->SetSize(900, 700); diff --git a/tutorials/visualisation/rcanvas/rline_style.cxx b/tutorials/visualisation/rcanvas/rline_style.cxx index 444647dbace98..6d2b087ab8937 100644 --- a/tutorials/visualisation/rcanvas/rline_style.cxx +++ b/tutorials/visualisation/rcanvas/rline_style.cxx @@ -36,7 +36,7 @@ void rline_style() auto draw = canvas->Add(RPadPos{.32_normal, posy}, RPadPos{.8_normal, posy}); if (i < 11) - draw->line.style = (RAttrLine::EStyle) i; + draw->line.style = (RAttrLine::EStyle)i; else draw->line.pattern = "10,2,8,2,10,6,1,6"; diff --git a/tutorials/visualisation/rcanvas/rline_width.cxx b/tutorials/visualisation/rcanvas/rline_width.cxx index da1e76d4a7484..a2ab6a174e0a1 100644 --- a/tutorials/visualisation/rcanvas/rline_width.cxx +++ b/tutorials/visualisation/rcanvas/rline_width.cxx @@ -22,15 +22,15 @@ void rline_width() auto canvas = RCanvas::Create("Different line widths"); double num = 0.3; - for (int i = 10; i > 0; i--){ + for (int i = 10; i > 0; i--) { num = num + 0.05; - auto text = canvas->Add(RPadPos(.3_normal, 1_normal*num), std::to_string(i)); + auto text = canvas->Add(RPadPos(.3_normal, 1_normal * num), std::to_string(i)); text->text.size = 0.04; text->text.align = RAttrText::kRightCenter; text->text.font = RAttrFont::kArialOblique; - auto draw = canvas->Add(RPadPos(.32_normal, 1_normal*num), RPadPos(.8_normal, 1_normal*num)); + auto draw = canvas->Add(RPadPos(.32_normal, 1_normal * num), RPadPos(.8_normal, 1_normal * num)); draw->line.width = i; } diff --git a/tutorials/visualisation/rcanvas/rmarker.cxx b/tutorials/visualisation/rcanvas/rmarker.cxx index 4cfeee197c82f..4b2b03ace9a6c 100644 --- a/tutorials/visualisation/rcanvas/rmarker.cxx +++ b/tutorials/visualisation/rcanvas/rmarker.cxx @@ -24,27 +24,27 @@ void rmarker() double num = 0.3; double x = 0; - double dx = 1/16.0; + double dx = 1 / 16.0; for (int i = 1; i < 16; i++) { x += dx; - for (int row=0;row<3;++row) { + for (int row = 0; row < 3; ++row) { int style = i; if (row == 1) style += 19; - else if (row==2) + else if (row == 2) style += 34; - RPadPos pt(RPadLength::Normal(x), .17_normal + 0.3_normal*row); + RPadPos pt(RPadLength::Normal(x), .17_normal + 0.3_normal * row); auto text = canvas->Draw(pt, std::to_string(style)); text->text.font = RAttrFont::kVerdana; text->text.size = 0.05; text->text.align = RAttrText::kCenterTop; text->text.color = RColor::kGreen; - RPadPos pm(RPadLength::Normal(x), .25_normal + 0.3_normal*row); + RPadPos pm(RPadLength::Normal(x), .25_normal + 0.3_normal * row); auto draw = canvas->Draw(pm); - draw->marker.style = (RAttrMarker::EStyle) style; + draw->marker.style = (RAttrMarker::EStyle)style; draw->marker.color = RColor::kBlue; draw->marker.size = 0.1; // relative to pad height } diff --git a/tutorials/visualisation/rcanvas/rpad.cxx b/tutorials/visualisation/rcanvas/rpad.cxx index da4234b050faa..a58475da8e57e 100644 --- a/tutorials/visualisation/rcanvas/rpad.cxx +++ b/tutorials/visualisation/rcanvas/rpad.cxx @@ -29,7 +29,7 @@ void rpad() using namespace ROOT::Experimental; auto canvas = RCanvas::Create("RCanvas::Divide example"); - auto pads = canvas->Divide(3, 3); + auto pads = canvas->Divide(3, 3); for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) { diff --git a/tutorials/visualisation/rcanvas/rpave.cxx b/tutorials/visualisation/rcanvas/rpave.cxx index 09abcc6111b31..587f66637ec17 100644 --- a/tutorials/visualisation/rcanvas/rpave.cxx +++ b/tutorials/visualisation/rcanvas/rpave.cxx @@ -8,7 +8,8 @@ /// \macro_code /// /// \date 2020-06-18 -/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome! +/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback +/// is welcome! /// \author Sergey Linev /************************************************************************* @@ -64,8 +65,11 @@ void rpave() std::string fname = __FILE__; auto pos = fname.find("rpave.cxx"); - if (pos > 0) { fname.resize(pos); fname.append("comic.woff2"); } - else fname = "comic.woff2"; + if (pos > 0) { + fname.resize(pos); + fname.append("comic.woff2"); + } else + fname = "comic.woff2"; canvas->Draw("CustomFont", fname); auto text2 = canvas->Draw(); diff --git a/tutorials/visualisation/rcanvas/rstyle.cxx b/tutorials/visualisation/rcanvas/rstyle.cxx index b4431f9592e24..15eccb0fd49ff 100644 --- a/tutorials/visualisation/rcanvas/rstyle.cxx +++ b/tutorials/visualisation/rcanvas/rstyle.cxx @@ -24,24 +24,24 @@ void rstyle() auto canvas = RCanvas::Create("Use RStyle for line styling"); double num = 0.3; - for (int i = 10; i > 0; i--){ + for (int i = 10; i > 0; i--) { num = num + 0.05; - auto text = canvas->Add(RPadPos{.3_normal, 1_normal*num}, std::to_string(i)); + auto text = canvas->Add(RPadPos{.3_normal, 1_normal * num}, std::to_string(i)); text->text.size = 0.04; text->text.align = RAttrText::kRightCenter; text->text.font = RAttrFont::kArialOblique; - auto line = canvas->Add(RPadPos(.32_normal,1_normal*num), RPadPos(.8_normal, 1_normal*num)); + auto line = canvas->Add(RPadPos(.32_normal, 1_normal * num), RPadPos(.8_normal, 1_normal * num)); line->SetId(std::string("obj") + std::to_string(i)); line->SetCssClass(std::string("user_class_") + std::to_string(i % 3)); } auto style = std::make_shared(); - style->AddBlock(".user_class_1").AddInt("line_style", 4); // all lines with user_class_1 should get style 1 + style->AddBlock(".user_class_1").AddInt("line_style", 4); // all lines with user_class_1 should get style 1 style->AddBlock(".user_class_2").AddDouble("line_width", 5.); // all lines with user_class_2 should get line width 5 - style->AddBlock("#obj7").AddString("line_color", "#0000FF"); // line with id obj7 should be blue + style->AddBlock("#obj7").AddString("line_color", "#0000FF"); // line with id obj7 should be blue style->AddBlock("line").AddString("line_color", "red"); // all lines should get red color diff --git a/tutorials/visualisation/rcanvas/rtext_align.cxx b/tutorials/visualisation/rcanvas/rtext_align.cxx index 0211776f174e9..93552a743074f 100644 --- a/tutorials/visualisation/rcanvas/rtext_align.cxx +++ b/tutorials/visualisation/rcanvas/rtext_align.cxx @@ -35,7 +35,7 @@ void rtext_align() box->border.style = RAttrLine::kStyle6; auto drawText = [&canvas](double x, double y, RAttrText::EAlign align, const std::string &lbl) { - auto dbox = canvas->Add(RPadPos(x-0.003, y-0.003), RPadPos(x+0.003, y+0.003)); + auto dbox = canvas->Add(RPadPos(x - 0.003, y - 0.003), RPadPos(x + 0.003, y + 0.003)); dbox->fill.color = RColor::kRed; dbox->fill.style = RAttrFill::kSolid; diff --git a/tutorials/visualisation/rcanvas/rtext_angle.cxx b/tutorials/visualisation/rcanvas/rtext_angle.cxx index 32137aa8acc82..7917b132b608e 100644 --- a/tutorials/visualisation/rcanvas/rtext_angle.cxx +++ b/tutorials/visualisation/rcanvas/rtext_angle.cxx @@ -35,8 +35,8 @@ void rtext_angle() for (double angle = 0; angle <= 360; angle += 10) { auto draw = canvas->Draw(RPadPos(0.5_normal, 0.6_normal), "____ Hello World"); - draw->text.color = RColor((int) (0.38*angle), (int) (0.64*angle), (int) (0.76*angle)); - draw->text.size = 0.01 + angle/5000.; + draw->text.color = RColor((int)(0.38 * angle), (int)(0.64 * angle), (int)(0.76 * angle)); + draw->text.size = 0.01 + angle / 5000.; draw->text.angle = angle; draw->text.align = RAttrText::kLeftTop; draw->text.font = RAttrFont::kArial; diff --git a/tutorials/visualisation/rcanvas/rtext_font.cxx b/tutorials/visualisation/rcanvas/rtext_font.cxx index 754699c85560a..37099e0bc2c57 100644 --- a/tutorials/visualisation/rcanvas/rtext_font.cxx +++ b/tutorials/visualisation/rcanvas/rtext_font.cxx @@ -73,8 +73,11 @@ void rtext_font() posy -= 0.03; std::string fname = __FILE__; auto pos = fname.find("rtext_font.cxx"); - if (pos > 0) { fname.resize(pos); fname.append("comic.woff2"); } - else fname = "comic.woff2"; + if (pos > 0) { + fname.resize(pos); + fname.append("comic.woff2"); + } else + fname = "comic.woff2"; canvas->Draw("Comic", fname); drawText(RAttrFont::kTimes, true); diff --git a/tutorials/visualisation/rcanvas/symlog.cxx b/tutorials/visualisation/rcanvas/symlog.cxx index 5ae9327fed900..a5ba56fd34a19 100644 --- a/tutorials/visualisation/rcanvas/symlog.cxx +++ b/tutorials/visualisation/rcanvas/symlog.cxx @@ -38,7 +38,7 @@ void symlog() // Create a canvas to be displayed. auto canvas = RCanvas::Create("Drawing with symlog"); - auto pads = canvas->Divide(1, 3); + auto pads = canvas->Divide(1, 3); // first pad with linear scales auto frame1 = pads[0][0]->AddFrame(); @@ -85,11 +85,14 @@ void symlog() frame3->y.title.SetCenter(); pads[0][2]->Draw("symlog scale"); - for (int n=0;n<100;n++) { + for (int n = 0; n < 100; n++) { auto x1 = TMath::Power(10, gRandom->Uniform(1, 2.9)); auto y1 = TMath::Power(10, gRandom->Uniform(1, 1.9)); - if (n % 27 == 0) { x1 = 100; y1 *= 100; } + if (n % 27 == 0) { + x1 = 100; + y1 *= 100; + } RPadPos pm{RPadLength::User(x1), RPadLength::User(y1)}; pads[0][0]->Draw(pm)->SetCssClass("group1"); @@ -97,7 +100,7 @@ void symlog() pads[0][2]->Draw(pm)->SetCssClass("group1"); } - for (int n=0;n<75;n++) { + for (int n = 0; n < 75; n++) { auto x2 = gRandom->Uniform(-5., 5.); auto y2 = TMath::Power(10, gRandom->Uniform(2.2, 3.7)); diff --git a/tutorials/visualisation/rcanvas/th1_twoscales.cxx b/tutorials/visualisation/rcanvas/th1_twoscales.cxx index 485a43f77887e..76f1e14612100 100644 --- a/tutorials/visualisation/rcanvas/th1_twoscales.cxx +++ b/tutorials/visualisation/rcanvas/th1_twoscales.cxx @@ -9,7 +9,8 @@ /// \macro_code /// /// \date 2021-07-05 -/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome! +/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback +/// is welcome! /// \author Sergey Linev /************************************************************************* @@ -29,21 +30,21 @@ using namespace ROOT::Experimental; void th1_twoscales() { - //create/fill draw h1 - auto h1 = std::make_shared("h1","Example histogram",100,-3,3); + // create/fill draw h1 + auto h1 = std::make_shared("h1", "Example histogram", 100, -3, 3); h1->SetDirectory(nullptr); h1->SetStats(kFALSE); - for (int i=0;i<10000;i++) - h1->Fill(gRandom->Gaus(0,1)); + for (int i = 0; i < 10000; i++) + h1->Fill(gRandom->Gaus(0, 1)); - //create hint1 filled with the bins integral of h1 - auto hint1 = std::make_shared("hint1","h1 bins integral",100,-3,3); + // create hint1 filled with the bins integral of h1 + auto hint1 = std::make_shared("hint1", "h1 bins integral", 100, -3, 3); hint1->SetDirectory(nullptr); hint1->SetStats(kFALSE); Float_t sum = 0; - for (int i=1;i<=100;i++) { + for (int i = 1; i <= 100; i++) { sum += h1->GetBinContent(i); - hint1->SetBinContent(i,sum); + hint1->SetBinContent(i, sum); } hint1->SetLineColor(kRed); hint1->GetYaxis()->SetAxisColor(kRed); diff --git a/tutorials/visualisation/rcanvas/tobject.cxx b/tutorials/visualisation/rcanvas/tobject.cxx index 9b00ba22bfa14..919f1c2c94a25 100644 --- a/tutorials/visualisation/rcanvas/tobject.cxx +++ b/tutorials/visualisation/rcanvas/tobject.cxx @@ -39,8 +39,8 @@ void tobject() static constexpr int nth1points = 100; static constexpr int nth2points = 40; - double x[npoints] = { 1., 2., 3., 4., 5., 6., 7., 8., 9., 10. }; - double y[npoints] = { .1, .2, .3, .4, .3, .2, .1, .2, .3, .4 }; + double x[npoints] = {1., 2., 3., 4., 5., 6., 7., 8., 9., 10.}; + double y[npoints] = {.1, .2, .3, .4, .3, .2, .1, .2, .3, .4}; auto gr = new TGraph(npoints, x, y); // create normal object to be able draw it once @@ -53,11 +53,11 @@ void tobject() auto th2 = std::make_shared("gaus2", "Example of TH2", nth2points, -5, 5, nth2points, -5, 5); // is is highly recommended to set directory to nullptr to avoid ownership conflicts th2->SetDirectory(nullptr); - for (int n=0;nSetBinContent(th2->GetBin(n+1, k+1), (int) (1000*TMath::Gaus(x)*TMath::Gaus(y))); + for (int n = 0; n < nth2points; ++n) { + for (int k = 0; k < nth2points; ++k) { + double x = 10. * n / nth2points - 5.; + double y = 10. * k / nth2points - 5.; + th2->SetBinContent(th2->GetBin(n + 1, k + 1), (int)(1000 * TMath::Gaus(x) * TMath::Gaus(y))); } } @@ -77,7 +77,7 @@ void tobject() canvas->Draw(TObjectDrawable::kPalette); // Divide canvas on 2x2 sub-pads to show different draw options - auto subpads = canvas->Divide(2,2); + auto subpads = canvas->Divide(2, 2); // draw graph with "AL" option, drawable take over object ownership subpads[0][0]->Draw(gr, "AL"); diff --git a/tutorials/visualisation/webgui/browserv7/browser.cxx b/tutorials/visualisation/webgui/browserv7/browser.cxx index 5d421e3252f0b..2ce1f02e247d9 100644 --- a/tutorials/visualisation/webgui/browserv7/browser.cxx +++ b/tutorials/visualisation/webgui/browserv7/browser.cxx @@ -28,4 +28,3 @@ void browser() // clear when connection to client closed br->ClearOnClose(br); } - diff --git a/tutorials/visualisation/webgui/browserv7/filedialog.cxx b/tutorials/visualisation/webgui/browserv7/filedialog.cxx index 7ee7ce6f2795c..28a5af83e9342 100644 --- a/tutorials/visualisation/webgui/browserv7/filedialog.cxx +++ b/tutorials/visualisation/webgui/browserv7/filedialog.cxx @@ -15,28 +15,25 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ - // Normally file dialogs will be used inside other widgets as ui5 dialogs. // By default, dialog starts in async mode - means macro immediately returns to command line // To start OpenFile dialog in sync mode, call `root "filedialog.cxx(1)" -q`. // Once file is selected, root execution will be stopped. - // macro must be here to let macro work on Windows R__LOAD_LIBRARY(libROOTBrowserv7) #include - void filedialog(int kind = 0) { std::string fileName; // example of sync methods, blocks until name is selected switch (kind) { - case 1: fileName = ROOT::RFileDialog::OpenFile("OpenFile title"); break; - case 2: fileName = ROOT::RFileDialog::SaveAs("SaveAs title", "newfile.xml"); break; - case 3: fileName = ROOT::RFileDialog::NewFile("NewFile title", "test.txt"); break; + case 1: fileName = ROOT::RFileDialog::OpenFile("OpenFile title"); break; + case 2: fileName = ROOT::RFileDialog::SaveAs("SaveAs title", "newfile.xml"); break; + case 3: fileName = ROOT::RFileDialog::NewFile("NewFile title", "test.txt"); break; } if (kind > 0) { @@ -46,7 +43,8 @@ void filedialog(int kind = 0) auto dialog = std::make_shared(ROOT::RFileDialog::kOpenFile, "OpenFile dialog in async mode"); - dialog->SetNameFilters({ "C++ files (*.cxx *.cpp *.c *.C)", "ROOT files (*.root)", "Image files (*.png *.jpg *.jpeg)", "Text files (*.txt)", "Any files (*)" }); + dialog->SetNameFilters({"C++ files (*.cxx *.cpp *.c *.C)", "ROOT files (*.root)", "Image files (*.png *.jpg *.jpeg)", + "Text files (*.txt)", "Any files (*)"}); dialog->SetSelectedFilter("ROOT files"); @@ -60,4 +58,3 @@ void filedialog(int kind = 0) dialog->Show(); } - diff --git a/tutorials/visualisation/webgui/fitpanelv7/fitpanel6.cxx b/tutorials/visualisation/webgui/fitpanelv7/fitpanel6.cxx index b53e8efd69ec1..2da5bf8636c4b 100644 --- a/tutorials/visualisation/webgui/fitpanelv7/fitpanel6.cxx +++ b/tutorials/visualisation/webgui/fitpanelv7/fitpanel6.cxx @@ -31,7 +31,7 @@ void fitpanel6() // create panel auto panel = std::make_shared("FitPanel"); - TH1F *test = new TH1F("test","This is test histogram",100,-4,4); + TH1F *test = new TH1F("test", "This is test histogram", 100, -4, 4); test->FillRandom("gaus", 10000); panel->AssignHistogram(test); @@ -40,4 +40,3 @@ void fitpanel6() panel->ClearOnClose(panel); } -