Belle II Software  release-08-01-10
TestNewMCDecayFinder Class Reference
Inheritance diagram for TestNewMCDecayFinder:
Collaboration diagram for TestNewMCDecayFinder:

Public Member Functions

def testReconstructMCDecay (self)
 
def testReconstructMCDecay_3KS (self)
 
def testMCDecayFinder (self)
 
def testMCDecayFinder_3KS (self)
 

Detailed Description

The unit test

Definition at line 19 of file test_reconstructmcdecay.py.

Member Function Documentation

◆ testMCDecayFinder()

def testMCDecayFinder (   self)
Reconstruct/search for an MC decay chain using the findMCDecay tool.

Definition at line 114 of file test_reconstructmcdecay.py.

114  def testMCDecayFinder(self):
115  """Reconstruct/search for an MC decay chain using the findMCDecay tool."""
116 
117  testFile = tempfile.NamedTemporaryFile()
118 
119  main = create_path()
120 
121  inputfile = b2test_utils.require_file(
122  'analysis/1000_B_DstD0Kpi_skimmed.root', 'validation', py_case=self)
123  inputMdst(inputfile, path=main)
124 
125  findMCDecay(
126  'B0:DstD0Kpi',
127  'B0 =direct=> [D*+ =direct=> [D0 =direct=> K- pi+ ] pi+] pi-',
128  path=main)
129 
130  ntupler = register_module('VariablesToNtuple')
131  ntupler.param('fileName', testFile.name)
132  ntupler.param('variables', ['isSignal'])
133  ntupler.param('particleList', 'B0:DstD0Kpi')
134  main.add_module(ntupler)
135 
137 
138  ntuplefile = TFile(testFile.name)
139  ntuple = ntuplefile.Get('ntuple')
140 
141  self.assertFalse(ntuple.GetEntries() == 0, "Ntuple is empty.")
142 
143  allBkg = ntuple.GetEntries("isSignal == 0")
144  allSig = ntuple.GetEntries("isSignal > 0")
145 
146  print(f"True candidates {allSig}")
147  print(f"False candidates {allBkg}")
148 
149  sig_expected = 406
150 
151  self.assertTrue(
152  allSig == sig_expected,
153  f"n_sig expected: {sig_expected} found: {sig_expected}.")
154  self.assertTrue(allBkg == 0, f"n_bkg expected 0, found: {allBkg}.")
155 
156  print("Test passed, cleaning up.")
157 
def require_file(filename, data_type="", py_case=None)
Definition: __init__.py:54
def safe_process(*args, **kwargs)
Definition: __init__.py:236

◆ testMCDecayFinder_3KS()

def testMCDecayFinder_3KS (   self)
Reconstruct/search for an MC decay chain using the findMCDecay tool.

Definition at line 158 of file test_reconstructmcdecay.py.

◆ testReconstructMCDecay()

def testReconstructMCDecay (   self)
Reconstruct/search for an MC decay chain using the reconstructMCDecay tool.

Definition at line 22 of file test_reconstructmcdecay.py.

◆ testReconstructMCDecay_3KS()

def testReconstructMCDecay_3KS (   self)
Reconstruct/search for an MC decay chain using the reconstructMCDecay tool.

Definition at line 71 of file test_reconstructmcdecay.py.


The documentation for this class was generated from the following file: