|
19 | 19 | In addition, every piece of data in the EventSetup comes from either an ESSource or an ESProducer. Every
|
20 | 20 | ESSource and ESProducer is assigned a label (referred to here as the moduleLabel) in the configuration of
|
21 | 21 | the job. This label may be explicitly set or it may just be the C++ class type of the ESSource/ESProducer.
|
| 22 | + For example, say there is an ESProducer of C++ class type FooESProd. If the python configuration has |
| 23 | + process.FooESProd = cms.ESProducer("FooESProd", ...) |
| 24 | + then the module label is 'FooESProd'. |
| 25 | + If the python configuration has |
| 26 | + process.add_( cms.ESProducer("FooESProd", ...) |
| 27 | + then the module label is also 'FooESProd'. |
| 28 | + However, if the python configuration has |
| 29 | + process.foos = cms.ESProducer("FooESProd",...) |
| 30 | + then the module label is 'foos'. |
22 | 31 |
|
23 | 32 | The ESInputTag allows one to specify both the dataLabel and moduleLabel. The dataLabel is used to find the data
|
24 | 33 | being requested. The moduleLabel is only used to determine if the data that was found comes from the specified
|
25 | 34 | module. If the data does not come from the module then an error has occurred. If the moduleLabel is set to the
|
26 | 35 | empty string then the data is allowed to come from any module.
|
27 | 36 |
|
| 37 | + Example 1: |
| 38 | + FooESProd makes Foos with the default dataLabel ("") |
| 39 | + The module is declared in the python configuration as |
| 40 | + process.FooESProd = cms.ESProducer("FooESProd",...) |
| 41 | + The following python configurations for ESInputTag can be used to get its data |
| 42 | + cms.ESInputTag("") |
| 43 | + cms.ESInputTag(":") |
| 44 | + cms.ESInputTag("","") |
| 45 | + cms.ESInputTag("FooESProd") |
| 46 | + cms.ESInputTag("FooESProd:") |
| 47 | + cms.ESInputTag("FooESProd","") |
| 48 | +
|
| 49 | + Example 2: |
| 50 | + FooESProd makes Foos with the dataLabel "bar" |
| 51 | + The module is declared in the python configuration as |
| 52 | + process.FooESProd = cms.ESProducer("FooESProd",...) |
| 53 | + The following python configurations for ESInputTag can be used to get its data |
| 54 | + cms.ESInputTag(":bar") |
| 55 | + cms.ESInputTag("","bar") |
| 56 | + cms.ESInputTag("FooESProd:bar") |
| 57 | + cms.ESInputTag("FooESProd","bar") |
| 58 | +
|
| 59 | + Example 3: |
| 60 | + FooESProd makes Foos with the default dataLabel ("") |
| 61 | + process.FooESProd = cms.ESProducer("FooESProd",...) |
| 62 | + Foo2ESProd also makes Foos with the default dataLabel ("") |
| 63 | + process.Foo2ESProd = cms.ESProducer("Foo2ESProd",...) |
| 64 | + The jobs has an ESPrefer which states Foos should come from FooESProd |
| 65 | + process.perferedFoo = cms.ESPrefer("FooESProd") |
| 66 | + Then to get the data, one can specify the ESInputTag identical to Example 1. |
| 67 | + However, the following ESInputTags will lead to an exception begin thrown |
| 68 | + cms.ESInputTag("Foo2ESProd") |
| 69 | + cms.ESInputTag("Foo2ESProd:") |
| 70 | + cms.ESInputTag("Foo2ESProd","") |
| 71 | + The exception happens because FooESProd is the only allowed source of Foos |
| 72 | + but the ESInputTag says you really wanted them to come from Foo2ESProd. |
28 | 73 | */
|
29 | 74 | //
|
30 | 75 | // Original Author: Chris Jones
|
|
0 commit comments