The unit test
Definition at line 19 of file test_reconstructmcdecay.py.
◆ testMCDecayFinder()
def testMCDecayFinder |
( |
|
self | ) |
|
Reconstruct/search for an MC decay chain using the findMCDecay tool.
Definition at line 70 of file test_reconstructmcdecay.py.
70 def testMCDecayFinder(self):
71 """Reconstruct/search for an MC decay chain using the findMCDecay tool."""
73 testFile = tempfile.NamedTemporaryFile()
78 'analysis/1000_B_DstD0Kpi_skimmed.root',
'validation', py_case=self)
79 inputMdst(inputfile, path=main)
83 'B0 =direct=> [D*+ =direct=> [D0 =direct=> K- pi+ ] pi+] pi-',
86 ntupler = register_module(
'VariablesToNtuple')
87 ntupler.param(
'fileName', testFile.name)
88 ntupler.param(
'variables', [
'isSignal'])
89 ntupler.param(
'particleList',
'B0:DstD0Kpi')
90 main.add_module(ntupler)
94 ntuplefile = TFile(testFile.name)
95 ntuple = ntuplefile.Get(
'ntuple')
97 self.assertFalse(ntuple.GetEntries() == 0,
"Ntuple is empty.")
99 allBkg = ntuple.GetEntries(
"isSignal == 0")
100 allSig = ntuple.GetEntries(
"isSignal > 0")
102 print(f
"True candidates {allSig}")
103 print(f
"False candidates {allBkg}")
108 allSig == sig_expected,
109 f
"n_sig expected: {sig_expected} found: {sig_expected}.")
110 self.assertTrue(allBkg == 0, f
"n_bkg expected 0, found: {allBkg}.")
112 print(
"Test passed, cleaning up.")
def require_file(filename, data_type="", py_case=None)
def safe_process(*args, **kwargs)
◆ testReconstructMCDecay()
def testReconstructMCDecay |
( |
|
self | ) |
|
The documentation for this class was generated from the following file: