ATLAS Offline Software
Functions
JetEfficiencyMonitorAlgorithm Namespace Reference

Functions

def JetEfficiencyMonitoringConfig (flags)
 

Function Documentation

◆ JetEfficiencyMonitoringConfig()

def JetEfficiencyMonitorAlgorithm.JetEfficiencyMonitoringConfig (   flags)
Function to configure LVL1 JetEfficiency algorithm in the monitoring system.

Definition at line 4 of file JetEfficiencyMonitorAlgorithm.py.

5  '''Function to configure LVL1 JetEfficiency algorithm in the monitoring system.'''
6 
7  # get the component factory - used for getting the algorithms
8  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9  from AthenaConfiguration.ComponentFactory import CompFactory
10  result = ComponentAccumulator()
11 
12 
13  from AthenaConfiguration.Enums import Format
14 
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) )
22 
23  from eflowRec.PFCfg import PFGlobalFlowElementLinkingCfg
24  if flags.DQ.Environment == "AOD":
25  result.merge(PFGlobalFlowElementLinkingCfg(flags, useMuonTopoClusters=True))
26  else:
27  result.merge(PFGlobalFlowElementLinkingCfg(flags))
28  from eflowRec.PFCfg import PFGlobalFlowElementLinkingCfg
29  result.merge(PFGlobalFlowElementLinkingCfg(flags))
30  from METReconstruction.METAssociatorCfg import METAssociatorCfg
31  result.merge(METAssociatorCfg(flags, 'AntiKt4EMPFlow'))
32  from METUtilities.METMakerConfig import getMETMakerAlg
33  metCA=ComponentAccumulator()
34  metCA.addEventAlgo(getMETMakerAlg('AntiKt4EMPFlow'))
35  result.merge(metCA)
36 
37 
38  # make the athena monitoring helper
39  from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig import L1CaloMonitorCfgHelper
40  helper = L1CaloMonitorCfgHelper(flags,CompFactory.JetEfficiencyMonitorAlgorithm,'JetEfficiencyMonAlg')
41  groupName = 'JetEfficiencyMonitor' # the monitoring group name is also used for the package name
42  JetEfficiencyMonAlg = helper.alg
43  JetEfficiencyMonAlg.PackageName = groupName
44 
45 
46 
50 
51  # Do we want to emulate the Phase 1 triggers?
52  emulated = False
53  JetEfficiencyMonAlg.Emulated = emulated
54 
55  # We can choose if we want to use pass before prescale, or not when defining our trigger efficiency
56  # generally only want to use pass before prescale when considering the efficiency of a trigger for
57  # internal evaluation of how triggers are behaving
58  # the prescaling is an important feature of real utility if a
59  passedb4Prescale = True
60  JetEfficiencyMonAlg.PassedBeforePrescale = passedb4Prescale
61 
62 
66 
67  #define the various reference triggers
68  hltRandom_reference_triggers = ['HLT_j0_perf_L1RD0_FILLED', 'HLT_j0_perf_pf_ftf_L1RD0_FILLED']
69  JetEfficiencyMonAlg.HLTRandomReferenceTriggers = hltRandom_reference_triggers
70 
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",
74  "L1_RD0_FILLED"]
75  JetEfficiencyMonAlg.MuonReferenceTriggers = muon_reference_triggers
76 
77  JetEfficiencyMonAlg.BootstrapReferenceTrigger='L1_J15'
78  bootstrap_trigger = JetEfficiencyMonAlg.BootstrapReferenceTrigger
79 
80  JetEfficiencyMonAlg.HLTBootstrapReferenceTrigger='HLT_noalg_L1J20'
81  HLTbootstrap_trigger = JetEfficiencyMonAlg.HLTBootstrapReferenceTrigger
82 
83  trigPath = 'Developer/JetEfficiency/'
84  distributionPath = 'Distributions/'
85  noRefPath = 'NoReferenceTrigger/'
86  muonRefPath = 'MuonReferenceTrigger/'
87  randomRefPath = 'RandomHLTReferenceTrigger/'
88  bsRefPath = 'BootstrapReferenceTrigger/'
89  bsHLTRefPath = 'BootstrapHLTReferenceTrigger/'
90  GeV = 1000
91 
92  # add monitoring algorithm to group, with group name and main directory
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']
97 
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']
100 
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']
104 
105 
106  all_SR_singletriggers = single_triggers + gfex_SR_triggers + jfex_SR_triggers
107  all_LR_singletriggers = LR_triggers + gfex_LR_triggers + jfex_LR_triggers
108 
109  JetEfficiencyMonAlg.SmallRadiusJetTriggers_phase1_and_legacy = all_SR_singletriggers
110  JetEfficiencyMonAlg.LargeRadiusJetTriggers_phase1_and_legacy = all_LR_singletriggers
111  JetEfficiencyMonAlg.multiJet_LegacySmallRadiusTriggers = multijet_triggers
112 
113  if passedb4Prescale:
114  prescale_title_add = " (PassBeforePrescale) "
115  else:
116  prescale_title_add = " "
117 
118  reference_titles = {"Muon" : ' wrt muon triggers',
119  "RandomHLT": ' wrt HLT random chain ' + hltRandom_reference_triggers[0] + ' and ' + hltRandom_reference_triggers[1],
120  "No": '',
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())
126 
127 
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())
143 
144 
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())
151 
152 
153 
154 
155  helper.defineHistogram('run',title='Run Number;run;Events',
156  fillGroup=groupName,
157  path=trigPath,xbins=1000000,xmin=-0.5,xmax=999999.5)
158 
159  helper.defineHistogram('raw_pt',title='pT for all leading offline jets (with no trigger requirments);PT [MeV];Events',
160  fillGroup=groupName,
161  path=trigPath + distributionPath,xbins=nbins["pt"],xmin=binmin["pt"], xmax=binmax["pt"])
162 
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',
164  fillGroup=groupName,
165  path=trigPath + distributionPath,xbins=nbins["eta"],xmin=binmin["eta"], xmax=binmax["eta"])
166 
167 
168  for tgroup in trigger_groups: #iterate through the trigger groups
169  for t in trigger_group_list[tgroup]: #pull out trigger of interest
170  if ("gJ" in t) or ("gLJ" in t) or ("jLJ" in t) or ("jJ" in t): pathAdd = "phase1/"
171  else: pathAdd = "legacy/"
172  for r in references: #iteratate through the refernce trigger options
173  for p in properties:
174 
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 '
178  else:
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 '
181 
182  helper.defineHistogram(p+'_'+r+'_'+t+','+p+'_'+r, type='TEfficiency', title=eff_plot_title,
183  fillGroup=groupName,
184  path=trigPath + pathAdd+ reference_paths[r], xbins=nbins[p], xmin=binmin[p], xmax=binmax[p])
185 
186  helper.defineHistogram(p+':'+r+'_'+t, title=dist_plot_title,
187  fillGroup=groupName,
188  path=trigPath + distributionPath, xbins=nbins[p], xmin=binmin[p], xmax=binmax[p])
189 
190 
191 
192  acc = helper.result()
193  result.merge(acc)
194  print("flags.DQ.Environment = " + flags.DQ.Environment )
195  return result
196 
197 
198 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
METMakerConfig.getMETMakerAlg
def getMETMakerAlg(suffix, jetSelection="Tier0", jetColl="")
Definition: METMakerConfig.py:41
METAssociatorCfg
Definition: METAssociatorCfg.py:1
python.JetRecConfig.JetRecCfg
def JetRecCfg(flags, jetdef, returnConfiguredDef=False)
Top level functions returning ComponentAccumulator out of JetDefinition.
Definition: JetRecConfig.py:37
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
JetEfficiencyMonitorAlgorithm.JetEfficiencyMonitoringConfig
def JetEfficiencyMonitoringConfig(flags)
Definition: JetEfficiencyMonitorAlgorithm.py:4
PFCfg.PFGlobalFlowElementLinkingCfg
def PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs)
Definition: PFCfg.py:455