14import modularAnalysis
as ma
15from vertex
import kFit
21 Verify results make sense.
23 ntuplefile = TFile(filename)
24 ntuple = ntuplefile.Get('ntuple')
26 if ntuple.GetEntries() == 0:
27 basf2.B2FATAL(
"No D0s saved")
29 if ntuple.GetEntries(
"significanceOfDistance < 0 && significanceOfDistance != -1") > 0:
30 basf2.B2FATAL(
"Some entries have negative significanceOfDistance?")
32 if ntuple.GetEntries(
"significanceOfDistance > 0") == 0:
33 basf2.B2FATAL(
"significanceOfDistance never positive?")
36testFile = tempfile.NamedTemporaryFile()
38main = basf2.create_path()
42ma.fillParticleList(
'K-',
'', path=main)
43ma.fillParticleList(
'pi+',
'', path=main)
45ma.fillParticleList(
'gamma',
'', path=main)
46ma.reconstructDecay(
'pi0 -> gamma gamma',
'0.11 < M < 0.15', 0, path=main)
47ma.matchMCTruth(
'pi0', path=main)
50kFit(
'pi0', 0.0, path=main)
52ma.reconstructDecay(
'D0 -> K- pi+ pi0',
'', 0, path=main)
53ma.matchMCTruth(
'D0', path=main)
55kFit(
'D0', 0.0, decay_string=
'D0 -> ^K- ^pi+ pi0', path=main)
57ntupler = basf2.register_module(
'VariablesToNtuple')
58ntupler.param(
'fileName', testFile.name)
59ntupler.param(
'variables', [
'M',
'isSignal',
'distance',
'dr',
'dz',
'significanceOfDistance',
'pValue'])
60ntupler.param(
'particleList',
'D0')
61main.add_module(ntupler)
def require_file(filename, data_type="", py_case=None)
def clean_working_directory()
def safe_process(*args, **kwargs)