Belle II Software  light-2303-iriomote
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 20 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 115 of file test_reconstructmcdecay.py.

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

◆ testMCDecayFinder_3KS()

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

Definition at line 159 of file test_reconstructmcdecay.py.

◆ testReconstructMCDecay()

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

Definition at line 23 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 72 of file test_reconstructmcdecay.py.


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