CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HLTTauPostProcessor_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
3 
5 
6 def makeInclusiveAnalyzer(monitorModule):
7  m1 = DQMEDHarvester("DQMGenericClient",
8  subDirs = cms.untracked.vstring(monitorModule.DQMBaseFolder.value()+"/"+monitorModule.PathSummaryPlotter.DQMFolder.value()),
9  verbose = cms.untracked.uint32(0), # Set to 2 for all messages
10  outputFileName = cms.untracked.string(''),
11  resolution = cms.vstring(),
12  efficiency = cms.vstring(),
13  efficiencyProfile = cms.untracked.vstring(
14  "PathEfficiency 'Accepted Events per Path;;' helpers/PathTriggerBits helpers/RefEvents"
15  ),
16  )
17 
18  m2 = DQMEDHarvester("HLTTauPostProcessor",
19  DQMBaseFolder = cms.untracked.string(monitorModule.DQMBaseFolder.value())
20  )
21 
22  return (m1, m2)
23 
24 def makePFTauAnalyzer(monitorModule):
25  (m1, m2) = makeInclusiveAnalyzer(monitorModule)
26  m1.subDirs.extend([monitorModule.DQMBaseFolder.value()+"/HLT_.*",
27  monitorModule.DQMBaseFolder.value()+"/"+monitorModule.L1Plotter.DQMFolder.value(),
28  monitorModule.DQMBaseFolder.value()+"/.*"])
29 
30  def _addEfficiencies(level, quantities, nameFormat, titleObject="#tau", postfix=""):
31  if postfix != "":
32  postfix = " "+postfix
33  for quantity, titleLabel in quantities:
34  name = nameFormat % (level, quantity)
35  title = "%s %s %s efficiency%s" % (level, titleObject, titleLabel, postfix)
36  m1.efficiencyProfile.append("%s '%s' helpers/%sNum helpers/%sDenom" % (name, title, name, name))
37 
38  _addEfficiencies("L1", [("Et", "E_{T}"),
39  ("Eta", "#eta"),
40  ("Phi", "#phi")], "%sTau%sEff")
41  _addEfficiencies("L1", [("Et", "E_{T}"),
42  ("Eta", "#eta"),
43  ("Phi", "#phi")], "%sIsoTau%sEff")
44  _addEfficiencies("L1", [("HighEt", "E_{T}")], "%sTau%sEff", postfix="(high E_{T})")
45 
46  _addEfficiencies("L1", [("Et", "E_{T}")], "%sETM%sEff", "ETM")
47 
48  _addEfficiencies("L2", [("Et", "E_{T}"),
49  ("Phi", "#phi")], "%sTrigMET%sEff", "MET")
50  _addEfficiencies("tau", [("Et", "E_{T}"),("Eta", "#eta"),("Phi", "#phi")], "%s%sEff", titleObject="")
51  _addEfficiencies("muon", [("Et", "E_{T}"),("Eta", "#eta"),("Phi", "#phi")], "%s%sEff", titleObject="")
52  _addEfficiencies("electron", [("Et", "E_{T}"),("Eta", "#eta"),("Phi", "#phi")], "%s%sEff", titleObject="")
53  _addEfficiencies("met", [("Et", "E_{T}"),("Phi", "#phi")], "%s%sEff", titleObject="")
54 
55  for level in ["L2", "L3"]:
56  _addEfficiencies(level, [("Et", "p_{T}"),
57  ("Eta", "#eta"),
58  ("Phi", "#phi")], "%sTrigTau%sEff")
59  _addEfficiencies(level, [("HighEt", "p_{T}")], "%sTrigTau%sEff", postfix="(high p_{T})")
60  _addEfficiencies(level, [("Et", "p_{T}"),
61  ("Eta", "#eta"),
62  ("Phi", "#phi")], "%sTrigElectron%sEff", "electron")
63  _addEfficiencies(level, [("Et", "p_{T}"),
64  ("Eta", "#eta"),
65  ("Phi", "#phi")], "%sTrigMuon%sEff", "muon")
66 
67  m1.efficiency.append("L3EtaPhiEfficiency 'eta phi eff; #eta; #phi' helpers/L3TrigTauEtaPhiEffNum helpers/L3TrigTauEtaPhiEffDenom")
68  m1.efficiency.append("tauEtaPhiEfficiency 'eta phi eff; #eta; #phi' helpers/tauEtaPhiEffNum helpers/tauEtaPhiEffDenom")
69  m1.efficiency.append("muonEtaPhiEfficiency 'eta phi eff; #eta; #phi' helpers/muonEtaPhiEffNum helpers/muonEtaPhiEffDenom")
70  m1.efficiency.append("electronEtaPhiEfficiency 'eta phi eff; #eta; #phi' helpers/electronEtaPhiEffNum helpers/electronEtaPhiEffDenom")
71 
72  return (m1, m2)
73 
74 
75 (HLTTauPostAnalysisInclusive, HLTTauPostAnalysisInclusive2) = makeInclusiveAnalyzer(hltTauOfflineMonitor_Inclusive)
76 (HLTTauPostAnalysisPFTaus, HLTTauPostAnalysisPFTaus2) = makePFTauAnalyzer(hltTauOfflineMonitor_PFTaus)
77 (HLTTauPostAnalysisTP, HLTTauPostAnalysisTP2) = makePFTauAnalyzer(hltTauOfflineMonitor_TagAndProbe)
78 
79 HLTTauPostSeq = cms.Sequence(
80  HLTTauPostAnalysisInclusive+HLTTauPostAnalysisInclusive2+
81  HLTTauPostAnalysisPFTaus+HLTTauPostAnalysisPFTaus2+
82  HLTTauPostAnalysisTP+HLTTauPostAnalysisTP2
83 )