Belle II Software development
tdcpv_variables.py
1#!/usr/bin/env python3
2
3
10
11"""
12A test of the TDCPV variables using the small test file for running quickly
13"""
14
15import b2test_utils
16from basf2 import set_random_seed, create_path, process
17import modularAnalysis as ma
18import vertex as vx
19
20# make logging more reproducible by replacing some strings
22set_random_seed("1337")
23
24
25path = create_path()
26
27# load single event from the mdst file
28path.add_module('RootInput', inputFileNames=b2test_utils.require_file('analysis/tests/tdcpv-mdst.root'))
29
30# Creates Muon particle list
31ma.fillParticleList(decayString='mu+:all', cut='', path=path)
32
33# reconstruct J/psi -> mu+ mu- decay
34ma.reconstructDecay(decayString='J/psi:mumu -> mu+:all mu-:all', cut='dM<0.11', path=path)
35
36# reconstruct Ks from standard pi+ particle list
37ma.fillParticleList(decayString='pi+:all', cut='', path=path)
38ma.reconstructDecay(decayString='K_S0:pipi -> pi+:all pi-:all', cut='dM<0.25', path=path)
39
40# reconstruct B0 -> J/psi Ks decay
41ma.reconstructDecay(decayString='B0:sig -> J/psi:mumu K_S0:pipi', cut='Mbc > 5.2 and abs(deltaE)<0.15', path=path)
42
43# Does the matching between reconstructed and MC particles
44ma.matchMCTruth(list_name='B0:sig', path=path)
45
46# build the rest of the event associated to the B0
47ma.buildRestOfEvent(target_list_name='B0:sig', fillWithMostLikely=True,
48 path=path)
49
50# Vertex fit for the signal B0
51vx.treeFit('B0:sig', ipConstraint=True, path=path)
52
53# Fit Vertex of the B0 on the tag side
54vx.TagV(list_name='B0:sig', MCassociation='breco', fitAlgorithm='KFit', constraintType='tube', path=path)
55
56tdcpv_vars = ['DeltaT', 'DeltaTErr', 'DeltaTBelle', 'TagVz', 'TagVzErr', 'mcDeltaT', 'mcDeltaTau', 'isSignal']
57
58# Print the variables to log
59ma.printVariableValues('B0:sig', var_names=tdcpv_vars, path=path)
60
61process(path)
def require_file(filename, data_type="", py_case=None)
Definition: __init__.py:54
def configure_logging_for_tests(user_replacements=None)
Definition: __init__.py:106