Into Which Record Should My Data Go?

Complete: 4


The EventSetup system uses Records to hold Data and the 'interval of validity' (IOV) is bound to the Record (thereby allowing Data with the same IOV to be naturally grouped together). But when you make a new piece of Data you want to be accessible via the EventSetup, how do you know what Record you should use? There are three cases
  • data comes from an external source (e.g., calibrations from a database)
  • data is a 'transformation' of data available in one Record
  • data is a 'transformation' of data obtained from multiple Records

Data from external source

If the data is being obtained from an external source (e.g., a database or an XML file) then it usually works best to create a new Record for your data. The reason is if you have multiple data items sharing a Record then they are required to have the same IOV. The only way this can be guaranteed is if those data items come from the same external source. Such restrictions tend to be a 'pain' and therefore having each data item use their own Record tends to avoid problems.

The only caveat to this case is for items with an 'infinite' IOV, e.g. the ideal geometry description. In that case, having multiple data items sharing the same Record (e.g. the IdealGeometryRecord) does not tend to cause a problem.

Data built from data in one Record

If you are creating a new data item which is being build by an ESProducer (i.e., an algorithm) and that algorithm only needs data from one Record, you can place your new data item into that already existing Record. E.g., if you had an algorithm that reads in the tracker geometry and then creates a new data object that only needs information from the tracker geometry (e.g., a list of the number of wafers in each layer) then you can place that new data object into the Record that holds the tracker geometry. [NOTE: an ESProducer places its newly created data items into the Record that is used for the argument of the ESProducer's produce method]

If you do no like sharing the same Record, you can create a new Record and then make your new Record 'dependent' on the other Record. However, this is not the preferred solution since a new Record does require the system to generate a fair amount of new objects.

Data built from data from multiple Records

If you are creating a new data item which is being build by an ESProducer (i.e., an algorithm) and that algorithm needs data from more than one Record, then you must create a new Record. In addition, you must make your new Record be 'dependent' on all those other Records.

Review Status

Reviewer/Editor and Date (copy from screen) Comments
ChrisDJones - 25 Oct 2005 page created, no content edits since
JennyWilliams - 07 Feb 2007 editing to include in SWGuide

Responsible: ChrisDJones
Last reviewed by: Reviewer

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r5 - 2012-12-07 - ChrisDJones

    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

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