ATLAS Offline Software
Functions
TrigBtagEmulationToolConfig Namespace Reference

Functions

ComponentAccumulator jetManagerToolCfg (flags, str name, **kwargs)
 
ComponentAccumulator jetPFlowCNTManagerToolCfg (flags, **kwargs)
 
ComponentAccumulator jetEMTopoPRESELManagerToolCfg (flags, **kwargs)
 
ComponentAccumulator TrigBtagEmulationToolCfg (flags, list toBeEmulatedTriggers, str InputChain_EMTopo, str InputJetContainer_EMTopo, str InputJetContainer_EMTopoPresel, str InputChain_PFlow, str InputJetContainer_PFlow, str InputJetContainer_PFlowPresel, **kwargs)
 
ComponentAccumulator TrigBtagValidationTestCfg (flags, **kwargs)
 

Function Documentation

◆ jetEMTopoPRESELManagerToolCfg()

ComponentAccumulator TrigBtagEmulationToolConfig.jetEMTopoPRESELManagerToolCfg (   flags,
**  kwargs 
)

Definition at line 28 of file TrigBtagEmulationToolConfig.py.

29  **kwargs) -> ComponentAccumulator:
30  kwargs.setdefault('JetContainerName', 'HLT_AntiKt4EMTopoJets_subjesIS')
31  return jetManagerToolCfg(flags,
32  name = "JM_EMTopo_PRESEL",
33  **kwargs)
34 
35 # Emulation Tool

◆ jetManagerToolCfg()

ComponentAccumulator TrigBtagEmulationToolConfig.jetManagerToolCfg (   flags,
str  name,
**  kwargs 
)

Definition at line 10 of file TrigBtagEmulationToolConfig.py.

10 def jetManagerToolCfg(flags,
11  name: str,
12  **kwargs) -> ComponentAccumulator:
13  assert isinstance(name, str), "JetManagerTool name must be a string"
14  acc = ComponentAccumulator()
15  kwargs.setdefault('BTaggingLink', 'btaggingLink')
16  acc.setPrivateTools(CompFactory.Trig.JetManagerTool(name, **kwargs))
17  return acc
18 
19 # CNT

◆ jetPFlowCNTManagerToolCfg()

ComponentAccumulator TrigBtagEmulationToolConfig.jetPFlowCNTManagerToolCfg (   flags,
**  kwargs 
)

Definition at line 20 of file TrigBtagEmulationToolConfig.py.

21  **kwargs) -> ComponentAccumulator:
22  kwargs.setdefault('JetContainerName', 'HLT_AntiKt4EMPFlowJets_subjesIS')
23  return jetManagerToolCfg(flags,
24  name = "JM_PFlow_CNT",
25  **kwargs)
26 
27 # PRESEL

◆ TrigBtagEmulationToolCfg()

ComponentAccumulator TrigBtagEmulationToolConfig.TrigBtagEmulationToolCfg (   flags,
list  toBeEmulatedTriggers,
str  InputChain_EMTopo,
str  InputJetContainer_EMTopo,
str  InputJetContainer_EMTopoPresel,
str  InputChain_PFlow,
str  InputJetContainer_PFlow,
str  InputJetContainer_PFlowPresel,
**  kwargs 
)

Definition at line 36 of file TrigBtagEmulationToolConfig.py.

