Skip to content

Commit 543b3a9

Browse files
committed
Merge pull request cms-sw#2566 from Dr15Jones/improveESInputTagDocumentation
Documentation updates -- Improved ESInputTag’s documentation
2 parents 4cbf1d2 + 24d834c commit 543b3a9

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

FWCore/Utilities/interface/ESInputTag.h

+45
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,57 @@
1919
In addition, every piece of data in the EventSetup comes from either an ESSource or an ESProducer. Every
2020
ESSource and ESProducer is assigned a label (referred to here as the moduleLabel) in the configuration of
2121
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'.
2231
2332
The ESInputTag allows one to specify both the dataLabel and moduleLabel. The dataLabel is used to find the data
2433
being requested. The moduleLabel is only used to determine if the data that was found comes from the specified
2534
module. If the data does not come from the module then an error has occurred. If the moduleLabel is set to the
2635
empty string then the data is allowed to come from any module.
2736
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.
2873
*/
2974
//
3075
// Original Author: Chris Jones

0 commit comments

Comments
 (0)