3 from AthenaConfiguration.ComponentFactory
import CompFactory
4 from TrigBphysHypo.TrigMultiTrkComboHypoMonitoringConfig
import TrigMultiTrkComboHypoMonitoring, TrigMultiTrkComboHypoToolMonitoring
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaCommon.Logging
import logging
7 log = logging.getLogger(
'TrigMultiTrkComboHypoConfig')
9 trigMultiTrkComboHypoToolDict = {
10 'bJpsimumu' : {
'massRange' : (2500., 4300.),
'chi2' : 20. },
11 'bJpsi' : {
'massRange' : (2500., 4300.),
'chi2' : 20. },
12 'bJpsimutrk' : {
'massRange' : (2600., 3600.),
'chi2' : 20. },
13 'bUpsimumu' : {
'massRange' : (8000., 12000.),
'chi2' : 20. },
14 'bUpsi' : {
'massRange' : (8000., 12000.),
'chi2' : 20. },
15 'bDimu' : {
'massRange' : (1500., 14000.),
'chi2' : 20. },
16 'bDimu2700' : {
'massRange' : ( 100., 2700.),
'chi2' : 20. },
17 'bDimu6000' : {
'massRange' : ( 100., 6000.),
'chi2' : 20. },
18 'bBmumu' : {
'massRange' : (4000., 8500.),
'chi2' : 20. },
19 'bPhi' : {
'massRange' : ( 940., 1100.),
'chi2' : 10. },
20 'bTau' : {
'massRange' : ( 0., 2700.),
'chi2' : 50. },
21 'b3mu' : {
'massRange' : ( 100., 10000.),
'chi2' : 30.,
'nTrk' : 3,
'charge' : 1 },
22 'bBeeM6000' : {
'massRange' : ( 100., 6000.),
'chi2' : 20. },
23 'b0dRAB12vtx20' : {
'massRange' : ( 0., 999999999.),
'chi2' : 20.,
'deltaRMax' : 1.2 },
24 'b0dRAB207invmAB22vtx20': {
'massRange' : ( 7000., 22000.),
'chi2' : 20.,
'deltaRMax' : 2.0 },
25 'b0dRAB127invmAB22vtx20': {
'massRange' : ( 7000., 22000.),
'chi2' : 20.,
'deltaRMax' : 1.2 },
26 'b7invmAB22vtx20' : {
'massRange' : ( 7000., 22000.),
'chi2' : 20.,
'charge' : -1 },
27 'b7invmAB9vtx20' : {
'massRange' : ( 7000., 9000.),
'chi2' : 20.,
'charge' : -1 },
28 'b11invmAB60vtx20' : {
'massRange' : ( 11000., 60000.),
'chi2' : 20.,
'charge' : -1 },
29 'b11invmAB24vtx20' : {
'massRange' : ( 11000., 24000.),
'chi2' : 20.,
'charge' : -1 },
30 'b24invmAB60vtx20' : {
'massRange' : ( 24000., 60000.),
'chi2' : 20.,
'charge' : -1 }
35 log.debug(
'DimuL2ComboHypoCfg.name = %s ', name)
36 kwargs = {
"isStreamer" :
True,
37 "trigSequenceName" :
'Dimu',
39 "TrackCollectionKey" :
'HLT_IDTrack_Muon_FTF'}
43 log.debug(
'DimuL2IOComboHypoCfg.name = %s ', name)
44 kwargs = {
"isStreamer" :
True,
45 "trigSequenceName" :
'Dimu',
46 "trigLevel" :
'L2IO' }
50 log.debug(
'DimuL2MTComboHypoCfg.name = %s ', name)
51 kwargs = {
"isStreamer" :
True,
52 "trigSequenceName" :
'Dimu',
53 "trigLevel" :
'L2MT' }
57 log.debug(
'DimuEFComboHypoCfg.name = %s ', name)
58 kwargs = {
"isStreamer" :
False,
59 "trigSequenceName" :
'Dimu',
61 "checkMultiplicity" :
True,
62 "TrigBphysCollectionKey" :
'HLT_DimuEF'}
66 log.debug(
'StreamerDimuEFComboHypoCfg.name = %s ', name)
67 kwargs = {
"isStreamer" :
True,
68 "trigSequenceName" :
'StreamerDimu',
71 "massRange" : [ (100., 6000.) ],
72 "trackPtThresholds" : [ [ 100., 100. ] ],
77 log.debug(
'DiElecPrecisionGSFComboHypoCfg.name = %s ', name)
78 kwargs = {
"isStreamer" :
False,
79 "trigSequenceName" :
'DiElecPrecisionGSF',
82 "TrigBphysCollectionKey" :
'HLT_DiElecPrecisionGSF'}
86 log.debug(
'NoMuonDiElecPrecisionGSFComboHypoCfg.name = %s ', name)
87 kwargs = {
"isStreamer" :
False,
88 "trigSequenceName" :
'NoMuonDiElecPrecisionGSF',
91 "TrigBphysCollectionKey" :
'HLT_NoMuonDiElecPrecisionGSF' }
95 log.debug(
'BmutrkComboHypoCfg.name = %s ', name)
96 kwargs = {
"isStreamer" :
False,
97 "trigSequenceName" :
'Bmutrk',
99 "TrackCollectionKey" :
'HLT_IDTrack_Bmumux_IDTrig',
100 "isMuTrkMode" :
True,
103 "totalCharge" : [ 0 ],
104 "massRange" : [ (2500., 4400.) ],
105 "trackPtThresholds" : [ [ 10000., 2000. ] ],
106 "TrigBphysCollectionKey" :
'HLT_Bmutrk'}
110 log.debug(
'DrellYanComboHypoCfg.name = %s ', name)
111 kwargs = {
"isStreamer" :
False,
112 "trigSequenceName" :
'DrellYan',
115 "totalCharge" : [ -1 ],
116 "massRange" : [ (7000., 60000.) ],
117 "trackPtThresholds" : [ [ 100., 100. ] ],
119 "combineInputDecisionCollections" :
True,
120 "applyOverlapRemoval" :
False,
121 "useLeptonMomentum" :
True,
122 "TrigBphysCollectionKey" :
'HLT_DrellYan'}
131 kwargs.setdefault(
"isStreamer",
False)
132 kwargs.setdefault(
"trigLevel",
'L2')
133 kwargs.setdefault(
"TrackCollectionKey",
'')
134 kwargs.setdefault(
"TrigBphysCollectionKey",
'TrigBphysContainer')
135 kwargs.setdefault(
"CheckMultiplicityMap",
False)
136 kwargs.setdefault(
"doElectrons",
False)
137 trigLevel = kwargs[
'trigLevel']
139 trigLevelDict = {
'L2':0,
'L2IO':1,
'L2MT':2,
'EF':3}
141 value = trigLevelDict[trigLevel]
142 log.debug(
'TrigMultiTrkComboHypo.trigLevel = %s ', value)
144 raise Exception(
'TrigMultiTrkComboHypo.trigLevel should be L2, L2IO, L2MT or EF, but %s provided.', trigLevel)
146 baseName =
'Streamer'+trigSequenceName+trigLevel
if kwargs[
'isStreamer']
else trigSequenceName+trigLevel
148 from TrigBphysHypo.TrigBPhyCommonConfig
import TrigBPHY_TrkVKalVrtFitterCfg
149 from InDetConfig.InDetConversionFinderToolsConfig
import BPHY_VertexPointEstimatorCfg
150 from TrkConfig.TrkVertexAnalysisUtilsConfig
import V0ToolsCfg
151 if kwargs[
"doElectrons"]:
152 kwargs.setdefault(
"nTracks", [ 2 ])
153 kwargs.setdefault(
"trackPtThresholds", [ [ -1., -1. ] ])
154 kwargs.setdefault(
"massRange", [ (100., 20000.) ])
155 kwargs.setdefault(
"mergedElectronChains", [
'BPH-0DR3-EM7J15',
'HLT_e5_lhvloose_bBeeM6000',
'HLT_e5_lhvloose_L1eEM5_bBeeM6000',
'HLT_e5_lhvloose_L1EM3_bBeeM6000' ])
156 kwargs.setdefault(
"caloClusterEtThreshold", 3.)
157 alg = CompFactory.TrigMultiTrkComboHypo(
158 name = baseName+
'ComboHypo',
161 V0Tools = acc.popToolsAndMerge(
V0ToolsCfg(flags,
'V0Tools_'+baseName)),
164 acc.addEventAlgo(alg, primary=
True)
167 kwargs.setdefault(
"nTracks", [ 2, 3 ])
168 kwargs.setdefault(
"trackPtThresholds", [ [ 3650., 3650. ], [ 3650., 3650., 3650. ] ])
169 kwargs.setdefault(
"massRange", [ (100., 20000.), (0., 11000.) ])
170 alg = CompFactory.TrigMultiTrkComboHypo(
171 name = baseName+
'ComboHypo',
174 V0Tools = acc.popToolsAndMerge(
V0ToolsCfg(flags,
'V0Tools_'+baseName)),
178 acc.addEventAlgo(alg, primary=
True)
183 tool = CompFactory.TrigMultiTrkComboHypoTool(chainDict[
'chainName'])
186 topo = chainDict[
'topo'][0]
187 value = trigMultiTrkComboHypoToolDict[topo]
188 tool.massRange = value[
'massRange']
189 tool.chi2 = value[
'chi2']
190 tool.nTrk = value[
'nTrk']
if 'nTrk' in value
else 2
191 tool.totalCharge = value[
'charge']
if 'charge' in value
else 0
192 if 'deltaRMin' in value:
193 tool.deltaRMin = value[
'deltaRMin']
194 if 'deltaRMax' in value:
195 tool.deltaRMax = value[
'deltaRMax']
197 raise Exception(
'TrigMultiTrkComboHypo misconfigured for \'%s\': topo \'%s\' is not supported.', chainDict[
'chainName'], topo)
199 if 'nocut' in chainDict[
'topo']:
200 tool.AcceptAll =
True
202 if 'noos' in chainDict[
'topo']:
203 tool.totalCharge = -100
205 if 'Lxy0' in chainDict[
'topo']:
208 if 'sigmaLxy3' in chainDict[
'topo']:
209 tool.sigmaLxyCut = 3.
211 electronMultiplicity = [
int(chainPart[
'multiplicity'])
for chainPart
in chainDict[
'chainParts']
if chainPart[
'signature']==
'Electron']
212 if len(electronMultiplicity) == 1
and electronMultiplicity[0] == 1:
213 tool.isMergedElectronChain =
True
215 if 'bJpsimutrk' in chainDict[
'topo']:
216 tool.isMuonTrkPEB =
True
218 tool.trackPtThresholds = [-1., 2000.]
if 'lowpt' in chainDict[
'topo']
else [-1., 3000.]
220 if 'bTau' in chainDict[
'topo']:
221 tool.nTrk =
sum(
int(chainPart[
'multiplicity'])
for chainPart
in chainDict[
'chainParts'])
222 tool.totalCharge = 1
if tool.nTrk == 3
else -1
224 signatures = chainDict[
'signatures']
225 tool.isCombinedChain = (signatures.count(signatures[0]) != len(signatures))
226 tool.legMultiplicities = chainDict[
'chainMultiplicities']
228 monGroups = [
'bphysMon:online']
229 if any(group
in monGroups
for group
in chainDict[
'monGroups']):