Difference: TrigEventTPSeparation (34 vs. 35)

Revision 352008-08-13 - AndrewHamilton

Line: 1 to 1
 
META TOPICPARENT name="TriggerEDMCoordination"
This page documents Transient-Persistent (TP) separation in the trigger Event Data Model (EDM). The page contains guidelines for developers needing to introduce new classes or evolve old classes. Since much of the trigger EDM in in the TrigEvent packages, this twiki uses TrigEvent examples.
Line: 12 to 12
  If you would like to persistify (ie. write to ESD/AOD/DPD) a new class into the TrigEvent EDM (any class in Trigger/TrigEvent) you will need to include suitable persistent classes and converters in the Trigger/TrigEvent/TrigEventTPCnv and Trigger/TrigEvent/TrigEventAthenaPool packages. The TrigEventAthenPool classes (AthenaPoolConverters) act as the interface between POOL and your persistent classes and converters - this is the code that decides which persistent class (ie p1, p2, tlp1, etc) should be read from, or written to, disk. The persistent classes and their corresponding converters are found in the TrigEventTPCnv package.
Changed:
<
<
Example: The TrigEventAthenaPool/src/TrigElectronContainerCnv class describes the POOL interface to the TrigElectronContainer converters. The TrigEventTPCnv package contains the TrigElectron_p1 and TrigElectronCnv_p1 classes which describe a persistent class and it's corresponding converter. There are other TrigElectron related classes that are described below.
>
>
The following is a loose "step-by-step" set of instructions you can follow to create introduce your new TrigEvent class. It does not explain all details or use cases, but should be used as a starting point for understanding what to do.
 
Changed:
<
<
The following is a loose "step-by-step" set of instructions you can follow to create introduce your new TrigEvent class. It does not explain all details or use cases, but should be used as a starting point for understanding what to do:
>
>
TrigEventTPCnv Package:
 
  • Write the persistent version of your class in the TrigEventTPCnv package. The name will be YourClassName_p1, the "_p1" reflecting that it is the first persistent version of the class. The persistent class should contain private data members with the information you want to persistify, but no accessor methods (since the persistent class will never be accessed by the user). If the persistent class contains a data member of a non-basic type, then you must decide to either "embed" or "link" (using an ElementLink) the contained class. If you "embed" the object then you will be making a copy of the object inside your class (likely wasting disk space and reducing flexibility), while if you "link" the object to your class then you must be sure to persistify the object linked to so that the link points to! Any base classes (P4EtaPhiM for example) must be embedded as a data member of the persistent class. Note that there should be no pointer data members in the persistent class since this duplicates the information pointed to.
    • Example: TrigElectron_p2 has links to the TrigEMCluster and TrigInDetTrack, and embeds the P4EtaPhiM base class. The p2 here represents the fact that it is actually the second persistent TrigElectron version.
Line: 23 to 23
 
    • Example: TrigElectronCnv_p2 shows many types of conversions. Note that basic types, embedded classes, base classes, and ElementLinks are all dealt with differently, see TransentPersistentSeparation for more details.

  • Write a persistent container and the corresponding container converter in the TrigEventTPCnv package, YourClassNameContainer_p1 and YourClassNameContainerCnv_p1. Normally, the container only requires a header file, no cxx file, because the implementation comes from the inheritance. Note that every TrigEvent class that can have more than one instance per event must be contained in a container (or collection). This is due to the underlying structure of the trigger EDM and navigation. If your transient class does not have a container (or collection) you will have to add one.
Changed:
<
<
    • Example: See TrigElectronCollection_p2 and TrigElectronCollectionCnv_p2
>
>
    • Example: See TrigElectronContainer_p2 and TrigElectronContainerCnv_p2
 
  • Write the "Top Level" persistent class and converter for your class in the TrigEventTPCnv package, YourClassNameContainer_tlp1 and YourClassNameContainerCnv_tlp1. This "!TLP" class is used to eliminate the chain effect caused when contained classes evolve. For example, if you embedded a P4EtaPhiM_p1 class into your class, you would need to change this if P4EtaPhiM was evolved to P4EtaPhiM_p2. This is obviously not maintainable in the long term. Therefore, the TLP allows you to specify classes by reference, called a TPObjRef, and you do not need to change your class if a base class evolves under you.
Changed:
<
<
    • Example: See TrigElectronCollection_tlp2 and TrigElectronCollectionCnv_tlp2
>
>
    • Example: See TrigElectronContainer_tlp2 and TrigElectronContainerCnv_tlp2
 
  • Include your class in the TrigEventTPCnv/TrigEventTPCnvDict.h

  • Include your class in the TrigEventTPCnv/selection.xml. The id number needs to be unique for each class and all letters must be capital. You get a unique id by doing uuidgen | tr 'a-z' 'A-Z' (the tr part of the command converts the id to all capitols).
Added:
>
>
  • If not already included, add your transient class's package to the TrigEventTPCnv/cmt/requriements file

TrigEventAthenaPool Package:

 
  • Write the AthenaPoolConverters in the TrigEventAthenaPool package, YourClassNameContainerCnv. These converters are used to 'steer' the user request for an object to the correct persistent version to be read or written. The id values from the TrigEventTPCnv/selection.xml are used in this converter to identify the persistent version present on disk (using the compareClassGuid method)
Added:
>
>
    • Example: See TrigElectronContainerCnv in TrigEventAthenaPool package (note that both header and cxx files are in the src directory)

* Include your transient class's package and class library in the TrigEventAthenaPool/cmt/requirements file

TriggerJobOpts Package:

  • The TriggerCommon/TriggerJobOpts/python/HLTTriggerGetter.py file defines what classes are included in the trigger EDM. Include your classes in this file, following examples therein.
 

Instructions to Schema Evolve (change the EDM)

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback