Data Definitions in Gaudi

From Daya Bay
Jump to navigation Jump to search

There are more than one way to define the schema of our data.

Through the GaudiObjDesc package

With this package you write XML files that describe your data. An author of a data class must write one or more XML files following the gdd.dtd schema. These files are then used to generate C++ class header files and ROOT and Python dictionary classes. For information on how to use this method see GaudiObjDesc.

Benefits of using GaudiObjDesc

Single source files
All description of a particular data class is held in one file
Uniform C++ class code
Because the C++ class header is generated all .h files are written in a uniform format so easier to read

Downsides of using GaudiObjDesc

Not in Gaudi proper
This package is technically part of LHCb but we will mirror it in our SVN. LHCb developers have been quick to provide help and accept patches and have offered to move it back into Gaudi proper
Not all expected features
Some elements of the XML file do not currently cause any dictionary code creation. Experience has shown that these features can be added in an hour of work.
Aesthetics
The generated code is not the most terse or the best layout, as the interpreter cannot make intelligent formatting or ordering decisions. This is a matter of taste, though. --Nathaniel

Through hand coded classes and reflex_dictionary pattern

With this method you write header files to define the class schema (and the class itself) and XML files to tell what parts of the class you want to emit as dictionary code. For information on how to use this method see Gaudi and Python aware data.

Benefits of using reflex_dictionary

In Gaudi proper
If, for some reason, you do not use Daya Bay SVN, you do not have to go anywhere but Gaudi for this feature.

Downsides of using reflex_dictionary

Two files per class
You must edit two files for each class you wish to define.
Not all expected features
Some elements cause crashes in Reflex. Expect usually prompt ROOT response.

Class Identifiers

However a class in defined in Gaudi, if it is to be used by the conversion or persistency mechanism it needs to have CLID assign to it. The list of currenyl assigned CLIDs can be found in the file:

 dybgaudi/DataModel/doc/clid.txt