Install ROOT on Windows

-- Main. NkatekoBaloyi - 2019-03-07

  • You can find all the ROOT releases here
  • ROOT Version 6 is not supported for windows, download version 5.
  • I recommend Release 5.34/36
    • Download the .exe extension of ROOT matching your visual studio.
  • Install ROOTS
    • When installing, select add to path for user.
    • After Installation, Search for ROOT on your window.
    • You should be able to find the ROOT prompt if the installation was successful.

Setup environments for ROOT

-- Main.NkatekoBaloyi - 2019-03-07

  • Type root on the command prompt
    • If you are getting this error:
    • C:\Users\user>root 'root' is not recognized as an internal or external command, operable program or batch file
  • Then you need tp setup the enviroment.
    • Go to Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables -> System Variables
    • Select path -> edit
    • Add the full path of where ROOT is installed -> save
    • Close the previous command prompt and open it again, Type root.
    • If the correct path is added, this is how the command prompt will look like:

* *
* W E L C O M E to R O O T *
* *
* Version 5.34/36 5 April 2016 *
* *
* You are welcome to visit our Web site *
* *
* *

ROOT 5.34/36 (v5-34-36@v5-34-36, Apr 05 2016, 10:25:45 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0]

Congratulations!! You have installed and set up the ROOT environment.

NB : Once root is installed and running, download curl on this link


  1. Download the version compatible with your system processor. Instructions on how to check your system's precessor
  2. After downloading the zipped file, unzip the .tar file on the folder you want to install your softwares oe any folder
  3. open the curl-folder -> bin
  4. double click on curl run command
  5. now copy the path of the curl and add it to your system path i.e same way you added root to the system path.
  6. close the command prompt window and open it again. run curl to see if is correctly added to the path
  7. you should get this message if curl is added to the path

curl: try 'curl --help' or 'curl --manual' for more information

Installing ROOT on Linux

-- TheodoreGaelejwe - 2019-03-09

You can install ROOT on different platforms and but it is adviceable to run it from Linux since documentation is widely available. Detailed instructions are found on this link HowToInstallRoot. It is assumed that you already have Ubuntu installed but if you do not, here are some short and straightforward steps to install.

For installing on a Virtual Machine: ClickHere

For installing on your Local Machine: ClickHere

Notes:* The link provided for installing on VM refers to an old version of Ubuntu but the process is the same for most versions.* Remember to install Guest Additions as they come with features that assist with display and audio. Make sure the Additions are compatible with your version of Ubuntu.

Accessing ROOT on lxplus

-- TheodoreGaelejwe - 2019-03-07

Another way to access ROOT is through LXPLUS. LXPLUS is a cluster used for executing jobs that would otherwise take eons to run on your local machine. It is accessed by using the ssh command with your CERN username. The link provided has more details about the cluster.

Running TMVA Scripts

-- Main.NkatekoBaloyi - 2019-03-08

  • To run a script on ROOT, the scripts and data must be saved on the ROOT directory.
  • On the commnd prompt, use the cd command to go to the directory where the scripts are saved:


    • C:\Users\user> cd C:\root_v5.34.36\Nkateko\MVA C:\root_v5.34.36\user\MVA>

    • To run the script type :root -l script_name.C OR*
    • type root and the root prompt will show.
      • Run the following command: .X script_name.C
  • You can also run your script on the command prompt without changing directories:
  • On the command prompt run:
    • root -l full_path_to_the_folder\script.C
    • e.g. C:\Users\user> root -l C:\root_v5.34.36\Nkateko\MVA\compareBDTs.C
  • To quit root, run the .q command

Reading ROOT files

-- ThabangMagabe - 2019-03-07

Root file

The root file is like a database. it has trees and the trees have branches with leafs. The leafs can be data ntuples ,histograms etc.

eg myfile.root

Openning a root file.

If you have root installed on your machine, just double click on the file and it will show a Tbrowser window, which you can use to browse the file.

The following is an image of Tbrowser showing leafs and the leafs are data ntuples. on the right you ca see the histogram for the ntuple Lambdac_Loki_M.


Reading your root file into root:

  • Go through the example script TMVAClassification.C

Running an example:

  • You will need the following scripts: tmvaglob.C, correlations.C, efficiencies.C, mvaeffs.C, mvas.C, plotall.C, TMVAClassification.C, TMVAGui.C ,
  • You will find this files in the folder tmva/test/ which is in the directory where root is installed.
  • Copy this files and paste them in the Macros folder in the directory where root is installed, so you don't have to write full path when running this scripts.


This is the script that does the classification training. Go through it as it has well explained comments in it.

Below are snippets of the TMVAClassification.C and explanation of basics in the code.



Define the input variables that shall be used for the MVA training.

Note that the variable names must be the same as in the ROOT tree which they will be read from.


You can add so-called "Spectator variables", which are not used in the MVA training,
but will appear in the final "TestTree" produced by TMVA. This TestTree will contain the
input variables, the response values of all trained MVAs, and the spectator variables.

You can use the spectator variables for cuts. That is partition the data based on those variables.






This script executes the TMVA gui which you can use to get plots of variables and results. This script calls the other scripts and puts everything on a gui.

Getting Started with Tensorflow

-- TheodoreGaelejwe - 2019-03-10

Tensorflow is a powerful tool for deep learning tasks in machine learning. The use of deep neural networks has gained popularity and justification in the HEP community of late. A number of researchers indicate that DNNs do better than the trusted BDT algorithm in HEP data analysis, however, this is yet to be rigorously tested. See the following for examples 1 2.

The Tensorflow documentation on Deep Neural Networks provides good explanations and tutorials to understand a basic DNN so it is advisable to go through it first 3. Below is a jupyter notebook example of a DNN applied to MC data.

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatipynb DNN_on_Tensorflow.ipynb r1 manage 60.7 K 2019-06-25 - 16:30 TheodoreCwereGaelejwe  
PNGpng curl.PNG r1 manage 169.7 K 2019-03-20 - 14:20 NkatekoBaloyi  
PNGpng r1.PNG r1 manage 14.0 K 2019-03-13 - 15:11 AudreyThabangMagabe  
PNGpng r2.PNG r1 manage 13.9 K 2019-03-13 - 15:16 AudreyThabangMagabe  
PNGpng r3.PNG r1 manage 8.1 K 2019-03-13 - 15:25 AudreyThabangMagabe  
PNGpng r4.PNG r1 manage 8.2 K 2019-03-13 - 16:26 AudreyThabangMagabe  
PNGpng r5.PNG r1 manage 49.5 K 2019-03-13 - 15:27 AudreyThabangMagabe  
PNGpng r6.PNG r1 manage 34.2 K 2019-03-13 - 16:48 AudreyThabangMagabe  
PNGpng root-tbrowser.png r1 manage 50.3 K 2019-03-11 - 17:25 AudreyThabangMagabe  
Edit | Attach | Watch | Print version | History: r25 < r24 < r23 < r22 < r21 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r25 - 2019-06-25 - TheodoreCwereGaelejwe
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback