5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from TrigEgammaMonitoring.TrigEgammaMonitCategory
import single_electron_triggers, single_photon_triggers
16 def __init__(self, flags, name, triggerList = [],
18 ElectronTriggerList = single_electron_triggers,
19 PhotonTriggerList = single_photon_triggers):
56 from TrigEgammaHypo.TrigEgammaFastCaloHypoTool
import createTrigEgammaFastCaloSelectors
57 from TrigEgammaHypo.TrigEgammaPrecisionPhotonHypoTool
import createTrigEgammaPrecisionPhotonSelectors
58 from TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool
import TrigEgammaPrecisionElectronCBSelectorCfg
59 from TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool
import TrigEgammaPrecisionElectronLHSelectorCfg
60 from TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool
import TrigEgammaPrecisionElectronDNNSelectorCfg
74 for tool
in self.
__emulator.ElectronDNNSelectorTools:
75 tool.skipAmbiguityCut =
True
76 for tool
in self.
__emulator.ElectronLHSelectorTools:
77 tool.skipDeltaPoverP =
True
85 cppyy.load_library(
'libElectronPhotonSelectorToolsDict')
87 from TriggerMenuMT.HLT.Config.Utility.DictFromChainName
import dictFromChainName
90 signature = d[
'signatures'][0]
92 from TrigEgammaHypo.TrigEgammaFastCaloHypoTool
import TrigEgammaFastCaloHypoToolFromDict
93 from TrigEgammaHypo.TrigEgammaFastElectronHypoTool
import TrigEgammaFastElectronHypoToolFromDict
94 from TrigEgammaHypo.TrigEgammaFastPhotonHypoTool
import TrigEgammaFastPhotonHypoToolFromDict
95 from TrigEgammaHypo.TrigEgammaPrecisionCaloHypoTool
import TrigEgammaPrecisionCaloHypoToolFromDict
96 from TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool
import TrigEgammaPrecisionElectronHypoToolFromDict
97 from TrigEgammaHypo.TrigEgammaPrecisionPhotonHypoTool
import TrigEgammaPrecisionPhotonHypoToolFromDict
98 from TrigEgammaHypo.TrigEgammaPrecisionTrackingHypoTool
import TrigEgammaPrecisionTrackingHypoToolFromDict
101 L1CaloTool = self.
setupL1Calo(trigger +
"_Step0" , d)
106 if signature ==
'Electron':
107 isEtCut =
bool(d[
'chainParts'][0][
'addInfo'])
108 isIdperf =
bool(d[
'chainParts'][0][
'idperfInfo'])
111 sequence = [FastCaloTool, FastTool, PrecisionCaloTool]
114 sequence = [FastCaloTool, FastTool, PrecisionCaloTool, PrecisionTrackingTool]
118 sequence = [FastCaloTool, FastTool, PrecisionCaloTool, PrecisionTrackingTool, PrecisionTool]
119 elif signature ==
'Photon':
120 isEtCut =
bool(d[
'chainParts'][0][
'addInfo'])
123 sequence = [FastCaloTool, FastTool, PrecisionCaloTool]
126 sequence = [FastCaloTool, FastTool, PrecisionCaloTool, PrecisionTool]
128 chain = CompFactory.Trig.TrigEgammaEmulationChain(
134 Signature = signature.lower(),
147 from AthenaConfiguration.ComponentFactory
import CompFactory
151 L1Item = info[
'chainParts'][0][
'L1threshold']
152 L1thr =
float( re.findall(
r'\d+', L1Item)[0] )
156 HadCoreCutMin = [ 1.0 , 1.0 , 1.0 , 1.0 ]
157 HadCoreCutOff = [-0.2 , -0,2 , -0.2 , -0.2 ]
158 HadCoreSlope = [ 1/23. , 1/23., 1/23., 1/23.]
159 EmIsolCutMin = [ 2.0 , 1.0 , 1.0 , 1.5 ]
160 EmIsolCutOff = [-1.8 , -2.6 , -2.0 , -1.8 ]
161 EmIsolSlope = [ 1/8. , 1/8. , 1/8. , 1/8. ]
164 L1CaloTool = CompFactory.Trig.TrigEgammaEmulationL1CaloHypoTool(
168 HadCoreCutMin = HadCoreCutMin[wp],
169 HadCoreCutOff = HadCoreCutOff[wp],
170 HadCoreSlope = HadCoreSlope[wp],
171 EmIsolCutMin = EmIsolCutMin[wp],
172 EmIsolCutOff = EmIsolCutOff[wp],
173 EmIsolSlope = EmIsolSlope[wp],
188 from AthenaConfiguration.ComponentFactory
import CompFactory
190 "HLT_e17_lhvloose_L1EM15VHI",
191 "HLT_e5_etcut_L1EM3",
192 "HLT_e26_lhtight_L1EM22VHI",
193 "HLT_g20_loose_L1EM15"
196 '''Function to configures some algorithms in the monitoring system.'''
198 from AthenaMonitoring
import AthMonitorCfgHelper
199 helper = AthMonitorCfgHelper(inputFlags,
'TrigEgammaEmulationToolTestCfg')
201 test = helper.addAlgorithm( CompFactory.TrigEgammaEmulationToolTest(
"EmulationTest") )
203 EgammaMatchTool = CompFactory.TrigEgammaMatchingToolMT()
204 EgammaMatchTool.DeltaR=0.4
205 acc.addPublicTool(EgammaMatchTool)
210 emulator.TriggerList += triggerList
211 acc.addPublicTool(emulator.core())
212 test.MatchTool = EgammaMatchTool
213 test.EmulatorTool = emulator.core()
214 test.ElectronTriggerList = [
216 "HLT_e17_lhvloose_L1EM15VHI",
219 test.PhotonTriggerList = []
222 basepath =
'/HLT/EgammaMon'
223 for trigger
in triggerList:
224 cutLabels = [
'L1Calo',
'L2Calo',
'L2',
'EFCalo',
'HLT']
225 monGroup = helper.addGroup( test, trigger, basepath+
'/EgammaEmulationTest/'+trigger )
226 monGroup.defineHistogram(
"decisions", type=
'TH1I', path=
'', title=
"Event Selection; Cut ; Count",
227 xbins=len(cutLabels), xmin=0, xmax=len(cutLabels), xlabels=cutLabels)
228 monGroup.defineHistogram(
"emulations", type=
'TH1I', path=
'', title=
"Event Selection; Cut ; Count",
229 xbins=len(cutLabels), xmin=0, xmax=len(cutLabels), xlabels=cutLabels)
231 return helper.result()
235 if __name__==
'__main__':
238 from PyUtils.Helpers
import ROOT6Setup
242 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
244 path =
'/afs/cern.ch/work/j/jodafons/public/valid_sampleA/AOD_fixCalo.pool.root'
246 flags.Input.Files = [path]
247 flags.Input.isMC =
True
248 flags.Output.HISTFileName =
'TrigEgammaMonitorOutput.root'
252 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
253 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
260 cfg.printConfig(withDetails=
False)