21 import modularAnalysis
as ma
24 path = b2.create_path()
27 ma.inputMdst(filename=b2.find_file(
'mdst14.root',
'validation',
False),
31 empty_path = b2.create_path()
32 skimfilter = b2.register_module(
'VariableToReturnValue')
33 skimfilter.param(
'variable',
'nCleanedTracks(dr < 2 and abs(dz) < 4)')
34 skimfilter.if_value(
'>12', empty_path, b2.AfterConditionPath.END)
35 path.add_module(skimfilter)
38 ma.fillParticleList(
'mu+',
'muonID > 0.8 and dr < 2 and abs(dz) < 4', writeOut=
True, path=path)
39 ma.fillParticleList(
'e+',
'electronID > 0.8 and dr < 2 and abs(dz) < 4', writeOut=
True, path=path)
42 '[[clusterReg == 1 and E > 0.10] or [clusterReg == 2 and E > 0.09] or [clusterReg == 3 and E > 0.16]]',
46 'B+:sig_e -> gamma e+',
47 '1.000 < M < 6.000 and cos(useRestFrame(daughterAngle(0, 1))) < 0.6',
52 'B+:sig_mu -> gamma mu+',
53 '1.000 < M < 6.000 and cos(useRestFrame(daughterAngle(0, 1))) < 0.6',
57 ma.copyLists(
'B+:sig', [
'B+:sig_e',
'B+:sig_mu'], writeOut=
True, path=path)
58 ma.looseMCTruth(
'B+:sig', path=path)
59 ma.rankByHighest(
'B+:sig',
'daughter(0,E)', outputVariable=
'PhotonCandidateRank', path=path)
60 ma.buildRestOfEvent(
'B+:sig', path=path)
63 'dr < 2 and abs(dz) < 4',
64 'clusterE9E25 > 0.9 and clusterTiming < 50 and E > 0.09 and clusterTrackMatch==0')
65 ma.appendROEMasks(
'B+:sig', [clean_roe_mask], path=path)
66 ma.applyCuts(
'B+:sig',
'roeDeltae(CleanROE) < 2.0 and roeMbc(CleanROE) > 4.8', path=path)
68 skimfilter = b2.register_module(
'SkimFilter')
69 skimfilter.param(
'particleLists', [
'B+:sig'])
70 empty_path = b2.create_path()
71 skimfilter.if_value(
'=0', empty_path, b2.AfterConditionPath.END)
72 path.add_module(skimfilter)
75 path.add_module(
'MCDecayFinder', decayString=
'B+ -> e+ nu_e gamma', listName=
'B+:FEIMC_e', writeOut=
True)
76 path.add_module(
'MCDecayFinder', decayString=
'B+ -> mu+ nu_mu gamma', listName=
'B+:FEIMC_mu', writeOut=
True)
77 ma.copyLists(
'B+:FEIMC', [
'B+:FEIMC_e',
'B+:FEIMC_mu'], writeOut=
True, path=path)
81 isSignal =
'isSignalAcceptMissingNeutrino'
82 signalMC =
'eventCached(countInList(B+:FEIMC))'
83 cut =
'[[{mc} > 0 and {sig} == 1] or [{mc} == 0 and {sig} != 1]]'.format(mc=signalMC, sig=isSignal)
84 ma.applyCuts(
'B+:sig', cut, path=path)
87 fei_tag =
'my_specFEI'
88 belle_particles = fei.get_default_channels(KLong=
False,
92 B_extra_cut=
'nRemainingTracksInEvent <= 3',
96 configuration = fei.config.FeiConfiguration(prefix=fei_tag, training=
True, monitor=
False, cache=-1)
100 feistate = fei.get_path(belle_particles, configuration)
103 if feistate.stage == 0:
106 rO = b2.register_module(
'RootOutput')
107 rO.set_name(
'ROE_RootOutput')
108 rO.param(
'additionalBranchNames', [
'RestOfEvent'])
109 feistate.path.add_module(rO)
110 roe_path = b2.create_path()
111 cond_module = b2.register_module(
'SignalSideParticleFilter')
112 cond_module.param(
'particleLists', [
'B+:sig'])
113 cond_module.if_true(feistate.path, b2.AfterConditionPath.END)
114 roe_path.add_module(cond_module)
115 path.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
118 path = b2.create_path()
119 ma.inputMdstList([], path)
120 path.add_path(feistate.path)
121 r1 = b2.register_module(
'RootOutput')
122 r1.set_name(
'ROE_RootOutput')
123 r1.param(
'additionalBranchNames', [
'RestOfEvent'])
128 b2.process(path, max_event=100)