# Walkthrough: Starting ROOT **(5 minutes)** ROOT is a robust, complex environment for performing physics analysis, and you can spend a lifetime learning it.[^f15] To actually run ROOT, just type: > root :::{admonition} Command window :class: note The Terminal window in which you type this command will become your {ref}`ROOT command window `.[^two] You'll see some "Welcome to ROOT" text in the window. ::: [^two]: In case you skipped over the {ref}`Getting started ` section, or you don't like clicking on links in the middle of Notes: You will need _two_ terminal windows open during this section of the tutorial: a UNIX window and a ROOT window. You can type `.help` to see a list of ROOT commands. You'll probably get more information than you can use right now. Try it and see. For the moment, the most important ROOT line command is the one to quit ROOT. To exit ROOT, type `.q`. Do this now and then start ROOT again, just to make sure you can do it. :::{admonition} Dealing with crashes :class: note Sometimes ROOT will crash. If it does, it can get into a state for which `.q` won't work. Try typing `.qqq` (three q) if `.q` doesn't work; if that still doesn't work, try five q, then seven q. Unfortunately, if you type ten q, ROOT won't respond, "You're welcome." OK, that's a dumb joke; I should leave the humor to xkcd. But the tip about `.qqq`, `.qqqqq`, and `.qqqqqqq` is legitimate. Sometimes I find just typing `q` or using Ctrl-C also works. ::: :::::{admonition} ROOT as a calculator :class: tip One of the defining features of Python is that if you just type in a equation or a variable, it will simply print it out. ROOT can do the same thing in C++, thanks to its command-line interpreter [cling](https://root.cern/cling/). For example: [] int x = 5 (int) 5 [] x (int) 5 [] 2+3 (int) 5 [] sqrt(2) (double) 1.4142136 :::{admonition} C++ types :class: note If you're familiar with Python, one difference you'll notice immediately: C++ expects you to supply an explicit type for its variables. I had to type `int x=5` instead of just `x=5` for ROOT to accept the statement without an error message. `x=5` will still work (give it a try) but ROOT will complain. You can ask C++ to deduce the type for you by using the keyword `auto`: [] auto x = 5 (int) 5 [] auto z = 5.0 (double) 5.0000000 As a matter of programming style, I specify explicit types for base C++ types like numbers and strings, but use `auto` for complicated derived types like `std::map::const_iterator`. ::: I'm not going to dwell on this aspect of ROOT, but it's good to know it's there.[^f16] ::::: :::{figure-md} e_to_the_pi_minus_pi-fig :align: center xkcd e_to_the_pi_minus_pi by Randall Munroe. If you want to try this in ROOT, it's `exp(TMath::Pi()) - TMath::Pi()` ::: [^f15]: That's three lifetimes so far. {ref}`In case you missed it `, lifetime #2 was spent learning emacs. [^f16]: If it matters, ROOT's trig functions use radians by default. If you want to take the sine of 30 degrees you have to use `sin(30.*TMath::Pi()/180.)`