Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:35

0001 import FWCore.ParameterSet.Config as cms
0002 from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
0003 
0004 from DQMOffline.Trigger.HLTTauDQMOffline_cfi import *
0005 
0006 def makeInclusiveAnalyzer(monitorModule):
0007     m1 = DQMEDHarvester("DQMGenericClient",
0008         subDirs        = cms.untracked.vstring(monitorModule.DQMBaseFolder.value()+"/"+monitorModule.PathSummaryPlotter.DQMFolder.value()),
0009         verbose        = cms.untracked.uint32(0), # Set to 2 for all messages
0010         outputFileName = cms.untracked.string(''),
0011         resolution     = cms.vstring(),
0012         efficiency     = cms.vstring(),
0013         efficiencyProfile = cms.untracked.vstring(
0014             "PathEfficiency 'Accepted Events per Path;;' helpers/PathTriggerBits helpers/RefEvents"
0015         ),
0016     )
0017 
0018     m2 = DQMEDHarvester("HLTTauPostProcessor",
0019         DQMBaseFolder = cms.untracked.string(monitorModule.DQMBaseFolder.value())
0020     )
0021 
0022     return (m1, m2)
0023 
0024 def makePFTauAnalyzer(monitorModule):
0025     (m1, m2) = makeInclusiveAnalyzer(monitorModule)
0026     m1.subDirs.extend([monitorModule.DQMBaseFolder.value()+"/HLT_.*",
0027                        monitorModule.DQMBaseFolder.value()+"/"+monitorModule.L1Plotter.DQMFolder.value(),
0028                        monitorModule.DQMBaseFolder.value()+"/.*"])
0029 
0030     def _addEfficiencies(level, quantities, nameFormat, titleObject="#tau", postfix=""):
0031         if postfix != "":
0032             postfix = " "+postfix
0033         for quantity, titleLabel in quantities:
0034             name = nameFormat % (level, quantity)
0035             title = "%s %s %s efficiency%s" % (level, titleObject, titleLabel, postfix)
0036             m1.efficiencyProfile.append("%s '%s' helpers/%sNum helpers/%sDenom" % (name, title, name, name))
0037 
0038     _addEfficiencies("L1", [("Et", "E_{T}"),
0039                             ("Eta", "#eta"),
0040                             ("Phi", "#phi")], "%sTau%sEff")
0041     _addEfficiencies("L1", [("Et", "E_{T}"),
0042                             ("Eta", "#eta"),
0043                             ("Phi", "#phi")], "%sIsoTau%sEff")
0044     _addEfficiencies("L1", [("HighEt", "E_{T}")], "%sTau%sEff", postfix="(high E_{T})")
0045 
0046     _addEfficiencies("L1", [("Et", "E_{T}")], "%sETM%sEff", "ETM")
0047 
0048     _addEfficiencies("L2", [("Et", "E_{T}"),
0049                             ("Phi", "#phi")], "%sTrigMET%sEff", "MET")
0050     _addEfficiencies("tau", [("Et", "E_{T}"),("Eta", "#eta"),("Phi", "#phi")], "%s%sEff", titleObject="")
0051     _addEfficiencies("muon", [("Et", "E_{T}"),("Eta", "#eta"),("Phi", "#phi")], "%s%sEff", titleObject="")
0052     _addEfficiencies("electron", [("Et", "E_{T}"),("Eta", "#eta"),("Phi", "#phi")], "%s%sEff", titleObject="")
0053     _addEfficiencies("met", [("Et", "E_{T}"),("Phi", "#phi")], "%s%sEff", titleObject="")
0054 
0055     for level in ["L2", "L3"]:
0056         _addEfficiencies(level, [("Et", "p_{T}"),
0057                                  ("Eta", "#eta"),
0058                                  ("Phi", "#phi")], "%sTrigTau%sEff")
0059         _addEfficiencies(level, [("HighEt", "p_{T}")], "%sTrigTau%sEff", postfix="(high p_{T})")
0060         _addEfficiencies(level, [("Et", "p_{T}"),
0061                                  ("Eta", "#eta"),
0062                                  ("Phi", "#phi")], "%sTrigElectron%sEff", "electron")
0063         _addEfficiencies(level, [("Et", "p_{T}"),
0064                                  ("Eta", "#eta"),
0065                                  ("Phi", "#phi")], "%sTrigMuon%sEff", "muon")
0066 
0067     m1.efficiency.append("L3EtaPhiEfficiency 'eta phi eff; #eta; #phi' helpers/L3TrigTauEtaPhiEffNum helpers/L3TrigTauEtaPhiEffDenom")
0068     m1.efficiency.append("tauEtaPhiEfficiency 'eta phi eff; #eta; #phi' helpers/tauEtaPhiEffNum helpers/tauEtaPhiEffDenom")
0069     m1.efficiency.append("muonEtaPhiEfficiency 'eta phi eff; #eta; #phi' helpers/muonEtaPhiEffNum helpers/muonEtaPhiEffDenom")
0070     m1.efficiency.append("electronEtaPhiEfficiency 'eta phi eff; #eta; #phi' helpers/electronEtaPhiEffNum helpers/electronEtaPhiEffDenom")
0071 
0072     return (m1, m2)
0073 
0074 
0075 (HLTTauPostAnalysisInclusive, HLTTauPostAnalysisInclusive2) = makeInclusiveAnalyzer(hltTauOfflineMonitor_Inclusive)
0076 (HLTTauPostAnalysisPFTaus, HLTTauPostAnalysisPFTaus2) = makePFTauAnalyzer(hltTauOfflineMonitor_PFTaus)
0077 (HLTTauPostAnalysisTP, HLTTauPostAnalysisTP2) = makePFTauAnalyzer(hltTauOfflineMonitor_TagAndProbe)
0078 
0079 HLTTauPostSeq = cms.Sequence(
0080     HLTTauPostAnalysisInclusive+HLTTauPostAnalysisInclusive2+
0081     HLTTauPostAnalysisPFTaus+HLTTauPostAnalysisPFTaus2+
0082     HLTTauPostAnalysisTP+HLTTauPostAnalysisTP2
0083 )