5 import modularAnalysis
as ma
7 import flavorTagger
as ft
8 from variables
import variables
as vm
14 filenumber = sys.argv[1]
17 b2.conditions.prepend_globaltag(ma.getAnalysisGlobaltag())
24 filelist=[b2.find_file(f
"starterkit/2021/1111540100_eph3_BGx0_{filenumber}.root",
"examples")],
31 "electronID > 0.1 and dr < 0.5 and abs(dz) < 2 and thetaInCDCAcceptance",
38 "goodFWDGamma",
"passesCut(clusterReg == 1 and clusterE > 0.075)"
41 "goodBRLGamma",
"passesCut(clusterReg == 2 and clusterE > 0.05)"
44 "goodBWDGamma",
"passesCut(clusterReg == 3 and clusterE > 0.1)"
47 "goodGamma",
"passesCut(goodFWDGamma or goodBRLGamma or goodBWDGamma)"
49 ma.fillParticleList(
"gamma:brems",
"goodGamma", path=main)
50 ma.correctBrems(
"e+:corrected",
"e+:uncorrected",
"gamma:brems", path=main)
51 vm.addAlias(
"isBremsCorrected",
"extraInfo(bremsCorrected)")
55 "J/psi:ee -> e+:corrected e-:corrected ?addbrems",
65 "B0 -> J/psi:ee K_S0:merged",
66 cut=
"Mbc > 5.2 and abs(deltaE) < 0.15",
71 ma.matchMCTruth(
"B0", path=main)
74 ma.buildRestOfEvent(
"B0", fillWithMostLikely=
True, path=main)
75 track_based_cuts =
"thetaInCDCAcceptance and pt > 0.075 and dr < 5 and abs(dz) < 10"
76 ecl_based_cuts =
"thetaInCDCAcceptance and E > 0.05"
77 roe_mask = (
"my_mask", track_based_cuts, ecl_based_cuts)
78 ma.appendROEMasks(
"B0", [roe_mask], path=main)
81 ft.flavorTagger([
"B0"], path=main)
87 b2.set_random_seed(
"Belle II StarterKit")
88 ma.rankByHighest(
"B0", variable=
"random", numBest=1, path=main)
93 standard_vars = vc.kinematics + vc.mc_kinematics + vc.mc_truth
94 b_vars += vc.deltae_mbc
95 b_vars += standard_vars
98 roe_kinematics = [
"roeE()",
"roeM()",
"roeP()",
"roeMbc()",
"roeDeltae()"]
99 roe_multiplicities = [
102 "nROE_NeutralHadrons()",
104 b_vars += roe_kinematics + roe_multiplicities
106 for roe_variable
in roe_kinematics + roe_multiplicities:
108 roe_variable_with_mask = roe_variable.replace(
"()",
"(my_mask)")
109 b_vars.append(roe_variable_with_mask)
111 b_vars += ft.flavor_tagging
112 b_vars += vc.tag_vertex + vc.mc_tag_vertex
115 fs_vars = vc.pid + vc.track + vc.track_hits + standard_vars
116 b_vars += vu.create_aliases_for_selected(
117 fs_vars + [
"isBremsCorrected"],
118 "B0 -> [J/psi -> ^e+ ^e-] K_S0",
121 b_vars += vu.create_aliases_for_selected(
122 fs_vars,
"B0 -> J/psi [K_S0 -> ^pi+ ^pi-]", prefix=[
"pip",
"pim"]
125 jpsi_ks_vars = vc.inv_mass + standard_vars
126 jpsi_ks_vars += vc.vertex + vc.mc_vertex
127 b_vars += vu.create_aliases_for_selected(jpsi_ks_vars,
"B0 -> ^J/psi ^K_S0")
130 "Jpsi_M_uncorrected",
"daughter(0, daughterCombination(M,0:0,1:0))"
132 b_vars += [
"Jpsi_M_uncorrected"]
135 cmskinematics = vu.create_aliases(
136 vc.kinematics,
"useCMSFrame({variable})",
"CMS"
138 b_vars += vu.create_aliases_for_selected(
139 cmskinematics,
"^B0 -> [^J/psi -> ^e+ ^e-] [^K_S0 -> ^pi+ ^pi-]"
143 "withBremsCorrection",
144 "passesCut(passesCut(ep_isBremsCorrected == 1) or passesCut(em_isBremsCorrected == 1))",
146 b_vars += [
"withBremsCorrection"]
149 ma.variablesToNtuple(
152 filename=
"Bd2JpsiKS.root",
def stdKshorts(prioritiseV0=True, fitter='TreeFit', path=None, updateAllDaughters=False, writeOut=False)
def kFit(list_name, conf_level, fit_type='vertex', constraint='', daughtersUpdate=False, decay_string='', massConstraint=[], recoilMass=0, smearing=0, path=None)
def TagV(list_name, MCassociation='', confidenceLevel=0., trackFindingType="standard_PXD", constraintType="tube", askMCInfo=False, reqPXDHits=0, maskName='all', fitAlgorithm='KFit', kFitReqReducedChi2=5.0, useTruthInFit=False, useRollBack=False, path=None)