Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-14 23:16:43

0001 import FWCore.ParameterSet.Config as cms
0002 import argparse
0003 import sys
0004 
0005 parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test GlobalObjectMapRecord')
0006 
0007 parser.add_argument('--globalObjectMapClassVersion', type=int, help='Class version of GlobalObjectMap (default: 10)', default=10)
0008 parser.add_argument('--inputFileName', type=str, help='Input file name (default: testGlobalObjectMapRecord.root)', default='testGlobalObjectMapRecord.root')
0009 parser.add_argument('--outputFileName', type=str, help='Output file name (default: testGlobalObjectMapRecord2.root)', default='testGlobalObjectMapRecord2.root')
0010 args = parser.parse_args()
0011 
0012 process = cms.Process('READ')
0013 
0014 process.source = cms.Source('PoolSource', fileNames = cms.untracked.vstring(f'file:{args.inputFileName}'))
0015 process.maxEvents.input = 1
0016 
0017 process.testReadGlobalObjectMapRecord = cms.EDAnalyzer('TestReadGlobalObjectMapRecord',
0018     expectedAlgoNames = cms.vstring('muonAlgo', 'electronAlgo'),
0019     expectedAlgoBitNumbers = cms.vint32(11, 21),
0020     expectedAlgoGtlResults = cms.vint32(1, 0),
0021     expectedTokenNames0 = cms.vstring('testnameA', 'testNameB'),
0022     expectedTokenNumbers0 = cms.vint32(101, 102),
0023     expectedTokenResults0 = cms.vint32(1, 0),
0024     expectedTokenNames3 = cms.vstring('testNameC', 'testNameD'),
0025     expectedTokenNumbers3 = cms.vint32(1001, 1002),
0026     expectedTokenResults3 = cms.vint32(0, 1),
0027     expectedFirstElement = cms.int32(11),
0028     expectedElementDelta = cms.int32(3),
0029     expectedBxIndexModulus = cms.uint32(3),
0030     # 3 (delta) * (3*4*5 + 3*4) + 11 = 227
0031     expectedFinalValue = cms.int32(227),
0032     globalObjectMapRecordTag = cms.InputTag('globalObjectMapRecordProducer', '', 'PROD'),
0033     globalObjectMapClassVersion = cms.uint32(args.globalObjectMapClassVersion),
0034 )
0035 
0036 process.out = cms.OutputModule('PoolOutputModule',
0037     fileName = cms.untracked.string(f'{args.outputFileName}'),
0038     fastCloning = cms.untracked.bool(False)
0039 )
0040 
0041 process.path = cms.Path(process.testReadGlobalObjectMapRecord)
0042 
0043 process.endPath = cms.EndPath(process.out)