6 <contact>Fernando Abudinen; abudinen@mpp.mpg.de</contact>
7 <description>This file skims events that are usefull to test the time dependent CPV analysis tools,
8 i.e. those events where the signal B0 meson is correctly MC matched and where no tracks on the tag side
9 belongs to the signal side. The variable used for skimming is isRelatedRestOfEventB0Flavor.
10 As input one needs a MC mdst file for the signal channel B0sig->J/PsiKs.
11 The script reconstructs B0sig->J/PsiKs on the signal side
12 and applies the flavor tagger on the ROE.
13 The vertex of B0sig is reconstructed (JPsi vertex) and the vertex of B0tag is reconstructed
14 with the TagV module. </description>
19 import modularAnalysis
as ma
20 import flavorTagger
as ft
22 from variables
import variables
25 from reconstruction
import add_mdst_output
27 if len(sys.argv) != 3:
28 sys.exit(
'Must provide three input parameters: [Belle_Belle2] [output_root_file_name]'
31 belleOrBelle2Flag = sys.argv[1]
32 outRootFileName = sys.argv[2]
36 cp_val_path = b2.Path()
38 environmentType =
"default"
40 if belleOrBelle2Flag ==
"Belle":
41 from b2biiConversion
import convertBelleMdstToBelleIIMdst, setupB2BIIDatabase, setupBelleMagneticField
46 setupB2BIIDatabase(isBelleMC)
47 os.environ[
'BELLE_POSTGRES_SERVER'] =
'can51'
48 os.environ[
'USE_GRAND_REPROCESS_DATA'] =
'1'
50 environmentType =
"Belle"
52 ma.inputMdstList(environmentType=environmentType, filelist=[], path=cp_val_path)
54 ma.fillParticleList(decayString=
'mu+:all', cut=
'', path=cp_val_path)
55 ma.reconstructDecay(decayString=
'J/psi:mumu -> mu+:all mu-:all', cut=
'dM<0.11', path=cp_val_path)
56 ma.matchMCTruth(list_name=
'J/psi:mumu', path=cp_val_path)
58 if belleOrBelle2Flag ==
"Belle":
61 ma.matchMCTruth(list_name=
'K_S0:mdst', path=cp_val_path)
64 ma.reconstructDecay(decayString=
'B0:sig -> J/psi:mumu K_S0:mdst', cut=
'Mbc > 5.2 and abs(deltaE)<0.15', path=cp_val_path)
66 if belleOrBelle2Flag ==
"Belle2":
69 ma.fillParticleList(decayString=
'pi+:all', cut=
'', path=cp_val_path)
70 ma.reconstructDecay(decayString=
'K_S0:pipi -> pi+:all pi-:all', cut=
'dM<0.25', path=cp_val_path)
73 ma.reconstructDecay(decayString=
'B0:sig -> J/psi:mumu K_S0:pipi', cut=
'Mbc > 5.2 and abs(deltaE)<0.15', path=cp_val_path)
75 ma.matchMCTruth(list_name=
'B0:sig', path=cp_val_path)
77 ma.buildRestOfEvent(target_list_name=
'B0:sig', path=cp_val_path)
79 ma.applyCuts(list_name=
'B0:sig', cut=
'abs(isRelatedRestOfEventB0Flavor) == 1', path=cp_val_path)
111 skimfilter = b2.register_module(
'SkimFilter')
112 skimfilter.set_name(
'SkimFilter_B2JPsiKs_NoTargetOfFT')
114 skimfilter.param(
'particleLists', [
'B0:sig'])
115 cp_val_path.add_module(skimfilter)
120 B0skim_path = b2.Path()
123 skimfilter.if_value(
'=0', B0skim_path)
126 add_mdst_output(cp_val_path,
True, outRootFileName)
128 ma.summaryOfLists(particleLists=[
'B0:sig'], path=cp_val_path)
131 ma.process(cp_val_path)