Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 import sys
0003 
0004 process = cms.Process("READMERGE")
0005 process.MessageLogger.cerr.FwkReport.reportEvery = 1000
0006 process.MessageLogger.cerr.threshold = cms.untracked.string('ERROR')
0007 
0008 process.load("FWCore.Framework.test.cmsExceptionsFatal_cff")
0009 
0010 from IOPool.TFileAdaptor.modules import AdaptorConfig
0011 process.add_(AdaptorConfig(stats = False))
0012 
0013 process.maxEvents.input = -1
0014 
0015 from IOPool.Output.modules import PoolOutputModule
0016 process.output = PoolOutputModule(fileName = 'reduced_test.root')
0017 
0018 from FWCore.Framework.modules import TestMergeResults
0019 process.testmerge = TestMergeResults(
0020     #   Check to see that the value we read matches what we know
0021     #   was written. Expected values listed below come in sets of three
0022     #      value expected in Thing
0023     #      value expected in ThingWithMerge
0024     #      value expected in ThingWithIsEqual
0025     #   Each set of 3 is tested at endRun for the expected
0026     #   run values or at endLuminosityBlock for the expected
0027     #   lumi values. And then the next set of three values
0028     #   is tested at the next endRun or endLuminosityBlock.
0029     #   When the sequence of parameter values is exhausted it stops checking
0030     #   0's are just placeholders, if the value is a "0" the check is not made.
0031 
0032     expectedBeginRunNew = [
0033         10001,   20004,  10003,   # end run 100
0034         10001,   20004,  10003,   # end run 1
0035         10001,   20004,  10003,   # end run 1
0036         10001,   20004,  10003,   # end run 2
0037         10001,   20004,  10003,   # end run 11
0038         10001,   20004,  10003,   # end run 12
0039         10001,   20004,  10003,   # end run 13
0040         10001,   20004,  10003,   # end run 1000
0041         10001,   20004,  10003,   # end run 1001
0042         10001,   20004,  10003,   # end run 1002
0043         10001,   20004,  10003,   # end run 2000
0044         10001,   20004,  10003,   # end run 2001
0045         10001,   20004,  10003    # end run 2002
0046     ],
0047 
0048     expectedEndRunNew = [
0049         100001,   200004,  100003,   # end run 100
0050         100001,   200004,  100003,   # end run 1
0051         100001,   200004,  100003,   # end run 1
0052         100001,   200004,  100003,   # end run 2
0053         100001,   200004,  100003,   # end run 11
0054         100001,   200004,  100003,   # end run 12
0055         100001,   200004,  100003,   # end run 13
0056         100001,   200004,  100003,   # end run 1000
0057         100001,   200004,  100003,   # end run 1001
0058         100001,   200004,  100003,   # end run 1002
0059         100001,   200004,  100003,   # end run 2000
0060         100001,   200004,  100003,   # end run 2001
0061         100001,   200004,  100003    # end run 2002
0062     ],
0063 
0064     expectedBeginLumiNew = [
0065         101,       204,    103    # end run 100 lumi 100
0066 # There are more, but all with the same pattern as the first        
0067     ],
0068 
0069     expectedEndLumiNew = [
0070         1001,     2004,   1003,   # end run 100 lumi 100
0071     ],
0072 
0073     expectedProcessHistoryInRuns = [
0074         'PROD',            # Run 100
0075         'MERGE',
0076         'MERGETWOFILES',
0077         'READMERGE',
0078         'PROD',            # Run 1 in files 1, 8, 9, 10
0079         'MERGE',
0080         'MERGETWOFILES',
0081         'READMERGE',
0082         'PROD',            # Run 1 in files 2, 3, 11
0083         'EXTRA',
0084         'MERGE',
0085         'MERGETWOFILES',
0086         'READMERGE',
0087         'PROD',            # Run 2 in file 2
0088         'EXTRA',
0089         'MERGE',
0090         'MERGETWOFILES',
0091         'READMERGE',
0092         'PROD',            # Run 11 in file 5
0093         'MERGE',
0094         'MERGETWOFILES',
0095         'READMERGE',
0096         'PROD',            # Run 12 in file 5
0097         'MERGE',
0098         'MERGETWOFILES',
0099         'READMERGE',
0100         'PROD',            # Run 13 in file 5
0101         'MERGE',
0102         'MERGETWOFILES',
0103         'READMERGE',
0104         'PROD',            # Run 1000 in file 6
0105         'EXTRA',
0106         'MERGE',
0107         'MERGETWOFILES',
0108         'READMERGE',
0109         'PROD',            # Run 1001 in file 6
0110         'EXTRA',
0111         'MERGE',
0112         'MERGETWOFILES',
0113         'READMERGE',
0114         'PROD',            # Run 1002 in file 6
0115         'EXTRA',
0116         'MERGE',
0117         'MERGETWOFILES',
0118         'READMERGE',
0119         'PROD',            # Run 2000 in file 7
0120         'EXTRA',
0121         'MERGE',
0122         'MERGETWOFILES',
0123         'READMERGE',
0124         'PROD',            # Run 2001 in file 7
0125         'EXTRA',
0126         'MERGE',
0127         'MERGETWOFILES',
0128         'READMERGE',
0129         'PROD',            # Run 2002 in file 7
0130         'EXTRA',
0131         'MERGE',
0132         'MERGETWOFILES',
0133         'READMERGE'
0134     ],
0135     verbose = True
0136 )
0137 
0138 from IOPool.Input.modules import PoolSource
0139 process.source = PoolSource(
0140     fileNames = [f"file:{sys.argv[1]}"],
0141     duplicateCheckMode = "noDuplicateCheck"
0142 )
0143 
0144 from FWCore.Framework.modules import RunLumiEventAnalyzer
0145 process.test = RunLumiEventAnalyzer(
0146     verbose = True,
0147     expectedRunLumiEvents = [
0148 100,   0,   0,
0149 100, 100,   0,
0150 100, 100, 100,
0151 100, 100, 100,
0152 100, 100,   0,
0153 100,   0,   0,
0154   1,   0,   0,  
0155   1,   1,   0,
0156   1,   1,  11,
0157   1,   1,  12,
0158   1,   1,  13,
0159   1,   1,  14,
0160   1,   1,  15,
0161   1,   1,  16,
0162   1,   1,  17,
0163   1,   1,  18,
0164   1,   1,  19,
0165   1,   1,  20,
0166   1,   1, 102,
0167   1,   1,  11,
0168   1,   1,  12,
0169   1,   1,  13,
0170   1,   1,  14,
0171   1,   1,  15,
0172   1,   1,  16,
0173   1,   1,  17,
0174   1,   1,  18,
0175   1,   1,  19,
0176   1,   1,  20,
0177   1,   1, 102,
0178   1,   1,   0,
0179   1,   0,   0,
0180   1,   0,   0,
0181   1,   1,   0,
0182   1,   1,  21,
0183   1,   1,  22,
0184   1,   1,  23,
0185   1,   1,  24,
0186   1,   1,  25,
0187   1,   1,   1,
0188   1,   1,   2,
0189   1,   1,   3,
0190   1,   1,   4,
0191   1,   1,   5,
0192   1,   1,   6,
0193   1,   1,   7,
0194   1,   1,   8,
0195   1,   1,   9,
0196   1,   1,  10,
0197   1,   1,  21,
0198   1,   1,  22,
0199   1,   1,  23,
0200   1,   1,  24,
0201   1,   1,  25,
0202   1,   1,   1,
0203   1,   1,   2,
0204   1,   1,   3,
0205   1,   1,   4,
0206   1,   1,   5,
0207   1,   1,   6,
0208   1,   1,   7,
0209   1,   1,   8,
0210   1,   1,   9,
0211   1,   1,  10,
0212   1,   1,   0,
0213   1,   2,   0,
0214   1,   2,   0,
0215   1,   0,   0,
0216   2,   0,   0,
0217   2,   1,   0,
0218   2,   1,   1,
0219   2,   1,   2,
0220   2,   1,   3,
0221   2,   1,   4,
0222   2,   1,   5,
0223   2,   1,   1,
0224   2,   1,   2,
0225   2,   1,   3,
0226   2,   1,   4,
0227   2,   1,   5,
0228   2,   1,   0,
0229   2,   0,   0
0230 ]
0231 )
0232 
0233 process.test.expectedRunLumiEvents.extend([
0234  11,   0,   0,
0235  11,   1,   0,
0236  11,   1,   1,
0237  11,   1,   1,
0238  11,   1,   0,
0239  11,   2,   0,
0240  11,   2,   1,
0241  11,   2,   2,
0242  11,   2,   3,
0243  11,   2,   1,
0244  11,   2,   2,
0245  11,   2,   3,
0246  11,   2,   0,
0247  11,   3,   0,
0248  11,   3,   4,
0249  11,   3,   5,
0250  11,   3,   6,
0251  11,   3,   4,
0252  11,   3,   5,
0253  11,   3,   6,
0254  11,   3,   0,
0255  11,   4,   0,
0256  11,   4,   7,
0257  11,   4,   8,
0258  11,   4,   9,
0259  11,   4,   7,
0260  11,   4,   8,
0261  11,   4,   9,
0262  11,   4,   0,
0263  11,   0,   0,
0264  12,   0,   0,
0265  12,   2,   0,
0266  12,   2,   1,
0267  12,   2,   2,
0268  12,   2,   3,
0269  12,   2,   1,
0270  12,   2,   2,
0271  12,   2,   3,
0272  12,   2,   0,
0273  12,   3,   0,
0274  12,   3,   4,
0275  12,   3,   5,
0276  12,   3,   6,
0277  12,   3,   4,
0278  12,   3,   5,
0279  12,   3,   6,
0280  12,   3,   0,
0281  12,   4,   0,
0282  12,   4,   7,
0283  12,   4,   8,
0284  12,   4,   9,
0285  12,   4,   7,
0286  12,   4,   8,
0287  12,   4,   9,
0288  12,   4,   0,
0289  12,   0,   0,
0290  13,   0,   0,
0291  13,   2,   0,
0292  13,   2,   1,
0293  13,   2,   2,
0294  13,   2,   1,
0295  13,   2,   2,
0296  13,   2,   0,
0297  13,   0,   0,
0298 1000,  0,   0,
0299 1000,  1,   0,
0300 1000,  1,   0,
0301 1000,  0,   0,
0302 1001,  0,   0,
0303 1001,  1,   0,
0304 1001,  1,   0,
0305 1001,  0,   0,
0306 1002,  0,   0,
0307 1002,  1,   0,
0308 1002,  1,   0,
0309 1002,  0,   0,
0310 # Between ~3_1_0  and 3_7_X these following are not in the input file
0311 # because runs with no lumis in the input were always dropped.
0312 # The test passes, it just never gets past this point.
0313 2000,  0,   0,
0314 2000,  0,   0,
0315 2001,  0,   0,
0316 2001,  0,   0,
0317 2002,  0,   0,
0318 2002,  0,   0
0319 ])
0320 
0321 process.path1 = cms.Path(process.test*process.testmerge)
0322 
0323 process.ep = cms.EndPath(process.output)