ATLAS Offline Software
Loading...
Searching...
No Matches
plugin_TrigGepPerfFromJson.py
Go to the documentation of this file.
1from GlobalSimulation.GlobalSimJsonConfig import GlobalSimJsonCfg
2from TrigValTools.TrigValSteering.Common import find_file_in_path
3
4def setup(flags):
5 if flags.Concurrency.NumThreads==0:
6 flags.Concurrency.NumThreads=1
7
8 flags.DQ.doMonitoring = False
9 flags.IOVDb.GlobalTag = "OFLCOND-MC23-SDR-RUN3-11-02"
10
11#jsonpath = find_file_in_path("L0GlobalTestMenuv1_Khoo.json", 'DATAPATH')
12jsonpath = find_file_in_path("GlobalSimulation/L0GlobalTestMenuv1_TrigGepPerf.json", 'DATAPATH')
13
14force_TOBs = [
15 'OfflineCellsTower',
16 'Eratio',
17 'GEPMETBasicClusters',
18 'GEPMETEtaSKClusters',
19 'GEPMETCellsTower',
20 'GEPMETTopoTower',
21 'GEPMETTCTower',
22 'ConeBasicClustersJets',
23 'ModAntikTBasicClustersJets',
24 # 'WTAConeBasicClustersJets',
25 # 'WTAConeEtaSKClustersJets',
26 # 'WTAConeCellTowerJets',
27]
28
29ignore_prereqs = [
30]
31
32from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
33from AthenaConfiguration.ComponentFactory import CompFactory
34offline_cfg = ComponentAccumulator()
35offline_cfg.addSequence(CompFactory.AthSequencer('TrigGepPerf_OfflineReco'))
36
37from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg
38offline_cfg.merge(CaloTopoClusterCfg(
39 flags,
40 cellsname='AllCalo',
41 clustersname='CaloCalTopoClusters',
42 clustersnapname='CaloTopoClusters',
43 cellthresholds=(4,2,0)
44 ), sequenceName='TrigGepPerf_OfflineReco')
45
46offline_cfg.merge(CaloTopoClusterCfg(
47 flags,
48 cellsname='AllCalo',
49 clustersname='CaloCalTopoClusters422',
50 clustersnapname='CaloTopoClusters422',
51 cellthresholds=(4,2,2)
52 ), sequenceName='TrigGepPerf_OfflineReco')
53
54# PU suppressed clusters
55from JetRecConfig.JetDefinition import JetInputConstitSeq
56from JetRecConfig.JetRecConfig import getInputAlgs
57from JetRecConfig.StandardJetConstits import stdConstitDic
58from ROOT import xAODType
59
60for clusters in [
61 'CaloTopoClusters',
62 'CaloTopoClusters422',
63]:
64 for puseq in [
65 ['SK'],
66 ['Vor'],
67 ['Vor','SK']
68 ]:
69 label = clusters + ''.join(puseq)
70 if label not in stdConstitDic:
71 stdConstitDic[label] = JetInputConstitSeq(
72 name = label,
73 objtype = xAODType.CaloCluster,
74 modifiers = puseq,
75 inputname = clusters,
76 outputname = label,
77 )
78 for alg in getInputAlgs(stdConstitDic[label], flags):
79 offline_cfg.addEventAlgo(alg, sequenceName='TrigGepPerf_OfflineReco')
80
81from JetRecConfig.StandardSmallRJets import AntiKt4EMTopo, AntiKt4Truth, AntiKt4EMPFlow
82from JetRecConfig.StandardLargeRJets import (
83 AntiKt10Truth, AntiKt10TruthSoftDrop,
84 AntiKt10UFOCSSK, AntiKt10UFOCSSKSoftDrop
85)
86from JetRecConfig.JetRecConfig import JetRecCfg
87AntiKt1EMTopo = AntiKt4EMTopo.clone(radius=0.1,modifiers=[])
88AntiKt2EMTopo = AntiKt4EMTopo.clone(radius=0.2,modifiers=[])
89AntiKt3EMTopo = AntiKt4EMTopo.clone(radius=0.3,modifiers=[])
90AntiKt10EMTopo = AntiKt4EMTopo.clone(radius=1.0,modifiers=[])
91offline_jets = [
92 AntiKt1EMTopo, AntiKt2EMTopo, AntiKt3EMTopo,
93 AntiKt4EMTopo, AntiKt10EMTopo,
94 AntiKt4Truth, AntiKt4EMPFlow,
95 AntiKt10Truth, AntiKt10TruthSoftDrop,
96 AntiKt10UFOCSSK, AntiKt10UFOCSSKSoftDrop,
97 ]
98for j in offline_jets:
99 if j.fullname() not in flags.Input.Collections:
100 print(f'Scheduling reco of {j.fullname()}')
101 offline_cfg.merge(JetRecCfg(flags,j), sequenceName='TrigGepPerf_OfflineReco')
102
103offline_cfg.printConfig()
104cfg.merge(offline_cfg)
105
106
107triggepperf_cfg = GlobalSimJsonCfg(flags, jsonpath, force_TOBs, ignore_prereqs)
108
109# Hack because TrigGepPerf doesn't provide handles to set this
110# and at this stage I prefer not to touch their code.
111# Depending on the job/input, the name of the available jFEX
112# jets may not match the default (L1_jFexSRJetRoISim)
113jFexSRname = "L1_jFexSRJetRoI_ReSim"
114for alg in triggepperf_cfg.getEventAlgos():
115 if hasattr(alg,'jFexSRJetRoIs'):
116 alg.jFexSRJetRoIs = jFexSRname
117
118cfg.merge( triggepperf_cfg )
119
void print(char *figname, TCanvas *c1)