32from background
import add_output
46 sad =
'phase2.1.4_collimators_1'
55 sad =
'phase2.1.4_collimators_1'
64 sad =
'phase2.1.4_collimators_1'
86 print(
'basf2', argvs[0],
87 '(Touschek,Coulomb,Brems) (HER,LER) equivTime_us num [(study,usual,ECL,PXD) phase outdir]')
91inputSAD =
"/group/belle2/BGcampaigns/SAD/forG4/"
92bgType = bgType +
'_' + accRing
93sadFile = inputSAD + bgType +
'_' + sad +
'.root'
94realTime = float(equivTime) * 1000
95fname = bgType +
'_' + sampleType +
'-phase' + str(phase) +
'-' + num
96outputFile = outdir +
'/' + fname +
'.root'
100if not os.path.exists(sadFile):
101 b2.B2ERROR(
'SAD file ' + sadFile +
' not found')
106if not os.path.exists(outdir):
110b2.B2RESULT(
'Output file: ' + outputFile)
111b2.B2RESULT(
'Corresponds to ' + equivTime +
' us of running phase ' + str(phase))
114b2.set_log_level(b2.LogLevel.RESULT)
117main = b2.create_path()
121eventinfosetter = b2.register_module(
'EventInfoSetter')
122eventinfosetter.param(
'evtNumList', [10000000])
123main.add_module(eventinfosetter)
126gearbox = b2.register_module(
'Gearbox')
128 gearbox.param(
'fileName',
'geometry/Beast2_phase2.xml')
130 gearbox.param(
'fileName',
'geometry/Belle2_earlyPhase3.xml')
131if sampleType ==
'study':
132 gearbox.param(
'override', [
133 (
"/DetectorComponent[@name='PXD']//ActiveChips",
'true',
''),
134 (
"/DetectorComponent[@name='PXD']//SeeNeutrons",
'true',
''),
135 (
"/DetectorComponent[@name='SVD']//ActiveChips",
'true',
''),
136 (
"/DetectorComponent[@name='SVD']//SeeNeutrons",
'true',
''),
137 (
"/DetectorComponent[@name='TOP']//BeamBackgroundStudy",
'1',
''),
138 (
"/DetectorComponent[@name='ARICH']//BeamBackgroundStudy",
'1',
''),
139 (
"/DetectorComponent[@name='ECL']//BeamBackgroundStudy",
'1',
''),
140 (
"/DetectorComponent[@name='KLM']//BeamBackgroundStudy",
'1',
''),
142main.add_module(gearbox)
145generator = b2.register_module(
'BeamBkgGenerator')
146generator.param(
'fileName', sadFile)
147generator.param(
'ringName', accRing)
148generator.param(
'realTime', realTime)
149main.add_module(generator)
152geometry = b2.register_module(
'Geometry')
153geometry.param(
'useDB',
False)
155 geometry.param(
'additionalComponents', [
'BEAMABORT',
'MICROTPC',
'CLAWS',
'HE3TUBE'])
156main.add_module(geometry)
159fullsim = b2.register_module(
'FullSim')
160if sampleType ==
'study':
161 fullsim.param(
'PhysicsList',
'FTFP_BERT_HP')
162 fullsim.param(
'UICommandsAtIdle', [
'/process/inactivate nKiller'])
163 fullsim.param(
'StoreAllSecondaries',
True)
164 fullsim.param(
'SecondariesEnergyCut', 0.000001)
165main.add_module(fullsim)
168progress = b2.register_module(
'Progress')
169main.add_module(progress)
176excludeBranch = [
'MCParticles']
177add_output(main, bgType, realTime, sampleType, phase, fileName=outputFile, excludeBranches=excludeBranch)