5 '''@file MTMonitoring.py
6 @authors P-A. Delsart, Jona Bossio
8 @brief Python configuration for the Run III Trigger Jet Monitoring
11 from AthenaCommon.Logging
import logging
12 logger = logging.getLogger(__name__)
14 from TrigDecisionTool.TrigDecisionToolConfig
import getRun3NavigationContainerFromInput
31 OfflineJetCollections = dict()
33 OfflineJetCollections[
'pp'] = {
34 'AntiKt4EMTopoJets' : {
'MatchTo' :
'AntiKt4EMPFlowJets' },
35 'AntiKt4EMPFlowJets' : {
'MatchTo' :
'NONE' },
39 OfflineJetCollections[
'HI'] = {
40 'AntiKt4HIJets' : {
'MatchTo' :
'AntiKt4HIJets' },
51 L1JetCollections = dict()
53 match_smallRL1_OfflineJets_List = [
'AntiKt4EMPFlowJets',
'HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf']
55 match_largeRL1_OfflineJets_List = [
'AntiKt4EMPFlowJets',
'HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf']
56 match_HIL1_OfflineJets_List = [
'AntiKt4HIJets',
'HLT_AntiKt4HIJets']
58 L1JetCollections[
'pp'] = {
59 'L1_jFexSRJetRoI': {
'MatchTo': match_smallRL1_OfflineJets_List},
60 'L1_gFexSRJetRoI': {
'MatchTo': match_smallRL1_OfflineJets_List},
61 'L1_gFexLRJetRoI': {
'MatchTo': match_largeRL1_OfflineJets_List},
64 L1JetCollections[
'HI'] = {
65 'L1_jFexSRJetRoI': {
'MatchTo': match_HIL1_OfflineJets_List},
66 'L1_gFexSRJetRoI': {
'MatchTo': match_HIL1_OfflineJets_List},
69 for case
in L1JetCollections.keys():
71 items = L1JetCollections[case].
items()
72 except (AttributeError, TypeError):
73 raise RuntimeError(
'L1JetCollections for %s is not a mapping type'%case)
78 except (AttributeError, TypeError):
79 raise RuntimeError(
'L1JetCollections value for %s is not a mapping type'%case)
81 if 'MatchTo' not in d:
82 errmsg =
'L1Collections entry %s has no (possibly empty) MatchType list' % (
84 raise RuntimeError(errmsg)
94 'L1_jFexSRJetRoI':
'L1jFexSRJetRoIContainerName',
95 'L1_gFexSRJetRoI':
'L1gFexJetRoIContainerName',
96 'L1_gFexLRJetRoI':
'L1gFexJetRoIContainerName',
99 for case
in L1JetCollections.keys():
100 for k, d
in L1JetCollections[case].
items():
102 if k
not in l1Coll2MatcherKey:
103 errmsg =
'Match(es) to an L1 container requested entry '\
104 '%s but no C++ MatcherAlg attribute name provided' % (
str(k),)
105 raise RuntimeError(errmsg)
111 Chain2L1JetCollDict = dict()
113 Chain2L1JetCollDict[
'pp'] = {
115 'L1_jJ40': [
'L1_jFexSRJetRoI'],
116 'L1_jJ50': [
'L1_jFexSRJetRoI'],
117 'L1_jJ160': [
'L1_jFexSRJetRoI'],
118 'L1_jJ85p0ETA21_3jJ40p0ETA25': [
'L1_jFexSRJetRoI'],
119 'L1_3jJ70p0ETA23': [
'L1_jFexSRJetRoI'],
120 'L1_4jJ40': [
'L1_jFexSRJetRoI'],
123 'L1_gJ20p0ETA25': [
'L1_gFexSRJetRoI'],
124 'L1_gJ50p0ETA25': [
'L1_gFexSRJetRoI'],
125 'L1_gJ100p0ETA25': [
'L1_gFexSRJetRoI'],
126 'L1_gJ400p0ETA25': [
'L1_gFexSRJetRoI'],
128 'L1_gLJ80p0ETA25': [
'L1_gFexLRJetRoI'],
129 'L1_gLJ100p0ETA25': [
'L1_gFexLRJetRoI'],
130 'L1_gLJ140p0ETA25': [
'L1_gFexLRJetRoI'],
131 'L1_gLJ160p0ETA25': [
'L1_gFexLRJetRoI'],
133 'L1_SC111-CjJ40': [
'L1_jFexSRJetRoI'],
134 'L1_HT190-jJ40s5pETA21': [
'L1_jFexSRJetRoI'],
137 Chain2L1JetCollDict[
'HI'] = {
138 'L1_jJTE20': [
'L1_jFexSRJetRoI'],
140 'L1_jJ10': [
'L1_jFexSRJetRoI'],
141 'L1_jJ20': [
'L1_jFexSRJetRoI'],
143 'L1_jJ10p30ETA49': [
'L1_jFexSRJetRoI'],
153 JetCollections = dict()
155 JetCollections[
'pp'] = {
156 'HLT_AntiKt4EMTopoJets_subjesIS' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
157 'HLT_AntiKt4EMTopoJets_subjesIS_fastftag' : {
'MatchTo' :
'NONE'},
158 'HLT_AntiKt4EMTopoJets_subresjesgscIS_ftf' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
159 'HLT_AntiKt4EMTopoJets_subjesgscIS_ftf' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
160 'HLT_AntiKt4EMPFlowJets_subjesgscIS_ftf' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
161 'HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
162 'HLT_AntiKt4EMPFlowJets_nojcalib_ftf' : {
'MatchTo' :
'NONE'},
163 'HLT_AntiKt10EMTopoRCJets_subjesIS' : {
'MatchTo' :
'NONE'},
164 'HLT_AntiKt10LCTopoJets_subjes' : {
'MatchTo' :
'NONE'},
165 'HLT_AntiKt10LCTopoTrimmedPtFrac4SmallR20Jets_jes' : {
'MatchTo' :
'NONE'},
166 'HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_nojcalib_ftf' : {
'MatchTo' :
'NONE'},
167 'HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf' : {
'MatchTo' :
'NONE'},
170 JetCollections[
'HI'] = {
171 'HLT_AntiKt4HIJets' : {
'MatchTo':
'AntiKt4HIJets'},
172 'HLT_AntiKt4EMPFlowJets_jes_ftf' : {
'MatchTo':
'AntiKt4HIJets'},
173 'HLT_AntiKt4EMTopoJets_subjesIS' : {
'MatchTo':
'AntiKt4HIJets'},
179 Chains2Monitor = dict()
180 from TrigConfigSvc.TriggerConfigAccess
import getHLTMonitoringAccess
185 ListOfMonChains = monAccess.monitoredChains(signatures=
"jetMon", monLevels = [
"shifter",
"t0"])
187 default_dict = {
"HLTColl":
"NONE",
"RefChain":
"NONE" ,
"OfflineColl":
"NONE"}
188 Chains2Monitor[monMode] = dict((chain, default_dict.copy())
for chain
in ListOfMonChains)
191 for chainName
in Chains2Monitor[
'HI']:
192 if '_ionp_' in chainName:
193 Chains2Monitor[
'HI'][chainName][
"HLTColl"] =
"HLT_AntiKt4HIJets"
194 Chains2Monitor[
'HI'][chainName][
"OfflineColl"] =
"AntiKt4HIJets"
195 elif '_pf_ftf_' in chainName:
196 Chains2Monitor[
'HI'][chainName][
"HLTColl"] =
"HLT_AntiKt4EMPFlowJets_jes_ftf"
197 Chains2Monitor[
'HI'][chainName][
"OfflineColl"] =
"AntiKt4EMPFlowJets"
199 Chains2Monitor[
'HI'][chainName][
"HLTColl"] =
"HLT_AntiKt4EMTopoJets_subjesIS"
200 Chains2Monitor[
'HI'][chainName][
"OfflineColl"] =
"AntiKt4HIJets"
204 if Chains2Monitor[
'HI'].
get(
'HLT_j60_ion_L1jJ40'): Chains2Monitor[
'HI'][
'HLT_j60_ion_L1jJ40'].update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
205 if Chains2Monitor[
'HI'].
get(
'HLT_j75_ion_L1jJ60'): Chains2Monitor[
'HI'][
'HLT_j75_ion_L1jJ60'].update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
206 if Chains2Monitor[
'HI'].
get(
'HLT_j85_ion_L1jJ60'): Chains2Monitor[
'HI'][
'HLT_j85_ion_L1jJ60'].update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
207 if Chains2Monitor[
'HI'].
get(
'HLT_j150_ion_L1jJ90'): Chains2Monitor[
'HI'][
'HLT_j150_ion_L1jJ90'].update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
208 if Chains2Monitor[
'HI'].
get(
'HLT_j200_ion_L1jJ90'): Chains2Monitor[
'HI'][
'HLT_j200_ion_L1jJ90'].update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
210 if Chains2Monitor[
'HI'].
get(
'HLT_j50f_ion_L1jJ40p30ETA49'): Chains2Monitor[
'HI'][
'HLT_j50f_ion_L1jJ40p30ETA49'].update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
211 if Chains2Monitor[
'HI'].
get(
'HLT_j60f_ion_L1jJ40p30ETA49'): Chains2Monitor[
'HI'][
'HLT_j60f_ion_L1jJ40p30ETA49'].update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
215 if Chains2Monitor[
'HI'].
get(
'HLT_j20_L1jJ10'): Chains2Monitor[
'HI'][
'HLT_j20_L1jJ10'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
216 if Chains2Monitor[
'HI'].
get(
'HLT_j40_L1jJ20'): Chains2Monitor[
'HI'][
'HLT_j40_L1jJ20'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
217 if Chains2Monitor[
'HI'].
get(
'HLT_j30a_L1jTE20'): Chains2Monitor[
'HI'][
'HLT_j30a_L1jTE20'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
218 if Chains2Monitor[
'HI'].
get(
'HLT_j25f_L1jJ10p30ETA49'): Chains2Monitor[
'HI'][
'HLT_j25f_L1jJ10p30ETA49'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
221 if Chains2Monitor[
'HI'].
get(
'HLT_j20_ionp_L1jJ10'): Chains2Monitor[
'HI'][
'HLT_j20_ionp_L1jJ10'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
222 if Chains2Monitor[
'HI'].
get(
'HLT_j40_ionp_L1jJ20'): Chains2Monitor[
'HI'][
'HLT_j40_ionp_L1jJ20'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
223 if Chains2Monitor[
'HI'].
get(
'HLT_j30a_ionp_L1jTE20'): Chains2Monitor[
'HI'][
'HLT_j30a_ionp_L1jTE20'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
224 if Chains2Monitor[
'HI'].
get(
'HLT_j25f_ionp_L1jJ10p30ETA49'): Chains2Monitor[
'HI'][
'HLT_j25f_ionp_L1jJ10p30ETA49'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
227 if Chains2Monitor[
'HI'].
get(
'HLT_j20_pf_ftf_L1jJ10'): Chains2Monitor[
'HI'][
'HLT_j20_pf_ftf_L1jJ10'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
228 if Chains2Monitor[
'HI'].
get(
'HLT_j40_pf_ftf_L1jJ20'): Chains2Monitor[
'HI'][
'HLT_j40_pf_ftf_L1jJ20'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
229 if Chains2Monitor[
'HI'].
get(
'HLT_j30a_pf_ftf_L1jTE20'): Chains2Monitor[
'HI'][
'HLT_j30a_pf_ftf_L1jTE20'].update({
"RefChain":
"HLT_mb_sptrk_L1TRT_FILLED",
"OfflineColl":
"AntiKt4HIJets"})
231 elif monMode ==
"pp":
233 for chainName
in Chains2Monitor[
'pp']:
234 Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt4EMTopoJets_subjesIS"
235 if '_pf_' in chainName
and 'a10' not in chainName:
236 Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf"
237 Chains2Monitor[
'pp'][chainName][
"OfflineColl"] =
"AntiKt4EMPFlowJets"
238 elif 'a10' in chainName:
239 if 'a10t' in chainName: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10LCTopoTrimmedPtFrac4SmallR20Jets_jes"
240 elif 'sd_cssk_pf' in chainName: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf"
241 elif 'a10r' in chainName: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10EMTopoRCJets_subjesIS"
242 else: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10LCTopoJets_subjes"
243 elif '_noalg_' in chainName:
244 Chains2Monitor[
'pp'][chainName][
"RefChain"] =
"HLT_j45_pf_ftf_preselj20_L1jJ40"
245 Chains2Monitor[
'pp'][chainName][
"OfflineColl"] =
"AntiKt4EMPFlowJets"
246 if 'gLJ' in chainName: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf"
250 if Chains2Monitor[
'pp'].
get(
'HLT_j420_L1jJ160'): Chains2Monitor[
'pp'][
'HLT_j420_L1jJ160'].update({
"RefChain":
"HLT_j85_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
251 if Chains2Monitor[
'pp'].
get(
'HLT_3j200_L1jJ160'): Chains2Monitor[
'pp'][
'HLT_3j200_L1jJ160'].update({
"RefChain":
"HLT_j85_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
252 if Chains2Monitor[
'pp'].
get(
'HLT_4j120_L13jJ90'): Chains2Monitor[
'pp'][
'HLT_4j120_L13jJ90'].update({
"RefChain":
"HLT_j85_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
253 if Chains2Monitor[
'pp'].
get(
'HLT_5j80_pf_ftf_presel5j50_L14jJ40'): Chains2Monitor[
'pp'][
'HLT_5j80_pf_ftf_presel5j50_L14jJ40'].update({
"RefChain":
"HLT_j45_pf_ftf_preselj20_L1jJ40",
"OfflineColl":
"AntiKt4EMPFlowJets"})
254 if Chains2Monitor[
'pp'].
get(
'HLT_j400_pf_ftf_L1jJ160'): Chains2Monitor[
'pp'][
'HLT_j400_pf_ftf_L1jJ160'].update({
"RefChain":
"HLT_j85_pf_ftf_preselj50_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
255 if Chains2Monitor[
'pp'].
get(
'HLT_j400_pf_ftf_preselj225_L1jJ160'): Chains2Monitor[
'pp'][
'HLT_j400_pf_ftf_preselj225_L1jJ160'].update({
"RefChain":
"HLT_j85_pf_ftf_preselj50_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
258 errmsg =
'Returned empty Chains2Monitor due to invalid monMode'
259 raise RuntimeError(errmsg)
260 return Chains2Monitor
267 etaMin,etaMax = 0,2.5
269 if 'eta490_j' in chain:
270 etaMin,etaMax = 0,4.9
272 etaParts = chain.split(
'eta')
273 etaMinTemp = etaParts[0].
split(
'_')
274 etaMin = etaMinTemp[len(etaMinTemp)-1]
275 etaMin =
int(etaMin)/10
276 etaMax = etaParts[1].
split(
'_')[0]
277 etaMax =
int(etaMax)/10
280 etaMin,etaMax = 3.2,4.9
283 etaMin,etaMax = 0,4.9
289 xbins, xmin, xmax = 160,0.,800000.
291 if varname ==
"pt" or varname ==
"et":
293 if 'jJ500' in chain
or 'J400' in chain:
return 160,xmin,800000
294 else:
return 100,xmin,500000
297 threshold =
int(re.search(
r'\d+',chain.split(
"_")[1].
split(
'j')[1]).
group())
299 return 40, 0., 100000.
301 return 36, 20000., 200000.
304 xmin = 50000.+100000.*(
int(threshold/100)-1)
305 if threshold % 100 == 0:
306 xmin = 1000.*(threshold - 100.)
307 xmax = xmin + 200000.
317 xbins, xmin, xmax = 35, 30000., 100000.
318 return xbins, xmin, xmax
321 parts = chain.split(
'HT')
322 threshold = parts[1].
split(
'_')[0]
323 if 'XX' in threshold:
324 threshold = threshold.split(
'XX')[0]
325 xmin =
int(0.9 *
int(threshold))
327 xbins =
int((xmax-xmin)/binwidth)-1
328 return xbins, xmin, xmax
336 xvar = f
"{network_prefix}_p{f}"
337 varname = f
"ftag_p{f}"
338 fillerTools += [HistoSpec(varname, xvar=xvar, bins=(70, -0.2, 1.2), title=f
"{varname};{varname};;Entries")]
339 fastDipsSelectSpec = SelectSpec(f
"{network_prefix}_{cutname}",
'20<pt:GeV&|eta|<3.2', path=
'NoTriggerSelection/'+cutname, FillerTools=fillerTools)
340 conf.appendHistos(fastDipsSelectSpec)
345 from JetMonitoring.JetMonitoringConfig
import JetMonAlgSpec, HistoSpec, EventHistoSpec, SelectSpec, ToolSpec
346 from AthenaConfiguration.ComponentFactory
import CompFactory
349 ExtraOfflineHists = [
356 "TrackWidthPt1000[0]",
361 ExtraSmallROnlineHists = [
362 HistoSpec(
'et:GeV;eta', (100,0,750, 50,-5,5) , title=
'#eta vs E_{T};E_{T} [GeV];#eta;Entries'),
373 ExtraLargeROnlineHists = [
376 ExtraOnlineNJetHists = [
381 OfflineScaleMomenta = [
"ConstitScale",
"EMScale",
"PileupScale",
"EtaJESScale"]
382 OnlineScaleMomenta = [
"ConstitScale" ]
383 for var
in [
"pt",
"eta",
"m" ]:
384 for offlinescale
in OfflineScaleMomenta:
385 ExtraOfflineHists.append(
"Jet"+offlinescale+
"Momentum_"+var)
386 for onlinescale
in OnlineScaleMomenta:
387 ExtraSmallROnlineHists.append(
"Jet"+onlinescale+
"Momentum_"+var)
389 OnlineScaleMomenta.append(
"")
390 OfflineScaleMomenta.append(
"")
395 Schedules JetCopier tool to make a shallow copy of
396 the original offline/HLT jet container, for the JetMatcherAlg to decorate.
397 This prevents our jet monitoring from decorating
398 the original jet containers, which may end up being
399 persistified in AOD/ESD (ATLASRECTS-7168,ATR-27980,ATR-26076)
401 jcopy = CompFactory.JetCopier(
408 jprovider = CompFactory.JetRecAlg(
409 "jetalg_copy_"+outjets,
412 OutputContainer = outjets,
419 Schedules L1JetCopyAlgorithm to make a shallow copy of
420 the original L1 jet container, for the JetMatcherAlg to decorate.
421 This prevents our jet monitoring from decorating
422 the original jet containers, which may end up being
423 persistified in AOD/ESD (ATLASRECTS-7168,ATR-27980,ATR-26076).
424 The L1JetCopyAlgorithm is a templated class (e.g. L1JetCopyAlgorithm<JTM_JetRoIContainer>).
425 The python class name is what is generated by Athena during build time.
426 The template types are defined in JTMContainers.h.
429 jcopy_alg_name =
"l1jetcopy_alg_"+injets
430 if injets ==
"L1_jFexSRJetRoI":
431 jcopy_alg = CompFactory.L1JetCopyAlgorithm_JTM_jFexSRJetRoIContainer_(jcopy_alg_name)
432 elif injets
in [
"L1_gFexSRJetRoI",
"L1_gFexLRJetRoI"]:
433 jcopy_alg = CompFactory.L1JetCopyAlgorithm_JTM_gFexJetRoIContainer_(jcopy_alg_name)
435 raise ValueError(f
"L1 jet container {injets} not recognised")
436 jcopy_alg.JetInContainerName = injets
437 jcopy_alg.JetOutContainerName = outjets
443 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
447 if inputFlags.Reco.EnableHI: monMode =
'HI'
455 for chain,chaindict
in Chains2Monitor[monMode].
items():
456 if chaindict[
'HLTColl']
not in JetCollections[case]:
457 JetCollections[case][chaindict[
'HLTColl']] = {
'MatchTo':
'NONE'}
460 CopiedJetCollections = copy.deepcopy(JetCollections)
461 for hltColl,collDict
in JetCollections[monMode].
items():
462 if collDict[
'MatchTo'] !=
'NONE':
463 copiedhltColl = f
'{hltColl}_{copySuffix}'
464 CopiedJetCollections[monMode][copiedhltColl] = CopiedJetCollections[monMode].pop(hltColl)
466 jetcopyalg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
468 cfg.addEventAlgo(jetcopyalg)
469 for jetcalibscale
in OnlineScaleMomenta:
470 scalestring =
"_"+jetcalibscale
if jetcalibscale !=
"" else ""
471 name =
'Matching_{}{}_{}'.
format(hltColl,scalestring,collDict[
'MatchTo'])
472 alg = CompFactory.JetMatcherAlg(name,
473 JetContainerName1=copiedhltColl,
474 JetContainerName2=collDict[
'MatchTo'],
475 JetCalibScale=jetcalibscale)
477 alg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
479 cfg.addEventAlgo(alg)
482 CopiedOfflineJetCollections = copy.deepcopy(OfflineJetCollections)
483 for offjetColl,collDict
in OfflineJetCollections[monMode].
items():
484 if collDict[
'MatchTo'] !=
'NONE':
485 copiedjetcoll = f
'{offjetColl}_{copySuffix}'
486 CopiedOfflineJetCollections[monMode][copiedjetcoll] = CopiedOfflineJetCollections[monMode].pop(offjetColl)
488 cfg.addEventAlgo(jetcopyalg)
489 for jetcalibscale
in OfflineScaleMomenta:
490 scalestring =
"_"+jetcalibscale
if jetcalibscale !=
"" else ""
491 name =
'Matching_{}{}_{}'.
format(offjetColl,scalestring,collDict[
'MatchTo'])
492 alg = CompFactory.JetMatcherAlg(name,
493 JetContainerName1=copiedjetcoll,
494 JetContainerName2=collDict[
'MatchTo'],
495 JetCalibScale=jetcalibscale)
497 alg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
499 cfg.addEventAlgo(alg)
503 CopiedL1JetCollections = copy.deepcopy(L1JetCollections)
504 for l1jetColl,collDict
in L1JetCollections[monMode].
items():
505 copiedl1jetColl = f
'{l1jetColl}_{copySuffix}'
506 CopiedL1JetCollections[monMode][copiedl1jetColl] = CopiedL1JetCollections[monMode].pop(l1jetColl)
508 l1jetcopyalg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
510 cfg.addEventAlgo(l1jetcopyalg)
511 for matchjetcoll
in collDict[
'MatchTo']:
513 kwds = {
'name':
'Matching_{}_{}'.
format(l1jetColl,matchjetcoll),
514 l1Coll2MatcherKey[l1jetColl]: copiedl1jetColl,
515 'JetContainerName2': matchjetcoll,
519 alg = CompFactory.JetMatcherAlg(**kwds)
520 alg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
522 cfg.addEventAlgo(alg)
526 from AthenaMonitoring
import AthMonitorCfgHelper
527 helper = AthMonitorCfgHelper(inputFlags,
'TrigJetMonitorAlgorithm')
529 from AthenaMonitoring.EventFlagFilterToolConfig
import EventFlagFilterToolCfg
530 from AthenaMonitoring.BadLBFilterToolConfig
import LArBadLBFilterToolCfg
532 for jetcoll
in CopiedL1JetCollections[monMode]:
534 alg=l1jetconf.toAlg(helper)
538 for chain,jetcolls
in Chain2L1JetCollDict[monMode].
items():
539 for jetcoll
in jetcolls:
541 alg=l1chainconf.toAlg(helper)
545 for jetcoll
in CopiedOfflineJetCollections[monMode]:
546 offlineMonitorConf =
jetMonitoringConfig(inputFlags,jetcoll,CopiedOfflineJetCollections,monMode)
547 alg=offlineMonitorConf.toAlg(helper)
551 for jetcoll
in CopiedJetCollections[monMode]:
555 monitorConf.toAlg(helper)
558 for chain,chainDict
in Chains2Monitor[monMode].
items():
559 jetcoll = chainDict[
'HLTColl']
563 if 'noalg' not in chain:
565 alg=chainMonitorConfT.toAlg(helper)
569 alg=chainMonitorConfF.toAlg(helper)
572 if chainDict[
'RefChain'] !=
'NONE' and chainDict[
'OfflineColl'] !=
'NONE':
574 effMonitorConf.toAlg(helper)
576 cfg.merge(helper.result())
583 path =
'NoTriggerSelection' if isOnline
else 'standardHistos/'
584 minNjetBin = 1
if isOnline
else 0
586 TopLevelDir =
'HLT/JetMon/'
587 TopLevelDir +=
'Online/' if isOnline
else 'Offline/'
589 jetcollFolder = jetcoll
590 jetcollFolder=jetcoll.replace(f
"_{copySuffix}",
"")
591 Conf = JetMonAlgSpec(jetcoll+
"Mon",JetContainerName = jetcoll, defaultPath = path, topLevelDir=TopLevelDir, bottomLevelDir=jetcollFolder, failureOnMissingContainer=
False)
656 SelectSpec(
'central',
'|eta|<3.2', path, FillerTools = [
"pt",
"et",
"m"] ),
657 SelectSpec(
'forward',
'3.2<|eta|', path, FillerTools = [
"pt",
"et",
"m"] ),
658 SelectSpec(
'lowmu',
'avgMu<30', path, isEventVariable=
True, FillerTools = [
"pt",
"et",
"m",
"phi",
"eta"]),
659 SelectSpec(
'highmu',
'30<avgMu', path, isEventVariable=
True, FillerTools = [
"pt",
"et",
"m",
"phi",
"eta"]),
661 EventHistoSpec(
'njets', (25,minNjetBin,25), title=
'NJets;NJets;Entries' ),
662 EventHistoSpec(
'njetsPt20', (25,minNjetBin,25), title=
'NJetsPt20;NJetsPt20;Entries' ),
663 EventHistoSpec(
'njetsPt50', (25,minNjetBin,25), title=
'NJetsPt50;NJetsPt50;Entries' ),
672 path =
'NoTriggerSelection' if isOnline
else 'standardHistos/'
674 TopLevelDir =
'HLT/JetMon/'
675 TopLevelDir +=
'Online/' if isOnline
else 'Offline/'
677 jetcollFolder = jetcoll
678 jetcollFolder=jetcoll.replace(f
"_{copySuffix}",
"")
679 Conf = JetMonAlgSpec(jetcoll+
"Mon",JetContainerName = jetcoll, defaultPath = path, topLevelDir=TopLevelDir, bottomLevelDir=jetcollFolder, failureOnMissingContainer=
False)
737 HistoSpec(
'pt:GeV;m:GeV', (100,0,400, 100,0,400) , title=
'p_{T} vs mass;p_{T} [GeV];m [GeV];Entries'),
738 HistoSpec(
'eta;et:GeV', (100,-5,5, 100,0,400) , title=
'#eta vs e_{T};#eta;E_{T} [GeV];Entries'),
739 HistoSpec(
'phi;et:GeV', (60,-math.pi,math.pi, 100,0,400) , title=
'#phi vs E_{T};#phi;E_{T} [GeV];Entries'),
742 SelectSpec(
'central',
'|eta|<3.2', path, FillerTools = [
"pt",
"et",
"m"] ),
743 SelectSpec(
'forward',
'3.2<|eta|', path, FillerTools = [
"pt",
"et",
"m"] ),
744 SelectSpec(
'pt60',
'60<pt:GeV', path, FillerTools = [
"m",
"phi",
"eta",
"eta;phi"]),
751 '''Function to configures some algorithms in the monitoring system.'''
753 isOnline =
True if 'HLT' in jetcoll
else False
760 jetCollMonDetails = jetCollDict[monMode][jetcoll]
764 if 'AntiKt4' in jetcoll
or 'a4tcem' in jetcoll:
766 for hist
in ExtraSmallROnlineHists: conf.appendHistos(hist)
768 conf.appendHistos(
"Jvt")
769 conf.appendHistos(
"JVFCorr")
770 conf.appendHistos(
"JvtRpt")
771 conf.appendHistos(
"SumPtTrkPt500[0]")
772 conf.appendHistos(
"NumTrkPt1000[0]")
773 conf.appendHistos(
"TrackWidthPt1000[0]")
775 conf.appendHistos(
"SumPtChargedPFOPt500[0]")
776 conf.appendHistos(
"fCharged")
777 if "subresjesgscIS" in jetcoll:
781 if 'fastftag' in jetcoll:
786 if 'EMTopo' in jetcoll:
787 conf.appendHistos(
"Timing")
789 for hist
in ExtraLargeROnlineHists: conf.appendHistos(hist)
791 if jetCollMonDetails[
'MatchTo'] !=
'NONE':
792 def defineHistoForHLTJetMatch(conf, parentAlg, monhelper , path):
794 group = monhelper.addGroup(parentAlg, conf.Group, conf.topLevelDir+
'/'+conf.bottomLevelDir+
'/NoTriggerSelection/')
796 for histname
in [
'ptdiff',
'energydiff',
'massdiff' ]:
797 group.defineHistogram(histname,title=histname, type=
"TH1F",
798 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
799 xbins=100 , xmin=-100000., xmax=100000. ,)
801 for histname
in [
'ptresp',
'energyresp',
'massresp' ]:
802 group.defineHistogram(histname,title=histname, type=
"TH1F",
803 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
804 xbins=100 , xmin=-2., xmax=2. ,)
806 group.defineHistogram(
'ptresp,ptref;ptresp_vs_ptRef',title=
'ptresponse vs ptRef', type=
"TH2F",
807 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
808 xbins=10 , xmin=-2., xmax=2., ybins=10, ymin=0., ymax=500000.,)
810 group.defineHistogram(
'ptresp,etaref;ptresp_vs_etaRef',title=
'ptresponse vs etaRef', type=
"TH2F",
811 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
812 xbins=10 , xmin=-2., xmax=2., ybins=10, ymin=-5., ymax=5.,)
814 group.defineHistogram(
'ptref,ptresp;ptRef_vs_ptresp',title=
'ptRef vs ptresponse', type=
"TH2F",
815 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
816 xbins=100 , xmin=0., xmax=400000., ybins=80, ymin=-2., ymax=2.,)
818 group.defineHistogram(
'etaref,ptresp;etaRef_vs_ptresp',title=
'etaRef vs ptresponse', type=
"TH2F",
819 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
820 xbins=100 , xmin=-5., xmax=5., ybins=80, ymin=-2., ymax=2.,)
822 matchedJetColl = jetCollMonDetails[
'MatchTo']
825 jetmatchKey =
'{}.matched_{}'.
format(jetcoll,matchedJetColl)
826 jetptdiffKey =
'{}.ptdiff_{}'.
format(jetcoll,matchedJetColl)
827 jetenergydiffKey =
'{}.energydiff_{}'.
format(jetcoll,matchedJetColl)
828 jetmassdiffKey =
'{}.massdiff_{}'.
format(jetcoll,matchedJetColl)
829 jetptrespKey =
'{}.ptresp_{}'.
format(jetcoll,matchedJetColl)
830 jetenergyrespKey =
'{}.energyresp_{}'.
format(jetcoll,matchedJetColl)
831 jetmassrespKey =
'{}.massresp_{}'.
format(jetcoll,matchedJetColl)
832 jetptrefKey =
'{}.ptRef_{}'.
format(jetcoll,matchedJetColl)
833 jetetarefKey =
'{}.etaRef_{}'.
format(jetcoll,matchedJetColl)
834 name =
'jetMatched_{}_{}'.
format(jetcoll,matchedJetColl)
835 conf.appendHistos(ToolSpec(
'JetHistoMatchedFiller', name,
836 JetMatchedKey=jetmatchKey, JetPtDiffKey=jetptdiffKey,
837 JetEnergyDiffKey=jetenergydiffKey,
838 JetMassDiffKey=jetmassdiffKey, JetPtRespKey=jetptrespKey,
839 JetEnergyRespKey=jetenergyrespKey, JetMassRespKey=jetmassrespKey,
840 JetPtRefKey=jetptrefKey,JetEtaRefKey=jetetarefKey,
841 defineHistoFunc=defineHistoForHLTJetMatch,Group=
'matchedJets_'+jetcoll)
844 for hist
in ExtraOfflineHists: conf.appendHistos(hist)
845 if 'AntiKt4' in jetcoll
and monMode==
"pp":
846 conf.appendHistos(SelectSpec(
'LooseBadFailedJets',
'LooseBad',
853 conf.appendHistos(
"SumPtChargedPFOPt500[0]")
854 conf.appendHistos(
"fCharged")
855 elif 'EMTopo' in jetcoll:
856 conf.appendHistos(
"Timing")
857 if jetCollMonDetails[
'MatchTo'] !=
'NONE':
858 def defineHistoForOfflineJetMatch(conf, parentAlg, monhelper , path):
860 group = monhelper.addGroup(parentAlg, conf.Group, conf.topLevelDir+
'/'+conf.bottomLevelDir+
'/standardHistos/')
862 for histname
in [
'ptdiff',
'energydiff',
'massdiff' ]:
863 group.defineHistogram(histname,title=histname, type=
"TH1F",
864 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
865 xbins=100 , xmin=-100000., xmax=100000. ,)
867 for histname
in [
'ptresp',
'energyresp',
'massresp' ]:
868 group.defineHistogram(histname,title=histname, type=
"TH1F",
869 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
870 xbins=100 , xmin=-2., xmax=2. ,)
872 group.defineHistogram(
'ptresp,ptref;ptresp_vs_ptRef',title=
'ptresp vs ptRef', type=
"TH2F",
873 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
874 xbins=10 , xmin=-2., xmax=2., ybins=10, ymin=0., ymax=500000.,)
876 group.defineHistogram(
'ptresp,etaref;ptresp_vs_etaRef',title=
'ptresp vs etaRef', type=
"TH2F",
877 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
878 xbins=10 , xmin=-2., xmax=2., ybins=10, ymin=-5., ymax=5.,)
880 group.defineHistogram(
'ptref,ptresp;ptRef_vs_ptresp',title=
'ptRef vs ptresponse', type=
"TH2F",
881 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
882 xbins=100 , xmin=0., xmax=400000., ybins=80, ymin=-2., ymax=2.,)
884 group.defineHistogram(
'etaref,ptresp;etaRef_vs_ptresp',title=
'etaRef vs ptresponse', type=
"TH2F",
885 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
886 xbins=100 , xmin=-5., xmax=5., ybins=80, ymin=-2., ymax=2.,)
888 matchedJetColl = jetCollMonDetails[
'MatchTo']
889 jetmatchKey =
'{}.matched_{}'.
format(jetcoll,matchedJetColl)
890 jetptdiffKey =
'{}.ptdiff_{}'.
format(jetcoll,matchedJetColl)
891 jetenergydiffKey =
'{}.energydiff_{}'.
format(jetcoll,matchedJetColl)
892 jetmassdiffKey =
'{}.massdiff_{}'.
format(jetcoll,matchedJetColl)
893 jetptrespKey =
'{}.ptresp_{}'.
format(jetcoll,matchedJetColl)
894 jetenergyrespKey =
'{}.energyresp_{}'.
format(jetcoll,matchedJetColl)
895 jetmassrespKey =
'{}.massresp_{}'.
format(jetcoll,matchedJetColl)
896 jetptrefKey =
'{}.ptRef_{}'.
format(jetcoll,matchedJetColl)
897 jetetarefKey =
'{}.etaRef_{}'.
format(jetcoll,matchedJetColl)
898 name =
'jetMatched_{}_{}'.
format(jetcoll,matchedJetColl)
899 conf.appendHistos(ToolSpec(
'JetHistoMatchedFiller',name,
900 JetMatchedKey=jetmatchKey, JetPtDiffKey=jetptdiffKey,
901 JetEnergyDiffKey=jetenergydiffKey,
902 JetMassDiffKey=jetmassdiffKey, JetPtRespKey=jetptrespKey,
903 JetEnergyRespKey=jetenergyrespKey,
904 JetMassRespKey=jetmassrespKey,
905 JetPtRefKey=jetptrefKey, JetEtaRefKey=jetetarefKey,
906 defineHistoFunc=defineHistoForOfflineJetMatch,Group=
'matchedJets_'+jetcoll)
913 from TrigJetMonitoring.L1JetMonitoringConfig
import L1JetMonAlg
914 name = jetColl
if chain==
'' else jetColl+
'_'+chain
917 jetColl = jetColl.replace(f
"_{copySuffix}",
"")
919 if not jetDict[monMode][jetCollKey][
'MatchTo']:
920 conf = L1JetMonAlg(name,jetColl,jetCollKey,chain)
922 assert len(jetDict[monMode][jetCollKey][
'MatchTo']) == 2
924 conf = L1JetMonAlg(name,jetColl,jetCollKey,chain,
925 matched,jetDict[monMode][jetCollKey][
'MatchTo'][0],
926 jetDict[monMode][jetCollKey][
'MatchTo'][1])
931 '''Function to configures some algorithms in the monitoring system.'''
933 jetcollFolder = jetcoll
938 jetMonAlgSpecName = chain+
"TrigMon"
939 if not onlyUsePassingJets:
940 chainFolder = chainFolder +
"/ExpertHistos"
941 jetMonAlgSpecName = jetMonAlgSpecName +
"_ExpertHistos"
945 return parts[1].
split(
'_')[0]
947 def getEtaRangeString(chain):
948 etaMin, etaMax = 0, 32
949 if 'eta490_j' in chain:
950 etaMin, etaMax = 0, 49
952 etaParts = chain.split(
'eta')
953 etaMinTemp = etaParts[0].
split(
'_')
954 etaMin = etaMinTemp[len(etaMinTemp)-1]
955 etaMax = etaParts[1].
split(
'_')[0]
959 etaMin, etaMax = 32, 49
960 return 'Eta{}_{}'.
format(etaMin,etaMax)
962 def getNjetHistName(chain):
963 NjetHistName =
'NONE'
964 parts = chain.split(
'j')
966 multiplicity = parts[0].
split(
'_')[1]
967 if (chain.count(
'_j')-chain.count(
'_jes')) > 1
or multiplicity !=
'':
972 trigConf = JetMonAlgSpec(
974 JetContainerName = jetcoll,
975 TriggerChain = chain,
976 defaultPath = chainFolder,
977 topLevelDir=
"HLT/JetMon/Online/",
978 bottomLevelDir=jetcollFolder,
979 failureOnMissingContainer=
True,
980 onlyPassingJets=onlyUsePassingJets,
981 isExpressStreamJob=inputFlags.Common.doExpressProcessing,
984 trigConf.appendHistos(
991 for hist
in ExtraOnlineNJetHists: trigConf.appendHistos(EventHistoSpec(hist, (20,0,25), title=hist+
';'+hist+
';Entries'))
993 if 'ht' not in chain
and 'HT' not in chain
and 'dijet' not in chain
and 'DIJET' not in chain
and 'fbdj' not in chain
and 'noalg' not in chain:
994 NjetHistName = getNjetHistName(chain)
995 from JetMonitoring.JetStandardHistoSpecs
import knownEventVar
996 if knownEventVar.get(NjetHistName,
None)
is not None and NjetHistName
not in ExtraOnlineNJetHists:
997 trigConf.appendHistos(
998 EventHistoSpec(NjetHistName, (25,0,25), title=NjetHistName+
';'+NjetHistName+
';Entries' ),
1000 NjetHistName = NjetHistName.replace(
'Et',
'Pt')
1001 if knownEventVar.get(NjetHistName,
None)
is not None and NjetHistName
not in ExtraOnlineNJetHists:
1002 trigConf.appendHistos(
1003 EventHistoSpec(NjetHistName, (25,0,25), title=NjetHistName+
';'+NjetHistName+
';Entries' ),
1005 if 'ftf' in chain
and 'a10' not in chain:
1006 trigConf.appendHistos(
"Jvt")
1007 trigConf.appendHistos(
"JVFCorr")
1008 trigConf.appendHistos(
"JvtRpt")
1010 if 'ht' in chain
or 'HT' in chain:
1011 def defineHistoForHTChain(conf, parentAlg, monhelper , path):
1013 group = monhelper.addGroup(parentAlg, conf.Group, conf.topLevelDir+jetcollFolder+
'/')
1016 group.defineHistogram(
"jetHT;HT",title=
"Jet HT;H_{T} [GeV];Entries", type=
"TH1F", path=chainFolder, xbins=xbins , xmin=xmin, xmax=xmax ,)
1017 trigConf.appendHistos(ToolSpec(
'JetHistoHTFiller',
'JetHistoHTFiller_'+chain,MinPt=30.,MaxEta=3.2,FailureOnMissingContainer=
False,
1018 defineHistoFunc=defineHistoForHTChain,Group=
'jetHT_'+jetcoll))
1023 '''Function to configures some algorithms in the monitoring system.'''
1025 jetcollFolder = onlinejetcoll
1033 def defineHistoForJetTrigg(conf, parentAlg, monhelper , path):
1035 group = monhelper.addGroup(parentAlg, conf.Group, conf.topLevelDir+jetcollFolder+
'/')
1037 append =
"offlineCut_"+conf.name.split(
"_")[-1]
if "offlineCut" in conf.name
else "noOfflineCut"
1038 histname =
"trigEff_vs_"+conf.Var.Name+
"_"+append
1040 group.defineHistogram(
'trigPassed,jetVar;'+histname, title=histname, type=
"TEfficiency",
1042 xbins=xbins , xmin=xmin, xmax=xmax,)
1045 validchain = chain.replace(
'noalg',
'j0')
1046 parts = validchain.split(
'j')
1047 multiplicity = parts[0].
split(
'_')[1]
1048 if multiplicity !=
'': index =
int(multiplicity) - 1
1052 from JetMonitoring.JetMonitoringConfig
import retrieveVarToolConf
1053 trigConf = JetMonAlgSpec(
1055 JetContainerName = offlinejetcoll,
1056 TriggerChain = refChain,
1057 defaultPath = chainFolder,
1058 topLevelDir =
"HLT/JetMon/Online/",
1059 bottomLevelDir = jetcollFolder,
1060 failureOnMissingContainer =
True,
1061 onlyPassingJets =
False,
1063 trigConf.appendHistos(
1064 SelectSpec(
'eff',
'{}<|eta|<{}'.
format(etaMin,etaMax), chainFolder, SelectedIndex=index, FillerTools = [
1066 ToolSpec(
'JetHistoTriggEfficiency', chain,
1068 Group=
'jetTrigGroup_'+chain,
1071 ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg),
1076 trigConf.appendHistos(
1077 SelectSpec(
'm50',
'50<m:GeV&{}<|eta|<{}'.
format(etaMin,etaMax), chainFolder, SelectedIndex=index, FillerTools = [
1078 ToolSpec(
'JetHistoTriggEfficiency', chain+
'_offlineCut_m50',
1079 Group=
'jetTrigGroup_'+chain+
'_m50',
1081 ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg
1084 SelectSpec(
'et500',
'500<et:GeV&{}<|eta|<{}'.
format(etaMin,etaMax), chainFolder, SelectedIndex=index, FillerTools = [
1085 ToolSpec(
'JetHistoTriggEfficiency', chain+
'_offlineCut_et500',
1086 Group=
'jetTrigGroup_'+chain+
'_et500',
1089 ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg
1096 if __name__==
'__main__':
1101 parser = argparse.ArgumentParser()
1102 parser.add_argument(
'--runTruthReco', action=
'store_true', dest=
'runTruthReco', default=
False)
1103 parser.add_argument(
'--genOfflineR10PF', action=
'store_true', dest=
'genOfflineR10PF', default=
False)
1104 parser.add_argument(
'--printDetailedConfig', action=
'store_true', dest=
'printDetailedConfig', default=
False)
1105 parser.add_argument(
'--input', action=
'store', dest=
'inputFile')
1106 args = parser.parse_args()
1107 RunTruth = args.runTruthReco
1108 GenOfflineR10PF = args.genOfflineR10PF
1109 PrintDetailedConfig = args.printDetailedConfig
1112 if args.inputFile
is not None: inputFile = args.inputFile
1114 logger.error(
'ERROR: No input file provided, exiting')
1118 from AthenaCommon.Logging
import log
1123 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
1125 flags.Input.Files = [inputFile]
1126 flags.Input.isMC =
True
1127 flags.Output.HISTFileName =
'AthenaMTMonitorOutput.root'
1131 if flags.Reco.EnableHI: monMode =
'HI'
1139 for chain,chaindict
in Chains2Monitor[monMode].
items():
1140 if chaindict[
'HLTColl']
not in JetCollections[case]:
1141 JetCollections[case][chaindict[
'HLTColl']] = {
'MatchTo':
'NONE'}
1144 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
1145 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
1149 outputlist = [
"xAOD::EventInfo#*",
"xAOD::VertexContainer#*",
"xAOD::JetContainer#AntiKt4*Jets",
"xAOD::JetAuxContainer#AntiKt4*JetsAux.-PseudoJet",
"xAOD::JetContainer#HLT_*",
"xAOD::JetAuxContainer#HLT_*Aux.-PseudoJet",
"xAOD::ShallowAuxContainer#HLT_*Aux.-PseudoJet"]
1152 from JetRecConfig.StandardSmallRJets
import AntiKt4Truth
1154 from JetRecConfig.JetRecConfig
import JetRecCfg
1158 key =
"{0}Jets".
format(AntiKt4Truth.basename)
1159 outputlist += [
"xAOD::JetContainer#"+key,
"xAOD::JetAuxContainer#"+key+
"Aux.-PseudoJet"]
1163 from JetRecConfig.JetDefinition
import JetConstitSeq, JetDefinition, xAODType
1164 EMPFlowCSSK = JetConstitSeq(
"EMPFlowCSSK", xAODType.ParticleFlow, [
"CorrectPFO",
"CS",
"SK",
"CHS"],
"JetETMissParticleFlowObjects",
"CSSKParticleFlowObjects", label=
"EMPFlowCSSK")
1165 AntiKt10EMPFlowCSSK = JetDefinition(
"AntiKt",1.0,EMPFlowCSSK,ptmin=2e3,)
1166 AntiKt10EMPFlowCSSK.modifiers = [
"ConstitFourMom",
"Sort",
"Filter:2000"]
1167 from JetRecConfig.JetGrooming
import JetSoftDrop
1168 from JetRecConfig.StandardLargeRJets
import standardrecomods,substrmods
1169 AntiKt10EMPFlowCSSKSoftDrop = JetSoftDrop(AntiKt10EMPFlowCSSK,modifiers=standardrecomods+substrmods,ZCut=0.1,Beta=1.0)
1171 from JetRecConfig.JetRecConfig
import JetRecCfg
1172 comp =
JetRecCfg(AntiKt10EMPFlowCSSKSoftDrop,flags)
1175 key =
"{0}Jets".
format(AntiKt10EMPFlowCSSKSoftDrop.basename)
1176 outputlist += [
"xAOD::JetContainer#"+key,
"xAOD::JetAuxContainer#"+key+
"Aux.-PseudoJet"]
1179 if RunTruth
or GenOfflineR10PF:
1181 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
1188 from AthenaMonitoring
import AthMonitorCfgHelper
1189 helper = AthMonitorCfgHelper(flags,
'TrigJetMonitorAlgorithm')
1190 cfg.merge(helper.result())
1193 for hltColl,collDict
in JetCollections[monMode].
items():
1194 if collDict[
'MatchTo'] !=
'NONE':
1195 for jetcalibscale
in OnlineScaleMomenta:
1196 scalestring =
"_"+jetcalibscale
if jetcalibscale !=
"" else ""
1197 name =
'Matching_{}{}_{}'.
format(hltColl,scalestring,collDict[
'MatchTo'])
1198 alg = CompFactory.JetMatcherAlg(name, JetContainerName1=hltColl,JetContainerName2=collDict[
'MatchTo'],JetCalibScale=jetcalibscale)
1200 cfg.addEventAlgo(alg,sequenceName=
'AthMonSeq_TrigJetMonitorAlgorithm')
1203 for offjetColl,collDict
in OfflineJetCollections[monMode].
items():
1204 if collDict[
'MatchTo'] !=
'NONE':
1205 for jetcalibscale
in OfflineScaleMomenta:
1206 scalestring =
"_"+jetcalibscale
if jetcalibscale !=
"" else ""
1207 name =
'Matching_{}{}_{}'.
format(offjetColl,scalestring,collDict[
'MatchTo'])
1208 alg = CompFactory.JetMatcherAlg(name, JetContainerName1=offjetColl,JetContainerName2=collDict[
'MatchTo'],JetCalibScale=jetcalibscale)
1210 cfg.addEventAlgo(alg,sequenceName=
'AthMonSeq_TrigJetMonitorAlgorithm')
1213 for l1jetColl,collDict
in L1JetCollections[monMode].
items():
1214 for matchjetcoll
in collDict[
'MatchTo']:
1215 if matchjetcoll !=
'NONE':
1216 name =
'Matching_{}_{}'.
format(l1jetColl,matchjetcoll)
1217 alg = CompFactory.JetMatcherAlg(name, L1JetContainerName1=l1jetColl,JetContainerName2=matchjetcoll,MatchL1=
True)
1219 cfg.addEventAlgo(alg,sequenceName=
'AthMonSeq_TrigJetMonitorAlgorithm')
1222 for jetcoll
in L1JetCollections[monMode]:
1224 l1jetconf.toAlg(helper)
1227 for chain,jetcoll
in Chain2L1JetCollDict[monMode].
items():
1229 l1chainconf.toAlg(helper)
1232 for jetcoll
in OfflineJetCollections[monMode]:
1234 offlineMonitorConf.toAlg(helper)
1237 for jetcoll
in JetCollections[monMode]:
1241 monitorConf.toAlg(helper)
1244 for chain,chainDict
in Chains2Monitor[monMode].
items():
1245 jetcoll = chainDict[
'HLTColl']
1249 if 'noalg' not in chain:
1251 chainMonitorConfT.toAlg(helper)
1254 chainMonitorConfF.toAlg(helper)
1256 if chainDict[
'RefChain'] !=
'NONE' and chainDict[
'OfflineColl'] !=
'NONE':
1258 chainDict[
'OfflineColl'], chain,
1259 chainDict[
'RefChain'])
1260 effMonitorConf.toAlg(helper)
1262 cfg.merge(helper.result())
1265 cfg.printConfig(withDetails=PrintDetailedConfig)