How to implement MC propagation

IMPORTANT With SVN revision 9240 the implementation of MC propagation has changed! A FairLink consists now of a string and an integer. The string is the branch name, where the data is stored in. The integer is the position in the TClonesArray as usual. Internally the FairRootManager translates the branch name into a unique ID which is stored in the file.

In addition the setting of links now checks if the data the link is pointing to is transient. If this is the case the link information of the previous stage is saved instead of the original link. In this way it is ensured that the chain of link is not interrupted by intermediated data which is not stored.

  1. Derive your data class from FairMultiLinkedData*
    • If your data class already derives from FairHit or FairMCPoint this is not necessary
    • Be careful Multiple inheritance from different classes causes problems in ROOT so better avoid it.
  2. Use one of the methods SetLink, SetLinks, AddLink or AddLinks
    • Use the methods SetLink/SetLinks, AddLink/AddLinks to save the FairLink to the previous data-object
    • SetLink(FairLink) overrides an existing link array with one FairLink
    • SetLinks(FairMultiLinkedData) overrides an existing array with an array of FairLinks
    • AddLink(FairLink) / AddLinks(FairMultiLinkedData) adds the given data at the end of the existing FairLink array.
  3. Compile / Check/ Upload
    • Compile your code
    • Run a simulation
    • Check if your data class contains a fLinks branch with entries for fType and fIndex
    • Upload your code to SVN
    • Thats it. You have successfully implemented MC propagation into your code.