ATLAS Offline Software
Loading...
Searching...
No Matches
TrigT2CaloEgammaConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentFactory import CompFactory
4from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
6from TrigEDMConfig.TriggerEDM import recordable
7from TrigT2CaloCalibration.EgammaCalibrationConfig import (EgammaHitsCalibrationBarrelConfig,
8 EgammaHitsCalibrationEndcapConfig,
9 EgammaGapCalibrationConfig,
10 EgammaTransitionRegionsConfig,
11 EgammaSshapeCalibrationBarrelConfig,
12 EgammaSshapeCalibrationEndcapConfig)
13
14_T2CaloEgamma_ExtraInputs = {
15 ('IRegSelLUTCondData', 'ConditionStore+RegSelLUTCondData_TTEM'),
16 ('IRegSelLUTCondData', 'ConditionStore+RegSelLUTCondData_TTHEC'),
17 ('IRegSelLUTCondData', 'ConditionStore+RegSelLUTCondData_TILE'),
18 ('IRegSelLUTCondData', 'ConditionStore+RegSelLUTCondData_FCALEM'),
19 ('IRegSelLUTCondData', 'ConditionStore+RegSelLUTCondData_FCALHAD'),
20 ('LArBadChannelCont' , 'ConditionStore+LArBadChannel')
21}
22
23#local variable
24from HLTSeeding.HLTSeedingConfig import mapThresholdToL1RoICollection
25inputEDM = mapThresholdToL1RoICollection("FSNOSEED")
26
27def RingerReFexConfig(flags, name="RingerReMaker", RingerKey="FastCaloRings",
28 ClustersName="HLT_FastCaloEMClusters",**kwargs):
29
30 from TrigT2CaloEgamma.RingerConstants import Layer
31 from TrigT2CaloEgamma.RingerConstants import DETID as det
32
33 monTool = GenericMonitoringTool(flags, 'MonTool')
34 monTool.defineHistogram( "TIME_total", title="Total Time;time [us]",xbins=100, xmin=0, xmax=500,type='TH1F', path='EXPERT')
35 monTool.defineHistogram( "TIME_load_cells", title="Load Cells Time;time [us]",xbins=50, xmin=0, xmax=100,type='TH1F', path='EXPERT')
36
37 _lenNRings = 7 # number of entries in NRings
38
39 ringer = CompFactory.RingerReFex(
40 name = name,
41 EtaBins = [0.0000, 2.500], # bin pairs: min < eta <= max, PS,barrel,crack,endcap
42 RingerKey = RingerKey,
43 ClustersName = ClustersName,
44 GlobalCenter = False,
45 EtaSearchWindowSize = 0.1,
46 PhiSearchWindowSize = 0.1,
47 NRings = [8, 64, 8, 8, 4, 4, 4],
48 DeltaEta = [0.025, 0.003125, 0.025, 0.05, 0.1, 0.1, 0.1],
49 DeltaPhi = [0.098174770424681, 0.098174770424681, 0.024543692606170, 0.024543692606170,
50 0.098174770424681, 0.098174770424681, 0.098174770424681],
51 UseTile = True,
52 Detectors = [ [det.TTEM], [det.TTEM], [det.TTEM], [det.TTEM], [det.TTHEC, det.TILE],
53 [det.TTHEC, det.TTHEC, det.TILE], [det.TTHEC, det.TILE] ],
54 Samplings = [ [0] , [1] , [2] , [3] , [0 , -1 ],
55 [1 , 2 , -1 ] , [3 , -1 ] ],
56 Samples = [ [ Layer.PreSamplerB,Layer.PreSamplerE ], # TTEM:0
57 [ Layer.EMB1, Layer.EME1 ], # TTEM: 1
58 [ Layer.EMB2, Layer.EME2 ], # TTEM: 2
59 [ Layer.EMB3, Layer.EME3 ], # TTEM: 3
60 [ Layer.HEC0, Layer.TileBar0, Layer.TileGap2, Layer.TileExt0 ], # TTHEC: 0, TILE
61 [ Layer.HEC1, Layer.HEC2, Layer.TileBar1, Layer.TileGap0, Layer.TileExt1 ], # TTHEC: 1,2, TILE
62 [ Layer.HEC3, Layer.TileBar2, Layer.TileGap1, Layer.TileExt2 ] # TTHEC: 3, TILE
63 ],
64 DumpCells = flags.Trigger.egamma.dumpCellsFastCaloInfo,
65 DoNoiseThrRings = flags.Trigger.egamma.doNoiseThrRings,
66 NoiseFactor = flags.Trigger.egamma.sigmaNoiseFactor,
67 DoQuarter = [flags.Trigger.egamma.doQuarterRings]*_lenNRings,
68 DoEtaAxesDivision = [True]*_lenNRings,
69 DoPhiAxesDivision = [True]*_lenNRings,
70 MonTool = monTool)
71 for k, v in kwargs.items():
72 setattr(ringer,k,v)
73 return ringer
74
75#=======================================================================
76
77def AsymRingerReFexConfig(flags, name="AsymRingerReMaker"):
78 ringer = RingerReFexConfig(flags, name, RingerKey="FastCaloAsymRings")
79 ringer.DoQuarter = [True]*len(ringer.NRings),
80 return ringer
81
82#=======================================================================
83
84def t2CaloEgamma_AllCfg(flags, name="T2CaloEgamma_All",RoIs=inputEDM,ExtraInputs=set(), ClustersName="HLT_FastCaloEMClusters"):
85 acc = ComponentAccumulator()
86 tool = CompFactory.EgammaAllFex("EgammaAllFex",
87 IncludeHad=True,
88 ExtraInputs={('TileEMScale','ConditionStore+TileEMScale'),
89 ('TileBadChannels','ConditionStore+TileBadChannels')})
90 alg = CompFactory.T2CaloEgammaReFastAlgo(name,
91 IReAlgToolList= [tool],
92 EtaWidth = 0.1,
93 PhiWidth = 0.1,
94 ExtraInputs = _T2CaloEgamma_ExtraInputs)
95 alg.RoIs=RoIs
96 if(not flags.Input.isMC):
97 alg.ExtraInputs |= {('LArDeadOTXFromSC' , 'StoreGateSvc+DeadOTXFromSC' )}
98 alg.ExtraInputs |= ExtraInputs
99 alg.ClustersName = recordable(ClustersName)
100 acc.addEventAlgo(alg)
101
102 return acc
103
104#=======================================================================
105
106def t2CaloEgamma_AllEmCfg(flags, name="T2CaloEgamma_AllEm", RoIs=inputEDM, ExtraInputs=set(), ClustersName="HLT_FastCaloEMClusters"):
107 acc = ComponentAccumulator()
108 tool = CompFactory.EgammaAllFex("EgammaAllEmFex",
109 ExtraInputs={('TileEMScale','ConditionStore+TileEMScale'),
110 ('TileBadChannels','ConditionStore+TileBadChannels')})
111
112 alg = CompFactory.T2CaloEgammaReFastAlgo(name,
113 IReAlgToolList= [tool],
114 EtaWidth = 0.1,
115 PhiWidth = 0.1,
116 ExtraInputs = _T2CaloEgamma_ExtraInputs)
117 alg.RoIs=RoIs
118 alg.ExtraInputs |= ExtraInputs
119 if(not flags.Input.isMC):
120 alg.ExtraInputs |= {('LArDeadOTXFromSC' , 'StoreGateSvc+DeadOTXFromSC' )}
121 alg.ClustersName = recordable(ClustersName)
122 acc.addEventAlgo(alg)
123 return acc
124
125#=======================================================================
126
127def t2CaloEgamma_ReFastAlgoCfg(flags, name="T2CaloEgamma_ReFastAlgo", ClustersName="HLT_FastCaloEMClusters",
128 doRinger=False, RingerKey="HLT_FastCaloRinger", RoIs=inputEDM, ExtraInputs=set()):
129 acc = ComponentAccumulator()
130
131 samp2 = CompFactory.EgammaReSamp2Fex("ReFaAlgoSamp2FexConfig",
132 MaxDetaHotCell=0.15, MaxDphiHotCell=0.15 )
133 samp1 = CompFactory.EgammaReSamp1Fex("ReFaAlgoSamp1FexConfig")
134 sampe = CompFactory.EgammaReEmEnFex("ReFaAlgoEmEnFexConfig")
135 samph = CompFactory.EgammaReHadEnFex("ReFaAlgoHadEnFexConfig",
136 ExtraInputs={('TileEMScale','ConditionStore+TileEMScale'),
137 ('TileBadChannels','ConditionStore+TileBadChannels')})
138 monTool = GenericMonitoringTool(flags, 'MonTool')
139 monTool.defineHistogram('TrigEMCluster_eT', path='EXPERT', type='TH1F', title="T2Calo Egamma E_T; E_T [ GeV ] ; Nclusters", xbins=80, xmin=0.0, xmax=140.0)
140 monTool.defineHistogram('TrigEMCluster_had1', path='EXPERT', type='TH1F', title="T2Calo Egamma had E_T samp1; had E_T samp1 [ GeV ] ; Nclusters", xbins=80, xmin=0.0, xmax=8.0)
141 monTool.defineHistogram('TrigEMCluster_eta', path='EXPERT', type='TH1F', title="T2Calo Egamma #eta; #eta ; Nclusters", xbins=100, xmin=-2.5, xmax=2.5)
142 monTool.defineHistogram('TrigEMCluster_phi', path='EXPERT', type='TH1F', title="T2Calo Egamma #phi; #phi ; Nclusters", xbins=128, xmin=-3.2, xmax=3.2)
143 monTool.defineHistogram('TrigEMCluster_eta,TrigEMCluster_phi', path='EXPERT', type='TH2F', title="T2Calo Egamma Number of Clusters; #eta ; #phi ; Number of Clusters", xbins=100, xmin=-2.5, xmax=2.5, ybins=128, ymin=-3.2, ymax=3.2)
144 monTool.defineHistogram('TrigEMCluster_rEta', path='EXPERT', type='TH1F', title="T2Calo Egamma rEta; rEta (e237/e277) ; Nclusters", xbins=140, xmin=-0.2, xmax=1.2)
145 monTool.defineHistogram('TIME_exec', path='EXPERT', type='TH1F', title="T2Calo Egamma time; time [ us ] ; Nruns", xbins=80, xmin=0.0, xmax=8000.0)
146 monTool.defineHistogram('TrigEMCluster_eta,TIME_exec', path='EXPERT', type='TH2F', title="T2Calo Egamma time vs #eta ; #eta ; time [ us ]", xbins=100, xmin=-2.5, xmax=2.5, ybins=80, ymin=0.0, ymax=8000.0)
147 if flags.Trigger.doValidationMonitoring:
148 monTool.defineHistogram('TrigEMCluster_eta,TrigEMCluster_eT', path='EXPERT', type='TH2F', title="Egamma E_T vs #eta ; #eta; E_T", xbins=100, xmin=-2.5, xmax=2.5)
149 monTool.defineHistogram('TrigEMCluster_eta,TrigEMCluster_et_rings', path='EXPERT', type='TH2F', title="Egamma E_T[calib] vs #eta ; #eta; E_T", xbins=100, xmin=-2.5, xmax=2.5)
150 monTool.defineHistogram('Resolution_et', path='EXPERT', type='TH1F', title="Egamma Resolution E_T; (E_T[calib] - E_T)/ E_T ; Nclusters", xbins=80, xmin=-10.0, xmax=10.0)
151 monTool.defineHistogram('TrigEMCluster_et_rings', path='EXPERT', type='TH1F', title="Egamma E_T [calib]; E_T [ GeV ] ; Nclusters", xbins=80, xmin=0.0, xmax=140.0)
152
153 alg = CompFactory.T2CaloEgammaReFastAlgo(
154 name,
155 IReAlgToolList = [ samp2, samp1, sampe, samph ],
156 ExtraInputs = _T2CaloEgamma_ExtraInputs,
157 EtaWidth = 0.2,
158 PhiWidth = 0.2,
159 MonTool = monTool,
160 CalibListBarrel = [EgammaSshapeCalibrationBarrelConfig(),
161 EgammaHitsCalibrationBarrelConfig(),
162 EgammaGapCalibrationConfig(),
163 EgammaTransitionRegionsConfig()],
164 CalibListEndcap = [EgammaSshapeCalibrationEndcapConfig(),
165 EgammaHitsCalibrationEndcapConfig(),
166 EgammaGapCalibrationConfig()])
167
168 if doRinger:
169 ringer = RingerReFexConfig(flags, 'ReFaAlgoRingerFexConfig',
170 RingerKey= RingerKey,
171 ClustersName = ClustersName)
172 alg.IReAlgToolList += [ringer]
173
174 if flags.Trigger.egamma.fastCaloETCalibration:
175 ringerCalib = CompFactory.TrigFastCalibWithRings(name="FastCalibRingsTool",
176 CalibPath = flags.Trigger.egamma.fastCaloETCalibrationVersion, RingerKey="HLT_FastCaloRinger")
177 alg.CalibWRingsTool = ringerCalib
178 alg.DoCalibWithRings = True
179
180 alg.UseRings = True
181
182
183 alg.RoIs=RoIs
184 alg.ExtraInputs |= ExtraInputs
185 if ( not flags.Input.isMC ):
186 alg.ExtraInputs |= {('LArDeadOTXFromSC' , 'StoreGateSvc+DeadOTXFromSC' )}
187 alg.ClustersName = recordable(ClustersName)
188 acc.addEventAlgo(alg)
189 return acc
190
191#=======================================================================
192
193def t2CaloEgamma_ReFastFWDAlgoCfg(flags, name="T2CaloEgamma_ReFastFWDAlgo",
194 ClustersName="HLT_FWDFastCaloEMClusters",
195 doRinger=False, RingerKey="HLT_FWDFastCaloRinger", RoIs=inputEDM, ExtraInputs=set()):
196 acc = ComponentAccumulator()
197
198 alg = CompFactory.T2CaloEgammaForwardReFastAlgo(name,
199 IReAlgToolList = [],
200 ExtraInputs = _T2CaloEgamma_ExtraInputs,
201 EtaWidth = 0.2,
202 PhiWidth = 0.2)
203 alg.RoIs=RoIs
204 alg.ExtraInputs |= ExtraInputs
205 if ( not flags.Input.isMC ):
206 alg.ExtraInputs |= {('LArDeadOTXFromSC' , 'StoreGateSvc+DeadOTXFromSC' )}
207 alg.ClustersName = recordable(ClustersName)
208 acc.addEventAlgo(alg)
209 return acc
210
211#=======================================================================
212
213# Test:
214if __name__ == '__main__':
215 from AthenaConfiguration.AllConfigFlags import initConfigFlags
216 flags = initConfigFlags()
217 flags.lock()
218 t2CaloEgamma_ReFastAlgoCfg(flags, "FastCaloL2EgammaAlgo_noRinger").printConfig(withDetails=True,summariseProps=True)
219 t2CaloEgamma_ReFastAlgoCfg(flags, "FastCaloL2EgammaAlgo", doRinger=True).printConfig(withDetails=True,summariseProps=True)
220 t2CaloEgamma_AllCfg(flags).printConfig(withDetails=True,summariseProps=True)
221 t2CaloEgamma_AllEmCfg(flags).printConfig(withDetails=True,summariseProps=True)
222 t2CaloEgamma_ReFastFWDAlgoCfg(flags, ClustersName="HLT_FastCaloEMClusters", doRinger=True).printConfig(withDetails=True,summariseProps=True)
if(febId1==febId2)
t2CaloEgamma_AllEmCfg(flags, name="T2CaloEgamma_AllEm", RoIs=inputEDM, ExtraInputs=set(), ClustersName="HLT_FastCaloEMClusters")
AsymRingerReFexConfig(flags, name="AsymRingerReMaker")
t2CaloEgamma_AllCfg(flags, name="T2CaloEgamma_All", RoIs=inputEDM, ExtraInputs=set(), ClustersName="HLT_FastCaloEMClusters")
t2CaloEgamma_ReFastAlgoCfg(flags, name="T2CaloEgamma_ReFastAlgo", ClustersName="HLT_FastCaloEMClusters", doRinger=False, RingerKey="HLT_FastCaloRinger", RoIs=inputEDM, ExtraInputs=set())
t2CaloEgamma_ReFastFWDAlgoCfg(flags, name="T2CaloEgamma_ReFastFWDAlgo", ClustersName="HLT_FWDFastCaloEMClusters", doRinger=False, RingerKey="HLT_FWDFastCaloRinger", RoIs=inputEDM, ExtraInputs=set())
RingerReFexConfig(flags, name="RingerReMaker", RingerKey="FastCaloRings", ClustersName="HLT_FastCaloEMClusters", **kwargs)