6 <output>PartGunChargedStableGenSim.root</output>
8 <contact>Marco Milesi, marco.milesi@unimelb.edu.au</contact>
9 <description> This steering script generates 1000 particle gun events for a set of charged stable particles,
10 runs the fullsim w/ mixed in background, and dumps full output (*Digits containers) in a file.</description>
18 parser = argparse.ArgumentParser(description=__doc__,
19 formatter_class=argparse.RawDescriptionHelpFormatter)
20 parser.add_argument(
"--bkg_dir",
23 help=
"The directory containing beam bkg files.\n"
24 "If not set, basf2 will search for the 'BELLE2_BACKGROUND_DIR' env variable by default,\n"
25 "which is defined on the validation server.")
26 args = parser.parse_args()
28 from ROOT
import Belle2
29 from background
import get_background_files
30 from simulation
import add_simulation
34 from simulation
import add_simulation
35 from background
import get_background_files
36 from ROOT
import Belle2
40 chargedStableList = []
41 for idx
in range(len(Belle2.Const.chargedStableSet)):
42 particle = Belle2.Const.chargedStableSet.at(idx)
43 pdgId = particle.getPDGCode()
44 chargedStableList.extend([pdgId, -pdgId])
47 main = basf2.create_path()
50 main.add_module(
"EventInfoSetter", evtNumList=[1000], runList=[1])
53 basf2.set_random_seed(
"P1s@Merd@")
56 pGun = basf2.register_module(
"ParticleGun")
58 "pdgCodes": chargedStableList,
60 "momentumGeneration":
"uniform",
61 "momentumParams": [0.05, 5.0],
62 "thetaGeneration":
"uniform",
63 "thetaParams": [17, 150],
64 "phiGeneration":
"uniform",
65 "phiParams": [0, 360],
66 "vertexGeneration":
"uniform",
67 "xVertexParams": [0.0, 0.0],
68 "yVertexParams": [0.0, 0.0],
69 "zVertexParams": [0.0, 0.0],
71 pGun.param(param_pGun)
75 add_simulation(main, bkgfiles=get_background_files(folder=args.bkg_dir))
78 main.add_module(
"Profile")
81 main.add_module(
"RootOutput", outputFileName=
"../PartGunChargedStableGenSim.root")
84 main.add_module(
"Progress")
86 basf2.print_path(main)