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