21 <output>pion-ExtMuidValidation.root</output>
22 <contact>piilonen@vt.edu</contact>
23 <description>Create events
with 1 pion track
for ext/muid validation.</description>
30from simulation import add_simulation
31from reconstruction import add_reconstruction
38 Create pion sample for the ExtMuid validation.
41 b2.set_random_seed(654321)
43 output_filename = '../pion-ExtMuidValidation.root'
45 print(output_filename)
47 path = b2.create_path()
49 eventinfosetter = b2.register_module(
'EventInfoSetter')
50 eventinfosetter.param(
'evtNumList', [1000])
51 path.add_module(eventinfosetter)
53 pgun = b2.register_module(
'ParticleGun')
55 'pdgCodes': [-211, 211],
58 'momentumGeneration':
'uniform',
59 'momentumParams': [0.5, 5.0],
60 'thetaGeneration':
'uniformCos',
61 'thetaParams': [15., 150.],
62 'phiGeneration':
'uniform',
63 'phiParams': [0.0, 360.0],
64 'vertexGeneration':
'fixed',
65 'xVertexParams': [0.0],
66 'yVertexParams': [0.0],
67 'zVertexParams': [0.0],
69 pgun.param(param_pgun)
73 if 'BELLE2_BACKGROUND_DIR' in os.environ:
74 background_files = glob.glob(os.environ[
'BELLE2_BACKGROUND_DIR'] +
'/*.root')
75 add_simulation(path, bkgfiles=background_files)
77 b2.B2FATAL(
'BELLE2_BACKGROUND_DIR is not set.')
79 add_reconstruction(path)
81 output = b2.register_module(
'RootOutput')
82 output.param(
'outputFileName', output_filename)
83 output.param(
'branchNames', [
'MCParticles',
'ExtHits',
'KLMMuidLikelihoods',
'KLMHit2ds'])
84 path.add_module(output)
85 path.add_module(
'Progress')
91if __name__ ==
'__main__':
95 print(
"This validation deactivated and thus basf2 is not executed.\n"
96 "If you want to run this validation, please set the 'ACTIVE' flag above to 'True'.\n"