ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkMuons
python
MuonsExtraTriggerConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
4
5
from
TriggerMenuMT.TriggerAPI.TriggerAPI
import
TriggerAPI
6
from
TriggerMenuMT.TriggerAPI.TriggerEnums
import
TriggerPeriod, TriggerType
7
from
AthenaConfiguration.AutoConfigFlags
import
GetFileMD
8
from
DerivationFrameworkPhys.TriggerListsHelper
import
read_trig_list_file
9
from
DerivationFrameworkPhys.TriggerMatchingCommonConfig
import
AddRun2TriggerMatchingToSlimmingHelper
10
from
DerivationFrameworkPhys.TriggerMatchingCommonConfig
import
TriggerMatchingCommonRun2Cfg
11
12
13
# Helper class to add extra trigger content to the Muon derivations.
14
class
MuonExtraTriggerHelper
:
15
def
__init__
(self, flags, existingTriggerHelper):
16
self.
flags
= flags
17
TriggerAPI.setConfigFlags(flags)
18
self.
extraChainList
= []
19
self.
existingTriggerHelper
= existingTriggerHelper
20
self.
FindExtraChainsRun2
()
21
22
# Find the chains missing in the existing trigger helper
23
def
FindExtraChainsRun2
(self):
24
25
md = GetFileMD(self.
flags
.Input.Files)
26
hlt_menu = md.get(
'TriggerMenu'
, {}).
get
(
'HLTChains'
,
None
)
27
28
if
self.
flags
.Trigger.EDMVersion <= 2:
29
30
# Trigger API for Runs 1, 2
31
allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34
32
trig_bmu = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu_bphys, livefraction=0.8)
33
34
35
extra_file = read_trig_list_file(
"DerivationFrameworkMuons/run2ExtraMatchingTriggers.txt"
)
36
37
38
trigger_names_full = list(
set
(trig_bmu+extra_file))
39
40
if
hlt_menu:
41
for
chain_name
in
hlt_menu:
42
if
chain_name
in
trigger_names_full:
43
self.
extraChainList
.append(chain_name)
44
else
:
# No means to filter based on in-file metadata
45
self.
extraChainList
= trigger_names_full
46
47
# remove overlap with the existing chains
48
self.
extraChainList
= [c
for
c
in
self.
extraChainList
if
c
not
in
self.
existingTriggerHelper
.Run2TriggerNamesNoTau
and
c
not
in
self.
existingTriggerHelper
.Run2TriggerNamesTau ]
49
50
# schedule the trigger matching tool for our new chains
51
def
Run2MatchAugmentationCfg
(self, flags, name="PhysCommonTrigMatchExtraMuons"):
52
acc = ComponentAccumulator()
53
acc.merge(TriggerMatchingCommonRun2Cfg(
54
flags,
55
name = name,
56
OutputContainerPrefix =
"TrigMatch_"
,
57
ChainNames = self.
extraChainList
))
58
return
acc
59
60
# add our new match branches to the slimming helper
61
def
AddRun2MatchingToSlimmingHelper
(self,SlimmingHelper,
62
OutputContainerPrefix = "TrigMatch_"):
63
AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = SlimmingHelper,
64
OutputContainerPrefix = OutputContainerPrefix,
65
TriggerList = self.
extraChainList
)
66
python.MuonsExtraTriggerConfig.MuonExtraTriggerHelper
Definition
MuonsExtraTriggerConfig.py:14
python.MuonsExtraTriggerConfig.MuonExtraTriggerHelper.extraChainList
list extraChainList
Now reduce the list based on the content of the first input AOD.
Definition
MuonsExtraTriggerConfig.py:18
python.MuonsExtraTriggerConfig.MuonExtraTriggerHelper.existingTriggerHelper
existingTriggerHelper
Definition
MuonsExtraTriggerConfig.py:19
python.MuonsExtraTriggerConfig.MuonExtraTriggerHelper.flags
flags
Definition
MuonsExtraTriggerConfig.py:16
python.MuonsExtraTriggerConfig.MuonExtraTriggerHelper.Run2MatchAugmentationCfg
Run2MatchAugmentationCfg(self, flags, name="PhysCommonTrigMatchExtraMuons")
Definition
MuonsExtraTriggerConfig.py:51
python.MuonsExtraTriggerConfig.MuonExtraTriggerHelper.AddRun2MatchingToSlimmingHelper
AddRun2MatchingToSlimmingHelper(self, SlimmingHelper, OutputContainerPrefix="TrigMatch_")
Definition
MuonsExtraTriggerConfig.py:62
python.MuonsExtraTriggerConfig.MuonExtraTriggerHelper.FindExtraChainsRun2
FindExtraChainsRun2(self)
Definition
MuonsExtraTriggerConfig.py:23
python.MuonsExtraTriggerConfig.MuonExtraTriggerHelper.__init__
__init__(self, flags, existingTriggerHelper)
Definition
MuonsExtraTriggerConfig.py:15
set
STL class.
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition
hcg.cxx:132
Generated on
for ATLAS Offline Software by
1.17.0