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