Table of Contents vii
Axis with Time Units ................................................................. 125
Axis Examples ............................................................................ 128
Graphical Objects Attributes ..................................................................... 130
Text Attributes ............................................................................ 130
Line Attributes ............................................................................ 133
Fill Attributes ............................................................................. 133
Color and Color Palettes ............................................................. 134
The Graphics Editor .................................................................................. 135
TAxisEditor ................................................................................ 135
TPadEditor .................................................................................. 135
Copy and Paste ......................................................................................... 135
Using the GUI............................................................................. 136
Programmatically ....................................................................... 136
Legends ..................................................................................................... 137
The PostScript Interface ............................................................................ 138
Special Characters ...................................................................... 139
Writing Several Canvases to the Same PostScript File .............. 139
Create or Modify a Style ........................................................................... 141
3D Viewers ............................................................................................... 143
Invoking a 3D viewer ................................................................. 143
The GL Viewer ........................................................................... 143
The X3D Viewer ........................................................................ 149
Common 3D Viewer Architecture .............................................. 149
10 Folders and Tasks 155
Folders ...................................................................................................... 155
Why Use Folders? ..................................................................................... 155
How to Use Folders .................................................................................. 156
Creating a Folder Hierarchy ....................................................... 156
Posting Data to a Folder (Producer) ........................................... 156
Reading Data from a Folder (Consumer) ................................... 156
Tasks ......................................................................................................... 157
Execute and Debug Tasks ......................................................................... 158
11 Input/Output 159
The Physical Layout of ROOT Files......................................................... 159
The File Header .......................................................................... 160
The Top Directory Description ................................................... 160
The Histogram Records .............................................................. 161
The Class Description List (StreamerInfo List) .......................... 161
The List of Keys and the List of Free Blocks ............................. 162
File Recovery.............................................................................. 162
The Logical ROOT File: TFile and TKey ................................................ 163
Viewing the Logical File Contents ............................................. 164
The Current Directory ................................................................ 165
Objects in Memory and Objects on Disk .................................... 165
Saving Histograms to Disk ......................................................... 167
Histograms and the Current Directory ........................................ 168
Saving Objects to Disk ............................................................... 168
Saving Collections to Disk ......................................................... 169
A TFile Object Going Out of Scope ........................................... 169
Retrieving Objects from Disk ..................................................... 169
Subdirectories and Navigation .................................................... 169
Streamers .................................................................................................. 171
Automatically Generated Streamers ........................................... 171
Transient Data Members (//!) ..................................................... 172
The Pointer to Objects (//->) ....................................................... 172
Variable Length Array ................................................................ 172
Double32_t ................................................................................. 172
Prevent Splitting (//|| ) ................................................................. 173
Streamers with Special Additions ............................................... 173
viii Table of Contents
Writing Objects .......................................................................... 174
Ignore Object Streamers ............................................................. 174
Streaming a TClonesArray ......................................................... 174
Pointers and References in Persistency ..................................................... 175
Streaming C++ Pointers ............................................................. 175
Motivation for the TRef Class .................................................... 175
Using TRef ................................................................................. 175
How Does It Work? .................................................................... 176
Action on Demand ...................................................................... 177
Array of TRef ............................................................................. 178
Schema Evolution ..................................................................................... 178
The TStreamerInfo Class ............................................................ 179
The TStreamerElement Class ..................................................... 179
Example: TH1 StreamerInfo ...................................................... 179
Optimized StreamerInfo ............................................................. 180
Automatic Schema Evolution ..................................................... 180
Manual Schema Evolution .......................................................... 180
Building Class Definitions with the StreamerInfo ...................... 181
Example: MakeProject ............................................................... 181
Migrating to ROOT 3 ............................................................................... 183
Compression and Performance ................................................................. 183
Remotely Access to ROOT Files via a rootd ............................................ 184
TNetFile URL ............................................................................. 184
Remote Authentication ............................................................... 184
A Simple Session ........................................................................ 184
The rootd Daemon ...................................................................... 185
Starting rootd via inetd ............................................................... 185
Command Line Arguments for rootd ......................................... 185
Reading ROOT Files via Apache Web Server .......................................... 186
Using the General Open Function of TFile ................................ 186
XML Interface .......................................................................................... 186
12 Trees 189
Why Should You Use a Tree? .................................................................. 189
A Simple TTree ........................................................................................ 189
Show an Entry with TTree::Show ............................................................. 190
Print the Tree Structure with TTree::Print ................................................ 190
Scan a Variable the Tree with TTree::Scan .............................................. 191
The Tree Viewer ....................................................................................... 191
Creating and Saving Trees ........................................................................ 193
Creating a Tree from a Folder Hierarchy .................................... 193
Tree and TRef Objects ................................................................ 193
Autosave ..................................................................................... 194
Trees with Circular Buffers ........................................................ 194
Size of TTree in the File ............................................................. 194
User Info Attached to a TTree Object ........................................ 194
Indexing a Tree ........................................................................... 194
Branches ................................................................................................... 195
Adding a Branch to Hold a List of Variables ............................................ 195
Adding a TBranch to Hold an Object ....................................................... 196
Setting the Split-level ................................................................. 197
Exempt a Data Member from Splitting ...................................... 198
Adding a Branch to Hold a TClonesArray ................................. 198
Identical Branch Names.............................................................. 198
Adding a Branch with a Folder ................................................................. 198
Adding a Branch with a Collection ........................................................... 198
Examples for Writing and Reading Trees ................................................. 199
Example 1: A Tree with Simple Variables ............................................... 199
Writing the Tree ......................................................................... 199
Viewing the Tree ........................................................................ 200
Reading the Tree ......................................................................... 201
Example 2: A Tree with a C Structure ...................................................... 202