3 from TrigHLTJetHypoUnitTests.TrigHLTJetHypoUnitTestsConf
import (
4 JetHypoExerciserCompareAlg,
5 SimpleHypoJetVectorGenerator,
6 RandomSignalHypoJetVectorGenerator,
10 from TriggerMenuMT.HLTMenuConfig.Menu
import DictFromChainName
12 from TrigHLTJetHypo.TrigJetHypoToolConfig
import (
13 trigJetHypoToolHelperFromDict,
14 trigJetHypoToolHelperFromDict_,)
16 from TrigHLTJetHypo.test_cases
import test_strings
18 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
20 from TrigHLTJetHypo.ConditionsToolSetterTree
import ConditionsToolSetterTree
22 from TrigHLTJetHypo.ConditionsToolSetterFastReduction
import \
23 ConditionsToolSetterFastReduction
33 generator = SimpleHypoJetVectorGenerator()
35 generator.ets = [80000. + 1000.*i + 500.
for i
in range(n_signal)]
36 generator.etas = [0.5*
pow(-1, i)
for i
in range(n_signal)]
38 generator.n_bkgd = n_bkgd
39 generator.bkgd_etmax = bkgd_etmax
43 generator.useEtaEtNotEtaE = useEtNotE
54 """ChainDict to excercise modifications to CombinationsHelperTool"""
56 chainNameDecoder = DictFromChainName.DictFromChainName()
62 chain_dict = chainNameDecoder.getChainDict(self.chain_name)
63 assert len(chain_dict[
'chainParts']) == 1
65 chain_dict[
'chainParts'][0][
'hypoScenario'] =
'combinationsTest'
70 chain_dict = self._make_chain_dict()
71 print(chain_dict[
'chainParts'][0])
72 return trigJetHypoToolHelperFromDict(chain_dict)
75 return self.chain_name +
'_b' +
str(self.n_bkgd) +
'_combs.log'
85 CombinationsTests.__init__(self)
92 setter1 = ConditionsToolSetterTree(
'dummyChainName')
93 helper1 = trigJetHypoToolHelperFromDict_(self.
chain_label,
107 helper0 = AlwaysSameHelperTool()
108 helper0.passflag =
False
110 setter0 = ConditionsToolSetterFastReduction(
'dummyChainName')
111 helper0 = trigJetHypoToolHelperFromDict_(self.
chain_label,
121 return (helper0, helper1)
134 print(test_conditions.__dict__)
136 ht0, ht1 = test_conditions.make_helper_tools()
141 jetHypoExerciserAlg=JetHypoExerciserCompareAlg(
"JetHypoCompareExerciser")
142 jetHypoExerciserAlg.JetHypoHelperTool0 = ht0
144 jetHypoExerciserAlg.JetHypoHelperTool1 = ht1
146 jetHypoExerciserAlg.event_generator = event_generator
148 jetHypoExerciserAlg.visit_debug =
True
150 jetHypoExerciserAlg.logname = test_conditions.logname
153 print(jetHypoExerciserAlg)
156 result.addEventAlgo(jetHypoExerciserAlg)
160 if __name__ ==
"__main__":
173 mult_string =
'_s' +
str(n_signal).zfill(2) +
'_b' + \
174 str(n_background).zfill(2)
183 useEtaEtNotEtaE =
False
184 event_generator = RandomSignalHypoJetVectorGenerator()
185 event_generator.n_sig_lo = n_sig_lo
186 event_generator.n_sig_hi = n_sig_hi
187 event_generator.e_sig_lo = e_sig_lo * 1000.
188 event_generator.e_sig_hi = e_sig_hi * 1000.
189 event_generator.eta_sig_hi = eta_sig_hi
190 event_generator.n_bkgd = n_bkgd
191 event_generator.bkgd_etmax = bkgd_etmax
192 event_generator.useEtaEtNotEtaE = useEtaEtNotEtaE
194 s_params = [
str(p).zfill(2)
for p
in (
202 mult_string =
'_s%s_%s_%s_%s_%s_b%s' % tuple(s_params)
209 label = test_strings[label_ind]
210 lfn =
'test_case.txt'
211 if(
not os.path.exists(lfn)):
212 with open(lfn,
'w')
as ofile:
213 ofile.write(label+
'\n')
218 0:
'simple1condComp',
219 1:
'simple2condComp',
229 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
230 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
232 flags.Exec.MaxEvents=10