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=[]): postprocessor = hltExoticaPostProcessor.clone() postprocessor.subDirs = ["HLT/Exotica/" + analysis_name] efficiency_strings = [ ] # List of plots to look for. This is quite a bit larger than the number of plots that will be made. # Higgs and SMP postprocessors use this string, but exo does not, for now. #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" #efficiency_strings.append(efficiency_summary_string) #efficiency_strings.append(efficiency_summary_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec")) for plot_type in plot_types: for object_type in object_types: for trigger in [ x.replace("_v", "") for x in _config.__getattribute__( analysis_name).hltPathsToCheck ]: this_efficiency_string = make_efficiency_string( object_type, plot_type, trigger) efficiency_strings.append(this_efficiency_string) efficiency_strings.append( this_efficiency_string.replace( "Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec")) for str_template in extra_str_templates: this_extra_string = str_template.replace( "@ANALYSIS@", analysis_name).replace("@TRIGGER@", trigger) efficiency_strings.append(this_extra_string) efficiency_strings.append( this_extra_stringreplace("Generated", "Reconstructed").replace( "Gen", "Reco").replace( "gen", "rec")) postprocessor.efficiencyProfile = efficiency_strings return postprocessor
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","l1MET"], extra_str_templates=[]): postprocessor = hltExoticaPostProcessor.clone() postprocessor.subDirs = ["HLT/Exotica/" + analysis_name] efficiency_strings = [] # List of plots to look for. This is quite a bit larger than the number of plots that will be made. # Higgs and SMP postprocessors use this string, but exo does not, for now. #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" #efficiency_strings.append(efficiency_summary_string) #efficiency_strings.append(efficiency_summary_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec")) for plot_type in plot_types: for object_type in object_types: for trigger in [x.replace("_v", "") for x in _config.__getattribute__(analysis_name).hltPathsToCheck]: this_efficiency_string = make_efficiency_string(object_type, plot_type, trigger) efficiency_strings.append(this_efficiency_string) efficiency_strings.append(this_efficiency_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec")) for str_template in extra_str_templates: this_extra_string = str_template.replace("@ANALYSIS@", analysis_name).replace("@TRIGGER@", trigger) efficiency_strings.append(this_extra_string) efficiency_strings.append(this_extra_stringreplace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec")) postprocessor.efficiencyProfile = efficiency_strings return postprocessor
plot_types = ["TurnOn1", "TurnOn2", "TurnOn3", "EffEta", "EffPhi"] #--- IMPORTANT: Update this collection whenever you introduce a new object # in the code (from EVTColContainer::getTypeString) obj_types = ["Mu", "Ele", "Photon", "PFTau", "PFJet", "MET"] #--- IMPORTANT: Trigger are extracted from the hltExoticaValidator_cfi.py module triggers = [] efficiency_strings = [] # Extract the triggers used in the hltExoticaValidator, for each path from HLTriggerOffline.Exotica.hltExoticaValidator_cfi import hltExoticaValidator as _config triggers = set([]) for an in _config.analysis: s = _config.__getattribute__(an) vstr = s.__getattribute__("hltPathsToCheck") map(lambda x: triggers.add(x.replace("_v", "")), vstr) triggers = list(triggers) print triggers #------------------------------------------------------------ # Generating the list with all the efficiencies for type in plot_types: for obj in obj_types: for trig in triggers: efficiency_strings.append(efficiency_string(obj, type, trig)) #for item in efficiency_strings: # print item add_reco_strings(efficiency_strings)
plot_types = ["TurnOn1", "TurnOn2", "TurnOn3", "TurnOn4", "EffEta", "EffPhi", "EffDxy"] #--- IMPORTANT: Update this collection whenever you introduce a new object # in the code (from EVTColContainer::getTypeString) obj_types = ["Mu","refittedStandAloneMuons","Track","Ele","Photon","PFTau","PFJet","MET","PFMET","PFMHT","GenMET","CaloJet" ,"CaloMET","l1MET"] #--- IMPORTANT: Trigger are extracted from the hltExoticaValidator_cfi.py module triggers = [ ] efficiency_strings = [] # Extract the triggers used in the hltExoticaValidator, for each path from HLTriggerOffline.Exotica.hltExoticaValidator_cfi import hltExoticaValidator as _config triggers = set([]) for an in _config.analysis: s = _config.__getattribute__(an) vstr = s.__getattribute__("hltPathsToCheck") map(lambda x: triggers.add(x.replace("_v","")),vstr) triggers = list(triggers) print triggers #------------------------------------------------------------ # Generating the list with all the efficiencies for type in plot_types: for obj in obj_types: for trig in triggers: efficiency_strings.append(efficiency_string(obj,type,trig)) #for item in efficiency_strings: # print item add_reco_strings(efficiency_strings)