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 result.merge(
JetRecCfg(flags,AntiKt4EMPFlow) )
21 from eflowRec.PFCfg
import PFGlobalFlowElementLinkingCfg
22 if flags.DQ.Environment ==
"AOD":
26 from eflowRec.PFCfg
import PFGlobalFlowElementLinkingCfg
28 from METReconstruction.METAssociatorCfg
import METAssociatorCfg
30 from METUtilities.METMakerConfig
import getMETMakerAlg
37 from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig
import L1CaloMonitorCfgHelper
38 helper = L1CaloMonitorCfgHelper(flags,CompFactory.JetEfficiencyMonitorAlgorithm,
'JetEfficiencyMonAlg')
39 groupName =
'JetEfficiencyMonitor'
40 JetEfficiencyMonAlg = helper.alg
41 JetEfficiencyMonAlg.PackageName = groupName
53 passedb4Prescale =
True
54 JetEfficiencyMonAlg.PassedBeforePrescale = passedb4Prescale
62 hltRandom_reference_triggers = [
'HLT_j0_perf_L1RD0_FILLED',
'HLT_j0_perf_pf_ftf_L1RD0_FILLED']
63 JetEfficiencyMonAlg.HLTRandomReferenceTriggers = hltRandom_reference_triggers
65 muon_reference_triggers = [
"L1_MU14FCH",
"L1_MU18VFCH",
"L1_MU8F_TAU20IM",
"L1_2MU8F",
"L1_MU8VF_2MU5VF",
"L1_3MU3VF",
"L1_MU5VF_3MU3VF",
"L1_4MU3V",
"L1_2MU5VF_3MU3V",
"L1_RD0_FILLED"]
66 JetEfficiencyMonAlg.MuonReferenceTriggers = muon_reference_triggers
68 JetEfficiencyMonAlg.BootstrapReferenceTrigger=
'L1_J15'
70 trigPath =
'Developer/JetEfficiency/'
71 ExpertTrigPath =
'Expert/Efficiency/'
72 distributionPath =
'Distributions/'
73 noRefPath =
'NoReferenceTrigger/'
74 muonRefPath =
'MuonReferenceTrigger/'
75 randomRefPath =
'RandomHLTReferenceTrigger/'
76 bsRefPath =
'BootstrapReferenceTrigger/'
81 multijet_triggers = []
84 gfex_SR_triggers = [
'L1_gJ20p0ETA25',
'L1_gJ50p0ETA25',
'L1_gJ100p0ETA25',
'L1_gJ400p0ETA25' ]
85 gfex_LR_triggers = [
'L1_gLJ80p0ETA25',
'L1_gLJ100p0ETA25',
'L1_gLJ140p0ETA25',
'L1_gLJ160p0ETA25']
87 jfex_SR_triggers = [
'L1_jJ30',
'L1_jJ40',
'L1_jJ50',
'L1_jJ60',
'L1_jJ80',
'L1_jJ90',
'L1_jJ125',
'L1_jJ140',
'L1_jJ160',
'L1_jJ180']
88 jfex_LR_triggers = [
'L1_SC111-CjJ40']
91 all_SR_singletriggers = single_triggers + gfex_SR_triggers + jfex_SR_triggers
92 all_LR_singletriggers = LR_triggers + gfex_LR_triggers + jfex_LR_triggers
94 JetEfficiencyMonAlg.SmallRadiusJetTriggers_phase1 = all_SR_singletriggers
95 JetEfficiencyMonAlg.LargeRadiusJetTriggers_phase1 = all_LR_singletriggers
96 JetEfficiencyMonAlg.multiJet_LegacySmallRadiusTriggers = multijet_triggers
98 reference_paths = {
"Muon" : muonRefPath,
"RandomHLT": randomRefPath,
"No": noRefPath,
"Bootstrap": bsRefPath}
99 references = [
"Muon",
"No",
"Bootstrap"]
102 trigger_group_list = {
"gfex_SR_triggers" : gfex_SR_triggers,
103 "gfex_LR_triggers" : gfex_LR_triggers,
104 "jfex_SR_triggers" : jfex_SR_triggers,
105 "jfex_LR_triggers" : jfex_LR_triggers }
106 trigger_groups =
list(trigger_group_list.keys())
108 xlabel_for_prop = {
"SRpt" :
'pT [MeV]',
"SReta" :
'#eta',
"LRpt" :
'pT [MeV]',
"LReta" :
'#eta'}
109 nbins = {
"SRpt": 220,
"SReta" :32,
"LRpt": 220,
"LReta" :32}
110 binmin = {
"SRpt": -50,
"SReta" :-3.3,
"LRpt": -50,
"LReta" :-3.3}
111 binmax = {
"SRpt": 1800*GeV,
"SReta" :3.3,
"LRpt": 1800*GeV,
"LReta" :3.3}
112 properties = [
"SRpt",
"LRpt"]
115 plotDistrubutions =
False
116 if plotDistrubutions:
117 helper.defineHistogram(
'raw_pt',title=
'pT for all leading offline jets (with no trigger requirments);PT [MeV];Events', fillGroup=groupName, path=trigPath + distributionPath, xbins=nbins[
"SRpt"], xmin=binmin[
"SRpt"], xmax=binmax[
"SRpt"])
119 helper.defineHistogram(
'raw_eta', title=
'Eta Distribution for all leading offline jets (with no trigger requirments);#eta; Count', fillGroup=groupName, path=trigPath + distributionPath, xbins=nbins[
"SReta"], xmin=binmin[
"SReta"], xmax=binmax[
"SReta"])
123 threshold_dict = {
"L1_gJ20p0ETA25" : [55e3, 75e3],
124 "L1_gJ50p0ETA25" : [110e3, 180e3],
125 "L1_gJ100p0ETA25" : [195e3, 3000e3],
126 "L1_gJ400p0ETA25" : [620e3, 900e3],
127 "L1_gLJ80p0ETA25" : [125e3, 200e3],
128 "L1_gLJ100p0ETA25" : [150e3, 240e3],
129 "L1_gLJ140p0ETA25" : [210e3, 315e3],
130 "L1_gLJ160p0ETA25" : [240e3, 260e3],
131 "L1_jJ30" : [50e3, 85e3],
132 "L1_jJ40" : [55e3, 90e3],
133 "L1_jJ50" : [60e3, 100e3],
134 "L1_jJ60" : [90e3, 130e3],
135 "L1_jJ80" : [90e3, 155e3],
136 "L1_jJ90" : [110e3, 185e3],
137 "L1_jJ125" : [145e3, 230e3],
138 "L1_jJ140" : [160e3, 225e3],
139 "L1_jJ160" : [180e3, 260e3],
140 "L1_jJ180" : [235e3, 320e3],
141 "L1_SC111-CjJ40": [195e3, 300e3],
145 for tgroup
in trigger_groups:
146 for t
in trigger_group_list[tgroup]:
147 if "g" in t: pathAdd =
"gFEX/"
148 elif "j" in t: pathAdd =
"jFEX/"
151 thresholdConfig = {
"Plateau":plateau_dict.get(t,[0.99,0.95])}
152 xMaxConfig =
min(threshold_dict[t][1]*2.5, binmax[
"SRpt"])
153 if t
in threshold_dict: thresholdConfig[
"Threshold"] = threshold_dict[t]
154 helper.defineDQAlgorithm(
"JetEfficiency_"+t,
155 hanConfig={
"libname":
"libdqm_algorithms.so",
"name":
"Simple_fermi_Fit_TEff",
"xmax":xMaxConfig,
"ImproveFit":1},
156 thresholdConfig=thresholdConfig
160 eff_plot_title = t+
';'+xlabel_for_prop[p]+
'; Efficiency '
163 if r ==
"Muon" and p
in [
"SRpt",
"LRpt"]:
164 helper.defineHistogram(f
"bool_{r}_{t}, val_{p};{p}_{t}", type=
'TEfficiency', title=eff_plot_title, fillGroup=groupName, path=ExpertTrigPath + pathAdd+ reference_paths[r], xbins=nbins[p], xmin=binmin[p], xmax=binmax[p], hanConfig={
"algorithm":
"JetEfficiency_"+t})
166 helper.defineHistogram(f
"bool_{r}_{t}, val_{p};{p}_{t}", type=
'TEfficiency', title=eff_plot_title, fillGroup=groupName, path=trigPath + pathAdd+ reference_paths[r], xbins=nbins[p], xmin=binmin[p], xmax=binmax[p])
170 acc = helper.result()
172 print(
"flags.DQ.Environment = " + flags.DQ.Environment )
177 if __name__==
'__main__':
179 from AthenaCommon.Logging
import log
184 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
189 inputs = glob.glob(
'/eos/atlas/atlastier0/rucio/data18_13TeV/physics_Main/00354311/data18_13TeV.00354311.physics_Main.recon.ESD.f1129/data18_13TeV.00354311.physics_Main.recon.ESD.f1129._lb0013._SFO-8._0001.1')
192 flags.Input.Files = inputs
193 flags.Output.HISTFileName =
'ExampleMonitorOutput_LVL1.root'
199 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
200 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
205 cfg.merge(JetEfficiencyMonitorCfg)
209 JetEfficiencyMonitorCfg.getEventAlgo(
'JetEfficiencyMonAlg').OutputLevel = 1