4 from basf2
import B2INFO
5 from cdctrigger
import add_cdc_trigger
6 from ecltrigger
import add_ecl_trigger
7 from klmtrigger
import add_klm_trigger
8 from grltrigger
import add_grl_trigger
9 from gdltrigger
import add_gdl_trigger
10 from effCalculation
import EffCalculation
20 component=["CDC", "ECL", "KLM", "GRL", "GDL"],
23 add the gdl module to path
24 @param path module is added to this path
25 @param SimulationMode the simulation mode in TSIM, 1: fast simulation,
26 trigger algoritm simulation only, no firmware simulation
27 2: full simulation, both trigger algorithm and firmware
29 @param minHits the minimum number of CDC super layers with hits, the default values is 4
30 @param OpenFilter if OpenFilter is True, the events failed to pass L1 trigger
31 will be discarded. Make sure you do need open filter before you
33 @param Belle2Phase the trigger menu at the phase is applied. Option: Phase2, Phase3
34 @param component list of sub-trigger components to be included in simulation
36 if (
"CDC" in component):
37 add_cdc_trigger(path=path, SimulationMode=SimulationMode, shortTracks=shortTracks, thetaDef=
'avg', zDef=
'min')
38 if (
"ECL" in component):
40 if (
"KLM" in component):
42 if (
"GRL" in component):
43 add_grl_trigger(path, SimulationMode)
44 if (
"GDL" in component):
45 add_gdl_trigger(path=path, SimulationMode=SimulationMode, OpenFilter=OpenFilter, Belle2Phase=Belle2Phase)
47 EffCalculation(path, Belle2Phase=Belle2Phase)
48 path.add_module(
'StatisticsSummary').set_name(
'Sum_TriggerSimulation')
50 B2INFO(
'The L1 trigger simulation (TSIM) is set up with the following configuration:',
51 SimulationMode=SimulationMode,
52 ShortTracks=shortTracks,
53 OpenFilter=OpenFilter,
54 Belle2Phase=Belle2Phase,
55 Components=
', '.join(component))
58 def add_subdetector_tsim(
69 add the trigger simlation of subdetector, no grl and gdl
70 the parameters are the same as above
72 if (
"CDC" in component):
73 add_cdc_trigger(path=path, SimulationMode=SimulationMode, shortTracks=shortTracks)
74 if (
"ECL" in component):
75 add_ecl_trigger(path=path)
76 if (
"KLM" in component):
77 add_klm_trigger(path=path)
80 def add_grl_gdl_tsim(path, SimulationMode=1, OpenFilter=False, Belle2Phase="Phase3", PrintResult=False):
82 add grl and gdl, the function have to applied based on the
83 dataobjects produced in add_subdetector_trigger_simulation
84 the parameters are the same as above
86 add_grl_trigger(path, SimulationMode)
87 add_gdl_trigger(path, SimulationMode, OpenFilter, Belle2Phase)
89 EffCalculation(path, Belle2Phase=Belle2Phase)