Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-14 02:38:45

0001 # A test of the noRunLumiSort configuration parameter
0002 # where the input has non-contiguous event sequences
0003 # from the same run. This configuration reads a file
0004 # created using that parameter and checks that the
0005 # run product and lumi product merging that occurred
0006 # was done properly.
0007 
0008 # It is expected there are 8 warnings that
0009 # print out while this runs related to merging.
0010 # The test should pass with these warnings.
0011 
0012 import FWCore.ParameterSet.Config as cms
0013 
0014 process = cms.Process("TEST")
0015 
0016 from IOPool.Input.modules import PoolSource
0017 process.source = PoolSource(
0018     fileNames = 'file:testRunMergeNoRunLumiSort.root',
0019     duplicateCheckMode = 'noDuplicateCheck'
0020 )
0021 
0022 from FWCore.Framework.modules import TestMergeResults, RunLumiEventAnalyzer
0023 process.test = TestMergeResults(
0024     #   Check to see that the value we read matches what we know
0025     #   was written. Expected values listed below come in sets of three
0026     #      value expected in Thing
0027     #      value expected in ThingWithMerge
0028     #      value expected in ThingWithIsEqual
0029     #   Each set of 3 is tested at endRun for the expected
0030     #   run values or at endLuminosityBlock for the expected
0031     #   lumi values. And then the next set of three values
0032     #   is tested at the next endRun or endLuminosityBlock.
0033     #   When the sequence of parameter values is exhausted it stops checking
0034     #   0's are just placeholders, if the value is a "0" the check is not made.
0035 
0036     expectedBeginRunProd = [
0037         0,   60012,  10003,
0038         0,   20004,  10003
0039     ],
0040                             
0041     expectedEndRunProd = [
0042         0, 600012, 100003,
0043         0, 200004, 100003
0044     ],
0045 
0046     expectedBeginLumiProd = [
0047         0,       612,    103,
0048         0,       204,    103
0049     ],
0050 
0051     expectedEndLumiProd = [
0052         0,     6012,   1003,
0053         0,     2004,   1003
0054     ],
0055 
0056     expectedBeginRunNew = [
0057         10001,   40008,  10003,
0058         10001,   20004,  10003
0059     ],
0060 
0061     expectedEndRunNew = [
0062         100001, 400008, 100003,
0063         100001, 200004, 100003
0064     ],
0065 
0066     expectedBeginLumiNew = [
0067         101,       408,    103,
0068         101,       204,    103
0069     ],
0070 
0071     expectedEndLumiNew = [
0072         1001,     4008,   1003,
0073         1001,     2004,   1003
0074     ]
0075 )
0076 
0077 process.test2 = RunLumiEventAnalyzer(
0078     verbose = True,
0079     expectedRunLumiEvents = [
0080 1, 0, 0,
0081 1, 1, 0,
0082 1, 1, 11,
0083 1, 1, 12,
0084 1, 1, 13,
0085 1, 1, 14,
0086 1, 1, 15,
0087 1, 1, 16,
0088 1, 1, 17,
0089 1, 1, 18,
0090 1, 1, 19,
0091 1, 1, 20,
0092 1, 1, 21,
0093 1, 1, 22,
0094 1, 1, 23,
0095 1, 1, 24,
0096 1, 1, 25,
0097 1, 1, 1,
0098 1, 1, 2,
0099 1, 1, 3,
0100 1, 1, 4,
0101 1, 1, 5,
0102 1, 1, 6,
0103 1, 1, 7,
0104 1, 1, 8,
0105 1, 1, 9,
0106 1, 1, 10,
0107 1, 1, 11,
0108 1, 1, 12,
0109 1, 1, 13,
0110 1, 1, 14,
0111 1, 1, 15,
0112 1, 1, 16,
0113 1, 1, 17,
0114 1, 1, 18,
0115 1, 1, 19,
0116 1, 1, 20,
0117 1, 1, 21,
0118 1, 1, 22,
0119 1, 1, 23,
0120 1, 1, 24,
0121 1, 1, 25,
0122 1, 1, 1,
0123 1, 1, 2,
0124 1, 1, 3,
0125 1, 1, 4,
0126 1, 1, 5,
0127 1, 1, 6,
0128 1, 1, 7,
0129 1, 1, 8,
0130 1, 1, 9,
0131 1, 1, 10,
0132 1, 1, 0,
0133 1, 0, 0
0134 ]
0135 )
0136 process.test2.expectedRunLumiEvents.extend([
0137 2, 0, 0,
0138 2, 1, 0,
0139 2, 1, 1,
0140 2, 1, 2,
0141 2, 1, 3,
0142 2, 1, 4,
0143 2, 1, 5,
0144 2, 1, 1,
0145 2, 1, 2,
0146 2, 1, 3,
0147 2, 1, 4,
0148 2, 1, 5,
0149 2, 1, 0,
0150 2, 0, 0
0151 ])
0152 
0153 from IOPool.Output.modules import PoolOutputModule
0154 process.out = PoolOutputModule(fileName = 'testRunMergeTEST6.root')
0155 
0156 process.path1 = cms.Path(process.test * process.test2)
0157 process.e = cms.EndPath(process.out)