ROOT I/O study for ATLAS LAr-style event objects

The purpose of this study was to compare different ROOT I/O persistency methods for events that resembled what we might actually use with a G4 simulation of the LAr calorimeter.

For the purposes of this study, I used the LArRootEvent class that I designed for my LArHits example. Since the goal of the study was to measure I/O times and not to do any physics, I created "phony" event records that would be the approximate size of actual LAr calorimeter events, but contained no physics content. The prescription for generating events was:

Event:
Run and event numbers are sequential integers.
Primary:
Ten primaries per event; Position(x,y,z) and Momentum(x,y,z) have each co-ordinate generated randomly between -50 and +50 [the units are irrelevant]; Polarization and Time set to 0; Particle ID incremented from 0 to 9.
Hit:
For 15% of the cells in the LAr Barrel, generate an "energy" and a "time" according to an exponential distribution.

The only reason to put values in the fields at all was to realistically duplicate the effects of the ROOT compression algorithm on the data.

I generated 8000 events written in each persistency scheme as defined below. This created a file of roughly 1 GB in size for each scheme; I assumed that this was a typical size for analysis files that we'd work with.

The results of the earlier study (see my message of 19-Dec-2000) suggested the following separate ROOT persistency methods:

Tree0:
Write the LArRootEvent objects in a ROOT TTree with splitlevel=0 (one TBranch for the entire event).
Tree1:
Write the LArRootEvent objects in a ROOT TTree with splitlevel=1 (one TBranch for each data element within the LArRootEvent class).
Object:
Write each LArRootEvent object directly to the file using the Write() method generated by rootcint.
TDataSet:
Following the prescription laid out by STAR, convert the event information into TTables (wrappers around C structs). The TTables are stored within TDataSets, which are written using the TDataSet->Write() method.
TDataSet-Tree:
Same as the previous scheme, except that the TDataSets are written as a single TBranch of a TTree.

The reason for testing the "TDataSet-Tree" method was the results of the earlier I/O study. That study indicated that there was a fast increase in direct object-I/O time that depended on the number of events written to a file. The "TDataSet-Tree" method attempts to exploit the faster I/O time associated with TDataSets with the slow increase in I/O time with the number of events associated with writing ROOT Trees.

The I/O process was split into two programs: an output program intended to resemble a Monte Carlo, and an input program intended to resemble an analysis program.

The output program had three phases:

Generate:
The contents of an event were generated according to the above prescription.
Convert:
The event was converted into the ROOT persistency scheme. This resembled the conversion of a G4Event object into a LArRootEvent or a TDataSet.
Write:
The actual output of the event information.

The input program also had three phases:

Read:
The actual input of the LArRootEvent objects.
Convert:
The event information was converted into a LArRootEvent. This was only relevant for the TDataSet and TDataSet-Tree persistency schemes; for OO design reasons, I decided to "hide" the I/O scheme from the histogramming section of the program, so it was necessary to convert the TDataSets into LArRootEvent objects.
Histogram:
A simple histogram of hit energies was filled.

These tests were run using ROOT 3.00/02, compiled with the gcc 2.95.2 compiler, and executed on a dual-processor 400 MHz Intel PIII. The individual phases were timed using ROOT's TStopwatch class. The Write and Read phases include the time of ROOT's I/O compression.

Output program phases
Time for 8000 events (in CP secs):

Scheme         Generate   Convert   Write     Total
Tree0            242        207      2055      2582
Tree1            243        208      2049      2580
Object           253        227      2099      2656
TDataSet         253         81      1033      1453
TDataSet-Tree    243         76       989      1385


Input program phases
Time for 8000 events (in CP secs):

Scheme          Read      Convert  Histogram  Total
Tree0           1319          0        31      1350
Tree1           1315          0        32      1348
Object          1351          0        29      1441
TDataSet         434        179        31       706
TDataSet-Tree    449        193        28       671


Up to the Nevis ATLAS Page.
Back to the previous Page.
[E-mail] Send comments and suggestions to the webmaster