20 import modularAnalysis
as ma
23 path = b2.create_path()
26 ma.inputMdst(filename=b2.find_file(
'mdst14.root',
'validation',
False),
30 empty_path = b2.create_path()
31 skimfilter = b2.register_module(
'VariableToReturnValue')
32 skimfilter.param(
'variable',
'nCleanedTracks(dr < 2 and abs(dz) < 4)')
33 skimfilter.if_value(
'>12', empty_path, b2.AfterConditionPath.END)
34 path.add_module(skimfilter)
37 ma.fillParticleList(
'mu+',
'muonID > 0.8 and dr < 2 and abs(dz) < 4', writeOut=
True, path=path)
38 ma.fillParticleList(
'e+',
'electronID > 0.8 and dr < 2 and abs(dz) < 4', writeOut=
True, path=path)
41 '[[clusterReg == 1 and E > 0.10] or [clusterReg == 2 and E > 0.09] or [clusterReg == 3 and E > 0.16]]',
45 'B+:sig_e -> gamma e+',
46 '1.000 < M < 6.000 and cos(useRestFrame(daughterAngle(0, 1))) < 0.6',
51 'B+:sig_mu -> gamma mu+',
52 '1.000 < M < 6.000 and cos(useRestFrame(daughterAngle(0, 1))) < 0.6',
56 ma.copyLists(
'B+:sig', [
'B+:sig_e',
'B+:sig_mu'], writeOut=
True, path=path)
57 ma.looseMCTruth(
'B+:sig', path=path)
58 ma.rankByHighest(
'B+:sig',
'daughter(0,E)', outputVariable=
'PhotonCandidateRank', path=path)
59 ma.buildRestOfEvent(
'B+:sig', path=path)
62 'dr < 2 and abs(dz) < 4',
63 'clusterE9E25 > 0.9 and clusterTiming < 50 and E > 0.9 and clusterTrackMatch==0')
64 ma.appendROEMasks(
'B+:sig', [clean_roe_mask], path=path)
65 ma.applyCuts(
'B+:sig',
'roeDeltae(CleanROE) < 2.0 and roeMbc(CleanROE) > 4.8', path=path)
67 skimfilter = b2.register_module(
'SkimFilter')
68 skimfilter.param(
'particleLists', [
'B+:sig'])
69 empty_path = b2.create_path()
70 skimfilter.if_value(
'=0', empty_path, b2.AfterConditionPath.END)
71 path.add_module(skimfilter)
79 fei_tag =
'FEIv4_2021_MC14_release_05_01_12'
85 b2.conditions.prepend_globaltag(ma.getAnalysisGlobaltag())
87 belle_particles = fei.get_default_channels(KLong=
False,
91 B_extra_cut=
'nRemainingTracksInEvent <= 3',
94 configuration = fei.config.FeiConfiguration(prefix=fei_tag, training=
False, monitor=
False, cache=0)
95 feistate = fei.get_path(belle_particles, configuration)
99 roe_path = feistate.path
100 empty_path = b2.create_path()
101 ma.copyLists(
'B-:generic_final', [], writeOut=
True, path=path)
102 ma.copyLists(
'B-:generic_final', [
'B-:generic'], writeOut=
True, path=roe_path)
103 ma.signalSideParticleFilter(
'B+:sig',
'', roe_path, empty_path)
104 path.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
107 upsilon_cut =
'7.5 <= M <= 10.5 and -2.0 <= m2RecoilSignalSide <= 4.0 and -0.15 <= daughter(0,deltaE) <= 0.1'
108 ma.reconstructDecay(
'Upsilon(4S):hadronic -> B-:generic_final B+:sig', upsilon_cut, dmID=1, path=path)
109 ma.copyLists(
'Upsilon(4S):all', [
'Upsilon(4S):hadronic'], path=path)
110 ma.looseMCTruth(
'Upsilon(4S):all', path=path)
112 ma.buildRestOfEvent(
'Upsilon(4S):all', path=path)
113 upsilon_roe = (
'UpsilonROE',
'dr < 2 and abs(dz) < 4',
'goodBelleGamma == 1')
114 ma.appendROEMasks(
'Upsilon(4S):all', [upsilon_roe], path=path)
115 ma.applyCuts(
'Upsilon(4S):all',
'-2.0 < m2RecoilSignalSide < 4.0', path=path)
116 ma.applyCuts(
'Upsilon(4S):all',
'roeEextra(UpsilonROE) <= 0.9', path=path)
117 ma.applyCuts(
'Upsilon(4S):all',
'nROE_Tracks(UpsilonROE) <= 4', path=path)
120 ma.rankByHighest(
'Upsilon(4S):all',
'daughter(0, extraInfo(SignalProbability))', numBest=1,
121 outputVariable=
'FEIProbabilityRank', path=path)
124 ma.variablesToNtuple(
'Upsilon(4S):all', [
'M',
'm2RecoilSignalSide',
'E'], filename=
"Upsilon.root", path=path)
127 b2.process(path, max_event=100)