13 <output>PartGunChargedStableGenSim.root</output>
15 <contact>arul.prakash@physik.uni-muenchen.de</contact>
16 <description> This steering script generates 1000 particle gun events
for a set of charged stable particles,
17runs the fullsim w/ mixed
in background,
and dumps full output (*Digits containers)
in a file.</description>
21# NB. Argument parsing is done *before* any import from the ROOT module, otherwise PyROOT will hijack the command-line options
22# in case of clashing option names. Most notably, this would happen with the '-h', '--help' option.
25parser = argparse.ArgumentParser(
26 description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
32 help=
"The directory containing beam bkg files.\n"
33 "If not set, basf2 will search for the 'BELLE2_BACKGROUND_DIR' env variable by default,\n"
34 "which is defined on the validation server.",
36args = parser.parse_args()
38from ROOT
import Belle2
39from background
import get_background_files
40from simulation
import add_simulation
45for idx
in range(len(Belle2.Const.chargedStableSet)):
46 particle = Belle2.Const.chargedStableSet.at(idx)
47 pdgId = particle.getPDGCode()
48 chargedStableList.extend([pdgId, -pdgId])
51main = basf2.create_path()
54main.add_module(
"EventInfoSetter", evtNumList=[3000], runList=[1])
57basf2.set_random_seed(
"Pe@ce&Love")
60pGun = basf2.register_module(
"ParticleGun")
62 "pdgCodes": chargedStableList,
64 "momentumGeneration":
"uniform",
65 "momentumParams": [0.05, 5.0],
66 "thetaGeneration":
"uniform",
67 "thetaParams": [17, 150],
68 "phiGeneration":
"uniform",
69 "phiParams": [0, 360],
70 "vertexGeneration":
"uniform",
71 "xVertexParams": [0.0, 0.0],
72 "yVertexParams": [0.0, 0.0],
73 "zVertexParams": [0.0, 0.0],
79add_simulation(main, bkgfiles=get_background_files(folder=args.bkg_dir))
82main.add_module(
"Profile")
86 "RootOutput", outputFileName=
"../PartGunChargedStableGenSim.root"
90main.add_module(
"Progress")