11 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12 from AthenaConfiguration.ComponentFactory
import CompFactory
13 from AthenaConfiguration.Enums
import MetadataCategory
15 TRIG8MergedElectronContainer =
"StdWithLRTElectrons"
16 TRIG8MergedMuonContainer =
"StdWithLRTMuons"
20 """Configure the derivation framework driving algorithm (kernel) for TRIG8"""
26 from DerivationFrameworkInDet.InDetToolsConfig
import InDetLRTMergeCfg
30 from DerivationFrameworkLLP.LLPToolsConfig
import LRTMuonMergerAlg
32 PromptMuonLocation =
"Muons",
33 LRTMuonLocation =
"MuonsLRT",
34 OutputMuonLocation = TRIG8MergedMuonContainer,
35 CreateViewCollection =
True))
38 from DerivationFrameworkLLP.LLPToolsConfig
import LRTElectronMergerAlg
40 PromptElectronLocation =
"Electrons",
41 LRTElectronLocation =
"LRTElectrons",
42 OutputCollectionName = TRIG8MergedElectronContainer,
44 CreateViewCollection =
True))
47 augmentationTools = [ ]
50 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
54 from DerivationFrameworkEGamma.EGammaLRTConfig
import EGammaLRTCfg
57 from DerivationFrameworkLLP.LLPToolsConfig
import LRTElectronLHSelectorsCfg
61 from DerivationFrameworkMuons.MuonsCommonConfig
import MuonsCommonCfg
65 from TriggerMenuMT.TriggerAPI.TriggerAPI
import TriggerAPI
66 from TriggerMenuMT.TriggerAPI.TriggerEnums
import TriggerPeriod
68 allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34
69 TriggerAPI.setConfigFlags(flags)
70 trig_all =
list(TriggerAPI.getAllHLT(allperiods).
keys())
73 TriggerListsHelper = kwargs[
'TriggerListsHelper']
74 trig_all += TriggerListsHelper.Run3TriggerNames
77 displaced_jet_triggers = [t
for t
in trig_all
if "dispjet" in t]
78 bjet_veto = [
"HLT_e26_lhtight_ivarloose_2j20_0eta290_020jvt_boffperf_pf_ftf_L1EM22VHI"]
79 bjet_triggers = [t
for t
in trig_all
if "boffperf" in t
and t
not in bjet_veto]
82 from DerivationFrameworkInDet.InDetToolsConfig
import TrackParticleThinningCfg
83 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import GenericObjectThinningCfg
84 from DerivationFrameworkTrigger.TriggerGenericObjectThinningConfig
import TriggerGenericThinningCfg
91 name =
"TRIG8PhotonsThinningTool",
92 StreamName = kwargs[
'StreamName'],
93 ContainerName =
"Photons",
94 SelectionString =
"Photons.pt >= 1000000."))
98 name =
"TRIG8TrackParticleThinningTool",
99 StreamName = kwargs[
'StreamName'],
100 SelectionString =
"InDetTrackParticles.pt > 1*GeV",
101 InDetTrackParticlesKey =
"InDetTrackParticles"))
105 name =
"TRIG8LRTTrackParticleThinningTool",
106 StreamName = kwargs[
'StreamName'],
107 SelectionString =
"InDetLargeD0TrackParticles.pt > 1*GeV",
108 InDetTrackParticlesKey =
"InDetLargeD0TrackParticles"))
111 thinningTools = [TRIG8PhotonsThinningTool,
112 TRIG8TrackParticleThinningTool,
113 TRIG8LRTTrackParticleThinningTool]
115 if((
not flags.Input.isMC)
or "HLT_AntiKt4EMTopoJets_subjesIS" in flags.Input.Collections):
118 name =
"TRIG8JetThinningTool",
119 StreamName = kwargs[
'StreamName'],
120 ContainerName =
"HLT_AntiKt4EMTopoJets_subjesIS",
121 TriggerListOR =
sorted(
list(
set(displaced_jet_triggers + bjet_triggers)))
124 thinningTools.append(TRIG8JETThinningTool)
130 idtrig_keys = [
'idperf',
'boffperf',
'ivarperf',
'idtp']
132 idtrig_veto = [
'HLT_e26_lhtight_ivarloose_2j20_0eta290_020jvt_boffperf_pf_ftf_L1EM22VHI']
134 additional_triggers = [
136 "HLT_j45_pf_ftf_preselj20_L1J15",
137 "HLT_xe80_tcpufit_isotrk120_medium_iaggrmedium_L1XE55",
138 "HLT_xe80_tcpufit_isotrk140_medium_iaggrmedium_L1XE55",
139 "HLT_xe80_tcpufit_dedxtrk50_medium_L1XE50",
140 "HLT_xe80_tcpufit_distrk20_medium_L1XE50",
141 "HLT_xe80_tcpufit_distrk20_tight_L1XE50",
144 idtrig_keys += additional_triggers
145 idtrig_keys += displaced_jet_triggers
147 triggers = [t
for t
in trig_all
for k
in idtrig_keys
if k
in t]
148 for veto
in idtrig_veto:
150 triggers.remove(veto)
152 print(f
"Warning, {veto} already removed from trigger list.")
156 print(
'TRIG8 list of triggers used for skimming:')
157 for trig
in triggers:
print(trig)
159 TriggerSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool
160 TRIG8TriggerSkimmingTool = TriggerSkimmingTool(name =
"TRIG8TriggerPreSkimmingTool",
162 TriggerListOR = triggers)
163 acc.addPublicTool(TRIG8TriggerSkimmingTool)
165 skimmingTools.append(TRIG8TriggerSkimmingTool)
167 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
169 SkimmingTools = skimmingTools,
170 ThinningTools = thinningTools,
171 AugmentationTools = augmentationTools))
184 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
185 TRIG8TriggerListsHelper = TriggerListsHelper(flags)
188 acc.merge(
TRIG8KernelCfg(flags, name=
"TRIG8Kernel", StreamName =
'StreamDAOD_TRIG8', TriggerListsHelper = TRIG8TriggerListsHelper))
194 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
195 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
196 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
198 TRIG8SlimmingHelper =
SlimmingHelper(
"TRIG8SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
200 TRIG8SlimmingHelper.SmartCollections = [
"EventInfo",
207 "InDetTrackParticles",
208 "InDetLargeD0TrackParticles",
210 "AntiKt4EMPFlowJets",
211 "BTagging_AntiKt4EMTopo",
212 "BTagging_AntiKt4EMPFlow",
216 TRIG8SlimmingHelper.AllVariables = [
"HLT_IDTrack_Electron_FTF",
217 "HLT_IDTrack_ElecLRT_FTF",
218 "HLT_IDTrack_Electron_IDTrig",
219 "HLT_IDTrack_ElecLRT_IDTrig",
220 "HLT_IDTrack_Electron_GSF",
221 "HLT_IDTrack_Electron_LRTGSF",
222 "HLT_IDTrack_Muon_FTF",
223 "HLT_IDTrack_Muon_IDTrig",
224 "HLT_IDTrack_MuonLRT_IDTrig",
225 "HLT_IDTrack_MuonIso_FTF",
226 "HLT_IDTrack_MuonIso_IDTrig",
227 "HLT_IDTrack_MuonLRT_FTF",
228 "HLT_IDTrack_Bmumux_FTF",
229 "HLT_IDTrack_Bmumux_IDTrig",
230 "HLT_IDTrack_TauCore_FTF",
231 "HLT_IDTrack_TauLRT_FTF",
232 "HLT_IDTrack_TauIso_FTF",
233 "HLT_IDTrack_Tau_IDTrig",
234 "HLT_IDTrack_TauLRT_IDTrig",
235 "HLT_IDTrack_FS_FTF",
236 "HLT_IDTrack_FSLRT_FTF",
237 "HLT_IDTrack_FSLRT_IDTrig",
238 "HLT_IDTrack_DVLRT_FTF",
239 "HLT_IDTrack_BeamSpot_FTF",
240 "HLT_IDTrack_JetSuper_FTF",
241 "HLT_IDTrack_Bjet_FTF",
242 "HLT_IDTrack_Bjet_IDTrig",
243 "HLT_IDTrack_MinBias_IDTrig",
244 "HLT_IDTrack_Cosmic_FTF",
245 "HLT_IDTrack_Cosmic_IDTrig",
246 "HLT_IDTrack_DJLRT_FTF",
247 "BTagging_AntiKt4EMPFlowSecVtx",
248 "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_BTaggingSecVtx",
250 "HLT_IDVertex_JetSuper",
254 "InDetDisappearingTrackParticles" ]
258 TRIG8SlimmingHelper.StaticContent = [
259 "TrigRoiDescriptorCollection#HLT_FSRoI",
260 "TrigRoiDescriptorCollection#HLT_MURoIs",
261 "TrigRoiDescriptorCollection#HLT_eEMRoIs",
262 "TrigRoiDescriptorCollection#HLT_eTAURoIs",
263 "TrigRoiDescriptorCollection#HLT_jTAURoIs",
264 "TrigRoiDescriptorCollection#HLT_cTAURoIs",
265 "TrigRoiDescriptorCollection#HLT_jEMRoIs",
266 "TrigRoiDescriptorCollection#HLT_jJRoIs",
267 "TrigRoiDescriptorCollection#HLT_jLJRoIs",
268 "TrigRoiDescriptorCollection#HLT_gJRoIs",
269 "TrigRoiDescriptorCollection#HLT_gLJRoIs",
270 "TrigRoiDescriptorCollection#HLT_EMRoIs",
271 "TrigRoiDescriptorCollection#HLT_METRoI",
272 "TrigRoiDescriptorCollection#HLT_JETRoI",
273 "TrigRoiDescriptorCollection#HLT_TAURoI",
274 "TrigRoiDescriptorCollection#HLT_Roi_LArPEBHLT",
275 "TrigRoiDescriptorCollection#HLT_Roi_IDCalibPEB",
276 "TrigRoiDescriptorCollection#HLT_Roi_FastElectron",
277 "TrigRoiDescriptorCollection#HLT_Roi_FastElectron_probe",
278 "TrigRoiDescriptorCollection#HLT_Roi_FastElectron_LRT",
279 "TrigRoiDescriptorCollection#HLT_Roi_FastElectron_LRT_probe",
280 "TrigRoiDescriptorCollection#HLT_Roi_FastPhoton",
281 "TrigRoiDescriptorCollection#HLT_Roi_FastPhoton_probe",
282 "TrigRoiDescriptorCollection#HLT_Roi_Bmumux",
283 "TrigRoiDescriptorCollection#MuonCandidates_FS_ROIs",
284 "TrigRoiDescriptorCollection#HLT_Roi_L2SAMuon",
285 "TrigRoiDescriptorCollection#HLT_Roi_L2SAMuon_probe",
286 "TrigRoiDescriptorCollection#HLT_Roi_L2SAMuon_LRT",
287 "TrigRoiDescriptorCollection#HLT_Roi_L2SAMuon_LRT_probe",
288 "TrigRoiDescriptorCollection#HLT_Roi_L2SAMuonForEF",
289 "TrigRoiDescriptorCollection#HLT_Roi_L2SAMuonForEF_probe",
290 "TrigRoiDescriptorCollection#HLT_Roi_MuonIso",
291 "TrigRoiDescriptorCollection#HLT_Roi_MuonIso_probe",
292 "TrigRoiDescriptorCollection#HLT_Roi_Tau",
293 "TrigRoiDescriptorCollection#HLT_Roi_Tau_probe",
294 "TrigRoiDescriptorCollection#HLT_Roi_TauCore",
295 "TrigRoiDescriptorCollection#HLT_Roi_TauCore_probe",
296 "TrigRoiDescriptorCollection#HLT_Roi_TauLRT",
297 "TrigRoiDescriptorCollection#HLT_Roi_TauLRT_probe",
298 "TrigRoiDescriptorCollection#HLT_Roi_TauIso",
299 "TrigRoiDescriptorCollection#HLT_Roi_TauIso_probe",
300 "TrigRoiDescriptorCollection#HLT_Roi_TauIsoBDT",
301 "TrigRoiDescriptorCollection#HLT_Roi_TauIsoBDT_probe",
302 "TrigRoiDescriptorCollection#HLT_Roi_JetPEBPhysicsTLA",
303 "TrigRoiDescriptorCollection#HLT_Roi_DV",
304 "TrigRoiDescriptorCollection#HLT_Roi_Bjet",
305 "TrigRoiDescriptorCollection#HLT_Roi_FS",
306 "TrigRoiDescriptorCollection#HLT_Roi_JetSuper",
307 "TrigRoiDescriptorCollection#HLT_Roi_DJ",
308 "TrigInDetTrackTruthMap#TrigInDetTrackTruthMap" ]
310 TRIG8SlimmingHelper.ExtraVariables += [
311 "Electrons.Tight.Medium.Loose.LHTight.LHMedium.LHLoose",
312 "LRTElectrons.Tight.Medium.Loose.LHTight.LHMedium.LHLoose",
313 "egammaClusters.phi_sampl.eta0.phi0",
314 "LRTegammaClusters.phi_sampl.eta0.phi0",
315 "TruthPrimaryVertices.t.x.y.z",
316 "PrimaryVertices.t.x.y.z.numberDoF.chiSquared.covariance.trackParticleLinks",
317 "InDetTrackParticles.d0.z0.vz.vx.vy.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.hitPattern.trackFitter.patternRecoInfo.numberDoF.numberOfTRTHits.numberOfTRTOutliers.numberOfBLayerHits.expectBLayerHit.numberOfPixelDeadSensors.numberOfSCTDeadSensors.numberOfTRTHighThresholdHits.expectInnermostPixelLayerHit",
318 "InDetLargeD0TrackParticles.d0.z0.vz.vx.vy.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.hitPattern.trackFitter.patternRecoInfo.numberDoF.numberOfTRTHits.numberOfTRTOutliers.numberOfBLayerHits.expectBLayerHit.numberOfPixelDeadSensors.numberOfSCTDeadSensors.numberOfTRTHighThresholdHits.expectInnermostPixelLayerHit",
319 "GSFTrackParticles.d0.z0.vz.vx.vy.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.numberOfPixelHoles.numberOfSCTHoles.numberDoF.chiSquared.trackFitter.patternRecoInfo.hitPattern.numberOfTRTHits.numberOfTRTOutliers.numberOfBLayerHits.expectBLayerHit.numberOfPixelDeadSensors.numberOfSCTDeadSensors.numberOfTRTHighThresholdHits.expectInnermostPixelLayerHit",
320 "LRTGSFTrackParticles.d0.z0.vz.vx.vy.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.numberOfPixelHoles.numberOfSCTHoles.numberDoF.chiSquared.trackFitter.patternRecoInfo.hitPattern.numberOfTRTHits.numberOfTRTOutliers.numberOfBLayerHits.expectBLayerHit.numberOfPixelDeadSensors.numberOfSCTDeadSensors.numberOfTRTHighThresholdHits.expectInnermostPixelLayerHit",
321 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
322 "TauJets.dRmax.etOverPtLeadTrk",
323 "HLT_AntiKt4EMTopoJets_subjesIS.m.pt.eta.phi"]
328 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import addTruth3ContentToSlimmerTool
330 TRIG8SlimmingHelper.AllVariables += [
'TruthHFWithDecayParticles',
'TruthHFWithDecayVertices',
'TruthCharm',
'TruthPileupParticles',
'InTimeAntiKt4TruthJets',
'OutOfTimeAntiKt4TruthJets']
331 TRIG8SlimmingHelper.ExtraVariables += [
"Electrons.TruthLink",
332 "LRTElectrons.TruthLink",
334 "MuonsLRT.TruthLink",
340 TRIG8SlimmingHelper.IncludeTriggerNavigation =
True
341 TRIG8SlimmingHelper.IncludeAdditionalTriggerContent =
True
342 TRIG8SlimmingHelper.IncludeJetTriggerContent =
False
343 TRIG8SlimmingHelper.IncludeMuonTriggerContent =
False
344 TRIG8SlimmingHelper.IncludeEGammaTriggerContent =
False
345 TRIG8SlimmingHelper.IncludeTauTriggerContent =
False
346 TRIG8SlimmingHelper.IncludeEtMissTriggerContent =
False
347 TRIG8SlimmingHelper.IncludeBJetTriggerContent =
False
348 TRIG8SlimmingHelper.IncludeBPhysTriggerContent =
False
349 TRIG8SlimmingHelper.IncludeMinBiasTriggerContent =
False
353 if flags.Trigger.EDMVersion == 2:
354 from DerivationFrameworkLLP.LLPToolsConfig
import LLP1TriggerMatchingToolRun2Cfg
355 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
357 OutputContainerPrefix =
"TrigMatch_",
358 TriggerList = TRIG8TriggerListsHelper.Run2TriggerNamesTau)
360 OutputContainerPrefix =
"TrigMatch_",
361 TriggerList = TRIG8TriggerListsHelper.Run2TriggerNamesNoTau)
364 name =
"LRTTriggerMatchingTool",
365 OutputContainerPrefix =
"LRTTrigMatch_",
366 TriggerList = TRIG8TriggerListsHelper.Run2TriggerNamesNoTau,
367 InputElectrons=TRIG8MergedElectronContainer,
368 InputMuons=TRIG8MergedMuonContainer
372 OutputContainerPrefix =
"LRTTrigMatch_",
373 TriggerList = TRIG8TriggerListsHelper.Run2TriggerNamesNoTau,
374 InputElectrons=TRIG8MergedElectronContainer,
375 InputMuons=TRIG8MergedMuonContainer
378 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
379 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
383 TRIG8ItemList = TRIG8SlimmingHelper.GetItemList()
384 acc.merge(
OutputStreamCfg(flags,
"DAOD_TRIG8", ItemList=TRIG8ItemList, AcceptAlgs=[
"TRIG8Kernel"]))
385 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_TRIG8", AcceptAlgs=[
"TRIG8Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))