Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-17 23:31:28

0001 from builtins import range
0002 import FWCore.ParameterSet.Config as cms
0003 from DQMOffline.L1Trigger.L1THistDefinitions_cff import histDefinitions
0004 
0005 jetEfficiencyThresholds = [36, 68, 128, 176]
0006 metEfficiencyThresholds = [40, 60, 80, 100, 120]
0007 mhtEfficiencyThresholds = [40, 60, 80, 100, 120]
0008 ettEfficiencyThresholds = [30, 50, 90, 140]
0009 httEfficiencyThresholds = [120, 160, 200, 240, 280]
0010 
0011 jetEfficiencyBins = []
0012 jetEfficiencyBins.extend(list(range(0, 120, 10)))
0013 jetEfficiencyBins.extend(list(range(120, 180, 20)))
0014 jetEfficiencyBins.extend(list(range(180, 300, 40)))
0015 jetEfficiencyBins.extend(list(range(300, 401, 100)))
0016 
0017 metEfficiencyBins = []
0018 metEfficiencyBins.extend(list(range(0, 40, 4)))
0019 metEfficiencyBins.extend(list(range(40, 70, 2)))
0020 metEfficiencyBins.extend(list(range(70, 100, 5)))
0021 metEfficiencyBins.extend(list(range(100, 160, 10)))
0022 metEfficiencyBins.extend(list(range(160, 261, 20)))
0023 
0024 mhtEfficiencyBins = []
0025 mhtEfficiencyBins.extend(list(range(30, 50, 1)))
0026 mhtEfficiencyBins.extend(list(range(50, 80, 5)))
0027 mhtEfficiencyBins.extend(list(range(80, 140, 10)))
0028 mhtEfficiencyBins.extend(list(range(140, 200, 15)))
0029 mhtEfficiencyBins.extend(list(range(200, 300, 20)))
0030 mhtEfficiencyBins.extend(list(range(300, 401, 50)))
0031 
0032 ettEfficiencyBins = []
0033 ettEfficiencyBins.extend(list(range(0, 30, 30)))
0034 ettEfficiencyBins.extend(list(range(30, 50, 10)))
0035 ettEfficiencyBins.extend(list(range(50, 90, 5)))
0036 ettEfficiencyBins.extend(list(range(90, 141, 2)))
0037 
0038 httEfficiencyBins = []
0039 httEfficiencyBins.extend(list(range(0, 100, 5)))
0040 httEfficiencyBins.extend(list(range(100, 200, 10)))
0041 httEfficiencyBins.extend(list(range(200, 400, 20)))
0042 httEfficiencyBins.extend(list(range(400, 500, 50)))
0043 httEfficiencyBins.extend(list(range(500, 601, 10)))
0044 
0045 # from https://twiki.cern.ch/twiki/bin/view/CMS/JetID13TeVRun2017
0046 centralJetSelection = [
0047     'abs(eta) <= 2.7',
0048     'neutralHadronEnergyFraction < 0.9',
0049     'neutralEmEnergyFraction < 0.9',
0050     'numberOfDaughters > 1',
0051     'muonEnergyFraction < 0.8'
0052 ]
0053 withinTrackerSelection = centralJetSelection[:]
0054 withinTrackerSelection += [
0055     'abs(eta) <= 2.4',
0056     'chargedHadronEnergyFraction > 0',
0057     'chargedMultiplicity > 0',
0058     'chargedEmEnergyFraction < 0.8'
0059 ]
0060 forwardJetSelection = [
0061     'abs(eta) > 2.7',
0062     'abs(eta) <= 3.0',
0063     'neutralEmEnergyFraction > 0.02',
0064     'neutralEmEnergyFraction < 0.99',
0065     'neutralMultiplicity > 2'
0066 ]
0067 veryForwardJetSelection = [
0068     'abs(eta) > 3.0',
0069     'neutralEmEnergyFraction < 0.99',
0070     'neutralHadronEnergyFraction > 0.02',
0071     'neutralMultiplicity > 10'
0072 ]
0073 centralJetSelection = ' && '.join(centralJetSelection)
0074 withinTrackerSelection = ' && '.join(withinTrackerSelection)
0075 forwardJetSelection = ' && '.join(forwardJetSelection)
0076 veryForwardJetSelection = ' && '.join(veryForwardJetSelection)
0077 completeSelection = 'et > 30 && (' + ' || '.join([centralJetSelection, withinTrackerSelection,
0078                                        forwardJetSelection, veryForwardJetSelection]) + ')'
0079 
0080 goodPFJetsForL1T = cms.EDFilter(
0081     "PFJetSelector",
0082     src=cms.InputTag("ak4PFJetsCHS"),
0083     cut=cms.string(completeSelection),
0084     filter=cms.bool(True),
0085 )
0086 
0087 from L1Trigger.L1TNtuples.L1TPFMetNoMuProducer_cfi import l1tPFMetNoMu
0088 
0089 l1tPFMetNoMuForDQM = l1tPFMetNoMu.clone(
0090     pfMETCollection= 'pfMETT1',
0091     muonCollection= 'muons'
0092 )
0093 
0094 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0095 l1tEtSumJetOfflineDQM = DQMEDAnalyzer(
0096     "L1TStage2CaloLayer2Offline",
0097     electronCollection=cms.InputTag("gedGsfElectrons"),
0098     pfJetCollection=cms.InputTag("goodPFJetsForL1T"),
0099     caloMETCollection=cms.InputTag("caloMetBE"),
0100     # MET collection including HF
0101     caloETMHFCollection=cms.InputTag("caloMet"),
0102     pfMETNoMuCollection=cms.InputTag('l1tPFMetNoMuForDQM'),
0103     conversionsCollection=cms.InputTag("allConversions"),
0104     PVCollection=cms.InputTag("offlinePrimaryVerticesWithBS"),
0105     beamSpotCollection=cms.InputTag("offlineBeamSpot"),
0106 
0107     triggerInputTag=cms.InputTag('hltTriggerSummaryAOD', '', 'HLT'),
0108     triggerProcess=cms.string('HLT'),
0109     triggerResults=cms.InputTag('TriggerResults', '', 'HLT'),
0110     triggerNames=cms.vstring(
0111         'HLT_IsoMu18_v*',
0112         'HLT_IsoMu20_v*',
0113         'HLT_IsoMu22_v*',
0114         'HLT_IsoMu24_v*',
0115         'HLT_IsoMu27_v*',
0116         'HLT_IsoMu30_v*',
0117     ),
0118 
0119     stage2CaloLayer2JetSource=cms.InputTag("caloStage2Digis", "Jet"),
0120     stage2CaloLayer2EtSumSource=cms.InputTag("caloStage2Digis", "EtSum"),
0121 
0122     histFolderEtSum=cms.string('L1T/L1TObjects/L1TEtSum/L1TriggerVsReco'),
0123     histFolderJet=cms.string('L1T/L1TObjects/L1TJet/L1TriggerVsReco'),
0124     jetEfficiencyThresholds=cms.vdouble(jetEfficiencyThresholds),
0125     metEfficiencyThresholds=cms.vdouble(metEfficiencyThresholds),
0126     mhtEfficiencyThresholds=cms.vdouble(mhtEfficiencyThresholds),
0127     ettEfficiencyThresholds=cms.vdouble(ettEfficiencyThresholds),
0128     httEfficiencyThresholds=cms.vdouble(httEfficiencyThresholds),
0129 
0130     jetEfficiencyBins=cms.vdouble(jetEfficiencyBins),
0131     metEfficiencyBins=cms.vdouble(metEfficiencyBins),
0132     mhtEfficiencyBins=cms.vdouble(mhtEfficiencyBins),
0133     ettEfficiencyBins=cms.vdouble(ettEfficiencyBins),
0134     httEfficiencyBins=cms.vdouble(httEfficiencyBins),
0135 
0136     recoHTTMaxEta=cms.double(2.5),
0137     recoMHTMaxEta=cms.double(2.5),
0138 
0139     histDefinitions=cms.PSet(
0140         nVertex=histDefinitions.nVertex.clone(),
0141         ETvsET=histDefinitions.ETvsET.clone(),
0142         PHIvsPHI=histDefinitions.PHIvsPHI.clone(),
0143         # L1JetETvsCaloJetET_HB=histDefinitions.ETvsET.clone(
0144         #     name='L1JetETvsCaloJetET_HB',
0145         #     title='L1 Jet E_{T} vs Offline Jet E_{T} (HB); Offline Jet E_{T} (GeV); L1 Jet E_{T} (GeV)',
0146         # )
0147     ),
0148 )
0149 
0150 # modifications for the pp reference run
0151 jetEfficiencyThresholds_HI = [8, 16, 24, 44, 60, 80, 90]
0152 jetEfficiencyBins_HI = []
0153 jetEfficiencyBins_HI.extend(list(range(0, 60, 2)))
0154 jetEfficiencyBins_HI.extend(list(range(60, 90, 5)))
0155 jetEfficiencyBins_HI.extend(list(range(90, 120, 10)))
0156 jetEfficiencyBins_HI.extend(list(range(120, 180, 20)))
0157 jetEfficiencyBins_HI.extend(list(range(180, 300, 40)))
0158 jetEfficiencyBins_HI.extend(list(range(300, 401, 100)))
0159 
0160 from Configuration.Eras.Modifier_ppRef_2017_cff import ppRef_2017
0161 ppRef_2017.toModify(
0162     l1tEtSumJetOfflineDQM,
0163     TriggerFilter=cms.InputTag('hltEle20WPLoose1GsfTrackIsoFilter', '', 'HLT'),
0164     TriggerPath=cms.string('HLT_Ele20_WPLoose_Gsf_v4'),
0165     jetEfficiencyThresholds=cms.vdouble(jetEfficiencyThresholds_HI),
0166     jetEfficiencyBins=cms.vdouble(jetEfficiencyBins_HI),
0167 )
0168 
0169 # emulator module
0170 l1tEtSumJetOfflineDQMEmu = l1tEtSumJetOfflineDQM.clone(
0171     stage2CaloLayer2JetSource = "simCaloStage2Digis",
0172     stage2CaloLayer2EtSumSource = "simCaloStage2Digis",
0173 
0174     histFolderEtSum = 'L1TEMU/L1TObjects/L1TEtSum/L1TriggerVsReco',
0175     histFolderJet= 'L1TEMU/L1TObjects/L1TJet/L1TriggerVsReco'
0176 )
0177 
0178 # sequences
0179 l1tEtSumJetOfflineDQMSeq = cms.Sequence(
0180     cms.ignore(goodPFJetsForL1T)
0181     + l1tPFMetNoMuForDQM
0182     + l1tEtSumJetOfflineDQM
0183 )
0184 
0185 l1tEtSumJetOfflineDQMEmuSeq = cms.Sequence(
0186     cms.ignore(goodPFJetsForL1T)
0187     + l1tPFMetNoMuForDQM
0188     + l1tEtSumJetOfflineDQMEmu
0189 )
0190