Difference: TrigEventTPSeparation (33 vs. 34)

Revision 342008-08-12 - 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: 10 to 10
 

Introducing a New TrigEvent Class

Changed:
<
<
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 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.
>
>
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.
  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.
Line: 22 to 22
 
  • Write the converter for your class in the TrigEventTPCnv package, the name should be YourClassNameCnv_p1. The converter will simply inherit from T_AthenaPoolTPCnvBase and contain a persToTrans and transToPers methods which do the conversion from the current transient version of the class to the p1 persistent version.
    • 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.
Changed:
<
<
  • Write a persistent container and the corresponding container converter, 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.
>
>
  • 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.
 
    • Example: See TrigElectronCollection_p2 and TrigElectronCollectionCnv_p2
Changed:
<
<
  • Write the "Top Level" persistent class and converter for your class, 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.
>
>
  • 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.
 
    • Example: See TrigElectronCollection_tlp2 and TrigElectronCollectionCnv_tlp2
Added:
>
>
  • 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).

  • 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)
 

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