CMS 3D CMS Logo

L1TMuonDQMEfficiency_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # generate the efficiency strings for the DQMGenericClient from the pt and quality cuts
4 def generateEfficiencyStrings(ptQualCuts):
5  numDenDir = "numerators_and_denominators/"
6  varStrings = ['pt', 'eta', 'phi', 'vtx']
7  etaStrings = ['etaMin0_etaMax0p83', 'etaMin0p83_etaMax1p24', 'etaMin1p24_etaMax2p4', 'etaMin0_etaMax2p4']
8  qualStrings = {0:'qualAll', 4:'qualOpen', 8:'qualDouble', 12:'qualSingle'}
9 
10  efficiencyStrings = []
11  for ptQualCut in ptQualCuts:
12  effDenNamePrefix = numDenDir+"effDen_"
13  effNumNamePrefix = numDenDir+"effNum_"
14  effNamePrefix = "eff_"
15  for varString in varStrings:
16  effDenNameVar = effDenNamePrefix+varString
17  effNumNameVar = effNumNamePrefix+varString+"_"+str(ptQualCut[0])
18  effNameVar = effNamePrefix+varString+"_"+str(ptQualCut[0])
19  if varString != "pt":
20  effDenNameVar += "_"+str(ptQualCut[0])
21  effDenNameEta = ''
22  effNumNameEta = ''
23  effNameEta = ''
24  if varString != "eta":
25  for etaString in etaStrings:
26  effDenName = effDenNameVar+"_"+etaString
27  effNumName = effNumNameVar+"_"+etaString+"_"+qualStrings[ptQualCut[1]]
28  effName = effNameVar+"_"+etaString+"_"+qualStrings[ptQualCut[1]]
29  efficiencyStrings.append(effName+" '"+effName+";;L1 muon efficiency' "+effNumName+" "+effDenName)
30  else:
31  effDenName = effDenNameVar
32  effNumName = effNumNameVar+"_"+qualStrings[ptQualCut[1]]
33  effName = effNameVar+"_"+qualStrings[ptQualCut[1]]
34  efficiencyStrings.append(effName+" '"+effName+";;L1 muon efficiency' "+effNumName+" "+effDenName)
35  return efficiencyStrings
36 
37 from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
38 from DQMOffline.L1Trigger.L1TMuonDQMOffline_cfi import ptQualCuts, ptQualCuts_HI
39 
40 l1tMuonDQMEfficiency = DQMEDHarvester("DQMGenericClient",
41  subDirs = cms.untracked.vstring("L1T/L1TObjects/L1TMuon/L1TriggerVsReco/"),
42  efficiency = cms.vstring(),
43  efficiencyProfile = cms.untracked.vstring(generateEfficiencyStrings(ptQualCuts)),
44  resolution = cms.vstring(),
45  outputFileName = cms.untracked.string(""),
46  verbose = cms.untracked.uint32(0)
47 )
48 
49 # emulator efficiency
50 l1tMuonDQMEmuEfficiency = l1tMuonDQMEfficiency.clone(
51  subDirs = cms.untracked.vstring("L1TEMU/L1TObjects/L1TMuon/L1TriggerVsReco/")
52 )
53 
54 # modifications for the pp reference run
55 from Configuration.Eras.Modifier_ppRef_2017_cff import ppRef_2017
56 ppRef_2017.toModify(l1tMuonDQMEfficiency,
57  efficiencyProfile = cms.untracked.vstring(generateEfficiencyStrings(ptQualCuts_HI))
58 )
59 ppRef_2017.toModify(l1tMuonDQMEmuEfficiency,
60  efficiencyProfile = cms.untracked.vstring(generateEfficiencyStrings(ptQualCuts_HI))
61 )
62 
L1TMuonDQMEfficiency_cff.generateEfficiencyStrings
def generateEfficiencyStrings(ptQualCuts)
Definition: L1TMuonDQMEfficiency_cff.py:4
L1TMuonDQMOffline_cfi
str
#define str(s)
Definition: TestProcessor.cc:52
DQMEDHarvester
Definition: DQMEDHarvester.py:1