28 b2.set_log_level(b2.LogLevel.ERROR)
31 basf2datadir = os.path.join(os.environ.get(
'BELLE2_LOCAL_DIR',
None),
'data')
36 evtmetagen = b2.register_module(
'EventInfoSetter')
37 evtmetainfo = b2.register_module(
'Progress')
38 paramloader = b2.register_module(
'Gearbox')
39 geobuilder = b2.register_module(
'Geometry')
40 particlegun = b2.register_module(
'ParticleGun')
41 evtgeninput = b2.register_module(
'EvtGenInput')
42 kkgeninput = b2.register_module(
'KKGenInput')
43 mcparticleprinter = b2.register_module(
'PrintMCParticles')
44 g4sim = b2.register_module(
'FullSim')
45 bkgmixer = b2.register_module(
'BeamBkgMixer')
46 cdcdigitizer = b2.register_module(
'CDCDigitizer')
47 cdctrg = b2.register_module(
"TRGCDC")
48 rootOut = b2.register_module(
'RootOutput')
49 rootIn = b2.register_module(
'RootInput')
50 srootIn = b2.register_module(
'SeqRootInput')
51 neuro = b2.register_module(
'NeuroTrigger')
62 simulatedComponents = [
'MagneticFieldConstant4LimitedRCDC',
'CDC',
67 evtmetagen.param({
'evtNumList': [1000],
'runList': [1]})
71 geobuilder.param(
'components', simulatedComponents)
76 particlegun.param(
'pdgCodes', [13, -13])
77 particlegun.param(
'nTracks', 5)
78 particlegun.param(
'momentumGeneration',
'inversePt')
81 particlegun.param(
'momentumParams', [0.2, 8.0])
86 particlegun.param(
'phiGeneration',
'uniform')
87 particlegun.param(
'phiParams', [0, 360])
90 particlegun.param(
'vertexGeneration',
'uniform')
91 particlegun.param(
'xVertexParams', [0, 0])
92 particlegun.param(
'yVertexParams', [0, 0])
93 particlegun.param(
'zVertexParams', [-20.0, 20.0])
102 kkdir = os.path.join(os.environ.get(
'BELLE2_LOCAL_DIR',
None),
'generators')
103 kkgeninput.param(
'tauinputFile', kkdir +
'kkmc/data/mu.input.dat')
104 kkgeninput.param(
'KKdefaultFile', kkdir +
'kkmc/data/KK2f_defaults.dat')
105 kkgeninput.param(
'taudecaytableFile',
'')
108 mcparticleprinter.param(
'maxLevel', -1)
120 dir =
'/sw/belle2/bkg/'
129 bkg_files = glob.glob(dir +
'/*.root')
131 bkgmixer.param(
'backgroundFiles', bkg_files)
132 bkgmixer.param(
'components', simulatedComponents)
133 bkgmixer.param(
'scaleFactors', [
134 (
'Coulomb_LER', bkgScaleFactor),
135 (
'Coulomb_HER', bkgScaleFactor),
136 (
'RBB_LER', bkgScaleFactor),
137 (
'RBB_HER', bkgScaleFactor),
138 (
'Touschek_LER', bkgScaleFactor),
139 (
'Touschek_HER', bkgScaleFactor)
155 cdctrg.param(
'ConfigFile', os.path.join(basf2datadir,
"trg/cdc/TRGCDCConfig_0_20101111.dat"))
157 cdctrg.param(
'CurlBackStop', 1)
158 cdctrg.param(
'SimulationMode', 1)
159 cdctrg.param(
'FastSimulationMode', 0)
165 cdctrg.param(
'InnerTSLUTFile', os.path.join(basf2datadir,
"trg/cdc/innerLUT_v3.0.coe"))
166 cdctrg.param(
'OuterTSLUTFile', os.path.join(basf2datadir,
"trg/cdc/outerLUT_v3.0.coe"))
171 cdctrg.param(
'HoughFinderMappingFileMinus', os.path.join(basf2datadir,
"trg/cdc/HoughMappingMinus20160223.dat"))
172 cdctrg.param(
'HoughFinderMappingFilePlus', os.path.join(basf2datadir,
"trg/cdc/HoughMappingPlus20160223.dat"))
188 cdctrg.param(
'TRGCDCDataInputMode', 2)
192 neuro.param(
'filename', os.path.join(basf2datadir,
"trg/cdc/Neuro20160309Nonlin.root"))
199 rootOut.param(
'outputFileName',
'basf2.root')
202 rootIn.param(
'inputFileName',
'basf2.root')
210 fullMain = b2.create_path()
212 fullMain.add_module(evtmetagen)
213 fullMain.add_module(evtmetainfo)
214 fullMain.add_module(paramloader)
215 fullMain.add_module(geobuilder)
216 fullMain.add_module(particlegun)
219 fullMain.add_module(mcparticleprinter)
220 fullMain.add_module(g4sim)
221 fullMain.add_module(bkgmixer)
222 fullMain.add_module(cdcdigitizer)
223 fullMain.add_module(cdctrg)
224 fullMain.add_module(neuro)
227 g4SimMain = b2.create_path()
229 g4SimMain.add_module(evtmetagen)
230 g4SimMain.add_module(evtmetainfo)
231 g4SimMain.add_module(paramloader)
232 g4SimMain.add_module(geobuilder)
233 g4SimMain.add_module(particlegun)
236 g4SimMain.add_module(mcparticleprinter)
237 g4SimMain.add_module(g4sim)
238 g4SimMain.add_module(bkgmixer)
239 g4SimMain.add_module(cdcdigitizer)
240 g4SimMain.add_module(rootOut)
243 savedG4SimMain = b2.create_path()
245 savedG4SimMain.add_module(rootIn)
246 savedG4SimMain.add_module(evtmetainfo)
247 savedG4SimMain.add_module(paramloader)
248 savedG4SimMain.add_module(geobuilder)
249 savedG4SimMain.add_module(cdctrg)
252 generatorMain = b2.create_path()
254 generatorMain.add_module(evtmetagen)
255 generatorMain.add_module(evtmetainfo)
256 generatorMain.add_module(paramloader)
257 generatorMain.add_module(geobuilder)
258 generatorMain.add_module(particlegun)
261 generatorMain.add_module(mcparticleprinter)
262 generatorMain.add_module(g4sim)
263 generatorMain.add_module(rootOut)
266 savedGeneratorMain = b2.create_path()
268 savedGeneratorMain.add_module(rootIn)
269 savedGeneratorMain.add_module(evtmetainfo)
270 savedGeneratorMain.add_module(paramloader)
271 savedGeneratorMain.add_module(geobuilder)
272 savedGeneratorMain.add_module(bkgmixer)
273 savedGeneratorMain.add_module(cdcdigitizer)
274 savedGeneratorMain.add_module(cdctrg)
277 readB2LMain = b2.create_path()
279 readB2LMain.add_module(srootIn)
280 readB2LMain.add_module(paramloader)
281 readB2LMain.add_module(geobuilder)
282 readB2LMain.add_module(cdcdigitizer)
283 readB2LMain.add_module(evtmetainfo)
284 readB2LMain.add_module(cdctrg)
300 b2.process(readB2LMain)