Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:18:52

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from HLTriggerOffline.Exotica.hltExoticaPostProcessor_cfi import *
0004 
0005 # Build the standard strings to the DQM
0006 def make_efficiency_string(objtype, plot_type, triggerpath):
0007     # --- IMPORTANT: Add here a elif if you are introduce a new collection
0008     #                (see EVTColContainer::getTypeString) 
0009     if objtype == "Mu" :
0010         objtypeLatex="#mu"
0011     elif objtype == "refittedStandAloneMuons": 
0012         objtypeLatex="refittedStandAlone #mu"
0013     elif objtype == "Ele": 
0014         objtypeLatex="e"
0015     elif objtype == "Photon": 
0016         objtypeLatex="#gamma"
0017     elif objtype == "PFTau": 
0018         objtypeLatex="#tau"
0019     else:
0020         objtypeLatex=objtype
0021     numer_description = "# gen %s passed the %s" % (objtypeLatex,triggerpath)
0022     denom_description = "# gen %s " % (objtypeLatex)
0023 
0024     if plot_type == "TurnOn1":
0025         title = "pT Turn-On"
0026         xAxis = "p_{T} of Leading Generated %s (GeV/c)" % (objtype)
0027         input_type = "gen%sMaxPt1" % (objtype)
0028     if plot_type == "TurnOn2":
0029         title = "Next-to-Leading pT Turn-On"
0030         xAxis = "p_{T} of Next-to-Leading Generated %s (GeV/c)" % (objtype)
0031         input_type = "gen%sMaxPt2" % (objtype)
0032     if plot_type == "TurnOn3":
0033         title = "Next-to-next-to-Leading pT Turn-On"
0034         xAxis = "p_{T} of Next-to-next-to-Leading Generated %s (GeV/c)" % (objtype)
0035         input_type = "gen%sMaxPt3" % (objtype)
0036     if plot_type == "TurnOn4":
0037         title = "SumEt Turn-On"
0038         xAxis = "SumEt of Leading Generated %s (GeV/c)" % (objtype)
0039         input_type = "gen%sSumEt" % (objtype)
0040     if plot_type == "EffEta":
0041         title = "#eta Efficiency"
0042         xAxis = "#eta of Generated %s " % (objtype)
0043         input_type = "gen%sEta" % (objtype)
0044     if plot_type == "EffPhi":
0045         title = "#phi Efficiency"
0046         xAxis = "#phi of Generated %s " % (objtype)
0047         input_type = "gen%sPhi" % (objtype)
0048     if plot_type == "EffDxy":
0049         title = "Dxy Efficiency"
0050         xAxis = "Dxy of Generated %s " % (objtype)
0051         input_type = "gen%sDxy" % (objtype)
0052 
0053     yAxis = "%s / %s" % (numer_description, denom_description)
0054     all_titles = "%s for trigger %s; %s; %s" % (title, triggerpath,
0055                                         xAxis, yAxis)
0056     return "Eff_%s_%s '%s' %s_%s %s" % (input_type,triggerpath,
0057                     all_titles,input_type,triggerpath,input_type)
0058 
0059 
0060 #--- IMPORTANT: Trigger are extracted from the hltExoticaValidator_cfi.py module
0061 from HLTriggerOffline.Exotica.hltExoticaValidator_cfi import hltExoticaValidator as _config
0062 #------------------------------------------------------------
0063 #--- IMPORTANT: Update this collection whenever you introduce a new object
0064 #               in the code (from EVTColContainer::getTypeString)
0065 def make_exo_postprocessor(analysis_name, plot_types=["TurnOn1", "TurnOn2", "TurnOn3", "TurnOn4", "EffEta", "EffPhi", "EffDxy"], object_types=["Mu","refittedStandAloneMuons","Track","Ele","Photon","PFTau","PFJet","MET","PFMET","PFMHT","GenMET","CaloJet","CaloMET","CaloMHT"], extra_str_templates=[]):
0066     postprocessor = hltExoticaPostProcessor.clone()
0067     postprocessor.subDirs = ["HLT/Exotica/" + analysis_name]
0068     efficiency_strings = [] # List of plots to look for. This is quite a bit larger than the number of plots that will be made.
0069 
0070     # Higgs and SMP postprocessors use this string, but exo does not, for now.
0071     #efficiency_summary_string = "EffSummaryPaths_" + analysis_name + "_gen ' Efficiency of paths used in " + analysis_name + " ; trigger path ' SummaryPaths_" + analysis_name + "_gen_passingHLT SummaryPaths_" + analysis_name + "_gen"
0072     #efficiency_strings.append(efficiency_summary_string)
0073     #efficiency_strings.append(efficiency_summary_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec"))
0074 
0075     for plot_type in plot_types:
0076         for object_type in object_types:
0077             for trigger in [x.replace("_v", "") for x in _config.__getattribute__(analysis_name).hltPathsToCheck]:
0078                 this_efficiency_string = make_efficiency_string(object_type, plot_type, trigger)
0079                 efficiency_strings.append(this_efficiency_string)
0080                 efficiency_strings.append(this_efficiency_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec"))
0081 
0082                 for str_template in extra_str_templates:
0083                     this_extra_string = str_template.replace("@ANALYSIS@", analysis_name).replace("@TRIGGER@", trigger)
0084                     efficiency_strings.append(this_extra_string)
0085                     efficiency_strings.append(this_extra_stringreplace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec"))
0086     postprocessor.efficiencyProfile = efficiency_strings
0087     return postprocessor
0088 
0089 hltExoticaPostLowPtTrimuon = make_exo_postprocessor("LowPtTrimuon")
0090 hltExoticaPostHighPtDimuon = make_exo_postprocessor("HighPtDimuon")
0091 hltExoticaPostHighPtDielectron = make_exo_postprocessor("HighPtDielectron")
0092 hltExoticaPostHighPtElectron = make_exo_postprocessor("HighPtElectron")
0093 hltExoticaPostLowPtElectron = make_exo_postprocessor("LowPtElectron")
0094 hltExoticaPostLowPtDimuon = make_exo_postprocessor("LowPtDimuon")
0095 hltExoticaPostLowPtDielectron = make_exo_postprocessor("LowPtDielectron")
0096 hltExoticaPostHighPtPhoton = make_exo_postprocessor("HighPtPhoton")
0097 hltExoticaPostDiPhoton = make_exo_postprocessor("DiPhoton")
0098 hltExoticaPostDisplacedDiPhoton = make_exo_postprocessor("DisplacedDiPhoton")
0099 hltExoticaPostSingleMuon = make_exo_postprocessor("SingleMuon")
0100 hltExoticaPostPFHT = make_exo_postprocessor("PFHT")
0101 hltExoticaPostCaloHT = make_exo_postprocessor("CaloHT")
0102 hltExoticaPostJetNoBptx = make_exo_postprocessor("JetNoBptx")
0103 hltExoticaPostMuonNoBptx = make_exo_postprocessor("MuonNoBptx")
0104 hltExoticaPostDisplacedMuEG = make_exo_postprocessor("DisplacedMuEG")
0105 hltExoticaPostDisplacedDimuon = make_exo_postprocessor("DisplacedDimuon")
0106 hltExoticaPostDisplacedL2Dimuon = make_exo_postprocessor("DisplacedL2Dimuon")
0107 hltExoticaPostMonojet = make_exo_postprocessor("Monojet")
0108 hltExoticaPostMonojetBackup = make_exo_postprocessor("MonojetBackup")
0109 hltExoticaPostPureMET = make_exo_postprocessor("PureMET")
0110 hltExoticaPostMETplusTrack = make_exo_postprocessor("METplusTrack")
0111 hltExoticaEleMu = make_exo_postprocessor("EleMu")
0112 hltExoticaPhotonMET = make_exo_postprocessor("PhotonMET")
0113 hltExoticaHTDisplacedJets = make_exo_postprocessor("HTDisplacedJets")
0114 hltExoticaDSTJets = make_exo_postprocessor("DSTJets")
0115 hltExoticaDSTMuons = make_exo_postprocessor("DSTMuons")
0116 hltExoticaTracklessJets = make_exo_postprocessor("TracklessJets")
0117 
0118 hltExoticaPostProcessors = cms.Sequence(
0119     # Tri-lepton paths
0120     hltExoticaPostLowPtTrimuon +
0121     # Di-lepton paths
0122     hltExoticaPostHighPtDimuon +
0123     hltExoticaPostHighPtDielectron +
0124     hltExoticaPostLowPtDimuon +
0125     hltExoticaPostLowPtDielectron +
0126     # Single Lepton paths
0127     hltExoticaPostHighPtElectron +
0128     hltExoticaPostLowPtElectron +
0129     # Photon paths
0130     hltExoticaPostHighPtPhoton +
0131     hltExoticaPostDiPhoton +
0132     hltExoticaPostDisplacedDiPhoton +
0133     # HT path
0134     hltExoticaPostPFHT +
0135     hltExoticaPostCaloHT +
0136     # NoBptx paths
0137     hltExoticaPostJetNoBptx +
0138     hltExoticaPostMuonNoBptx +
0139     # Displaced paths
0140     hltExoticaPostDisplacedMuEG +
0141     hltExoticaPostDisplacedDimuon +
0142     hltExoticaPostDisplacedL2Dimuon +
0143     # Others
0144     hltExoticaPostMonojet +
0145     hltExoticaPostMonojetBackup +
0146     hltExoticaPostPureMET +
0147     hltExoticaPostMETplusTrack +
0148     hltExoticaPostSingleMuon +
0149     hltExoticaEleMu +
0150     hltExoticaPhotonMET +
0151     hltExoticaHTDisplacedJets +
0152     hltExoticaTracklessJets +
0153     # scouting triggers
0154     hltExoticaDSTJets +
0155     hltExoticaDSTMuons 
0156     )
0157 
0158 
0159     #for analysis in _config.analyses:
0160 #    hltExoticaPostProcessors *= analysis_postprocessors[analysis]
0161