11from basf2
import register_module
16 fitterEngine='NewFitterGSL',
17 constraint='HardBeam',
19 addUnmeasuredPhoton=False,
23 Perform a 4C momentum constraint kinematic fit for particles
in the given ParticleList.
25 @param list_name name of the input ParticleList
26 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
27 @param constraint HardBeam
or RecoilMass
28 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
29 @param addUnmeasuredPhoton add one unmeasured photon (uses up three constraints)
30 @param path modules are added to this path
33 orca = register_module('ParticleKinematicFitter')
34 orca.set_name(
'ParticleKinematicFitter_' + list_name)
35 orca.param(
'debugFitter',
False)
36 orca.param(
'orcaTracer',
'None')
37 orca.param(
'orcaFitterEngine', fitterEngine)
38 orca.param(
'orcaConstraint', constraint)
39 orca.param(
'listName', list_name)
40 orca.param(
'updateDaughters', daughtersUpdate)
41 orca.param(
'addUnmeasuredPhoton', addUnmeasuredPhoton)
45def UnmeasuredfitKinematic1C(
47 fitterEngine='NewFitterGSL',
48 constraint='HardBeam',
53 Perform 1C momentum constraint kinematic fit with one unmeasured photon
for particles
in the given ParticleList.
55 @param list_name name of the input ParticleList
56 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
57 @param constraint HardBeam
or RecoilMass
58 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
59 @param path modules are added to this path
62 orca = register_module('ParticleKinematicFitter')
63 orca.set_name(
'ParticleKinematicFitter_' + list_name)
64 orca.param(
'debugFitter',
False)
65 orca.param(
'orcaTracer',
'None')
66 orca.param(
'orcaFitterEngine', fitterEngine)
67 orca.param(
'orcaConstraint', constraint)
68 orca.param(
'listName', list_name)
69 orca.param(
'updateDaughters', daughtersUpdate)
70 orca.param(
'addUnmeasuredPhoton',
True)
76 fitterEngine='NewFitterGSL',
77 constraint='HardBeam',
79 addUnmeasuredPhoton=False,
84 Perform 3C momentum constraint kinematic fit with one photon
with unmeasured energy
for particles
85 in the given ParticleList, the first daughter should be the energy unmeasured Photon.
87 @param list_name name of the input ParticleList
88 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
89 @param constraint HardBeam
or RecoilMass
90 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
91 @param addUnmeasuredPhoton add one unmeasured photon (uses up three constraints)
92 @param add3CPhoton add one photon
with unmeasured energy (uses up a constraint)
93 @param path modules are added to this path
96 orca = register_module('ParticleKinematicFitter')
97 orca.set_name(
'ParticleKinematicFitter_' + list_name)
98 orca.param(
'debugFitter',
False)
99 orca.param(
'orcaTracer',
'None')
100 orca.param(
'orcaFitterEngine', fitterEngine)
101 orca.param(
'orcaConstraint', constraint)
102 orca.param(
'listName', list_name)
103 orca.param(
'updateDaughters', daughtersUpdate)
104 orca.param(
'addUnmeasuredPhoton', addUnmeasuredPhoton)
105 orca.param(
'add3CPhoton', add3CPhoton)
106 path.add_module(orca)
111 fitterEngine='NewFitterGSL',
112 constraint='HardBeam',
113 daughtersUpdate=True,
114 addUnmeasuredPhotonAlongBeam="",
118 Perform 2C momentum constraint kinematic fit. The photon with unmeasured energy
and theta
119 has to be the first particle
in the decay string. If
'addUnmeasuredPhotonAlongBeam' is set to
120 'HER' or 'LER', both phi
and theta (treated
as measured) of this photon are then used. Concurrently,
121 an additional unmeasured photon along HER/LER will be taken into account
in the fit, which means
122 the momentum
is only constrained
in the plane perpendicular to one of the beams.
124 @param list_name name of the input ParticleList
125 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
126 @param constraint HardBeam
or RecoilMass
127 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
128 @param addUnmeasuredPhotonAlongBeam add an unmeasured photon along beam
if 'HER' or 'LER' is set
129 @param path modules are added to this path
133 assert addUnmeasuredPhotonAlongBeam
in [
"",
"LER",
"HER"]
135 orca = register_module(
'ParticleKinematicFitter')
136 orca.set_name(
'ParticleKinematicFitter_' + list_name)
137 orca.param(
'debugFitter',
False)
138 orca.param(
'orcaTracer',
'None')
139 orca.param(
'orcaFitterEngine', fitterEngine)
140 orca.param(
'orcaConstraint', constraint)
141 orca.param(
'listName', list_name)
142 orca.param(
'updateDaughters', daughtersUpdate)
143 orca.param(
'add3CPhoton',
True)
144 if addUnmeasuredPhotonAlongBeam ==
"":
145 orca.param(
'liftPhotonTheta',
True)
147 orca.param(
'addUnmeasuredPhoton',
True)
148 if addUnmeasuredPhotonAlongBeam ==
"HER":
149 orca.param(
'fixUnmeasuredToHER',
True)
151 orca.param(
'fixUnmeasuredToLER',
True)
152 path.add_module(orca)
155def MassfitKinematic1CRecoil(
158 fitterEngine='NewFitterGSL',
159 constraint='RecoilMass',
160 daughtersUpdate=True,
164 Perform recoil mass kinematic fit for particles
in the given ParticleList.
166 @param list_name name of the input ParticleList
167 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
168 @param constraint HardBeam
or RecoilMass
169 @param recoilMass RecoilMass (GeV)
170 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
171 @param path modules are added to this path
174 orca = register_module('ParticleKinematicFitter')
175 orca.set_name(
'ParticleKinematicFitter_' + list_name)
176 orca.param(
'debugFitter',
False)
177 orca.param(
'orcaTracer',
'None')
178 orca.param(
'orcaFitterEngine', fitterEngine)
179 orca.param(
'orcaConstraint', constraint)
180 orca.param(
'recoilMass', recoilMass)
181 orca.param(
'listName', list_name)
182 orca.param(
'updateDaughters', daughtersUpdate)
183 orca.param(
'addUnmeasuredPhoton',
False)
184 path.add_module(orca)
187def MassfitKinematic1C(
190 fitterEngine='NewFitterGSL',
192 daughtersUpdate=True,
196 Perform recoil mass kinematic fit for particles
in the given ParticleList.
198 @param list_name name of the input ParticleList
199 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
200 @param constraint HardBeam
or RecoilMass
or Mass
201 @param invMass Invariant Mass (GeV)
202 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
203 @param path modules are added to this path
206 orca = register_module('ParticleKinematicFitter')
207 orca.set_name(
'ParticleKinematicFitter_' + list_name)
208 orca.param(
'debugFitter',
False)
209 orca.param(
'orcaTracer',
'None')
210 orca.param(
'orcaFitterEngine', fitterEngine)
211 orca.param(
'orcaConstraint', constraint)
212 orca.param(
'invMass', invMass)
213 orca.param(
'listName', list_name)
214 orca.param(
'updateDaughters', daughtersUpdate)
215 orca.param(
'addUnmeasuredPhoton',
False)
216 path.add_module(orca)
219if __name__ ==
'__main__':
221 pretty_print_module(__name__,
"kinfit")