14 <output>PartGunChargedStableGenSim.root</output>
16 <contact>Marco Milesi, marco.milesi@unimelb.edu.au</contact>
17 <description> This steering script generates 1000 particle gun events for a set of charged stable particles,
18 runs the fullsim w/ mixed in background, and dumps full output (*Digits containers) in a file.</description>
26 parser = argparse.ArgumentParser(
27 description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
33 help=
"The directory containing beam bkg files.\n"
34 "If not set, basf2 will search for the 'BELLE2_BACKGROUND_DIR' env variable by default,\n"
35 "which is defined on the validation server.",
37 args = parser.parse_args()
39 from ROOT
import Belle2
40 from background
import get_background_files
41 from simulation
import add_simulation
45 chargedStableList = []
46 for idx
in range(len(Belle2.Const.chargedStableSet)):
47 particle = Belle2.Const.chargedStableSet.at(idx)
48 pdgId = particle.getPDGCode()
49 chargedStableList.extend([pdgId, -pdgId])
52 main = basf2.create_path()
55 main.add_module(
"EventInfoSetter", evtNumList=[1000], runList=[1])
58 basf2.set_random_seed(
"Pe@ce&Love")
61 pGun = basf2.register_module(
"ParticleGun")
63 "pdgCodes": chargedStableList,
65 "momentumGeneration":
"uniform",
66 "momentumParams": [0.05, 5.0],
67 "thetaGeneration":
"uniform",
68 "thetaParams": [17, 150],
69 "phiGeneration":
"uniform",
70 "phiParams": [0, 360],
71 "vertexGeneration":
"uniform",
72 "xVertexParams": [0.0, 0.0],
73 "yVertexParams": [0.0, 0.0],
74 "zVertexParams": [0.0, 0.0],
76 pGun.param(param_pGun)
80 add_simulation(main, bkgfiles=get_background_files(folder=args.bkg_dir))
83 main.add_module(
"Profile")
87 "RootOutput", outputFileName=
"../PartGunChargedStableGenSim.root"
91 main.add_module(
"Progress")
93 basf2.print_path(main)