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

Learning POOL by examples: Objects with transient data members


Description

The aim of this example is to show how to define of transient data members in persistent objects.

The user creates a class library which contains the implementation of a Hit class, which is associated to a Digit class via an embedded Ref< Digit > data member. A Transformation class is associated to the Hit class (pointer as transient data member) which constructs the Hit data from the Digit data.
The user runs the LCG dictionary for the Hit and Digit classes and builds the corresponding dictionary run time library.
A simple writer application writes Hits and Digits in different containers of a database file which are specified in the program using ROOT Tree storage technology. The reader starts an iteration in the implicit collection of Hit objects defined by the database/container specified in the writer and prints the contents of each Hit together with the contents of its associated Digit.
The writer and reader 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.