15 import modularAnalysis
as ma
18 path = b2.create_path()
21 ma.inputMdst(environmentType=
'default',
22 filename=b2.find_file(
'mdst12.root',
'validation',
False),
26 empty_path = b2.create_path()
27 skimfilter = b2.register_module(
'VariableToReturnValue')
28 skimfilter.param(
'variable',
'nCleanedTracks(dr < 2 and abs(dz) < 4)')
29 skimfilter.if_value(
'>12', empty_path, b2.AfterConditionPath.END)
30 path.add_module(skimfilter)
33 ma.fillParticleList(
'mu+',
'muonID > 0.8 and dr < 2 and abs(dz) < 4', writeOut=
True, path=path)
34 ma.fillParticleList(
'e+',
'electronID > 0.8 and dr < 2 and abs(dz) < 4', writeOut=
True, path=path)
37 '[[clusterReg == 1 and E > 0.10] or [clusterReg == 2 and E > 0.09] or [clusterReg == 3 and E > 0.16]]',
41 'B+:sig_e -> gamma e+',
42 '1.000 < M < 6.000 and cos(useRestFrame(daughterAngle(0, 1))) < 0.6',
47 'B+:sig_mu -> gamma mu+',
48 '1.000 < M < 6.000 and cos(useRestFrame(daughterAngle(0, 1))) < 0.6',
52 ma.copyLists(
'B+:sig', [
'B+:sig_e',
'B+:sig_mu'], writeOut=
True, path=path)
53 ma.looseMCTruth(
'B+:sig', path=path)
54 ma.rankByHighest(
'B+:sig',
'daughter(0,E)', outputVariable=
'PhotonCandidateRank', path=path)
55 ma.buildRestOfEvent(
'B+:sig', path=path)
58 'dr < 2 and abs(dz) < 4',
59 'clusterE9E25 > 0.9 and clusterTiming < 50 and E > 0.09 and trackMatchType==0')
60 ma.appendROEMasks(
'B+:sig', [clean_roe_mask], path=path)
61 ma.applyCuts(
'B+:sig',
'roeDeltae(CleanROE) < 2.0 and roeMbc(CleanROE) > 4.8', path=path)
63 skimfilter = b2.register_module(
'SkimFilter')
64 skimfilter.param(
'particleLists', [
'B+:sig'])
65 empty_path = b2.create_path()
66 skimfilter.if_value(
'=0', empty_path, b2.AfterConditionPath.END)
67 path.add_module(skimfilter)
70 path.add_module(
'MCDecayFinder', decayString=
'B+ -> e+ nu_e gamma', listName=
'B+:FEIMC_e', writeOut=
True)
71 path.add_module(
'MCDecayFinder', decayString=
'B+ -> mu+ nu_mu gamma', listName=
'B+:FEIMC_mu', writeOut=
True)
72 ma.copyLists(
'B+:FEIMC', [
'B+:FEIMC_e',
'B+:FEIMC_mu'], writeOut=
True, path=path)
76 isSignal =
'isSignalAcceptMissingNeutrino'
77 signalMC =
'eventCached(countInList(B+:FEIMC))'
78 cut =
'[[{mc} > 0 and {sig} == 1] or [{mc} == 0 and {sig} != 1]]'.format(mc=signalMC, sig=isSignal)
79 ma.applyCuts(
'B+:sig', cut, path=path)
82 fei_tag =
'my_specFEI'
83 belle_particles = fei.get_default_channels(KLong=
False,
87 B_extra_cut=
'nRemainingTracksInEvent <= 3',
91 configuration = fei.config.FeiConfiguration(prefix=fei_tag, training=
True, monitor=
False, cache=-1)
95 feistate = fei.get_path(belle_particles, configuration)
98 if feistate.stage == 0:
101 rO = b2.register_module(
'RootOutput')
102 rO.set_name(
'ROE_RootOutput')
103 rO.param(
'additionalBranchNames', [
'RestOfEvent'])
104 feistate.path.add_module(rO)
105 roe_path = b2.create_path()
106 cond_module = b2.register_module(
'SignalSideParticleFilter')
107 cond_module.param(
'particleLists', [
'B+:sig'])
108 cond_module.if_true(feistate.path, b2.AfterConditionPath.END)
109 roe_path.add_module(cond_module)
110 path.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
113 path = b2.create_path()
114 ma.inputMdstList(
'default', [], path)
115 path.add_path(feistate.path)
116 r1 = b2.register_module(
'RootOutput')
117 r1.set_name(
'ROE_RootOutput')
118 r1.param(
'additionalBranchNames', [
'RestOfEvent'])
123 b2.process(path, max_event=100)