12 This file skims events that are useful to test the time dependent CPV analysis tools,
13 i.e. those events where the signal B0 meson is correctly MC matched
and where no tracks on the tag side
14 belong to the signal side. The variable used
for skimming
is isRelatedRestOfEventB0Flavor.
15 As input one needs a MC mdst file
for the signal channel B0sig->J/PsiKs.
16 The script reconstructs B0sig->J/PsiKs on the signal side
17 and applies the flavor tagger on the ROE.
18 The vertex of B0sig
is reconstructed (JPsi vertex)
and the vertex of B0tag
is reconstructed
23import modularAnalysis as ma
27from mdst import add_mdst_output
30 sys.exit('Must provide three input parameters: [Belle_Belle2] [output_root_file_name]'
33belleOrBelle2Flag = sys.argv[1]
34outRootFileName = sys.argv[2]
38cp_val_path = b2.Path()
40environmentType =
"default"
42if belleOrBelle2Flag ==
"Belle":
43 os.environ[
'BELLE_POSTGRES_SERVER'] =
'can51'
44 os.environ[
'USE_GRAND_REPROCESS_DATA'] =
'1'
46 environmentType =
"Belle"
48ma.inputMdstList(environmentType=environmentType, filelist=[], path=cp_val_path)
50ma.fillParticleList(decayString=
'mu+:all', cut=
'', path=cp_val_path)
51ma.reconstructDecay(decayString=
'J/psi:mumu -> mu+:all mu-:all', cut=
'abs(dM) < 0.11', path=cp_val_path)
52ma.matchMCTruth(list_name=
'J/psi:mumu', path=cp_val_path)
54if belleOrBelle2Flag ==
"Belle":
57 ma.matchMCTruth(list_name=
'K_S0:mdst', path=cp_val_path)
60 ma.reconstructDecay(decayString=
'B0:sig -> J/psi:mumu K_S0:mdst', cut=
'Mbc > 5.2 and abs(deltaE) < 0.15', path=cp_val_path)
62if belleOrBelle2Flag ==
"Belle2":
65 ma.fillParticleList(decayString=
'pi+:all', cut=
'', path=cp_val_path)
66 ma.reconstructDecay(decayString=
'K_S0:pipi -> pi+:all pi-:all', cut=
'abs(dM) < 0.25', path=cp_val_path)
69 ma.reconstructDecay(decayString=
'B0:sig -> J/psi:mumu K_S0:pipi', cut=
'Mbc > 5.2 and abs(deltaE) < 0.15', path=cp_val_path)
71ma.matchMCTruth(list_name=
'B0:sig', path=cp_val_path)
73ma.buildRestOfEvent(target_list_name=
'B0:sig', path=cp_val_path)
75ma.applyCuts(list_name=
'B0:sig', cut=
'abs(isRelatedRestOfEventB0Flavor) == 1', path=cp_val_path)
79skimfilter = b2.register_module(
'SkimFilter')
80skimfilter.set_name(
'SkimFilter_B2JPsiKs_NoTargetOfFT')
82skimfilter.param(
'particleLists', [
'B0:sig'])
83cp_val_path.add_module(skimfilter)
88B0skim_path = b2.Path()
91skimfilter.if_value(
'=0', B0skim_path)
94add_mdst_output(cp_val_path,
True, outRootFileName)
96ma.summaryOfLists(particleLists=[
'B0:sig'], path=cp_val_path)
99ma.process(cp_val_path)