5 '''Function to configure LVL1 JetEfficiency algorithm in the monitoring system.'''
8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory
import CompFactory
13 from AthenaConfiguration.Enums
import Format
16 if flags.Input.Format
is Format.POOL
and not flags.Input.isMC
and not any([
"AOD" in a
for a
in flags.Input.ProcessingTags]):
17 from JetRecConfig.JetRecConfig
import JetRecCfg
18 from JetRecConfig.StandardSmallRJets
import AntiKt4EMPFlow
19 from JetRecConfig.JetConfigFlags
import jetInternalFlags
20 jetInternalFlags.isRecoJob =
True
21 result.merge(
JetRecCfg(flags,AntiKt4EMPFlow) )
23 from eflowRec.PFCfg
import PFGlobalFlowElementLinkingCfg
24 if flags.DQ.Environment ==
"AOD":
28 from eflowRec.PFCfg
import PFGlobalFlowElementLinkingCfg
30 from METReconstruction.METAssociatorCfg
import METAssociatorCfg
32 from METUtilities.METMakerConfig
import getMETMakerAlg
39 from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig
import L1CaloMonitorCfgHelper
40 helper = L1CaloMonitorCfgHelper(flags,CompFactory.JetEfficiencyMonitorAlgorithm,
'JetEfficiencyMonAlg')
41 groupName =
'JetEfficiencyMonitor'
42 JetEfficiencyMonAlg = helper.alg
43 JetEfficiencyMonAlg.PackageName = groupName
53 JetEfficiencyMonAlg.Emulated = emulated
59 passedb4Prescale =
True
60 JetEfficiencyMonAlg.PassedBeforePrescale = passedb4Prescale
68 hltRandom_reference_triggers = [
'HLT_j0_perf_L1RD0_FILLED',
'HLT_j0_perf_pf_ftf_L1RD0_FILLED']
69 JetEfficiencyMonAlg.HLTRandomReferenceTriggers = hltRandom_reference_triggers
71 muon_reference_triggers = [
"L1_MU14FCH",
"L1_MU18VFCH",
72 "L1_MU8F_TAU20IM",
"L1_2MU8F",
"L1_MU8VF_2MU5VF",
"L1_3MU3VF",
73 "L1_MU5VF_3MU3VF",
"L1_4MU3V",
"L1_2MU5VF_3MU3V",
75 JetEfficiencyMonAlg.MuonReferenceTriggers = muon_reference_triggers
77 JetEfficiencyMonAlg.BootstrapReferenceTrigger=
'L1_J15'
78 bootstrap_trigger = JetEfficiencyMonAlg.BootstrapReferenceTrigger
80 JetEfficiencyMonAlg.HLTBootstrapReferenceTrigger=
'HLT_noalg_L1J20'
81 HLTbootstrap_trigger = JetEfficiencyMonAlg.HLTBootstrapReferenceTrigger
83 trigPath =
'Developer/JetEfficiency/'
84 distributionPath =
'Distributions/'
85 noRefPath =
'NoReferenceTrigger/'
86 muonRefPath =
'MuonReferenceTrigger/'
87 randomRefPath =
'RandomHLTReferenceTrigger/'
88 bsRefPath =
'BootstrapReferenceTrigger/'
89 bsHLTRefPath =
'BootstrapHLTReferenceTrigger/'
93 single_triggers = [
'L1_J20',
'L1_J25',
'L1_J30',
'L1_J40',
'L1_J50',
'L1_J75',
94 'L1_J85',
'L1_J100',
'L1_J120',
'L1_J400']
95 multijet_triggers = [
'L1_J85_3J30',
'L1_3J50',
'L1_4J15',
'L1_4J20']
96 LR_triggers = [
'L1_SC111-CJ15']
98 gfex_SR_triggers = [
'L1_gJ20',
'L1_gJ20p0ETA25',
'L1_gJ20p25ETA49',
'L1_gJ20p0ETA25_EMPTY',
'L1_gJ30',
'L1_gJ40',
'L1_gJ50',
'L1_gJ50p0ETA25',
'L1_gJ100',
'L1_gJ100p0ETA25',
'L1_gJ400p0ETA25' ]
99 gfex_LR_triggers = [
'L1_gLJ80',
'L1_gLJ100',
'L1_gLJ140',
'L1_gLJ140p0ETA25']
101 jfex_SR_triggers = [
'L1_jJ30',
'L1_jJ40',
'L1_jJ50',
'L1_jJ60',
102 'L1_jJ80',
'L1_jJ90',
'L1_jJ125',
'L1_jJ140',
'L1_jJ160',
'L1_jJ180']
103 jfex_LR_triggers = [
'L1_SC111-CjJ40']
106 all_SR_singletriggers = single_triggers + gfex_SR_triggers + jfex_SR_triggers
107 all_LR_singletriggers = LR_triggers + gfex_LR_triggers + jfex_LR_triggers
109 JetEfficiencyMonAlg.SmallRadiusJetTriggers_phase1_and_legacy = all_SR_singletriggers
110 JetEfficiencyMonAlg.LargeRadiusJetTriggers_phase1_and_legacy = all_LR_singletriggers
111 JetEfficiencyMonAlg.multiJet_LegacySmallRadiusTriggers = multijet_triggers
114 prescale_title_add =
" (PassBeforePrescale) "
116 prescale_title_add =
" "
118 reference_titles = {
"Muon" :
' wrt muon triggers',
119 "RandomHLT":
' wrt HLT random chain ' + hltRandom_reference_triggers[0] +
' and ' + hltRandom_reference_triggers[1],
121 "Bootstrap":
' wrt bootstrap trigger ' + bootstrap_trigger,
122 "BootstrapHLT":
' wrt HLT bootstrap chain ' + HLTbootstrap_trigger }
123 reference_paths = {
"Muon" : muonRefPath,
"RandomHLT": randomRefPath,
124 "No": noRefPath,
"Bootstrap": bsRefPath,
"BootstrapHLT": bsHLTRefPath }
125 references =
list(reference_titles.keys())
128 trigger_group_list = {
"single_triggers" : single_triggers,
129 "multijet_triggers" : multijet_triggers,
130 "LR_triggers" : LR_triggers,
131 "gfex_SR_triggers" : gfex_SR_triggers,
132 "gfex_LR_triggers" : gfex_LR_triggers,
133 "jfex_SR_triggers" : jfex_SR_triggers,
134 "jfex_LR_triggers" : jfex_LR_triggers }
135 trigger_title_modifiers = {
"single_triggers" :
"leading offline jet",
136 "multijet_triggers" :
"last offline jet of multijet",
137 "LR_triggers" :
"leading LR offline jet",
138 "gfex_SR_triggers" :
"leading offline jet",
139 "gfex_LR_triggers" :
"leading LR offline jet",
140 "jfex_SR_triggers" :
"leading offline jet",
141 "jfex_LR_triggers" :
"leading LR offline jet" }
142 trigger_groups =
list(trigger_group_list.keys())
145 title_for_prop = {
"pt" :
'pT',
"eta" :
'#eta'}
146 xlabel_for_prop = {
"pt" :
'pT [MeV]',
"eta" :
'#eta'}
147 nbins = {
"pt": 200,
"eta" :32}
148 binmin = {
"pt": -50,
"eta" :-3.3}
149 binmax = {
"pt": 1400*GeV,
"eta" :3.3}
150 properties =
list(title_for_prop.keys())
155 helper.defineHistogram(
'run',title=
'Run Number;run;Events',
157 path=trigPath,xbins=1000000,xmin=-0.5,xmax=999999.5)
159 helper.defineHistogram(
'raw_pt',title=
'pT for all leading offline jets (with no trigger requirments);PT [MeV];Events',
161 path=trigPath + distributionPath,xbins=nbins[
"pt"],xmin=binmin[
"pt"], xmax=binmax[
"pt"])
163 helper.defineHistogram(
'eta', title=
'Eta Distribution of offline jets for HLT random chain ' + hltRandom_reference_triggers[0] +
' and ' + hltRandom_reference_triggers[1] +
';#eta; Count',
165 path=trigPath + distributionPath,xbins=nbins[
"eta"],xmin=binmin[
"eta"], xmax=binmax[
"eta"])
168 for tgroup
in trigger_groups:
169 for t
in trigger_group_list[tgroup]:
170 if (
"gJ" in t)
or (
"gLJ" in t)
or (
"jLJ" in t)
or (
"jJ" in t): pathAdd =
"phase1/"
171 else: pathAdd =
"legacy/"
175 if emulated
and ((
"gJ" in t)
or (
"gLJ" in t)):
176 eff_plot_title = title_for_prop[p] +
' Efficiency' + prescale_title_add +
'of ' + trigger_title_modifiers[tgroup] +
' for EMULATED trigger ' + t + reference_titles[r]+
';'+xlabel_for_prop[p]+
'; Efficiency '
177 dist_plot_title = title_for_prop[p] +
' distribution' + prescale_title_add +
'of '+ trigger_title_modifiers[tgroup] +
' for EMULATED trigger ' + t +
';'+xlabel_for_prop[p]+
'; Count '
179 eff_plot_title = title_for_prop[p] +
' Efficiency' + prescale_title_add +
'of ' + trigger_title_modifiers[tgroup] +
' for trigger ' + t + reference_titles[r]+
';'+xlabel_for_prop[p]+
'; Efficiency '
180 dist_plot_title = title_for_prop[p] +
' distribution' + prescale_title_add +
'of '+ trigger_title_modifiers[tgroup] +
' for trigger ' + t +
';'+xlabel_for_prop[p]+
'; Count '
182 helper.defineHistogram(p+
'_'+r+
'_'+t+
','+p+
'_'+r, type=
'TEfficiency', title=eff_plot_title,
184 path=trigPath + pathAdd+ reference_paths[r], xbins=nbins[p], xmin=binmin[p], xmax=binmax[p])
186 helper.defineHistogram(p+
':'+r+
'_'+t, title=dist_plot_title,
188 path=trigPath + distributionPath, xbins=nbins[p], xmin=binmin[p], xmax=binmax[p])
192 acc = helper.result()
194 print(
"flags.DQ.Environment = " + flags.DQ.Environment )