STAR Computing | |
Learning to Use Root for STAR | |
Offline Software using ROOT in STAR | Maintained by G. Van Buren and K. Turner |
Comments/Questions/Suggestions? Send them to gene@bnl.gov |
The path to using Root for STAR is different for people with various degrees of knowledge about using C++, Root itself, and the packages which have already been developed for STAR computing. Not only is code development to be done in C++, but Root's interface language is even based on C (CINT), so it is imperative that the user have some knowledge of C. Whichever path you need to take in Learning to Use Root for STAR, I hope you will find the stepping stones you need below...
or see Tutorials:Further info on ROOT in STAR - (Valerie's page)
Once you've become a Root user in STAR, you may find the Root for STAR web page a better springboard from which to find documentation about STAR offline software.
If you already know C++, then you should move on. Otherwise, you may need to brush up on your C++, or even the more basic fundamentals of the C programming language. While there are many good books on the subject, I found a reasonably paced tutorial online:
- DevCentral Learning Center
- C++ FAQ (This is a great place to refer back to when you have C++ questions!)
- Macmillan Publishing (Here you can find online "Sam's Teach Yourself C in 24 hours / C++ in 21 Days" and several other programming books, but a free subscription to the service is required.)
I list below some resources available for learning Root online, each with some descriptive remarks about what you can find and learn at the site:
- REQUIRED: Root Setup: In order to practice using Root, you must first be able to start Root.
- RECOMMENDED: Root Course by Fons Rademakers: This is a 76 page PDF tutorial (it is incomplete, a work in progress) with many good examples. Some examples are not applicable to the Root we use in STAR (in particular, please skip pp 13-16 on creating Root-based programs), and an effort will be made to annotate this document.
- BOOKMARK: The Root System (from CERN): This is THE Root web site, a good all-around resource. It has a variety of links, but the most useful for the beginner is the Tutorials.
- BOOKMARK: Root Class Guide: As you get to know Root better, you will certainly want access to documentation and code for the classes you use. This site is an index to the html documentation available for Root classes in STAR. Many of the classes are native to Root (and they are appropriately linked to CERN's Root Class Guide). This is a tremendous resource as it provides not only a standardized documentation of all code with cross-referencing links, but links to the source code itself.
- SIMPLE: If you find starting out with the large resources above intimidating (as I did), then you might want to check out some smaller, simpler, but still helpful web resources (all give basic examples for making histograms):
- PHENIX Root Tutorials
(M. Pollack)
- Root Introduction
(D. Zimmerman)
- The Root Primer
(S. Lange)
- Interactive Root (VEGA group)
- DETAILED: Root Web Info Page: This site has some BIG postscript files detailing much of Root.
- FAQ: roottalk archive: If there are basic questions you have about Root itself, then the best place to ask may be roottalk. This is a mailing list at CERN to which many Root experts and users listen. You are welcome to send email with questions to roottalk@root.cern.ch or browser through the roottalk archive. You can even subscribe to the mailing list via an email to Majordomo@root.cern.ch with the body:
subscribe roottalk username@addressFor questions about CINT, there is a small CINT FAQ.- ROOT FOLKLORE: The Root Folklore Forum is an excellent place to find (or post) obscure information or tricks that are difficult to find elsewhere.
Introduction:
For STAR analysis, ROOT is generally run in an interactive mode. We save a series of commands in a macro, run the macro, and get any output data (in files or histograms) that we want. The macro takes care of loading in the necessary code libraries, initializing your routines, and then looping over the events in a file and calling event processing routines, which we call Makers. Makers are run in an orderly fashion by placing them in a Chain of Makers. Sometimes, these Makers work with data which is stored in tables, and sometimes they work with data which is stored in the StEvent data architecture. Tables are generally data structures which have been carried on from the days before Root was used in STAR, and are still commonplace in code run during reconstruction. StEvent is an object oriented data model and is at this point available downstream of the reconstruction (at the analysis stage, or at the end of the reconstruction stage). If you are doing analysis only, it is likely that you will only need to learn the StEvent model. Now that you have a picture of the STAR working environment for Root, it is time to learn the details of Root programming.Going from StAF to Root:
If you already know StAF, then you will undoubtedly want to learn how Root does what StAF did. An important aspect to recognize is that all StAF analysis modules and tables still exist (and thrive!) in Root. They have been merely "wrapped" in C++ classes which have become standardized for Root. For example, StAF table classes like table_name_st are wrapped by Root C++ classes named St_table_name, and similarly for the analysis modules. Analysis modules associated with producing one dataset are now called from within one class associated with that dataset. This class is called a Maker, and is discussed in the next secion.Some of the basic structures are described in Valery Fine's web page:
A few basic parallels are also drawn in StAF to Root. Further details about migrating to Root can be learned in the next section.How Root for STAR Runs:
STAR Software Bulletin Board:
If you have a question whose answer may seem obscure, or simply a "feature" of Root for STAR, then this is the place to look. Some good tricks might be found here also.Accessing ROOT files at RCF via HTML