Belle II Software
development
B2A204-LoadAllECLClusters.py
1
#!/usr/bin/env python3
2
3
10
11
19
20
import
basf2
as
b2
21
from
modularAnalysis
import
inputMdst
22
from
modularAnalysis
import
fillParticleList
23
from
modularAnalysis
import
reconstructDecay
24
from
modularAnalysis
import
copyLists
25
from
modularAnalysis
import
variablesToNtuple
26
from
variables
import
variables
27
28
# create path
29
mypath = b2.create_path()
30
31
# load input ROOT file
32
inputMdst(filename=b2.find_file(
'B2pi0D_D2hh_D2hhh_B2munu.root'
,
'examples'
,
False
),
33
path=mypath)
34
35
# fill an all photon and all charged particle (does not really matter which one) list
36
fillParticleList(
'gamma:minimumE'
,
'clusterE > 0.1'
, path=mypath)
# neutral clusters
37
fillParticleList(
'e-:minimumE'
,
'clusterE > 0.1'
, path=mypath)
# track matched clusters
38
39
# reconstruct a pseudo particles with different combinations (implicit charge conjugation)
40
reconstructDecay(
'vpho:1 -> gamma:minimumE gamma:minimumE'
,
''
, 1, path=mypath)
# two neutral '00'
41
reconstructDecay(
'vpho:2 -> gamma:minimumE e-:minimumE'
,
''
, 2, path=mypath,
42
allowChargeViolation=
True
)
# neutral and charged '0+' and '0-'
43
reconstructDecay(
'vpho:3 -> e-:minimumE e+:minimumE'
,
''
, 3, path=mypath)
# different charge '+-' and '-+'
44
reconstructDecay(
'vpho:4 -> e-:minimumE e-:minimumE'
,
''
, 4, path=mypath, allowChargeViolation=
True
)
# same charge '++' and '--'
45
copyLists(
'vpho:bhabha'
, [
'vpho:1'
,
'vpho:2'
,
'vpho:3'
,
'vpho:4'
], path=mypath)
46
47
# aliases to make output better readable
48
# For more information on alias definitions (including an introduction to
49
# some very handy convenience functions with which you could
50
# define below aliases in very few lines), head over to
51
# ``VariableManager/variableAliases.py``.
52
variables.addAlias(
'combinationID'
,
'extraInfo(decayModeID)'
)
53
variables.addAlias(
'deltaPhi'
,
'daughterDiffOfClusterPhi(0, 1)'
)
54
variables.addAlias(
'deltaTheta'
,
'formula(daughter(0, clusterTheta) - daughter(1, clusterTheta))'
)
55
variables.addAlias(
'charge_0'
,
'daughter(0, charge)'
)
56
variables.addAlias(
'charge_1'
,
'daughter(1, charge)'
)
57
variables.addAlias(
'clusterE_0'
,
'daughter(0, clusterE)'
)
58
variables.addAlias(
'clusterE_1'
,
'daughter(1, clusterE)'
)
59
variables.addAlias(
'clusterTheta_0'
,
'daughter(0, clusterTheta)'
)
60
variables.addAlias(
'clusterTheta_1'
,
'daughter(1, clusterTheta)'
)
61
variables.addAlias(
'clusterPhi_0'
,
'daughter(0, clusterPhi)'
)
62
variables.addAlias(
'clusterPhi_1'
,
'daughter(1, clusterPhi)'
)
63
64
variables.addAlias(
'clusterECMS_0'
,
'daughter(0, useCMSFrame(clusterE))'
)
65
variables.addAlias(
'clusterECMS_1'
,
'daughter(1, useCMSFrame(clusterE))'
)
66
variables.addAlias(
'clusterThetaCMS_0'
,
'daughter(0, useCMSFrame(clusterTheta))'
)
67
variables.addAlias(
'clusterThetaCMS_1'
,
'daughter(1, useCMSFrame(clusterTheta))'
)
68
variables.addAlias(
'clusterPhiCMS_0'
,
'daughter(0, useCMSFrame(clusterPhi))'
)
69
variables.addAlias(
'clusterPhiCMS_1'
,
'daughter(1, useCMSFrame(clusterPhi))'
)
70
variables.addAlias(
'deltaPhiCMS'
,
'daughterDiffOfClusterPhiCMS(0, 1)'
)
71
72
# variables to ntuple
73
vars = [
'combinationID'
,
74
'deltaPhi'
,
75
'deltaPhiCMS'
,
76
'deltaTheta'
,
77
'charge_0'
,
78
'charge_1'
,
79
'clusterE_0'
,
80
'clusterE_1'
,
81
'clusterTheta_0'
,
82
'clusterTheta_1'
,
83
'clusterPhi_0'
,
84
'clusterPhi_1'
,
85
'clusterECMS_0'
,
86
'clusterECMS_1'
,
87
'clusterPhiCMS_0'
,
88
'clusterPhiCMS_1'
,
89
'clusterThetaCMS_0'
,
90
'clusterThetaCMS_1'
91
]
92
93
# store variables
94
variablesToNtuple
(
'vpho:bhabha'
, vars, filename=
'bhabha.root'
, path=mypath)
95
96
# Process the events
97
b2.process(mypath)
98
99
# print out the summary
100
print(b2.statistics)
variablesToNtuple
Definition:
variablesToNtuple.py:1
analysis
examples
tutorials
B2A204-LoadAllECLClusters.py
Generated on Tue Nov 12 2024 02:32:10 for Belle II Software by
1.9.6