Belle II Software development
B2A914-ApplyLambdaSelector.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 LambdaSelector as LambdaSelector
23
24# create path
25my_path = b2.create_path()
26
27# load input ROOT file
28ma.inputMdst(filename=b2.find_file('B02JpsiKs_Jpsi2mumu_Ks2pipi.root', 'examples', False),
29 path=my_path)
30
31# load stdLambda0s
32stdV0s.stdLambdas(path=my_path)
33
34b2.conditions.prepend_globaltag("analysis_tools_light-2503-ceres")
35
36# apply LambdaSelector to the Lambda0 particle list
37# the Lambda0 particle list type can be 'all', 'standard', 'tight', or 'loose'
38# If 'all', no cut is applied by LambdaSelector, and mva output become available via extraInfo.
39# if other list type, cut is applied on the original particle list.
40LambdaSelector.LambdaSelector(particleListName='Lambda0:merged',
41 output_label_name='standard',
42 extraInfoName_V0Selector='V0_mva',
43 extraInfoName_KsVeto='Ks_mva',
44 path=my_path)
45
46ma.matchMCTruth(list_name='Lambda0:standard', path=my_path)
47
48# set variables
49vars = vc.kinematics + vc.mc_kinematics + vc.mc_truth
50vars += ['extraInfo(V0_mva)']
51vars += ['extraInfo(Ks_mva)']
52
53# output
54ma.variablesToNtuple('Lambda0:standard',
55 variables=vars,
56 filename='test.root',
57 treename='mvalam',
58 path=my_path)
59
60b2.process(my_path)
61
62# print out the summary
63print(b2.statistics)
def LambdaSelector(particleListName, identifier_Lambda="Lambda_LGBM_V0Selector", identifier_vKs="Lambda_LGBM_KsVeto", output_label_name='', extraInfoName_V0Selector='LambdaSelector_V0Selector', extraInfoName_KsVeto='LambdaSelector_KsVeto', useCustomThreshold=False, threshold_V0Selector=0.72, threshold_KsVeto=0.27, path=None)
def stdLambdas(prioritiseV0=True, fitter='TreeFit', path=None, updateAllDaughters=False, writeOut=False)
Definition: stdV0s.py:182