26import modularAnalysis
as ma
46outfile =
"B2A701_output_"
51 if sys.argv[1]
not in [
'train',
'test',
'apply_signal',
'apply_qqbar']:
52 sys.exit(
"usage:\n\tbasf2 B2A701-ContinuumSuppression_Input.py <train,test,apply_signal,apply_qqbar>")
54 step = str(sys.argv[1])
57 input_file_list = [b2.find_file(
'ccbar_sample_to_train.root',
'examples',
False),
58 b2.find_file(
'Bd2K0spi0_to_train.root',
'examples',
False)]
60 input_file_list = [b2.find_file(
'ccbar_sample_to_test.root',
'examples',
False),
61 b2.find_file(
'Bd2K0spi0_to_test.root',
'examples',
False)]
62elif step ==
'apply_signal':
63 input_file_list = [b2.find_file(
'Bd2K0spi0_to_test.root',
'examples',
False)]
64elif step ==
'apply_qqbar':
65 input_file_list = [b2.find_file(
'ccbar_sample_to_test.root',
'examples',
False)]
67 sys.exit(
'Step does not match any of the available samples: `train`, `test`, `apply_signal`or `apply_qqbar`')
68outfile += step +
'.root'
73my_path = b2.create_path()
75ma.inputMdstList(filelist=input_file_list,
78ma.fillParticleList(decayString=
'gamma:all',
81ma.fillParticleList(decayString=
'pi+:good',
82 cut=
'chiProb > 0.001 and pionID > 0.5',
84ma.fillParticleList(decayString=
'pi-:good',
85 cut=
'chiProb > 0.001 and pionID > 0.5',
88ma.reconstructDecay(decayString=
'K_S0 -> pi+:good pi-:good',
89 cut=
'0.480<=M<=0.516',
92ma.reconstructDecay(decayString=
'pi0 -> gamma:all gamma:all',
93 cut=
'0.115<=M<=0.152',
96ma.reconstructDecay(decayString=
'B0 -> K_S0 pi0',
97 cut=
'5.2 < Mbc < 5.3 and -0.3 < deltaE < 0.2',
100ma.matchMCTruth(list_name=
'B0', path=my_path)
101ma.buildRestOfEvent(target_list_name=
'B0', path=my_path)
104cleanMask = (
'cleanMask',
'nCDCHits > 0 and useCMSFrame(p)<=3.2',
'p >= 0.05 and useCMSFrame(p)<=3.2')
105ma.appendROEMasks(list_name=
'B0',
106 mask_tuples=[cleanMask],
109ma.buildContinuumSuppression(list_name=
'B0',
110 roe_mask=
'cleanMask',
124 'KSFWVariables(pt_sum)',
125 'KSFWVariables(mm2)',
126 'KSFWVariables(hso00)',
127 'KSFWVariables(hso01)',
128 'KSFWVariables(hso02)',
129 'KSFWVariables(hso03)',
130 'KSFWVariables(hso04)',
131 'KSFWVariables(hso10)',
132 'KSFWVariables(hso12)',
133 'KSFWVariables(hso14)',
134 'KSFWVariables(hso20)',
135 'KSFWVariables(hso22)',
136 'KSFWVariables(hso24)',
137 'KSFWVariables(hoo0)',
138 'KSFWVariables(hoo1)',
139 'KSFWVariables(hoo2)',
140 'KSFWVariables(hoo3)',
141 'KSFWVariables(hoo4)',
154targetVar = [
'isNotContinuumEvent']
157ma.variablesToNtuple(decayString=
'B0',
158 variables=trainVars + targetVar,