20 from basf2
import create_path, process, statistics, conditions
26 print(
"usage: basf2", argvs[0],
"experiment run [fileNumber] -n <num_of_events>")
28 experiment = int(argvs[1])
32 num =
'MC-' + argvs[3]
35 expRun =
'{:0=4d}'.format(experiment) +
'.' +
'{:0=5d}'.format(run)
36 filename = f
"top.{expRun}.{num}.sroot"
39 conditions.append_globaltag(
'patch_main_release-07_noTOP')
41 conditions.append_globaltag(
'data_reprocessing_proc13')
43 conditions.append_globaltag(
'data_reprocessing_prompt')
44 conditions.append_globaltag(
'online')
47 def addLaserSource(x, angle, slotID, path):
49 Adds a laser source to the path
50 :param x local x coordinate of source in the local frame
51 :param angle vertical tilt of the source
52 :param slotID 1-16, slot number. If it's 0, then all the coorinates are in the BelleII frame
55 path.add_module(
'OpticalGun',
70 angularDistribution=
'uniform'
79 main.add_module(
'EventInfoSetter', expList=[experiment], runList=[run])
82 main.add_module(
'Gearbox')
85 main.add_module(
'Geometry')
88 main.add_module(
'TOPCalPulseGenerator', asicChannels=[0])
91 for slot
in range(1, 17):
92 for pos
in [0.9, 5.7, 11.3, 16.9, 22.5, 28.1, 33.7, 39.3, 44.1]:
95 addLaserSource(x, angle, slot, main)
98 main.add_module(
'FullSim')
101 main.add_module(
'TOPDigitizer', lookBackWindows=28)
104 main.add_module(
'TOPPacker')
107 main.add_module(
'SeqRootOutput', saveObjs=[
'EventMetaData',
'RawTOPs'], outputFileName=filename)
110 main.add_module(
'Progress')