36 def TrigBtagEmulationToolCfg(flags,
37  toBeEmulatedTriggers: list,
38  InputChain_EMTopo: str,
39  InputJetContainer_EMTopo: str,
40  InputJetContainer_EMTopoPresel: str,
41  InputChain_PFlow: str,
42  InputJetContainer_PFlow: str,
43  InputJetContainer_PFlowPresel: str,
44  **kwargs) -> ComponentAccumulator:
45  assert isinstance(toBeEmulatedTriggers, list)
46  assert isinstance(InputChain_EMTopo, str)
47  assert isinstance(InputJetContainer_EMTopo, str)
48  assert isinstance(InputJetContainer_EMTopoPresel, str)
49  assert isinstance(InputChain_PFlow, str)
50  assert isinstance(InputJetContainer_PFlow, str)
51  assert isinstance(InputJetContainer_PFlowPresel, str)
52 
53  if len(InputChain_EMTopo) == 0:
54  InputChain_EMTopo = 'HLT_j45_subjesgsc_ftf_L1J15'
55  if len(InputJetContainer_EMTopo) == 0:
56  InputJetContainer_EMTopo = 'HLT_AntiKt4EMTopoJets_subjesIS'
57  if len(InputJetContainer_EMTopoPresel) == 0:
58  InputJetContainer_EMTopoPresel = 'HLT_AntiKt4EMTopoJets_subjesIS'
59  if len(InputChain_PFlow) == 0:
60  InputChain_PFlow = 'HLT_j[234][05]_.*pf_ftf_[0b].*[ft]_L1.*'
61  if len(InputJetContainer_PFlow) == 0:
62  InputJetContainer_PFlow = 'HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf'
63  if len(InputJetContainer_PFlowPresel) == 0:
64  InputJetContainer_PFlowPresel = 'HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf'
65 
66 
67  chainDefinitions = {}
68  for chain in toBeEmulatedTriggers:
69  chainDict = dictFromChainName(flags, chain)
70  chainParts = ['L1item:' + chainDict['L1item']]
71  for chainPart in chainDict['chainParts']:
72  # Gaudi::Property has limited support for nested structures, put everything in a long string and parse in C++
73  # and update TrigBtagEmulationChain::parseChainDefinition(...) accordingly
74  partDefinition = ''
75  partDefinition += 'L1threshold:' + chainPart['L1threshold']
76  partDefinition += '|name:' + chainPart['chainPartName']
77  partDefinition += '|multiplicity:' + chainPart['multiplicity']
78  partDefinition += '|threshold:' + chainPart['threshold']
79  partDefinition += '|etaRange:' + chainPart['etaRange']
80  partDefinition += '|jvt:' + (chainPart['jvt'] if chainPart['jvt'] else '-99999')
81  partDefinition += '|tagger:' + chainPart['bTag']
82  partDefinition += '|jetpresel:' + chainPart['trkpresel']
83  partDefinition += '|dijetmass:' + (chainPart['hypoScenario'][len('DJMASS'):] if ('DJMASS' in chainPart['hypoScenario']) else 'None')
84  partDefinition += '|isPFlow:' + ('True' if (chainPart['constitType'] == 'pf') else 'False')
85  partDefinition += '|isShared:' + ('True' if ('SHARED' in chainPart['chainPartName']) else 'False')
86  chainParts.append(partDefinition)
87  chainName = chain.name if isinstance(chain, ChainProp) else chain
88  chainDefinitions[chainName] = chainParts
89 
90 
91  # Component Accumulator
92  acc = ComponentAccumulator()
93 
94 
95  tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
96 
97 
98  kwargs.setdefault('EmulatedChainDefinitions', chainDefinitions)
99  kwargs.setdefault('TrigDecisionTool', tdt)
100  kwargs.setdefault('InputChain', InputChain_PFlow)
101 
102  kwargs.setdefault('JM_PFlow_CNT' , acc.popToolsAndMerge(jetPFlowCNTManagerToolCfg(flags,
103  JetContainerName=InputJetContainer_PFlow)))
104 
105  kwargs.setdefault('JM_EMTopo_PRESEL', acc.popToolsAndMerge(jetEMTopoPRESELManagerToolCfg(flags,
106  JetContainerName=InputJetContainer_EMTopoPresel)))
107 
108  from TrigBjetHypo.TrigBjetBtagHypoTool import bTaggingWP
109  from TrigBjetHypo.TrigBjetBtagHypoTool import bbTaggingWP
110 
111  working_points = { "newTagger" : 1.234 }
112  working_points.update(bTaggingWP)
113  working_points.update(bbTaggingWP)
114 
115  kwargs.setdefault('WorkingPoints', working_points)
116  kwargs.setdefault('FTD_Remapping',
117  {"DL1d20210519r22_pu" : "DL1dEMUL_pu",
118  "DL1d20210519r22_pc" : "DL1dEMUL_pc",
119  "DL1d20210519r22_pb" : "DL1dEMUL_pb"})
120 
121  acc.setPrivateTools(CompFactory.Trig.TrigBtagEmulationTool('TrigBtagEmulationTool', **kwargs))
122  return acc
123 

◆ TrigBtagValidationTestCfg()

ComponentAccumulator TrigBtagEmulationToolConfig.TrigBtagValidationTestCfg (   flags,
**  kwargs 
)

Definition at line 124 of file TrigBtagEmulationToolConfig.py.

124 def TrigBtagValidationTestCfg(flags,
125  **kwargs) -> ComponentAccumulator:
126  acc = ComponentAccumulator()
127  histSvc = CompFactory.THistSvc()
128  histSvc.Output += ["VALIDATION DATAFILE='validation.root' OPT='RECREATE'"]
129  acc.addService(histSvc)
130 
131  options = {}
132  options['EmulatedChains'] = [c.name for c in kwargs['toBeEmulatedTriggers']]
133 
134  options['TrigBtagEmulationTool'] = acc.popToolsAndMerge( TrigBtagEmulationToolCfg(flags,
135  **kwargs))
136 
137  from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
138  tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
139  options['TrigDecisionTool'] = tdt
140 
141  acc.addEventAlgo( CompFactory.Trig.TrigBtagValidationTest('TrigBtagValidation', **options) )
142  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
DictFromChainName.dictFromChainName
def dictFromChainName(flags, chainInfo)
Definition: DictFromChainName.py:626
TrigBtagEmulationToolConfig.TrigBtagEmulationToolCfg
ComponentAccumulator TrigBtagEmulationToolCfg(flags, list toBeEmulatedTriggers, str InputChain_EMTopo, str InputJetContainer_EMTopo, str InputJetContainer_EMTopoPresel, str InputChain_PFlow, str InputJetContainer_PFlow, str InputJetContainer_PFlowPresel, **kwargs)
Definition: TrigBtagEmulationToolConfig.py:36
TrigBtagEmulationToolConfig.jetEMTopoPRESELManagerToolCfg
ComponentAccumulator jetEMTopoPRESELManagerToolCfg(flags, **kwargs)
Definition: TrigBtagEmulationToolConfig.py:28
python.TriggerInterface.TrigDecisionToolCfg
def TrigDecisionToolCfg(flags)
Definition: TriggerInterface.py:14
TrigBtagEmulationToolConfig.jetPFlowCNTManagerToolCfg
ComponentAccumulator jetPFlowCNTManagerToolCfg(flags, **kwargs)
Definition: TrigBtagEmulationToolConfig.py:20
TrigBtagEmulationToolConfig.TrigBtagValidationTestCfg
ComponentAccumulator TrigBtagValidationTestCfg(flags, **kwargs)
Definition: TrigBtagEmulationToolConfig.py:124
TrigBtagEmulationToolConfig.jetManagerToolCfg
ComponentAccumulator jetManagerToolCfg(flags, str name, **kwargs)
Definition: TrigBtagEmulationToolConfig.py:10