30import modularAnalysis
as ma
38 step = str(sys.argv[1])
41 input_file = b2.find_file(
'Bd2K0spi0_to_test.root',
'examples',
False)
43 input_file = b2.find_file(
'ccbar_sample_to_test.root',
'examples',
False)
45 sys.exit(
'Step does not match any of the available samples: `signal` or `qqbar`')
47outfile =
'MVAExpert_fullNTuple_' + step +
'.root'
51main = b2.create_path()
53ma.inputMdst(filename=input_file,
56ma.fillParticleList(decayString=
'gamma:all',
58ma.fillParticleList(decayString=
'pi+:good',
59 cut=
'chiProb > 0.001 and pionID > 0.5',
61ma.fillParticleList(decayString=
'pi-:good',
62 cut=
'chiProb > 0.001 and pionID > 0.5',
65ma.reconstructDecay(decayString=
'K_S0 -> pi+:good pi-:good',
66 cut=
'0.480<=M<=0.516',
69ma.reconstructDecay(decayString=
'pi0 -> gamma:all gamma:all',
70 cut=
'0.115<=M<=0.152',
73ma.reconstructDecay(decayString=
'B0 -> K_S0 pi0',
74 cut=
'5.2 < Mbc < 5.3 and -0.3 < deltaE < 0.2',
77ma.matchMCTruth(list_name=
'B0', path=main)
78ma.buildRestOfEvent(target_list_name=
'B0', path=main)
82cleanMask = (
'cleanMask',
'nCDCHits > 0 and useCMSFrame(p)<=3.2',
'p >= 0.05 and useCMSFrame(p)<=3.2')
83ma.appendROEMasks(list_name=
'B0',
84 mask_tuples=[cleanMask],
87ma.buildContinuumSuppression(list_name=
'B0',
103 'KSFWVariables(mm2)',
104 'KSFWVariables(hso00)',
105 'KSFWVariables(hso01)',
106 'KSFWVariables(hso02)',
107 'KSFWVariables(hso03)',
108 'KSFWVariables(hso04)',
109 'KSFWVariables(hso10)',
110 'KSFWVariables(hso12)',
111 'KSFWVariables(hso14)',
112 'KSFWVariables(hso20)',
113 'KSFWVariables(hso22)',
114 'KSFWVariables(hso24)',
115 'KSFWVariables(hoo0)',
116 'KSFWVariables(hoo1)',
117 'KSFWVariables(hoo2)',
118 'KSFWVariables(hoo3)',
119 'KSFWVariables(hoo4)',
132targetVar = [
'isNotContinuumEvent']
135main.add_module(
'MVAExpert', listNames=[
'B0'], extraInfoName=
'FastBDT', identifier=
'MVAFastBDT.root')
138expertVars = [
'extraInfo(FastBDT)',
'transformedNetworkOutput(FastBDT,0.1,1.0)']
141ma.variablesToNtuple(decayString=
'B0',
142 variables=trainVars + targetVar + expertVars,