Belle II Software development
0_Klong_efficiencies.py
1#!/usr/bin/env python3
2
3
10
11"""
12<header>
13 <output>K_long_full_validation_sample.root</output>
14 <description>Generates particle gun Klong Events for Kl efficiency validation.\t
15 Output is not very meaningful but sufficient to check for regression.</description>
16 <contact>cristina.martellini@roma3.infn.it</contact>
17 <interval>nightly</interval>
18</header>
19"""
20
21import basf2 as b2
22import simulation as sim
23import reconstruction as rec
24
25import os
26import glob
27
28bg = None
29if 'BELLE2_BACKGROUND_DIR' in os.environ:
30 bg = glob.glob(os.environ['BELLE2_BACKGROUND_DIR'] + '/*.root')
31else:
32 b2.B2FATAL('The variable BELLE2_BACKGROUND_DIR is not set!')
33
34b2.set_random_seed('L1V0RN0')
35
36main = b2.create_path()
37
38main.add_module('EventInfoSetter',
39 expList=0,
40 runList=0,
41 evtNumList=1000)
42
43main.add_module('ParticleGun',
44 nTracks=5,
45 momentumGeneration='uniform',
46 momentumParams=[0.05, 5.0],
47 pdgCodes=[130, 321, 311, 2212, 2112, 211, 13, 11])
48
49sim.add_simulation(path=main,
50 bkgfiles=bg)
51
52rec.add_reconstruction(path=main)
53
54# Run a module to generate histograms for PID performances
55main.add_module('KlongValidation',
56 outputName='K_long_full_validation_sample.root',
57 KlIdCut=0.1,
58 contact='cristina.martellini@roma3.infn.it')
59
60# add_mdst_output(main, True, 'Klong_validation_check.root')
61
62main.add_module('Progress')
63
64b2.process(main)
65print(b2.statistics)