12from ROOT
import Belle2
19 """Returns 1 if current event contains at least one BEAST hit, 0 otherwise"""
22 """reimplementation of Module::initialize()."""
25 """reimplementation of Module::event()."""
31 if len(p.getRelationsTo(
'MicrotpcSimHits')) > 0 \
32 or len(p.getRelationsTo(
'He3tubeSimHits')) > 0 \
33 or len(p.getRelationsTo(
'PindiodeSimHits')) > 0 \
34 or len(p.getRelationsTo(
'BgoSimHits')) > 0 \
35 or len(p.getRelationsTo(
'CsiSimHits')) > 0:
42d = datetime.datetime.today()
43print(d.strftime(
'job start: %Y-%m-%d %H:%M:%S\n'))
54 print(
'./RunBGMC.py [(RBB,Touschek,Coulomb)_(HER,LER)(,_far)] [num]')
58if name.find(
'LER') != -1:
60elif name.find(
'HER') != -1:
63 print(
'name should include either of HER or LER')
73if name.find(
'far') != -1:
79inputfilename =
'forIgal/' + name +
'.root'
80logfilename =
'log/' + name +
'_' + num +
'.log'
81outputfilename =
'output/out_phase1_pos_TiN_' + name +
'_' + num +
'.root'
82seed =
'1' + num + num +
'1'
96if name ==
'Brems_LER':
98elif name ==
'Touschek_LER':
101elif name ==
'Coulomb_LER':
104elif name ==
'Brems_HER':
107elif name ==
'Touschek_HER':
110elif name ==
'Coulomb_HER':
116 print(
'Unknown name!')
119print(
'accring: ', accring,
'(0:LER, 1:HER)')
120print(
'input: ', inputfilename)
121print(
'log: ', logfilename)
122print(
'output: ', outputfilename)
123print(
'range: ', range)
125print(
'nevent: ', nevent)
126print(
'readouttime:', readouttime)
167b2.set_log_level(b2.LogLevel.WARNING)
170b2.set_random_seed(int(seed))
176eventinfosetter = b2.register_module(
'EventInfoSetter')
177eventinfosetter.param({
'evtNumList': [nevent],
'runList': [1],
'expList': [1]})
181touschekinput = b2.register_module(
'SADInput')
182touschekinput.param(
'Filename', inputfilename)
188touschekinput.param(
'ReadMode', readmode)
193touschekinput.param(
'AccRing', accring)
198touschekinput.param(
'ReadoutTime', readouttime)
202touschekinput.param(
'Range', range)
210gearbox = b2.register_module(
'Gearbox')
211geometry = b2.register_module(
'Geometry')
212gearbox.param(
'fileName',
'/geometry/Beast2_phase1.xml')
213fullsim = b2.register_module(
'FullSim')
215param_fullsim = {
'RegisterOptics': 1,
'PhotonFraction': 0.3}
216fullsim.param(param_fullsim)
217fullsim.param(
'PhysicsList',
'QGSP_BERT_HP')
218fullsim.param(
'UICommandsAtIdle', [
'/process/inactivate nKiller'])
222fullsim.param(
'StoreAllSecondaries',
True)
223fullsim.param(
'SecondariesEnergyCut', 0.0)
228progress = b2.register_module(
'Progress')
231rootoutput = b2.register_module(
'RootOutput')
232rootoutput.param(
'outputFileName', outputfilename)
233rootoutput.param(
'updateFileCatalog',
False)
240rootoutput.param(
'branchNames', [
'BgoSimHits',
'MicrotpcSimHits',
241 'PindiodeSimHits',
'He3tubeSimHits',
'CsiSimHits'])
244main = b2.create_path()
245main.add_module(eventinfosetter)
246main.add_module(gearbox)
247main.add_module(touschekinput)
248main.add_module(geometry)
249main.add_module(fullsim)
250main.add_module(progress)
261main.add_module(rootoutput)
273print(
'Event Statistics:')
276d = datetime.datetime.today()
277print(d.strftime(
'job finish: %Y-%m-%d %H:%M:%S\n'))
A (simplified) python wrapper for StoreArray.