You can run your code as compiled code instead of interpreted. This makes it possible to debug your code, and might give slightly faster code.
Wherever you would specify MyCode.C you can simply specify
MyCode.C+ (note the trailing "+") and ROOT will start your compiler and load your code as dynamic library. Give it a try with ".x AnalyzeTree.C+". If you see "command not found", ROOT cannot find the compiler in your $PATH / %PATH%.