digiRootData Implementation Details
TClonesArray
No Memory Leaks
Namespaces
get and set 

Implementation Details

Use of TClonesArray

TClonesArrays are now in use to store both CAL and ACD digitization data.  TObjArrays are still in use for the TKR since TClonesArray cannot contain pointers.

If one looks at the Event class include file, you will notice the use of static TClonesArrays and TObjArrays.  This is done so that it is only necessary to allocate the TClonesArray/TObjArray once.

No More Memory Leaks

Our previous version of digiRootData had some issues with memory leaks.  Much time has been spent to modify the classes and insure that the issues with memory leaks can be put to rest.

Root provides a routine called:  gObjectTable->Print();
which can be used to dump the allocated memory during a Root session. 

Here is a test script used to try out the new digiRootData classes - to check to see that all allocated memory is removed when an event object is deleted.
The result of running this test script is located here.
The object table is printed 3 times.  The first time before we begin any processing - even before the digiRootData library is loaded.  This first object table contains the bare minimum of memory that is initially allocated by Root. 
The second object table is printed just after we create the Event object.  Here we see an increase in the amount of memory usage.  The TClonesArrays for the ACD and CAL and TObjArray for the TKR has been allocated.  The member variables, for AcdHeader, CalHeader, and TkrHeader now appear in the table.
The third object table is printed just after we have finished processing 500 events, and have deleted the Event object.  Scanning the table, we see no evidence of any of our digiRootData classes.  You will note that there are still ~200 TObjArrays allocated - these are used internally by Root and were created during our I/O for our root file.

Use of Namespaces, and names of classes

According to GLAST's coding standards, we support the use of namespaces - however, not all of our code is currently using them.  There are difficulties with using namespaces in a Root class - hence, namespaces are not used.  In future versions of Root - we expect that these problems will be fixed. 

In light of our decision not to use namespaces within the digiRootData classes themselves - some class names are not named as we would otherwise have hoped.  Our intention would be to name the Root classes to mimic the class names used within the Gaudi TDS.  However, this is not possible, since some of those TDS classes do not currently use namespaces.  For example, we would like to call the LogId class CalLogId - however, this would conflict with the use of CalLogId in the CalRecon package.  Similarly, rather than naming the main branch "Event", we would prefer to use "DigiEvent" - however this would conflict with the use of "DigiEvent" in the GlastEvent package.  Once we have standard use of namespaces, the classes within the digiRootData package may be modified to mimic those used in the Gaudi TDS.  This will not happen before October 2001.

Names of get and set methods

In order to adhere to GLAST's coding standards, all "get" and "set" routines begin with a lower case "g" or "s".  This is unlike ROOT, which uses "Get" and "Set".  This may at times be confusing when one is using the digiRootData classes within the Root Analysis environment.

New get methods

Additional methods have been added to the Event class to allow for easy retrieval of specific AcdTiles, XGT data, or TkrLayers.