import FWCore.ParameterSet.Config as cms
calibration = cms.VPSet(
    cms.PSet(
        etaMax = cms.double(0.435),
        etaMin = cms.double(0),
        l1tCalibrationFactors = cms.vdouble(
            1.27449917748, 1.27449917748, 1.27449917748, 1.23493179134, 1.18016297798, 
            1.13799575237, 1.10812834725, 1.09304437053, 1.06535849935, 1.05911433179, 
            1.05311693057, 1.04683141823, 1.04024977527, 1.03376492646, 1.02792720165, 
            1.01956986102, 1.00718649496, 0.988626784325, 0.998476722478, 1.01288124549, 
            1.02471525137, 1.03646775333, 1.05180913101, 1.05924395389, 1.07924401671, 
            1.08165375247, 1.08337316605, 1.10962671513, 1.12102129235, 1.13021919622, 
            1.13576642802
        ),
        l1tPtBins = cms.vdouble(
            -float('inf'), 15.9186731488, 22.8302714976, 31.3470623972, 40.9124979701, 
            50.8182301193, 60.9776479471, 71.0672224351, 81.1996034394, 91.6144971179, 
            101.789274468, 111.998416189, 122.693159862, 133.553585263, 143.795691085, 
            155.594148691, 172.833121605, 193.219678024, 219.365786562, 258.892647496, 
            301.652891703, 340.091206576, 384.245393528, 421.36317182, 466.073087432, 
            502.59375, 509.322916667, 554.909722222, 616.263888889, 649.822916667, 
            673.852678571, float('inf')
        )
    ), 
    cms.PSet(
        etaMax = cms.double(0.783),
        etaMin = cms.double(0.435),
        l1tCalibrationFactors = cms.vdouble(
            1.29025683658, 1.29025683658, 1.29025683658, 1.25298150518, 1.19487866706, 
            1.15080116375, 1.12093007164, 1.10806840148, 1.07542032572, 1.06982434752, 
            1.06427959217, 1.05839569094, 1.05415876237, 1.04791679928, 1.04281508228, 
            1.03415621861, 1.02449421978, 1.01478042466, 1.01158365084, 1.02291458246, 
            1.03300938298, 1.04555663218, 1.05063718336, 1.06450205914, 1.0726614699, 
            1.0729443896, 1.07622132959, 1.07800287535, 1.09647412495, 1.10102369381, 
            1.11498981219, 1.1308491155
        ),
        l1tPtBins = cms.vdouble(
            -float('inf'), 15.6919158647, 22.5226170435, 30.8891780787, 40.2493434193, 
            50.214229057, 60.4912167204, 70.5763790324, 80.500905786, 90.8133968691, 
            101.207902198, 111.871044901, 121.313961636, 131.090956543, 141.674814644, 
            154.513684583, 171.607379717, 189.685344913, 214.218520282, 253.593388284, 
            298.795202861, 346.563079677, 383.752406958, 423.721527778, 470.186111111, 
            487.996875, 495.507102273, 506.178977273, 548.90625, 597.473214286, 
            636.535714286, 699.458333333, float('inf')
        )
    ), 
    cms.PSet(
        etaMax = cms.double(1.131),
        etaMin = cms.double(0.783),
        l1tCalibrationFactors = cms.vdouble(
            1.30032664809, 1.30032664809, 1.30032664809, 1.25084727971, 1.18473554378, 
            1.13301872436, 1.10276185733, 1.08703419718, 1.06357257192, 1.05675721169, 
            1.04991871811, 1.04261488423, 1.03584577743, 1.02906929088, 1.02063131716, 
            1.01179767645, 0.998329381732, 1.01828991088, 1.01201460292, 1.00416117779, 
            0.994510368907, 0.985813238053, 0.978643190728, 0.970975488844, 0.96254161562, 
            0.961175449848, 0.951861024521, 0.939008392591, 0.92267285167, 0.918064561515, 
            0.905942754804, 0.877221856129
        ),
        l1tPtBins = cms.vdouble(
            -float('inf'), 15.9376851628, 22.9667030429, 31.5826642359, 41.2563645846, 
            51.6134274019, 61.737786741, 71.945868755, 82.3189929537, 92.2883651517, 
            102.331025225, 112.732966631, 123.083872784, 133.046905301, 144.237420066, 
            156.941009466, 173.344492287, 192.503331696, 218.721044328, 256.917525105, 
            304.239541454, 353.842483457, 396.738782991, 436.852061311, 480.382043828, 
            506.876068376, 535.750631313, 595.678409091, 674.5875, 731.208333333, 
            776.4375, 886.854166667, float('inf')
        )
    ), 
    cms.PSet(
        etaMax = cms.double(1.479),
        etaMin = cms.double(1.131),
        l1tCalibrationFactors = cms.vdouble(
            1.40630295592, 1.40630295592, 1.40630295592, 1.3451455964, 1.26173230426, 
            1.19825744521, 1.16239000556, 1.15460411542, 1.11317911814, 1.10876504365, 
            1.10362794273, 1.09894571801, 1.09461826627, 1.08895294806, 1.08521989237, 
            1.07836011776, 1.06893763358, 1.06054325313, 1.08532676037, 1.09042100065, 
            1.09208466173, 1.09391071074, 1.09680712368, 1.09909581139, 1.10478318931, 
            1.10569948748, 1.11027935157, 1.11505396558, 1.11542681834, 1.12458187837, 
            1.12799428451, 1.13085478987
        ),
        l1tPtBins = cms.vdouble(
            -float('inf'), 15.7808242842, 22.8598536893, 31.1328897878, 39.9581424851, 
            49.410406772, 59.3070027653, 68.7280465817, 78.7196211917, 88.7819701311, 
            98.5388212366, 108.569596929, 117.773288398, 127.981243371, 137.582002524, 
            148.402939584, 165.035821694, 183.236355957, 206.750527794, 251.111311387, 
            290.141534392, 310.296336207, 337.570889778, 367.517410714, 413.583134921, 
            451.722630719, 483.465686275, 537.492424242, 567.221590909, 622.25, 
            694.833333333, 731.0625, float('inf')
        )
    ), 
    cms.PSet(
        etaMax = cms.double(1.83),
        etaMin = cms.double(1.479),
        l1tCalibrationFactors = cms.vdouble(
            1.7217035487, 1.7217035487, 1.7217035487, 1.7217035487, 1.68988534586, 
            1.63791921552, 1.59185473537, 1.54971405338, 1.51154883337, 1.47823543692, 
            1.46172800374, 1.43645114385, 1.43046780928, 1.42226174585, 1.41623186647, 
            1.40561299065, 1.39363735903, 1.37464296082, 1.35286001653, 1.26158343404, 
            1.22056556893, 1.18715984647, 1.13819685131, 1.10934113225, 1.07919505312, 
            1.02868299603, 0.979047219899, 0.898684534732, 0.891076670235, 0.797123236841, 
            0.780947291941, 0.735669418772
        ),
        l1tPtBins = cms.vdouble(
            -float('inf'), 13.333575988, 18.4571028394, 24.1116921172, 30.5374906258, 
            37.5605591469, 44.6732556617, 51.969510234, 59.7448700477, 68.2252386063, 
            75.5169980339, 83.6148776707, 92.2747240616, 100.355850244, 108.463484563, 
            117.945260433, 130.813252843, 148.451261093, 171.674716389, 212.783964929, 
            264.625978134, 306.609011628, 353.073966408, 396.972222222, 430.255681818, 
            475.755681818, 532.25, 605.583333333, 655.208333333, 712.5, 
            774.625, 809.291666667, float('inf')
        )
    ), 
    cms.PSet(
        etaMax = cms.double(2.172),
        etaMin = cms.double(1.83),
        l1tCalibrationFactors = cms.vdouble(
            1.4936926105, 1.4936926105, 1.4936926105, 1.4936926105, 1.46485100129, 
            1.43305929866, 1.40381441593, 1.3729601552, 1.34123460884, 1.32284737093, 
            1.27511162571, 1.26798560095, 1.26164735469, 1.25626695799, 1.24848902406, 
            1.23877770715, 1.22404536549, 1.20885962123, 1.27286033084, 1.12054466533, 
            0.913202215731, 0.772663996883, 0.727095419562, 0.301220472331, 0.165219962792, 
            0.0626367213111, 1, 1
        ),
        l1tPtBins = cms.vdouble(
            -float('inf'), 13.9285565669, 19.4784943976, 26.0657472216, 33.348104504, 
            41.2050778872, 49.214573875, 57.4805182505, 66.5342548469, 74.11237099, 
            81.9515569476, 91.5619071823, 100.322330841, 107.946975123, 116.508341035, 
            127.887586641, 143.791663771, 163.257634657, 190.003392571, 230.031554019, 
            284.725347222, 337.628125, 365.9296875, 437.622869318, 523.068181818, 
            559.35, 594.808333333, 633.5, float('inf')
        )
    ), 
    cms.PSet(
        etaMax = cms.double(2.5),
        etaMin = cms.double(2.172),
        l1tCalibrationFactors = cms.vdouble(
            1.36288541376, 1.36288541376, 1.36288541376, 1.35728228981, 1.30022440066, 
            1.25938136072, 1.23301769934, 1.22642366857, 1.23558221804, 1.16540136021, 
            1.16082535056, 1.15619052246, 1.15215783917, 1.146792252, 1.1411562498, 
            1.13744491457, 1.12697797447, 1.11559143334, 1.06859652983, 1.03815298361, 
            1.00472588913, 0.978567329549, 0.951793014325, 0.935812848708, 0.920110074644, 
            0.860000530916, 0.820110419384, 0.799722140156
        ),
        l1tPtBins = cms.vdouble(
            -float('inf'), 14.6351342446, 20.0485971642, 26.9278098497, 35.1665914695, 
            43.9984688651, 53.3287953196, 62.5042389456, 71.1936448694, 80.3838909754, 
            89.9515275488, 99.6235248178, 108.724992978, 118.593807156, 130.146213706, 
            139.961544796, 154.849684614, 177.797305292, 204.724624754, 249.745733173, 
            312.791595442, 371.607804233, 423.857142857, 466.05952381, 497.333333333, 
            572.166666667, 670.875, 730.375, float('inf')
        )
    ), 
    cms.PSet(
        etaMax = cms.double(3),
        etaMin = cms.double(2.5),
        l1tCalibrationFactors = cms.vdouble(
            0.568401538708, 0.568401538708, 0.631816583718, 0.767769487666, 0.91701775882, 
            0.984206551733, 0.996248540801, 1.02919753052, 1.02695009331, 1.02474790333, 
            1.02239529801, 1.019105609, 1.01734381454, 1.01477529176, 1.01258536715, 
            1.00685181266, 1.00282299224, 0.977440455757, 0.978190703485, 0.979728137914, 
            0.981198285812, 0.98300553818, 0.984443527319
        ),
        l1tPtBins = cms.vdouble(
            -float('inf'), 25.7442980683, 30.4775600841, 36.2227147641, 45.0210408195, 
            54.8248076715, 64.6373689105, 75.0414582144, 84.6064437163, 93.5522537304, 
            102.70950032, 114.053123287, 124.208942991, 132.914884799, 142.481566353, 
            158.411426474, 178.038318239, 200.039800625, 226.059381044, 263.009688995, 
            311.587719298, 364.523809524, 416.94047619, float('inf')
        )
    ), 
    cms.PSet(
        etaMax = cms.double(5.191),
        etaMin = cms.double(3),
        l1tCalibrationFactors = cms.vdouble(
            1.0, 1.0, 1.0, 1.0, 1.0, 
            1.0, 1.0
        ),
        l1tPtBins = cms.vdouble(
            -float('inf'), 50.3968059551, 87.5328766659, 125.735369213, 167.221300362, 
            224.93359375, 214.8125, float('inf')
        )
    )
)

l1tPhase1JetCalibrator = cms.EDProducer('Phase1L1TJetCalibrator',
  inputCollectionTag = cms.InputTag("l1tPhase1JetProducer", "UncalibratedPhase1L1TJetFromPfCandidates", ""),
  absEtaBinning = cms.vdouble([p.etaMin.value() for p in calibration] + [calibration[-1].etaMax.value()]),
  calibration = calibration,
  outputCollectionName = cms.string("Phase1L1TJetFromPfCandidates")
)

