File indexing completed on 2024-04-06 12:09:34
0001 import FWCore.ParameterSet.Config as cms
0002
0003
0004 def generateEfficiencyStrings(ptQualCuts):
0005 numDenDir = "numerators_and_denominators/"
0006 varStrings = ['pt', 'eta', 'phi', 'vtx']
0007 etaStrings = ['etaMin0_etaMax0p83', 'etaMin0p83_etaMax1p24', 'etaMin1p24_etaMax2p4', 'etaMin0_etaMax2p4']
0008 qualStrings = {0:'qualAll', 4:'qualOpen', 8:'qualDouble', 12:'qualSingle'}
0009
0010 efficiencyStrings = []
0011 for ptQualCut in ptQualCuts:
0012 effDenNamePrefix = numDenDir+"effDen_"
0013 effNumNamePrefix = numDenDir+"effNum_"
0014 effNamePrefix = "eff_"
0015 for varString in varStrings:
0016 effDenNameVar = effDenNamePrefix+varString
0017 effNumNameVar = effNumNamePrefix+varString+"_"+str(ptQualCut[0])
0018 effNameVar = effNamePrefix+varString+"_"+str(ptQualCut[0])
0019 if varString != "pt":
0020 effDenNameVar += "_"+str(ptQualCut[0])
0021 effDenNameEta = ''
0022 effNumNameEta = ''
0023 effNameEta = ''
0024 if varString != "eta":
0025 for etaString in etaStrings:
0026 effDenName = effDenNameVar+"_"+etaString
0027 effNumName = effNumNameVar+"_"+etaString+"_"+qualStrings[ptQualCut[1]]
0028 effName = effNameVar+"_"+etaString+"_"+qualStrings[ptQualCut[1]]
0029 efficiencyStrings.append(effName+" '"+effName+";;L1 muon efficiency' "+effNumName+" "+effDenName)
0030 else:
0031 effDenName = effDenNameVar
0032 effNumName = effNumNameVar+"_"+qualStrings[ptQualCut[1]]
0033 effName = effNameVar+"_"+qualStrings[ptQualCut[1]]
0034 efficiencyStrings.append(effName+" '"+effName+";;L1 muon efficiency' "+effNumName+" "+effDenName)
0035 return efficiencyStrings
0036
0037 from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
0038 from DQMOffline.L1Trigger.L1TMuonDQMOffline_cfi import ptQualCuts, ptQualCuts_HI
0039
0040 l1tMuonDQMEfficiency = DQMEDHarvester("DQMGenericClient",
0041 subDirs = cms.untracked.vstring("L1T/L1TObjects/L1TMuon/L1TriggerVsReco/"),
0042 efficiency = cms.vstring(),
0043 efficiencyProfile = cms.untracked.vstring(generateEfficiencyStrings(ptQualCuts)),
0044 resolution = cms.vstring(),
0045 outputFileName = cms.untracked.string(""),
0046 verbose = cms.untracked.uint32(0)
0047 )
0048
0049
0050 l1tMuonDQMEmuEfficiency = l1tMuonDQMEfficiency.clone(
0051 subDirs = ["L1TEMU/L1TObjects/L1TMuon/L1TriggerVsReco/"]
0052 )
0053
0054
0055 from Configuration.Eras.Modifier_ppRef_2017_cff import ppRef_2017
0056 ppRef_2017.toModify(l1tMuonDQMEfficiency,
0057 efficiencyProfile = cms.untracked.vstring(generateEfficiencyStrings(ptQualCuts_HI))
0058 )
0059 ppRef_2017.toModify(l1tMuonDQMEmuEfficiency,
0060 efficiencyProfile = cms.untracked.vstring(generateEfficiencyStrings(ptQualCuts_HI))
0061 )
0062