Using es_prefer to Decide Where Data Comes From

Complete: 4


It is possible to configure the EventSetup such that multiple ESProducers or ESSources will tell the system that they want to deliver the same data. This can happen when doing calibration work where a job has configured the standard calibration database to deliver data but in the same job a calibration worker's own database has also been added which is meant to deliver the calibration being worked on. It is possible that both databases will tell the system they should be the provider for the particular calibration object.

In software release CMSSW_0_3_0 and before, the conflict was resolved by picking the last 'component' that was loaded into the job. As of software release CMSSW_0_4_0_pre1 it has been made an error. In software release CMSSW_0_4_0_pre2, one can use an es_prefer configuration option to state exactly which component should be used.


Old cfg language:
  es_prefer [module label] = <C++ class type> {
     [vstring <record name> = { [ "<C++ data type>"[/<data label>][,...]]}
New python configuration (GF: Not sure whether 'record name' part converted correctly to python.):
  process.myPrefer = cms.ESPrefer("<C++ class type>" [,"<module label>"
                                  [,<record name> = cms.vstring("<C++ data type>[/<data label>]"[,...])]
The items in square braces are optional.

The [module label] and <C++ class type> must match the values used for the ESProducer or ESSource which is being made the 'preferred' data provider.

If the body, i.e. info within the curly braces { }, is empty then all data from that component is considered preferred.

The allowed parameters within the body are all vstring s where the name of the parameter, <record name> is the actual name of an EventSetup Record class which holds the data you want to be preferred. NOT IMPLEMENTED YET: if the vstring is empty, then all data items in that Record will come from this component. The values in the vstring are the C++ name of the data object and an optional label that is used to get that data. The C++ class name and the label are separated by a slash, /.

For the python configuration, the name myPrefer is not significant: any name can be used. To make multiple ESPrefer statements, set multiple variables as myPrefer above, giving a unique name to each.


Two ESProducers

   es_module = GoodWidgetProducer { ... }
   es_module = BadWidgetProducer {....}

   #get our widgets from Good
   es_prefer = GoodWidgetProducer {}

Two ESProducers using labels

   es_module good = WidgetProducer { ... }
   es_module bad = WidgetProducer {....}

   #get our widgets from good
   es_prefer good = WidgetProducer {}

An ESProducer and a ESSource and want ESProducer

   es_source = WidgetESSource {...}
   es_module = WidgetProducer {...}
   #NOTE: no es_prefer needed since ESProducers automatically 'trump' ESSources

An ESProducer and a ESSource and want ESSource

   es_source = WidgetESSource {...}
   es_module = WidgetProducer {...}

   #want from source
   es_prefer = WidgetESSource {}

One item from ESSource everything else from ESProducer

   es_source = ManyWidgetsESSource {...}
   es_module = ManyWidgetsProducer {...}

   #want the 'BestWidget' from source
   es_prefer = ManyWidgetsESSource {
     vstring WidgetRecord = {"BestWidget"}

An ESProducer and an ESProducerLooper and want ESProducerLooper

   looper = AlignmentESProducerLooper {...}
   es_module = AlignmentESProducer {...}

   #NOTE: no es_prefer needed since ESProducerLoopers automatically 'trump' ESProducers

An ESProducer and an ESProducerLooper and want ESProducer

   looper =  AlignmentESProducerLooper {...}
   es_module = AlignmentESProducer {...}

   #want from non-looper source
   es_prefer = AlignmentESProducer {...}

Review Status

Reviewer/Editor and Date (copy from screen) CommentsSorted ascending
JennyWilliams - 07 Feb 2007 editing to include in SWGuide
ChrisDJones - 22 Dec 2005 page created. no further content edits since

Responsible: ChrisDJones
Last reviewed by: Reviewer

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r6 - 2009-06-22 - KristoferHenriksson

    • 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