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