Class Ids
Class Ids, or short CLIDs, are numerical class identifier, which must be unique throughout ATLAS s/w.
They allow persistency to interpret a sequence of bytes in a file as the
content of a data object and to read the object back.
CLIDs were originally generated manually in predefined
CLID ranges. They are now generated automatically with the script clid,
which is described below.
Note: For releases before 11.2.0 (included) CLIDSvc is located at
$AtlasArea/Control/CLIDSvc/CLIDSvc-*/
(AtlasArea=/afs/cern.ch/atlas/software/dist/<version>).
How to generate and test CLIDs
The package
CLIDSvc
provides the service and associated tools for generating and managing CLIDs. It provides also the
script clid in directory share.
Script clid
It is installed by CMT in the run-directory of a TestRelease, which uses CLIDSvc.
[TBD - say more about checking out a TestRelease,
see http://alxr.usatlas.bnl.gov/lxr/source/atlas/AtlasPolicy/doc/WorkModel.html#261 ]
The script can also be run directly from the distribution area
$AtlasArea/AtlasCore/<version>/Control/CLIDSvc/share/clid
(AtlasArea=/afs/cern.ch/atlas/software/releases).
It provides command-line access to the
CLID database (clid.db), which lists the CLID for each registered class.
The clid-command provides online help. For simplicity we define an environment
variable for the path to clid and select a <version>, e.g. 2.3.0; we work in the directory
run [TBD - there is share/clid, and python/clidGenerator.py but no file clid.py; ]
For example to generate a unique clid for class MyNewClass> CLIDPATH = $AtlasArea/AtlasCore/2.3.0/Control/CLIDSvc/share/> $CLIDPATH/clid --helpUsage: clid.py[ClassName] [CLID] > ./clidclid.py - Athena CLID GeneratorUsage: clid.py[ClassName] [CLID] Options and arguments:....
or even better> ./clid MyNewClass> 19773486 MyNewClass
The latter generates the CLASS_DEF macro line for MyNewClass ready to be pasted into the class header file. To avoid confusion, the generated CLID will always be above the range of the "historical" manually assigned CLIDs. Notice that for templated classes the class name should be included in "" otherwise the shell will interpret the angle brackets as redirections.> ./clid -m MyNewClassCLASS_DEF( MyNewClass , 19773486 , 1 )
> $AtlasArea/AtlasCore/2.3.0/Control/CLIDSvc/share/clid "vector< int >"16690895 vector< int >
One can also use the clid script to see which class corresponds to an existing id and vice-versa
This functionality is also provided inside athena by ClassIDSvc and its methods> ./clid 41014101 ScintillatorHitCollection> ./clid ScintillatorHitCollection4101 ScintillatorHitCollection
getTypeNameOfID and getIDOfTypeName.