Belle II Software light-2411-aldebaran
B2A910-ApplyKsSelector.py
1#!/usr/bin/env python3
2
3
10
11
17
18import basf2 as b2
19import modularAnalysis as ma
20import variables.collections as vc
21import stdV0s as stdV0s
22import ksSelector as ksSelector
23
24output_file = 'output.root'
25
26# create path
27my_path = b2.create_path()
28
29# load input ROOT file
30ma.inputMdst(filename=b2.find_file('B02JpsiKs_Jpsi2mumu_Ks2pipi.root', 'examples', False),
31 path=my_path)
32
33# load V0s and copy it
34stdV0s.stdKshorts(path=my_path)
35
36# ultimately, this line can be replaced with b2.conditions.prepend_globaltag(ma.getAnalysisGlobaltag())
37b2.conditions.prepend_globaltag('analysis_tools_light-2411-aldebaran')
38
39# apply ksSelector to the K_S0 particle list
40# list type can be 'all', 'standard', 'tight', or 'loose'
41# If 'all', no cut is applied by KsSelector, and mva output become available via extraInfo.
42# if other list type, cut is applied on the original particle list.
43ksSelector.ksSelector(particleListName='K_S0:merged',
44 output_label_name='standard',
45 extraInfoName_V0Selector='V0_mva',
46 extraInfoName_LambdaVeto='Lam_mva',
47 path=my_path)
48
49ma.matchMCTruth(list_name='K_S0:standard', path=my_path)
50
51# set variables
52vars = vc.kinematics + vc.mc_kinematics + vc.mc_truth
53vars += ['extraInfo(V0_mva)']
54vars += ['extraInfo(Lam_mva)']
55
56# output
57ma.variablesToNtuple('K_S0:standard',
58 variables=vars,
59 filename=output_file,
60 treename='tree',
61 path=my_path)
62
63b2.process(my_path)
64
65# print out the summary
66print(b2.statistics)
def ksSelector(particleListName, identifier_Ks="Ks_LGBM_V0Selector", identifier_vLambda="Ks_LGBM_LambdaVeto", output_label_name='', extraInfoName_V0Selector='KsSelector_V0Selector', extraInfoName_LambdaVeto='KsSelector_LambdaVeto', useCustomThreshold=False, threshold_V0Selector=0.90, threshold_LambdaVeto=0.11, path=None)
Definition: ksSelector.py:251
def stdKshorts(prioritiseV0=True, fitter='TreeFit', path=None, updateAllDaughters=False, writeOut=False)
Definition: stdV0s.py:17