digiRootData Implementation Details | ||
TClonesArray
No Memory Leaks Namespaces get and set |
Implementation DetailsTClonesArrays 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. 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(); 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. 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. 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. |