Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:28:30

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("READ")
0004 
0005 process.source = cms.Source("PoolSource",
0006     fileNames = cms.untracked.vstring("file:testSubProcess.root")
0007 )
0008 
0009 process.out = cms.OutputModule("PoolOutputModule",
0010     fileName = cms.untracked.string(
0011       'readSubprocessOutput.root'
0012     )
0013 )
0014 
0015 
0016 # Reusing some code I used for testing merging, although in this
0017 # context it has nothing to do with merging.
0018 # Here we are checking the event, run, and lumi products
0019 # from the last subprocess in the chain of subprocesses
0020 # are there.
0021 process.testproducts = cms.EDAnalyzer("TestMergeResults",
0022 
0023     expectedBeginRunProd = cms.untracked.vint32(
0024         10001,   10002,  10003,   # end run 1
0025         10001,   10002,  10003,   # end run 2
0026         10001,   10002,  10003    # end run 3
0027     ),
0028 
0029     expectedEndRunProd = cms.untracked.vint32(
0030         100001,   100002,  100003,   # end run 1
0031         100001,   100002,  100003,   # end run 2
0032         100001,   100002,  100003    # end run 3
0033     ),
0034 
0035     expectedBeginLumiProd = cms.untracked.vint32(
0036         101,       102,    103    # end run 1 lumi 1
0037 # There are more, but all with the same pattern as the first        
0038     ),
0039 
0040     expectedEndLumiProd = cms.untracked.vint32(
0041         1001,     1002,   1003    # end run 1 lumi 1
0042     ),
0043 
0044     expectedProcessHistoryInRuns = cms.untracked.vstring(
0045         'PROD',            # Run 1
0046         'PROD2',
0047         'READ',
0048         'PROD',            # Run 2
0049         'PROD2',
0050         'READ',
0051         'PROD',            # Run 3
0052         'PROD2',
0053         'READ'
0054     ),
0055     verbose = cms.untracked.bool(True)
0056 )
0057 
0058 process.test = cms.EDAnalyzer('RunLumiEventAnalyzer',
0059     verbose = cms.untracked.bool(True),
0060     expectedRunLumiEvents = cms.untracked.vuint32(
0061 1,   0,   0,
0062 1,   1,   0,
0063 1,   1,   1,
0064 1,   1,   2,
0065 1,   1,   3,
0066 1,   1,   4,
0067 1,   1,   0,
0068 1,   2,   0,
0069 1,   2,   5,
0070 1,   2,   6,
0071 1,   2,   7,
0072 1,   2,   8,
0073 1,   2,   0,
0074 1,   3,   0,
0075 1,   3,   9,
0076 1,   3,   10,
0077 1,   3,   0,
0078 1,   0,   0,
0079 2,   0,   0,
0080 2,   1,   0,
0081 2,   1,   1,
0082 2,   1,   2,
0083 2,   1,   3,
0084 2,   1,   4,
0085 2,   1,   0,
0086 2,   2,   0,
0087 2,   2,   5,
0088 2,   2,   6,
0089 2,   2,   7,
0090 2,   2,   8,
0091 2,   2,   0,
0092 2,   3,   0,
0093 2,   3,   9,
0094 2,   3,   10,
0095 2,   3,   0,
0096 2,   0,   0,
0097 3,   0,   0,
0098 3,   1,   0,
0099 3,   1,   1,
0100 3,   1,   2,
0101 3,   1,   3,
0102 3,   1,   4,
0103 3,   1,   0,
0104 3,   2,   0,
0105 3,   2,   5,
0106 3,   2,   6,
0107 3,   2,   7,
0108 3,   2,   8,
0109 3,   2,   0,
0110 3,   3,   0,
0111 3,   3,   9,
0112 3,   3,   10,
0113 3,   3,   0,
0114 3,   0,   0
0115 )
0116 )
0117 
0118 process.path1 = cms.Path(process.test*process.testproducts)
0119 
0120 process.ep = cms.EndPath(process.out)
0121 
0122 
0123 read2Process = cms.Process("READ2")
0124 process.addSubProcess(cms.SubProcess(read2Process,
0125     outputCommands = cms.untracked.vstring(
0126         "keep *", 
0127         "drop *_putInt2_*_*"
0128     )
0129 ))
0130 
0131 read2Process.getInt = cms.EDAnalyzer("TestFindProduct",
0132   inputTags = cms.untracked.VInputTag(
0133       cms.InputTag("putInt3")
0134   ),
0135   expectedSum = cms.untracked.int32(180),
0136   inputTagsNotFound = cms.untracked.VInputTag(
0137       cms.InputTag("putInt2")
0138   )
0139 )
0140 
0141 read2Process.path1 = cms.Path(read2Process.getInt)