# Presentation: 528513

## Athena/POOL integration

## AthenaPOOL components are components of the Athena framework

- From the Atlas “Athena” framework point of view the POOL provides just a new kind of I/O technology.
- This means the “integration” within Athena means a concrete  implementation of Athena Conversion service for POOL-technology first of all.
- The implementation project was present collaboration _[http://](http://www.usatlas.bnl.gov/~dladams/poolint/design.html)__[www.usatlas.bnl.gov/~dladams/poolint/design.html](http://www.usatlas.bnl.gov/~dladams/poolint/design.html)_

## History	

- Athena 5.2.0;  POOL  0.3.0 pre-release
- Athena 5.3.0;  POOL  0.3.0 pre-release
- Athena 6.1.0;  POOL  0.5.0 first public release (AthenaPOOL-17 public release)
- Athena 6.2.0;  POOL 1.0.0;   AthenaPOOL-22
- Athena 6.3.0;  POOL 1.0.0;   AthenaPOOL-39
- Athena 6.4.0;  POOL 1.1.0;   AthenaPOOL-45
- Athena 6.5.0;  POOL 1.1.0;   AthenaPOOL-51
- Athena 6.6.0;  POOL 1.2.0;   AthenaPOOL-58
- Athena 7.0.0;  POOL 1.2.0;   AthenaPOOL-62
- Athena 7.1.0 ; POOL 1.3.0;   coming soon

- With 3 weeks Athena release pace, and 1 week to freeze the core package
- requirement, and 1 week to make release up we have
**1 “effective development” week per release.**

## AtlasPOOL CVS repository

## AtlasPOOL example package

## Conversion Process

- See: Athena. Chapter 15 Converters

**AthenaPoolConverter**

**AthenaPoolAddress**

**AthenaPoolCnvSvc**

**AthenaPoolCnv<T>**

**AthenaPoolCnv<T>**

**AthenaPoolCnv<T>**

## POOL I/O for Athena algorithm

- AthenaPoolCnvSvc

- PoolSvc

- IService

- POOL

**POOL**
**Db**
** ****files**
**(ROOT)**

- Athena Algorithm

- StoreGate

**File**
**Catalog**
**(XML)**

**POOL**
** ****Collection**
**EventHeader**
**(MySQL)**

- jobOptions

- SEAL

- C++ class
- headers

- File ID

- The user should provide 2 things:
**Collection** to store /retrieve the object
- Object **pointer** / **token**

- LCG dictionary
- Athena converter

- POOL
-  token

## How to prepare your data  object and algorithm for POOL I/O

- Athena “Algorithm” is not affected
- One extra step is required for the “data object” – prepare LCG dictionary
- Prepare Athena “converter”
- Prepare job options
- Run  “athena”

## AthenaPOOL MySQL “collecton” - EventHeader

## Example of the AtlasPOOL collection

## Job option to read /write via POOL

**One needs to remember very few things**:
- Define the Athena Conversion service for POOL I/O technology. To do that it is sufficient _[to include ](http://atlas-sw.cern.ch/cgi-bin/viewcvs.cgi/offline/Database/AthenaPOOL/AthenaPoolCnvSvc/share/WriteAthenaPool_jobOptions.txt?rev=1.5&content-type=text/vnd.viewcvs-markup)_in the jobOption file:
-  _[#include "$ATHENAPOOLCNVSVCROOT/share/](http://atlas-sw.cern.ch/cgi-bin/viewcvs.cgi/offline/Database/AthenaPOOL/AthenaPoolCnvSvc/share/WriteAthenaPool_jobOptions.txt?rev=1.5&content-type=text/vnd.viewcvs-markup)__[WriteAthenaPool_jobOptions.txt](http://atlas-sw.cern.ch/cgi-bin/viewcvs.cgi/offline/Database/AthenaPOOL/AthenaPoolCnvSvc/share/WriteAthenaPool_jobOptions.txt?rev=1.5&content-type=text/vnd.viewcvs-markup)__[" ](http://atlas-sw.cern.ch/cgi-bin/viewcvs.cgi/offline/Database/AthenaPOOL/AthenaPoolCnvSvc/share/WriteAthenaPool_jobOptions.txt?rev=1.5&content-type=text/vnd.viewcvs-markup)_
-       This is to load and define two POOL-related Athena services:
-                     **ApplicationMgr.DLLs += { "PoolSvc", "AthenaPoolCnvSvc" };**
**                    ****ApplicationMgr.ExtSvc += { "PoolSvc", "AthenaPoolCnvSvc" }; **
- _[Define](http://atlas-sw.cern.ch/cgi-bin/viewcvs.cgi/offline/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleLcgDictionary/share/AthenaPoolExampleLcgDictionary_jobOption.txt?rev=1.2&content-type=text/vnd.viewcvs-markup)_ the Athena Converter for each package involved
**                    ****ApplicationMgr.DLLs += { "AthenaPoolExampleConverter" }; **
-       where **AthenaPoolExampleConverter **name of the user-provided converter share library
- _[Provide ](http://atlas-sw.cern.ch/cgi-bin/viewcvs.cgi/offline/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleLcgDictionary/share/AthenaPoolExampleLcgDictionary_jobOption.txt?rev=1.2&content-type=text/vnd.viewcvs-markup)_the StoreGate  Stream and the list of the class StoreGate ID’s for those instances of the classes one wants to be written out
-              **        ****Stream1.ItemList += {"9876#*" }; **
- Define _[the POOL Db collection](http://atlas-sw.cern.ch/cgi-bin/viewcvs.cgi/offline/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleJob/share/AthenaPoolExample_WriteJobOptions.txt?rev=1.3&content-type=text/vnd.viewcvs-markup)_ to keep the track about the stored events
**                    ****PoolSvc.Collection = “MyCollectionPoolTry"; **
-         where **" MyCollectionPoolTry "** is a **unique** name of the current session in the MySQL Db.
- Define (temporary) the name of the ROOT file to write these events out.
**              ****PoolSvc.Output = "SimplePoolFile.root"; **
**PoolSvc **may be provided with the optional POOL collection factory parameters to describe the various type collections

## Read the objects from the POOL

-  **To read the events back **one has to load a special implementation of the Athena **EventSelector** class and the name of the input Db collection.
-     To define the POOL event Selector implementation one can add the include statement
** ****#include $ATHENAPOOLCNVSVCROOT/share/ReadAthenaPool_jobOptions.txt" **
-         to his/her jobOptions.
- To define the POOL input collection the statement:
**                   ****EventSelector.InputCollection = "NewPoolTry"; **
-           where **"NewPoolTry"** is a name of the collection one wants to read the events from.
-      The file ID is stored in the Db. By this reason one needs to provide NO file name to read the events back.
-     In fact the file name is the POOL Db parameter rather the user-provided attribute

## Quick Db check

- The named collection can be seen via   from MySql Db. To browse the Atlas default Db
- http://atlassw1.phy.bnl.gov/phpMyAdmin/index.php
-    select **"pool_collection"** from the drop-down **"(databases)"** menu and the select the name of your collection.

## Conclusion

-   At the moment the fundamental problem of providing a tool to build the class dictionary and object Athena converters automatically solved. The Atlas user can try it and the developer group can assist them to collect the valuable feedback, and provide the feedback to the POOL developers.
-    Even though we may focus on other directions some problems should have been anticipated.

## C++ class serialization problem

- There are two anticipated problems to be resolved:
- Not enough SEAL/POOL capability to serialize some particular Athena C++ class:
- Can be resolved by class redesign
- Fix SEAL/POOL
- Internal Athena class design problem caused its transient nature.
-    The original I/O Gaudi paradigm came from the “Objectivity” that implied two hand-written classes, namely persistent class and class converter per each user data-class. Using ROOT-approach, generating automatically the class dictionary directly from its  C++ definition eliminates those hand–written classes . However the classes  originally were not design to be persistent that may have caused the problem.
- Can be resolved by class redesign

## How to find the “broken” class

- One has to try. It is a simplest way to find out the classes to be adjusted.
- Conclusion:
- The current level of implementation allows us to seek the collaboration-wide trial.

## Three ways to evolve

- C++ class serialization problem (I/O and dictionary) – needs the collaboration participation.
- It is not clear why one is required to provide the list of the class data-members. The LCG OO dictionary is in possession of this infomrstion. Required the user to change “selection.xml” as soon as his /her class evolves. This would have tremendously simplified the user life.
- POOL Db related problem – just next Athena/POOL integration step to be done.
- Athena/Pool Optimization
-     Removing the duplicated functionality
-     Selection the proper combination of the Db options POOL provides.
-     These cause no immediate problem. We have time to work out Atlas own proper solution or wait POOL Data Service evolves.

## POOL is an OO Db

- User doesn’t play with any file. The file name is an internal POOL unit and available through the POOL file catalog.
- The user defines the object he wants to be written out  (in term of StoreGate) and the type Db to keep the “event track” (for example MySQL collection name)
**Questions** to be addressed yet:
- Who allocates the POOL file space and where?
- How to choose the Db collection name to avoid clashes?
- Such kind of questions are not new for the Athena. It the same problem we faced to select and assign a unique class id for each class kept in StoreGate.

## Thank you.

- _ATLAS team:                    POOL/LCG team_
- David Adams (BNL)      Dirk Dulleman
- Christian Arnault           Markus Frank
- Hong Ma (BNL)             Ioannis
- David Melon                  Torre Wenaus
- David Quarrie
- RD Schaffer
- Alex Undrus