21 from modularAnalysis
import inputMdst
22 from modularAnalysis
import fillParticleList
23 from variables
import variables
24 from modularAnalysis
import reconstructDecay
25 from modularAnalysis
import applyEventCuts
26 from modularAnalysis
import rankByHighest
27 from modularAnalysis
import cutAndCopyList
28 from modularAnalysis
import variablesToEventExtraInfo
31 mypath = b2.create_path()
33 inputMdst(
'/group/belle2/dataprod/MC/MC13a_local/mumu/mumu_eph3_2295.root', path=mypath)
36 fillParticleList(
'mu-:highp',
'useCMSFrame(p) > 3.5 and abs(d0) < 0.5 and abs(z0) < 4 and nCDCHits>0 and nVXDHits>0', path=mypath)
37 cutAndCopyList(
'mu-:highE',
'mu-:highp',
'clusterE>1.', path=mypath)
39 variables.addAlias(
'nhighp',
'nParticlesInList(mu-:highp)')
40 variables.addAlias(
'nhighE',
'nParticlesInList(mu-:highE)')
41 applyEventCuts(
'[nhighE==0] and [nhighp==2]', mypath)
44 variables.addAlias(
'deltaPhiCMS',
'formula(57.2957795*abs(daughterDiffOfPhiCMS(0, 1)))')
45 variables.addAlias(
'sumThetaCMS',
'formula(57.2957795*(daughter(0, useCMSFrame(theta)) + daughter(1, useCMSFrame(theta))))')
46 event_cut =
'175 < sumThetaCMS < 185 and deltaPhiCMS > 175 and 9 < M < 11'
47 reconstructDecay(
'vpho:0 -> mu-:highp mu+:highp', event_cut, path=mypath)
50 variables.addAlias(
'nPair',
'nParticlesInList(vpho:0)')
51 applyEventCuts(
'nPair==1', mypath)
54 cutAndCopyList(
'mu-:muonID',
'mu-:highp',
'', path=mypath)
55 rankByHighest(
'mu-:muonID',
'muonID', path=mypath)
57 cutAndCopyList(
'mu-:bestID',
'mu-:muonID',
'extraInfo(muonID_rank)==1', path=mypath)
58 variablesToEventExtraInfo(particleList=
'mu-:bestID', variables={
'muonID':
'bestID'}, path=mypath)
59 variables.addAlias(
'bestMuonID',
'eventExtraInfo(bestID)')
61 cutAndCopyList(
'mu-:worstID',
'mu-:muonID',
'extraInfo(muonID_rank)==2', path=mypath)
62 variablesToEventExtraInfo(particleList=
'mu-:worstID', variables={
'muonID':
'worstID'}, path=mypath)
63 variables.addAlias(
'worstMuonID',
'eventExtraInfo(worstID)')
66 variables.addAlias(
'muThetaLab',
'formula(57.2957795*theta)')
67 variables.addAlias(
'muPhiLab',
'formula(57.2957795*phi)')
68 variables.addAlias(
'muPcms',
'useCMSFrame(p)')
69 variables.addAlias(
'muptLab',
'pt')
70 variables.addAlias(
'e1Uncorr',
'formula(clusterHighestE * clusterUncorrE / clusterE)')
71 variables.addAlias(
'clustThetaLab',
'formula(57.2957795*clusterTheta)')
72 variables.addAlias(
'clustPhiLab',
'formula(57.2957795*clusterPhi)')
91 outputName =
"muPairAlignment.root"
94 outputName = sys.argv[1]
95 mypath.add_module(
'VariablesToNtuple', particleList=
'mu-:highp', variables=varsToStore, fileName=outputName)