-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
EventHistory_SubProcess_cfg.py
272 lines (215 loc) · 8.05 KB
/
EventHistory_SubProcess_cfg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
import FWCore.ParameterSet.Config as cms
process = cms.Process("FIRST")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(100)
)
process.source = cms.Source("EmptySource")
process.intdeque = cms.EDProducer("IntDequeProducer",
count = cms.int32(12),
ivalue = cms.int32(21)
)
process.intlist = cms.EDProducer("IntListProducer",
count = cms.int32(4),
ivalue = cms.int32(3)
)
process.intset = cms.EDProducer("IntSetProducer",
start = cms.int32(100),
stop = cms.int32(110)
)
process.intvec = cms.EDProducer("IntVectorProducer",
count = cms.int32(9),
ivalue = cms.int32(11)
)
process.out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('testEventHistory_1.root')
)
process.p1 = cms.Path(process.intdeque+process.intlist+process.intset+process.intvec)
process.ep1 = cms.EndPath(process.out)
process2 = cms.Process("SECOND")
process.subProcess = cms.SubProcess(process2)
process2.intdeque = cms.EDProducer("IntDequeProducer",
count = cms.int32(12),
ivalue = cms.int32(21)
)
process2.intlist = cms.EDProducer("IntListProducer",
count = cms.int32(4),
ivalue = cms.int32(3)
)
process2.intset = cms.EDProducer("IntSetProducer",
start = cms.int32(100),
stop = cms.int32(110)
)
process2.intvec = cms.EDProducer("IntVectorProducer",
count = cms.int32(9),
ivalue = cms.int32(11)
)
process2.filt55 = cms.EDFilter("TestFilterModule",
acceptValue = cms.untracked.int32(55)
)
process2.filt75 = cms.EDFilter("TestFilterModule",
acceptValue = cms.untracked.int32(75)
)
process2.out = cms.OutputModule("PoolOutputModule",
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('f55')
),
fileName = cms.untracked.string('testEventHistory_2.root')
)
process2.s = cms.Sequence(process2.intdeque+process2.intlist+process2.intset+process2.intvec)
process2.f55 = cms.Path(process2.s*process2.filt55)
process2.f75 = cms.Path(process2.s*process2.filt75)
process2.ep2 = cms.EndPath(process2.out)
process2.sched = cms.Schedule(process2.f55, process2.f75, process2.ep2)
process3 = cms.Process("THIRD")
process2.subProcess = cms.SubProcess(process3,
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('f55')
)
)
process3.intdeque = cms.EDProducer("IntDequeProducer",
count = cms.int32(12),
ivalue = cms.int32(21)
)
process3.intlist = cms.EDProducer("IntListProducer",
count = cms.int32(4),
ivalue = cms.int32(3)
)
process3.intset = cms.EDProducer("IntSetProducer",
start = cms.int32(100),
stop = cms.int32(110)
)
process3.intvec = cms.EDProducer("IntVectorProducer",
count = cms.int32(9),
ivalue = cms.int32(11)
)
process3.out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('testEventHistory_3.root')
)
process3.outother = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('testEventHistory_other.root')
)
process3.p3 = cms.Path(process3.intdeque+process3.intlist+process3.intset)
process3.ep31 = cms.EndPath(process3.out)
process3.ep32 = cms.EndPath(process3.intvec*process3.intset*process3.outother*process3.out*process3.outother)
process3.epother = cms.EndPath(process3.outother)
process4 = cms.Process("FOURTH")
process3.subProcess = cms.SubProcess(process4)
process4.out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('testEventHistory_4.root')
)
process4.ep4 = cms.EndPath(process4.out)
process5 = cms.Process("FIFTH")
process4.subProcess = cms.SubProcess(process5)
process5.out = cms.OutputModule("PoolOutputModule",
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('f55:SECOND','f75:SECOND')
),
fileName = cms.untracked.string('testEventHistory_5.root')
)
process5.ep4 = cms.EndPath(process5.out)
process6 = cms.Process("SIXTH")
process5.subProcess = cms.SubProcess(process6,
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('f55:SECOND','f75:SECOND')
)
)
process6.historytest = cms.EDAnalyzer("HistoryAnalyzer",
# Why does the filter module (from step 3) pass 56 events, when I
# give it a rate of 55%? (after 100 events are created the filter
# starts counting at 1 and passes events 1 to 55 then 100 also ...)
expectedCount = cms.int32(56),
# this does not count the current process
expectedSize = cms.int32(4),
# check SelectEventInfo from previous processes
expectedSelectEventsInfo = cms.VPSet(
cms.PSet(
EndPathPositions = cms.vint32(),
EndPaths = cms.vstring(),
InProcessHistory = cms.bool(True),
SelectEvents = cms.vstring()
),
cms.PSet(
EndPathPositions = cms.vint32(),
EndPaths = cms.vstring(),
InProcessHistory = cms.bool(True),
SelectEvents = cms.vstring('f55')
),
cms.PSet(
EndPathPositions = cms.vint32(),
EndPaths = cms.vstring(),
InProcessHistory = cms.bool(True),
SelectEvents = cms.vstring()
),
cms.PSet(
EndPathPositions = cms.vint32(),
EndPaths = cms.vstring(),
InProcessHistory = cms.bool(False),
SelectEvents = cms.vstring('f55:SECOND','f75:SECOND')
)
),
# check the deletion modules from the top level
# ParameterSet of the current process. The following
# should be deleted
# OutputModules
# EDAnalyzers not on endPaths
# if unscheduled, EDFilters and EDProducers not on paths or end paths
# The module ParameterSet should be removed
# The label should be removed from @all_modules and all end paths
# empty end paths should be removed from @end_paths and @paths
expectedPaths = cms.vstring('p1', 'p2', 'ep62'),
expectedEndPaths = cms.vstring('ep62'),
expectedModules = cms.vstring('analyzerOnPath', 'filterOnEndPath', 'filterOnPath', 'historytest', 'producerOnEndPath', 'producerOnPath'),
expectedDroppedEndPaths = cms.vstring('ep61', 'ep63'),
expectedDroppedModules = cms.vstring('dummyanalyzer', 'dummyfilter', 'dummyproducer', 'dummyout'),
expectedDropFromProcPSet = cms.vstring('out', 'out2', 'analyzerOnEndPath'),
expectedModulesOnEndPaths = cms.PSet(
ep62 = cms.vstring('producerOnEndPath', 'filterOnEndPath', 'historytest')
)
)
process6.producerOnPath = cms.EDProducer("IntProducer",
ivalue = cms.int32(2)
)
process6.producerOnEndPath = cms.EDProducer("IntProducer",
ivalue = cms.int32(2)
)
process6.filterOnPath = cms.EDFilter("TestFilterModule",
acceptValue = cms.untracked.int32(55)
)
process6.filterOnEndPath = cms.EDFilter("TestFilterModule",
acceptValue = cms.untracked.int32(55)
)
process6.analyzerOnPath = cms.EDAnalyzer("NonAnalyzer")
process6.analyzerOnEndPath = cms.EDAnalyzer("NonAnalyzer")
process6.dummyanalyzer = cms.EDAnalyzer("NonAnalyzer")
process6.dummyproducer = cms.EDProducer("IntProducer",
ivalue = cms.int32(2)
)
process6.dummyfilter = cms.EDFilter("TestFilterModule",
acceptValue = cms.untracked.int32(55)
)
process6.dummyout = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('dummy_6.root')
)
process6.out = cms.OutputModule("PoolOutputModule",
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('f55:SECOND','f75:SECOND')
),
fileName = cms.untracked.string('testEventHistory_6.root')
)
process6.out2 = cms.OutputModule("PoolOutputModule",
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('f55:SECOND','f75:SECOND')
),
fileName = cms.untracked.string('testEventHistory_62.root')
)
process6.p1 = cms.Path(process6.historytest*process6.filterOnPath*process6.producerOnPath)
process6.p2 = cms.Path(process6.historytest*process6.analyzerOnPath)
process6.ep61 = cms.EndPath(process6.out)
process6.ep62 = cms.EndPath(process6.producerOnEndPath*process6.filterOnEndPath*process6.out*process6.historytest)
process6.ep63 = cms.EndPath(process6.analyzerOnEndPath*process6.out2*process6.out)
process7 = cms.Process("SEVENTH")
process6.subProcess = cms.SubProcess(process7)
process7.dummyproducerxxx = cms.EDProducer("IntProducer",
ivalue = cms.int32(2)
)
process7.p1 = cms.Path(process7.dummyproducerxxx)