Back to the POOL home page
Back to the Tutorial top page

Learning POOL by examples: Simple object collections


Description

The aim of this example is to demonstrate the creation and reading of explicit object collections, associated with meta data.

The user creates a class library which contains the implementation of a Cluster, a Sector, and an Event class. An event is associated to the information of the two sectors (a hadronic and an electromagnetic) of a calorimeter. A Sector holds the energy clusters produced in the current event in this region of the calorimeter.
The user runs the LCG dictionary for these classes and builds the corresponding dictionary run time library.
A writer application writes the Sectors with their Clusters in two different database files. Two runs of events are written in two different databases. A collection writer application starts an iteration in the implicit collection of Event objects objects defined by the database/container specified in the writer and creates and Explicit ROOT Collection for a subset of all the events, generating meta data information from the existing stored data.
Finally, a collection reader application, performs an event loop over the event collection after applying a selection on the meta data.
All applications are linked against the user class library. The dictionary library is explicitly loaded during run time.

Files

Building and running

Please copy above files to your workspace and simply execute the shell script:


./buildAndRunAll.sh

 

Extend this example


Contact : Zhang Yiheng, ATLAS, LNF-INFN.