Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-29 02:26:01

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.NanoAOD.nano_eras_cff import *
0003 from PhysicsTools.NanoAOD.common_cff import *
0004 import copy
0005 
0006 unpackedPatTrigger = cms.EDProducer("PATTriggerObjectStandAloneUnpacker",
0007     patTriggerObjectsStandAlone = cms.InputTag('slimmedPatTrigger'),
0008     triggerResults              = cms.InputTag('TriggerResults::HLT'),
0009     unpackFilterLabels = cms.bool(True)
0010 )
0011 # ERA-dependent configuration
0012 run2_miniAOD_80XLegacy.toModify(
0013   unpackedPatTrigger,
0014   patTriggerObjectsStandAlone = "selectedPatTrigger",
0015   unpackFilterLabels = False 
0016 )
0017 
0018 triggerObjectTable = cms.EDProducer("TriggerObjectTableProducer",
0019     name= cms.string("TrigObj"),
0020     src = cms.InputTag("unpackedPatTrigger"),
0021     l1EG = cms.InputTag("caloStage2Digis","EGamma"),
0022     l1Sum = cms.InputTag("caloStage2Digis","EtSum"),
0023     l1Jet = cms.InputTag("caloStage2Digis","Jet"),
0024     l1Muon = cms.InputTag("gmtStage2Digis","Muon"),
0025     l1Tau = cms.InputTag("caloStage2Digis","Tau"),
0026     selections = cms.VPSet(
0027         cms.PSet(
0028             name = cms.string("Electron (PixelMatched e/gamma)"), # this selects also photons for the moment!
0029             id = cms.int32(11),
0030             sel = cms.string("type(92) && pt > 7 && coll('hltEgammaCandidates') && filter('*PixelMatchFilter')"), 
0031             l1seed = cms.string("type(-98)"),  l1deltaR = cms.double(0.3),
0032             #l2seed = cms.string("type(92) && coll('')"),  l2deltaR = cms.double(0.5),
0033             skipObjectsNotPassingQualityBits = cms.bool(True),
0034             qualityBits = cms.string(
0035                             "filter('*CaloIdLTrackIdLIsoVL*TrackIso*Filter') + " \
0036                             "2*filter('hltEle*WPTight*TrackIsoFilter*') + " \
0037                             "4*filter('hltEle*WPLoose*TrackIsoFilter') + " \
0038                             "8*filter('*OverlapFilter*IsoEle*PFTau*') + " \
0039                             "16*filter('hltEle*Ele*CaloIdLTrackIdLIsoVL*Filter') + " \
0040                             "32*filter('hltMu*TrkIsoVVL*Ele*CaloIdLTrackIdLIsoVL*Filter*')  + " \
0041                             "64*filter('hlt*OverlapFilterIsoEle*PFTau*') + " \
0042                             "128*filter('hltEle*Ele*Ele*CaloIdLTrackIdLDphiLeg*Filter') + " \
0043                             "256*max(filter('hltL3fL1Mu*DoubleEG*Filtered*'),filter('hltMu*DiEle*CaloIdLTrackIdLElectronleg*Filter')) + " \
0044                             "512*max(filter('hltL3fL1DoubleMu*EG*Filter*'),filter('hltDiMu*Ele*CaloIdLTrackIdLElectronleg*Filter')) + " \
0045                             "1024*min(filter('hltEle32L1DoubleEGWPTightGsfTrackIsoFilter'),filter('hltEGL1SingleEGOrFilter')) + " \
0046                             "2048*filter('hltEle*CaloIdVTGsfTrkIdTGsfDphiFilter') + " \
0047                             "4096*path('HLT_Ele*PFJet*') + " \
0048                             "8192*max(filter('hltEG175HEFilter'),filter('hltEG200HEFilter'))"),
0049             qualityBitsDoc = cms.string("1 = CaloIdL_TrackIdL_IsoVL, 2 = 1e (WPTight), 4 = 1e (WPLoose), 8 = OverlapFilter PFTau, 16 = 2e, 32 = 1e-1mu, 64 = 1e-1tau, 128 = 3e, 256 = 2e-1mu, 512 = 1e-2mu, 1024 = 1e (32_L1DoubleEG_AND_L1SingleEGOr), 2048 = 1e (CaloIdVT_GsfTrkIdT), 4096 = 1e (PFJet), 8192 = 1e (Photon175_OR_Photon200)"),
0050             ),
0051         cms.PSet(
0052             name = cms.string("Photon (PixelMatch-vetoed e/gamma)"), 
0053             id = cms.int32(22),
0054             sel = cms.string("type(92) && pt > 20 && coll('hltEgammaCandidates') && !filter('*PixelMatchFilter')"), 
0055             l1seed = cms.string("type(-98)"),  l1deltaR = cms.double(0.3),
0056             #l2seed = cms.string("type(92) && coll('')"),  l2deltaR = cms.double(0.5),
0057             skipObjectsNotPassingQualityBits = cms.bool(True),
0058             qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
0059         ),
0060         cms.PSet(
0061             name = cms.string("Muon"),
0062             id = cms.int32(13),
0063             sel = cms.string("type(83) && pt > 5 && (coll('hltIterL3MuonCandidates') || (pt > 45 && coll('hltHighPtTkMuonCands')) || (pt > 95 && coll('hltOldL3MuonCandidates')))"),
0064             l1seed = cms.string("type(-81)"), l1deltaR = cms.double(0.5),
0065             l2seed = cms.string("type(83) && coll('hltL2MuonCandidates')"),  l2deltaR = cms.double(0.3),
0066             skipObjectsNotPassingQualityBits = cms.bool(True),
0067             qualityBits = cms.string(
0068                             "filter('*RelTrkIsoVVLFiltered0p4') + " \
0069                             "2*filter('hltL3crIso*Filtered0p07') + " \
0070                             "4*filter('*OverlapFilterIsoMu*PFTau*') + " \
0071                             "8*max(filter('hltL3crIsoL1*SingleMu*Filtered0p07'),filter('hltL3crIsoL1sMu*Filtered0p07')) + " \
0072                             "16*filter('hltDiMuon*Filtered*') + " \
0073                             "32*filter('hltMu*TrkIsoVVL*Ele*CaloIdLTrackIdLIsoVL*Filter*') + " \
0074                             "64*filter('hlt*OverlapFilterIsoMu*PFTau*') + " \
0075                             "128*filter('hltL3fL1TripleMu*') + " \
0076                             "256*max(filter('hltL3fL1DoubleMu*EG*Filtered*'),filter('hltDiMu*Ele*CaloIdLTrackIdLElectronleg*Filter')) + " \
0077                             "512*max(filter('hltL3fL1Mu*DoubleEG*Filtered*'),filter('hltMu*DiEle*CaloIdLTrackIdLElectronleg*Filter')) + " \
0078                             "1024*max(filter('hltL3fL1sMu*L3Filtered50*'),filter('hltL3fL1sMu*TkFiltered50*')) + " \
0079                             "2048*max(filter('hltL3fL1sMu*L3Filtered100*'),filter('hltL3fL1sMu*TkFiltered100*'))"),
0080             qualityBitsDoc = cms.string("1 = TrkIsoVVL, 2 = Iso, 4 = OverlapFilter PFTau, 8 = 1mu, 16 = 2mu, 32 = 1mu-1e, 64 = 1mu-1tau, 128 = 3mu, 256 = 2mu-1e, 512 = 1mu-2e, 1024 = 1mu (Mu50), 2048 = 1mu (Mu100)"),
0081             ),
0082         cms.PSet(
0083             name = cms.string("Tau"),
0084             id = cms.int32(15),
0085             sel = cms.string("type(84) && pt > 5 && coll('*Tau*') && ( filter('*LooseChargedIso*') || filter('*MediumChargedIso*') || filter('*DeepTau*') || filter('*TightChargedIso*') || filter('*TightOOSCPhotons*') || filter('hltL2TauIsoFilter') || filter('*OverlapFilterIsoMu*') || filter('*OverlapFilterIsoEle*') || filter('*L1HLTMatched*') || filter('*Dz02*') || filter('*DoublePFTau*') || filter('*SinglePFTau*') || filter('hlt*SelectedPFTau') || filter('*DisplPFTau*') )"), #All trigger objects from a Tau collection + passing at least one filter
0086             l1seed = cms.string("type(-100)"), l1deltaR = cms.double(0.3),
0087             l2seed = cms.string("type(84) && coll('hltL2TauJetsL1IsoTauSeeded')"),  l2deltaR = cms.double(0.3),
0088             skipObjectsNotPassingQualityBits = cms.bool(True),
0089             qualityBits = cms.string(
0090                             "filter('*LooseChargedIso*') + " \
0091                             "2*filter('*MediumChargedIso*') + " \
0092                             "4*filter('*TightChargedIso*') + " \
0093                             "8*filter('*DeepTau*') + " \
0094                             "16*filter('*TightOOSCPhotons*') + " \
0095                             "32*filter('*Hps*') + " \
0096                             "64*filter('hlt*DoublePFTau*TrackPt1*ChargedIsolation*Dz02*') + " \
0097                             "128*filter('hlt*DoublePFTau*DeepTau*L1HLTMatched') + " \
0098                             "256*filter('hlt*OverlapFilterIsoEle*WPTightGsf*PFTau') + " \
0099                             "512*filter('hlt*OverlapFilterIsoMu*PFTau*') + " \
0100                             "1024*filter('hlt*SelectedPFTau*L1HLTMatched') + " \
0101                             "2048*filter('hlt*DoublePFTau*TrackPt1*ChargedIso*') + " \
0102                             "4096*filter('hlt*DoublePFTau*Track*ChargedIso*AgainstMuon') + " \
0103                             "8192*filter('hltHpsSinglePFTau*HLTMatched') + " \
0104                             "16384*filter('hltHpsOverlapFilterDeepTauDoublePFTau*PFJet*') + " \
0105                             "32768*filter('hlt*Double*ChargedIsoDisplPFTau*Dxy*') + " \
0106                             "65536*filter('*Monitoring') + " \
0107                             "131072*filter('*Reg') + " \
0108                             "262144*filter('*L1Seeded') + " \
0109                             "524288*filter('*1Prong')"),
0110             qualityBitsDoc = cms.string("1 = LooseChargedIso, 2 = MediumChargedIso, 4 = TightChargedIso, 8 = DeepTau, 16 = TightID OOSC photons, 32 = HPS, 64 = charged iso di-tau, 128 = deeptau di-tau, 256 = e-tau, 512 = mu-tau, 1024 = single-tau/tau+MET, 2048 = run 2 VBF+ditau, 4096 = run 3 VBF+ditau, 8192 = run 3 double PF jets + ditau, 16384 = di-tau + PFJet, 32768 = Displaced Tau, 65536 = Monitoring, 131072 = regional paths, 262144 = L1 seeded paths, 524288 = 1 prong tau paths"),            
0111         ),
0112         cms.PSet(
0113             name = cms.string("BoostedTau"),
0114             id = cms.int32(1515),
0115             sel = cms.string("type(85) && pt > 120 && coll('hltAK8PFJetsCorrected') && filter('hltAK8SinglePFJets*SoftDropMass40*ParticleNetTauTau')"), 
0116             l1seed = cms.string("type(-99)"), l1deltaR = cms.double(0.3),
0117             l2seed = cms.string("type(85)  && coll('hltAK8CaloJetsCorrectedIDPassed')"),  l2deltaR = cms.double(0.3),
0118             skipObjectsNotPassingQualityBits = cms.bool(True),
0119             qualityBits = cms.string(
0120                 "filter('hltAK8SinglePFJets*SoftDropMass40*ParticleNetTauTau')"
0121                 ), 
0122             qualityBitsDoc = cms.string("Bit 0 for HLT_AK8PFJetX_SoftDropMass40_PFAK8ParticleNetTauTau0p30"),
0123         ),
0124         cms.PSet(
0125             name = cms.string("Jet"),
0126             id = cms.int32(1),
0127             sel = cms.string("( type(0) || type(85) || type(86) || type(-99) )"), 
0128             l1seed = cms.string("type(-99)"), l1deltaR = cms.double(0.3),
0129             l2seed = cms.string("type(85) || type(86) || type(-99)"),  l2deltaR = cms.double(0.3),
0130             skipObjectsNotPassingQualityBits = cms.bool(True),
0131             qualityBits = cms.string(
0132                 "1         * filter('*CrossCleaned*LooseChargedIsoPFTau*') + " \
0133                 "2         * filter('hltBTagCaloCSVp087Triple') + " \
0134                 "4         * filter('hltDoubleCentralJet90') + " \
0135                 "8         * filter('hltDoublePFCentralJetLooseID90') + " \
0136                 "16        * filter('hltL1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet') + " \
0137                 "32        * filter('hltQuadCentralJet30') + " \
0138                 "64        * filter('hltQuadPFCentralJetLooseID30') + " \
0139                 "128       * max(filter('hltL1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF'), filter('hltL1sQuadJetCIorTripleJetVBFIorHTT')) + " \
0140                 "256       * filter('hltQuadCentralJet45') + " \
0141                 "512       * filter('hltQuadPFCentralJetLooseID45') + " \
0142                 "1024      * max(filter('hltL1sQuadJetC60IorHTT380IorHTT280QuadJetIorHTT300QuadJet'), filter('hltL1sQuadJetC50to60IorHTT280to500IorHTT250to340QuadJet')) + " \
0143                 "2048      * max(filter('hltBTagCaloCSVp05Double'), filter('hltBTagCaloDeepCSVp17Double')) + " \
0144                 "4096      * filter('hltPFCentralJetLooseIDQuad30') + " \
0145                 "8192      * filter('hlt1PFCentralJetLooseID75') + " \
0146                 "16384     * filter('hlt2PFCentralJetLooseID60') + " \
0147                 "32768     * filter('hlt3PFCentralJetLooseID45') + " \
0148                 "65536     * filter('hlt4PFCentralJetLooseID40') + " \
0149                 "131072    * max(filter('hltBTagPFCSVp070Triple'), max(filter('hltBTagPFDeepCSVp24Triple'), filter('hltBTagPFDeepCSV4p5Triple')) )+ " \
0150                 "262144    * filter('hltHpsOverlapFilterDeepTauDoublePFTau*PFJet*') + " \
0151                 "524288   * filter('*CrossCleaned*MediumDeepTauDitauWPPFTau*') + " \
0152                 "1048576   * filter('*CrossCleanedUsingDiJetCorrChecker*')"
0153                 ), 
0154             qualityBitsDoc = cms.string(
0155                 "Jet bits: bit 0 for VBF cross-cleaned from loose iso PFTau, bit 1 for hltBTagCaloCSVp087Triple, bit 2 for hltDoubleCentralJet90, bit 3 for hltDoublePFCentralJetLooseID90," \
0156                 " bit 4 for hltL1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet, bit 5 for hltQuadCentralJet30, bit 6 for hltQuadPFCentralJetLooseID30," \
0157                 " bit 7 for hltL1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF or hltL1sQuadJetCIorTripleJetVBFIorHTT," \
0158                 " bit 8 for hltQuadCentralJet45, bit 9 for hltQuadPFCentralJetLooseID45," \
0159                 " bit 10  for hltL1sQuadJetC60IorHTT380IorHTT280QuadJetIorHTT300QuadJet or hltL1sQuadJetC50to60IorHTT280to500IorHTT250to340QuadJet" \
0160                 " bit 11 for hltBTagCaloCSVp05Double or hltBTagCaloDeepCSVp17Double, bit 12 for hltPFCentralJetLooseIDQuad30, bit 13 for hlt1PFCentralJetLooseID75," \
0161                 " bit 14 for hlt2PFCentralJetLooseID60, bit 15 for hlt3PFCentralJetLooseID45, bit 16 for hlt4PFCentralJetLooseID40," \
0162                 " bit 17 for hltBTagPFCSVp070Triple or hltBTagPFDeepCSVp24Triple or hltBTagPFDeepCSV4p5Triple,"\
0163                 " bit 18 for Double tau + jet,"\
0164                 " bit 19 for VBF cross-cleaned from medium deeptau PFTau,"+
0165                 " bit 20 for VBF cross-cleaned using dijet correlation checker ")
0166         ),
0167         cms.PSet(
0168             name = cms.string("FatJet"),
0169             id = cms.int32(6),
0170             sel = cms.string("type(85) && pt > 120 && coll('hltAK8PFJetsCorrected')"), 
0171             l1seed = cms.string("type(-99)"), l1deltaR = cms.double(0.3),
0172             l2seed = cms.string("type(85)  && coll('hltAK8CaloJetsCorrectedIDPassed')"),  l2deltaR = cms.double(0.3),
0173             skipObjectsNotPassingQualityBits = cms.bool(True),
0174             qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
0175         ),
0176         cms.PSet(
0177             name = cms.string("MET"),
0178             id = cms.int32(2),
0179             sel = cms.string("type(87) && pt > 30 && coll('hltPFMETProducer')"), 
0180             l1seed = cms.string("type(-87) && coll('L1ETM')"), l1deltaR = cms.double(9999),
0181             l1seed_2 = cms.string("type(-87) && coll('L1ETMHF')"), l1deltaR_2 = cms.double(9999),
0182             l2seed = cms.string("type( 87) && coll('hltMetClean')"),  l2deltaR = cms.double(9999),
0183             skipObjectsNotPassingQualityBits = cms.bool(True),
0184             qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
0185         ),
0186         cms.PSet(
0187             name = cms.string("HT"),
0188             id = cms.int32(3),
0189             sel = cms.string("type(89) || type(-89)"), 
0190             l1seed = cms.string("type(-89) && coll('L1HTT')"), l1deltaR = cms.double(9999),
0191             l1seed_2 = cms.string("type(-89) && coll('L1HTTHF')"), l1deltaR_2 = cms.double(9999),
0192             l2seed = cms.string("type(89) && coll('hltHtMhtJet30')"),  l2deltaR = cms.double(9999),
0193             skipObjectsNotPassingQualityBits = cms.bool(True),
0194             qualityBits = cms.string(
0195                 "1        * filter('hltL1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet') + " \
0196                 "2        * max(filter('hltL1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF'), filter('hltL1sQuadJetCIorTripleJetVBFIorHTT')) + " \
0197                 "4        * max(filter('hltL1sQuadJetC60IorHTT380IorHTT280QuadJetIorHTT300QuadJet'), filter('hltL1sQuadJetC50to60IorHTT280to500IorHTT250to340QuadJet')) + " \
0198                 "8        * max(filter('hltCaloQuadJet30HT300'), filter('hltCaloQuadJet30HT320')) + " \
0199                 "16       * max(filter('hltPFCentralJetsLooseIDQuad30HT300'), filter('hltPFCentralJetsLooseIDQuad30HT330'))"
0200                 ), 
0201             qualityBitsDoc = cms.string(
0202                 "HT bits: bit 0 for hltL1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet, bit 1 for hltL1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF or hltL1sQuadJetCIorTripleJetVBFIorHTT, " \
0203                 "bit 2 for hltL1sQuadJetC60IorHTT380IorHTT280QuadJetIorHTT300QuadJet or hltL1sQuadJetC50to60IorHTT280to500IorHTT250to340QuadJet, " \
0204                 "bit 3 for hltCaloQuadJet30HT300 or hltCaloQuadJet30HT320, bit 4 for hltPFCentralJetsLooseIDQuad30HT300 or hltPFCentralJetsLooseIDQuad30HT330"
0205             ),
0206         ),
0207         cms.PSet(
0208             name = cms.string("MHT"),
0209             id = cms.int32(4),
0210             sel = cms.string("type(90)"), 
0211             l1seed = cms.string("type(-90) && coll('L1HTM')"), l1deltaR = cms.double(9999),
0212             l1seed_2 = cms.string("type(-90) && coll('L1HTMHF')"), l1deltaR_2 = cms.double(9999),
0213             l2seed = cms.string("type(90) && coll('hltHtMhtJet30')"),  l2deltaR = cms.double(9999),
0214             skipObjectsNotPassingQualityBits = cms.bool(True),
0215             qualityBits = cms.string(
0216                 "1       * max(filter('hltCaloQuadJet30HT300'), filter('hltCaloQuadJet30HT320')) + " \
0217                 "2       * max(filter('hltPFCentralJetsLooseIDQuad30HT300'), filter('hltPFCentralJetsLooseIDQuad30HT330'))"
0218                 ), 
0219                 qualityBitsDoc = cms.string
0220                 (
0221                 "MHT bits: bit 0 for hltCaloQuadJet30HT300 or hltCaloQuadJet30HT320, bit 1 for hltPFCentralJetsLooseIDQuad30HT300 or hltPFCentralJetsLooseIDQuad30HT330"
0222             ),
0223         ),
0224 
0225     ),
0226 )
0227 
0228 # ERA-dependent configuration
0229 # Tune filter and collection names to 2016 HLT menus
0230 # FIXME: check non-lepton objects and cross check leptons
0231 selections2016 = copy.deepcopy(triggerObjectTable.selections)
0232 for sel in selections2016:
0233     if sel.name=='Muon':
0234         sel.sel = cms.string("type(83) && pt > 5 && (coll('hlt*L3MuonCandidates') || coll('hlt*TkMuonCands') || coll('hlt*TrkMuonCands'))")
0235         sel.qualityBits = cms.string("filter('*RelTrkIso*Filtered0p4') + 2*filter('hltL3cr*IsoFiltered0p09') + 4*filter('*OverlapFilter*IsoMu*PFTau*') + 8*filter('hltL3f*IsoFiltered0p09') + 1024*max(filter('hltL3fL1sMu*L3Filtered50*'),filter('hltL3fL1sMu*TkFiltered50*'))")
0236         sel.qualityBitsDoc = cms.string("1 = TrkIsoVVL, 2 = Iso, 4 = OverlapFilter PFTau, 8 = IsoTkMu, 1024 = 1mu (Mu50)")
0237     elif sel.name=='Tau':
0238         sel.sel = cms.string("type(84) && pt > 5 && coll('*Tau*') && ( filter('*LooseIso*') || filter('*MediumIso*') || filter('*MediumComb*Iso*') || filter('hltL2TauIsoFilter') || filter('*OverlapFilter*IsoMu*') || filter('*OverlapFilter*IsoEle*') || filter('*L1HLTMatched*') || filter('*Dz02*') )")
0239         sel.qualityBits = cms.string("(filter('*LooseIso*')-filter('*VLooseIso*'))+2*filter('*Medium*Iso*')+4*filter('*VLooseIso*')+8*0+16*filter('hltL2TauIsoFilter')+32*filter('*OverlapFilter*IsoMu*')+64*filter('*OverlapFilter*IsoEle*')+128*filter('*L1HLTMatched*')+256*filter('*Dz02*')")
0240         sel.qualityBitsDoc = cms.string("1 = LooseIso, 2 = Medium(Comb)Iso, 4 = VLooseIso, 8 = None, 16 = L2p5 pixel iso, 32 = OverlapFilter IsoMu, 64 = OverlapFilter IsoEle, 128 = L1-HLT matched, 256 = Dz")
0241 
0242 run2_HLTconditions_2016.toModify(
0243   triggerObjectTable,
0244   selections = selections2016
0245 )
0246 
0247 from PhysicsTools.PatUtils.L1PrefiringWeightProducer_cff import prefiringweight
0248 #Next lines are for UL2016 maps
0249 (run2_muon_2016 & tracker_apv_vfp30_2016).toModify( prefiringweight, DataEraECAL = cms.string("UL2016preVFP"),  DataEraMuon = cms.string("2016preVFP"))
0250 (run2_muon_2016 & ~tracker_apv_vfp30_2016).toModify( prefiringweight, DataEraECAL = cms.string("UL2016postVFP"),  DataEraMuon = cms.string("2016postVFP"))
0251 #Next line is for UL2017 maps 
0252 run2_jme_2017.toModify( prefiringweight, DataEraECAL = cms.string("UL2017BtoF"), DataEraMuon = cms.string("20172018"))
0253 #Next line is for UL2018 maps 
0254 run2_muon_2018.toModify( prefiringweight, DataEraECAL = cms.string("None"), DataEraMuon = cms.string("20172018"))
0255 
0256 #For pre-UL 2017 reprocessing, one should use the original maps and no muon jet protection  
0257 for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
0258     modifier.toModify( prefiringweight, DataEraECAL = cms.string("2017BtoF"), DataEraMuon = cms.string("20172018"))
0259     modifier.toModify( prefiringweight, JetMaxMuonFraction = cms.double(-1.) )
0260 #For pre-UL 2016 reprocessing, same thing
0261 run2_nanoAOD_94X2016.toModify( prefiringweight, DataEraECAL = cms.string("2016BtoH"), DataEraMuon = cms.string("2016") )
0262 run2_nanoAOD_94X2016.toModify( prefiringweight, JetMaxMuonFraction = cms.double(-1.) )
0263 
0264 l1PreFiringEventWeightTable = cms.EDProducer("GlobalVariablesTableProducer",
0265     name = cms.string("L1PreFiringWeight"),
0266     variables = cms.PSet(
0267         Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProb"), "float", doc = "L1 pre-firing event correction weight (1-probability)", precision=8),
0268         Up = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbUp"), "float", doc = "L1 pre-firing event correction weight (1-probability), up var.", precision=8),
0269         Dn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbDown"), "float", doc = "L1 pre-firing event correction weight (1-probability), down var.", precision=8),
0270         Muon_Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuon"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability)", precision=8),
0271         Muon_SystUp = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonSystUp"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability), up var. syst.", precision=8),
0272         Muon_SystDn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonSystDown"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability), down var. syst.", precision=8),
0273         Muon_StatUp = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonStatUp"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability), up var. stat.", precision=8),
0274         Muon_StatDn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonStatDown"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability), down var. stat.", precision=8),
0275         ECAL_Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbECAL"), "float", doc = "ECAL L1 pre-firing event correction weight (1-probability)", precision=8),
0276         ECAL_Up = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbECALUp"), "float", doc = "ECAL L1 pre-firing event correction weight (1-probability), up var.", precision=8),
0277         ECAL_Dn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbECALDown"), "float", doc = "ECAL L1 pre-firing event correction weight (1-probability), down var.", precision=8),
0278     )
0279 )
0280 
0281 l1bits=cms.EDProducer("L1TriggerResultsConverter",
0282                        src=cms.InputTag("gtStage2Digis"),
0283                        legacyL1=cms.bool(False),
0284                        storeUnprefireableBit=cms.bool(True),
0285                        src_ext=cms.InputTag("simGtExtUnprefireable"))
0286 
0287 triggerObjectTablesTask = cms.Task( unpackedPatTrigger,triggerObjectTable,l1bits)
0288 
0289 _triggerObjectTablesTask_withL1PreFiring = triggerObjectTablesTask.copy()
0290 _triggerObjectTablesTask_withL1PreFiring.add(prefiringweight,l1PreFiringEventWeightTable)
0291 (run2_HLTconditions_2016 | run2_HLTconditions_2017 | run2_HLTconditions_2018).toReplaceWith(triggerObjectTablesTask,_triggerObjectTablesTask_withL1PreFiring)
0292 
0293 (run2_miniAOD_80XLegacy | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1).toModify(l1bits, storeUnprefireableBit=False)