3 from TrigHLTJetHypoUnitTests.TrigHLTJetHypoUnitTestsConf
import (
5 SimpleHypoJetVectorGenerator,)
7 from TriggerMenuMT.HLTMenuConfig.Menu
import DictFromChainName
9 from TrigHLTJetHypo.TrigJetHypoToolConfig
import (
10 trigJetHypoToolHelperFromDict,
11 trigJetHypoToolHelperFromDict_,)
13 from TrigHLTJetHypo.test_cases
import test_strings
15 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
17 from TrigHLTJetHypo.ConditionsToolSetterTree
import ConditionsToolSetterTree
as ConditionsToolSetter
25 run_with_partitions=False):
34 """Chaindicts for Partion vs flownetwork strudies"""
36 chainNameDecoder = DictFromChainName.DictFromChainName()
42 chain_dict = chainNameDecoder.getChainDict(self.
chain_name)
43 assert len(chain_dict[
'chainParts']) == self.
n_conds
46 for cp
in chain_dict[
'chainParts']:
47 cp[
'hypoScenario'] =
'simple_partition'
53 generator = SimpleHypoJetVectorGenerator()
55 generator.ets = [80000. + 1000.*i
for i
in range(self.n_sgnl)]
56 generator.etas = [0.5] * self.n_sgnl
57 generator.n_bkgd = self.
n_bkgd
83 """ChainDict to excercise modifications to CombinationsHelperTool"""
85 chainNameDecoder = DictFromChainName.DictFromChainName()
91 chain_dict = chainNameDecoder.getChainDict(self.
chain_name)
92 assert len(chain_dict[
'chainParts']) == 1
94 chain_dict[
'chainParts'][0][
'hypoScenario'] =
'combinationsTest'
99 chain_dict = self._make_chain_dict()
100 print(chain_dict[
'chainParts'][0])
101 return trigJetHypoToolHelperFromDict(chain_dict)
105 generator = SimpleHypoJetVectorGenerator()
107 generator.ets = [80000. + 1000.*i
for i
in range(self.
n_sgnl)]
108 generator.etas = [0.5] * self.
n_sgnl
110 generator.n_bkgd = self.
n_bkgd
126 CombinationsTests.__init__(self, n_sgnl, n_bkgd, bkgd_etmax)
129 """ChainDict to excercise modifications to CombinationsHelperTool"""
131 chain_dict = CombinationsTests.make_chain_dict(self)
132 chain_dict[
'chainParts'][0][
'hypoScenario'] =
'partitionsTest'
138 print(chain_dict[
'chainParts'][0])
139 return trigJetHypoToolHelperFromDict(chain_dict)
143 return chain_name +
'_b' +
str(self.
n_bkgd) +
'_parts.log'
154 CombinationsTests.__init__(self, n_sgnl, n_bkgd, bkgd_etmax)
160 simple([(10et, 0eta320)(20et)])
164 toolSetter = ConditionsToolSetter(self.
chain_name)
165 return trigJetHypoToolHelperFromDict_(chain_label,
167 toolSetter=toolSetter)
174 generator = SimpleHypoJetVectorGenerator()
176 generator.ets = [80000. + 1000.*i
for i
in range(self.
n_sgnl)]
177 generator.etas = [0.5] * self.
n_sgnl
181 for i
in range(len(generator.etas)):
182 generator.etas[i] *= factor
185 generator.n_bkgd = self.
n_bkgd
199 CombinationsTests.__init__(self, n_sgnl, n_bkgd, bkgd_etmax)
206 toolSetter = ConditionsToolSetter(self.
chain_name)
207 return trigJetHypoToolHelperFromDict_(self.
chain_label,
209 toolSetter=toolSetter)
213 return '%s_s%d_b%d_l%d' % (chain_name,
220 generator = SimpleHypoJetVectorGenerator()
222 generator.ets = [80000. + 1000.*i
for i
in range(self.
n_sgnl)]
223 generator.etas = [0.5] * self.
n_sgnl
228 for i
in range(len(generator.etas)):
229 generator.etas[i] *= factor
232 generator.n_bkgd = self.
n_bkgd
256 print(test_conditions.__dict__)
258 chain_name = test_conditions.chain_name
260 ht = test_conditions.make_helper_tool()
264 jetHypoExerciserAlg=JetHypoExerciserAlg(
"JetHypoExerciser")
265 jetHypoExerciserAlg.JetHypoHelperTool = ht
266 jetHypoExerciserAlg.event_generator = test_conditions.make_event_generator()
267 jetHypoExerciserAlg.visit_debug =
True
269 lfn = test_conditions.logfile_name(chain_name)
271 jetHypoExerciserAlg.logname = lfn
274 print(jetHypoExerciserAlg)
277 result.addEventAlgo(jetHypoExerciserAlg)
282 if __name__==
"__main__":
289 label = test_strings[label_ind]
291 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
292 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
294 flags.Exec.MaxEvents=10