Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-26 05:06:39

0001 import FWCore.ParameterSet.Config as cms
0002 import sys
0003 import argparse
0004 
0005 parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test Run 2 Scouting data formats')
0006 
0007 parser.add_argument("--muonVersion", type=int, help="muon data format version (default: 3)", default=3)
0008 parser.add_argument("--trackVersion", type=int, help="track data format version (default: 2)", default=2)
0009 parser.add_argument("--vertexVersion", type=int, help="vertex data format version (default: 3)", default=3)
0010 parser.add_argument("--inputFile", type=str, help="Input file name (default: testRun2Scouting.root)", default="testRun2Scouting.root")
0011 parser.add_argument("--outputFileName", type=str, help="Output file name (default: testRun2Scouting2.root)", default="testRun2Scouting2.root")
0012 args = parser.parse_args()
0013 
0014 process = cms.Process("READ")
0015 
0016 process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring("file:"+args.inputFile))
0017 
0018 process.testReadRun2Scouting = cms.EDAnalyzer("TestReadRun2Scouting",
0019     # I stick to values exactly convertable to float
0020     # to avoid potential rounding issues in the test.
0021     expectedCaloJetsValues = cms.vdouble(
0022         2.0,   4.0 , 6.0,  8.0, 10.0,
0023         12.0, 14.0, 16.0, 18.0, 20.0,
0024         22.0, 24.0, 26.0, 28.0, 30.0,
0025         32.0
0026     ),
0027     caloJetsTag = cms.InputTag("run2ScoutingProducer", "", "PROD"),
0028     expectedElectronFloatingPointValues = cms.vdouble(
0029         10.0,   20.0,  30.0,  40.0,  50.0,
0030         60.0,   70.0,  80.0,  90.0, 100.0,
0031         110.0, 120.0, 130.0, 140.0
0032     ),
0033     expectedElectronIntegralValues = cms.vint32(10, 20),
0034     electronsTag = cms.InputTag("run2ScoutingProducer", "", "PROD"),
0035     muonClassVersion = cms.int32(args.muonVersion),
0036     expectedMuonFloatingPointValues = cms.vdouble(
0037         10.0,   20.0,  30.0,  40.0,  50.0,
0038         60.0,   70.0,  80.0,  90.0, 100.0,
0039         110.0, 120.0, 130.0, 140.0, 150.0,
0040         160.0, 170.0, 180.0, 190.0, 200.0,
0041         210.0, 220.0, 230.0
0042     ),
0043     expectedMuonIntegralValues = cms.vint32(
0044         10,   20,  30,  40,  50,
0045         60,   70,  80
0046     ),
0047     muonsTag = cms.InputTag("run2ScoutingProducer", "", "PROD"),
0048     expectedParticleFloatingPointValues = cms.vdouble(
0049         11.0,   21.0,  31.0,  41.0
0050     ),
0051     expectedParticleIntegralValues = cms.vint32(
0052         11,   21
0053     ),
0054     particlesTag = cms.InputTag("run2ScoutingProducer", "", "PROD"),
0055     expectedPFJetFloatingPointValues = cms.vdouble(
0056         12.0,   22.0,  32.0,  42.0,  52.0,
0057         62.0,   72.0,  82.0,  92.0, 102.0,
0058         112.0, 122.0, 132.0, 142.0, 152.0
0059     ),
0060     expectedPFJetIntegralValues = cms.vint32(
0061         12,   22,  32,  42,  52,
0062         62,   72,  82
0063     ),
0064     pfJetsTag = cms.InputTag("run2ScoutingProducer", "", "PROD"),
0065     expectedPhotonFloatingPointValues = cms.vdouble(
0066         14.0,   23.0,  33.0,  43.0,  53.0,
0067         63.0,   73.0,  83.0
0068     ),
0069     photonsTag = cms.InputTag("run2ScoutingProducer", "", "PROD"),
0070     trackClassVersion = cms.int32(args.trackVersion),
0071     expectedTrackFloatingPointValues = cms.vdouble(
0072         215.0,   225.0,  235.0,  245.0,  255.0,
0073         265.0,   275.0,  285.0,  295.0,  305.0,
0074         315.0,   325.0,  335.0,  345.0,  355.0,
0075         365.0
0076     ),
0077     expectedTrackIntegralValues = cms.vint32(
0078         52,   62,  72,  82
0079     ),
0080     tracksTag = cms.InputTag("run2ScoutingProducer", "", "PROD"),
0081     vertexClassVersion = cms.int32(args.vertexVersion),
0082     expectedVertexFloatingPointValues = cms.vdouble(
0083         15.0,   25.0,  35.0,  45.0,  55.0,
0084         65.0,   75.0
0085     ),
0086     expectedVertexIntegralValues = cms.vint32(
0087         12,   22,  32
0088     ),
0089     vertexesTag = cms.InputTag("run2ScoutingProducer", "", "PROD")
0090 )
0091 
0092 process.out = cms.OutputModule("PoolOutputModule",
0093     fileName = cms.untracked.string(args.outputFileName),
0094     fastCloning = cms.untracked.bool(False)
0095 )
0096 
0097 process.path = cms.Path(process.testReadRun2Scouting)
0098 
0099 process.endPath = cms.EndPath(process.out)