~9marusia6/maus/beamlinesimulation

« back to all changes in this revision

Viewing changes to doc/doc_src/data_structure.tex

  • Committer: justinchristensen at berkeley
  • Date: 2012-06-08 08:47:52 UTC
  • mfrom: (669.1.1 release)
  • Revision ID: justinchristensen@berkeley.edu-20120608084752-5x3f3rzflhhcewwi
new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
The data can be written in two formats. The main data format is a ROOT binary format. This requires the ROOT package to read and write, which is a standard analysis/plotting package in High Energy Physics and is installed by the MAUS build script. The secondary data format is JSON. This is an ascii data-tree format that in principle can be read by any text editor. Specific JSON parsers are also available - for example, the python \emph{json} module is available and comes prepackaged with MAUS.
15
15
 
16
 
\subsection{Loading ROOT Files in Python Using PyROOT}
17
 
The standard scripting tool in MAUS is python. The ROOT data structure can be loaded in python using the PyROOT package. An example of how to perform a simple analysis with PyROOT is available in \verb|bin/examples/load_root_file.py|.
18
 
 
19
 
\subsection{Loading ROOT Files on the ROOT Command Line}
20
 
One can load ROOT files from the command line using the ROOT interactive display. It is first necessary to load the MAUS class dictionary. Then The TBrowser ROOT GUI can be used to browse to the desired location and interrogate the data structure interactively. For example,
21
 
 
22
 
\begin{verbatim}
23
 
$ source env.sh
24
 
$ root
25
 
 
26
 
  *******************************************
27
 
  *                                         *
28
 
  *        W E L C O M E  to  R O O T       *
29
 
  *                                         *
30
 
  *   Version   5.30/03   20 October 2011   *
31
 
  *                                         *
32
 
  *  You are welcome to visit our Web site  *
33
 
  *          http://root.cern.ch            *
34
 
  *                                         *
35
 
  *******************************************
36
 
 
37
 
ROOT 5.30/03 (tags/v5-30-03@41540, Oct 24 2011, 11:51:36 on linuxx8664gcc)
38
 
 
39
 
CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
40
 
Type ? for help. Commands must be C++ statements.
41
 
Enclose multiple statements between { }.
42
 
root [0] .L $MAUS_ROOT_DIR/build/libMausCpp.so
43
 
root [1] TBrowser b
44
 
\end{verbatim}
 
16
\subsection{Accessing ROOT files}
 
17
For details on how to access the ROOT files, please see the introduction section of this document.
45
18
 
46
19
\subsection{Conversion to, and Working With, JSON}
47
20
MAUS also provides output in the JSON data format. This is an ascii format with IO libraries available for C++, Python and other languages. Two utilities are provided to perform conversions, \verb|bin/utilities/json_to_root.py| and \verb|bin/utilities/root_to_json.py| for conversion from and to JSON format respectively. JSON Input and Output modules are provided, \verb|InputPyJson| and \verb|OutputPyJson|.