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 from IOPool.Input.fixReading_12_4_X_Files import fixReading_12_4_X_Files
0005 
0006 parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test Run 3 Scouting data formats')
0007 
0008 parser.add_argument("--electronVersion", type=int, help="electron data format version (default: 7)", default=7)
0009 parser.add_argument("--photonVersion", type=int, help="photon data format version (default: 6)", default=6)
0010 parser.add_argument("--vertexVersion", type=int, help="photon data format version (default: 4)", default=4)
0011 parser.add_argument("--inputFile", type=str, help="Input file name (default: testRun3Scouting.root)", default="testRun3Scouting.root")
0012 parser.add_argument("--outputFileName", type=str, help="Output file name (default: testRun3Scouting2.root)", default="testRun3Scouting2.root")
0013 parser.add_argument("-f", "--fixStreamerInfo", action="store_true")
0014 args = parser.parse_args()
0015 
0016 process = cms.Process("READ")
0017 
0018 if args.fixStreamerInfo:
0019     process = fixReading_12_4_X_Files(process)
0020     print("FixingStreamerInfos")
0021 
0022 process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring("file:"+args.inputFile))
0023 
0024 process.testReadRun3Scouting = cms.EDAnalyzer("TestReadRun3Scouting",
0025     # I stick to values exactly convertable to float
0026     # to avoid potential rounding issues in the test.
0027     expectedCaloJetsValues = cms.vdouble(
0028         2.0,   4.0 , 6.0,  8.0, 10.0,
0029         12.0, 14.0, 16.0, 18.0, 20.0,
0030         22.0, 24.0, 26.0, 28.0, 30.0,
0031         32.0),
0032     caloJetsTag = cms.InputTag("run3ScoutingProducer", "", "PROD"),
0033     electronClassVersion = cms.int32(args.electronVersion),
0034     expectedElectronFloatingPointValues = cms.vdouble(
0035         10.0,   20.0,  30.0,  40.0,  50.0,
0036         60.0,   70.0,  80.0,  90.0, 100.0,
0037         110.0, 120.0, 130.0, 140.0, 150.0,
0038         160.0, 170.0, 180.0, 190.0, 200.0,
0039         210.0, 220.0, 230.0, 240.0, 250.0,
0040         260.0, 270.0, 280.0, 290.0, 300.0,
0041         310.0, 320.0, 330.0),
0042     expectedElectronIntegralValues = cms.vint32(10, 20, 30, 40, 50, 60, 70, 80),
0043     electronsTag = cms.InputTag("run3ScoutingProducer", "", "PROD"),
0044     expectedMuonFloatingPointValues = cms.vdouble(
0045         10.0,   20.0,  30.0,  40.0,  50.0,
0046         60.0,   70.0,  80.0,  90.0, 100.0,
0047         110.0, 120.0, 130.0, 140.0, 150.0,
0048         160.0, 170.0, 180.0, 190.0, 200.0,
0049         210.0, 220.0, 230.0, 240.0, 250.0,
0050         260.0, 270.0, 280.0, 290.0, 300.0,
0051         310.0, 320.0, 330.0, 340.0, 350.0,
0052         360.0, 370.0
0053     ),
0054     expectedMuonIntegralValues = cms.vint32(
0055         10,   20,  30,  40,  50,
0056         60,   70,  80,  90, 100,
0057         110, 120, 130, 140, 150,
0058         160, 170, 180, 190, 200,
0059         210, 220, 230, 240, 250,
0060         260
0061     ),
0062     muonsTag = cms.InputTag("run3ScoutingProducer", "", "PROD"),
0063     expectedParticleFloatingPointValues = cms.vdouble(
0064         11.0,   21.0,  31.0,  41.0,  51.0,
0065         61.0,   71.0,  81.0,  91.0, 101.0,
0066         111.0
0067     ),
0068     expectedParticleIntegralValues = cms.vint32(
0069         11,   21,  31,  41,  51
0070     ),
0071     particlesTag = cms.InputTag("run3ScoutingProducer", "", "PROD"),
0072     expectedPFJetFloatingPointValues = cms.vdouble(
0073         12.0,   22.0,  32.0,  42.0,  52.0,
0074         62.0,   72.0,  82.0,  92.0, 102.0,
0075         112.0, 122.0, 132.0, 142.0, 152.0
0076     ),
0077     expectedPFJetIntegralValues = cms.vint32(
0078         12,   22,  32,  42,  52,
0079         62,   72,  82
0080     ),
0081     pfJetsTag = cms.InputTag("run3ScoutingProducer", "", "PROD"),
0082     photonClassVersion = cms.int32(args.photonVersion),
0083     expectedPhotonFloatingPointValues = cms.vdouble(
0084         14.0,   23.0,  33.0,  43.0,  53.0,
0085         63.0,   73.0,  83.0,  93.0, 103.0,
0086         113.0, 123.0, 133.0, 143.0, 153.0,
0087         163.0, 173.0
0088     ),
0089     expectedPhotonIntegralValues = cms.vint32(
0090         14,   23,  33,  43,  53
0091     ),
0092     photonsTag = cms.InputTag("run3ScoutingProducer", "", "PROD"),
0093     expectedTrackFloatingPointValues = cms.vdouble(
0094         14.0,   24.0,  34.0,  44.0,  54.0,
0095         64.0,   74.0,  84.0,  94.0, 104.0,
0096         114.0, 124.0, 134.0, 144.0, 154.0,
0097         164.0, 174.0, 184.0, 194.0, 204.0,
0098         214.0, 224.0, 234.0, 244.0, 254.0,
0099         264.0, 274.0, 284.0, 294.0
0100     ),
0101     expectedTrackIntegralValues = cms.vint32(
0102         14,  24,  34,  44,  54
0103     ),
0104     tracksTag = cms.InputTag("run3ScoutingProducer", "", "PROD"),
0105     vertexClassVersion = cms.int32(args.vertexVersion),
0106     expectedVertexFloatingPointValues = cms.vdouble(
0107         15.0,  25.0,  35.0,  45.0,  55.0,
0108         65.0,  75.0,  85.0,  95.0, 105.0
0109     ),
0110     expectedVertexIntegralValues = cms.vint32(
0111         15,  25,  35
0112     ),
0113     vertexesTag = cms.InputTag("run3ScoutingProducer", "", "PROD")
0114 )
0115 
0116 process.out = cms.OutputModule("PoolOutputModule",
0117     fileName = cms.untracked.string(args.outputFileName),
0118     fastCloning = cms.untracked.bool(False)
0119 )
0120 
0121 process.path = cms.Path(process.testReadRun3Scouting)
0122 
0123 process.endPath = cms.EndPath(process.out)