11from basf2
import register_module
16 fitterEngine='NewFitterGSL',
17 constraint='HardBeam',
19 addUnmeasuredPhoton=False,
24 Perform a 4C momentum constraint kinematic fit for particles
in the given ParticleList.
26 @param list_name name of the input ParticleList
27 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
28 @param constraint HardBeam
or RecoilMass
29 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
30 @param addUnmeasuredPhoton add one unmeasured photon (uses up three constraints)
31 @param variablePrefix prepended to fit variables stored
in extra info. Required
if ParticleKinematicFitter
is run multiple times
32 @param path modules are added to this path
35 orca = register_module('ParticleKinematicFitter')
36 orca.set_name(
'ParticleKinematicFitter_' + list_name)
37 orca.param(
'debugFitter',
False)
38 orca.param(
'orcaTracer',
'None')
39 orca.param(
'orcaFitterEngine', fitterEngine)
40 orca.param(
'orcaConstraint', constraint)
41 orca.param(
'listName', list_name)
42 orca.param(
'updateDaughters', daughtersUpdate)
43 orca.param(
'addUnmeasuredPhoton', addUnmeasuredPhoton)
44 orca.param(
'variablePrefix', variablePrefix)
48def UnmeasuredfitKinematic1C(
50 fitterEngine='NewFitterGSL',
51 constraint='HardBeam',
57 Perform 1C momentum constraint kinematic fit with one unmeasured photon
for particles
in the given ParticleList.
59 @param list_name name of the input ParticleList
60 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
61 @param constraint HardBeam
or RecoilMass
62 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
63 @param variablePrefix prepended to fit variables stored
in extra info. Required
if ParticleKinematicFitter
is run multiple times
64 @param path modules are added to this path
67 orca = register_module('ParticleKinematicFitter')
68 orca.set_name(
'ParticleKinematicFitter_' + list_name)
69 orca.param(
'debugFitter',
False)
70 orca.param(
'orcaTracer',
'None')
71 orca.param(
'orcaFitterEngine', fitterEngine)
72 orca.param(
'orcaConstraint', constraint)
73 orca.param(
'listName', list_name)
74 orca.param(
'updateDaughters', daughtersUpdate)
75 orca.param(
'addUnmeasuredPhoton',
True)
76 orca.param(
'variablePrefix', variablePrefix)
82 fitterEngine='NewFitterGSL',
83 constraint='HardBeam',
85 addUnmeasuredPhoton=False,
91 Perform 3C momentum constraint kinematic fit with one photon
with unmeasured energy
for particles
92 in the given ParticleList, the first daughter should be the energy unmeasured Photon.
94 @param list_name name of the input ParticleList
95 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
96 @param constraint HardBeam
or RecoilMass
97 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
98 @param addUnmeasuredPhoton add one unmeasured photon (uses up three constraints)
99 @param add3CPhoton add one photon
with unmeasured energy (uses up a constraint)
100 @param variablePrefix prepended to fit variables stored
in extra info. Required
if ParticleKinematicFitter
is run multiple times
101 @param path modules are added to this path
104 orca = register_module('ParticleKinematicFitter')
105 orca.set_name(
'ParticleKinematicFitter_' + list_name)
106 orca.param(
'debugFitter',
False)
107 orca.param(
'orcaTracer',
'None')
108 orca.param(
'orcaFitterEngine', fitterEngine)
109 orca.param(
'orcaConstraint', constraint)
110 orca.param(
'listName', list_name)
111 orca.param(
'updateDaughters', daughtersUpdate)
112 orca.param(
'addUnmeasuredPhoton', addUnmeasuredPhoton)
113 orca.param(
'add3CPhoton', add3CPhoton)
114 orca.param(
'variablePrefix', variablePrefix)
115 path.add_module(orca)
120 fitterEngine='NewFitterGSL',
121 constraint='HardBeam',
122 daughtersUpdate=True,
123 addUnmeasuredPhotonAlongBeam="",
128 Perform 2C momentum constraint kinematic fit. The photon with unmeasured energy
and theta
129 has to be the first particle
in the decay string. If
'addUnmeasuredPhotonAlongBeam' is set to
130 'HER' or 'LER', both phi
and theta (treated
as measured) of this photon are then used. Concurrently,
131 an additional unmeasured photon along HER/LER will be taken into account
in the fit, which means
132 the momentum
is only constrained
in the plane perpendicular to one of the beams.
134 @param list_name name of the input ParticleList
135 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
136 @param constraint HardBeam
or RecoilMass
137 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
138 @param addUnmeasuredPhotonAlongBeam add an unmeasured photon along beam
if 'HER' or 'LER' is set
139 @param variablePrefix prepended to fit variables stored
in extra info. Required
if ParticleKinematicFitter
is run multiple times
140 @param path modules are added to this path
144 assert addUnmeasuredPhotonAlongBeam
in [
"",
"LER",
"HER"]
146 orca = register_module(
'ParticleKinematicFitter')
147 orca.set_name(
'ParticleKinematicFitter_' + list_name)
148 orca.param(
'debugFitter',
False)
149 orca.param(
'orcaTracer',
'None')
150 orca.param(
'orcaFitterEngine', fitterEngine)
151 orca.param(
'orcaConstraint', constraint)
152 orca.param(
'listName', list_name)
153 orca.param(
'updateDaughters', daughtersUpdate)
154 orca.param(
'add3CPhoton',
True)
155 if addUnmeasuredPhotonAlongBeam ==
"":
156 orca.param(
'liftPhotonTheta',
True)
158 orca.param(
'addUnmeasuredPhoton',
True)
159 if addUnmeasuredPhotonAlongBeam ==
"HER":
160 orca.param(
'fixUnmeasuredToHER',
True)
162 orca.param(
'fixUnmeasuredToLER',
True)
163 orca.param(
'variablePrefix', variablePrefix)
164 path.add_module(orca)
167def MassfitKinematic1CRecoil(
170 fitterEngine='NewFitterGSL',
171 constraint='RecoilMass',
172 daughtersUpdate=True,
177 Perform recoil mass kinematic fit for particles
in the given ParticleList.
179 @param list_name name of the input ParticleList
180 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
181 @param constraint HardBeam
or RecoilMass
182 @param recoilMass RecoilMass (GeV)
183 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
184 @param variablePrefix prepended to fit variables stored
in extra info. Required
if ParticleKinematicFitter
is run multiple times
185 @param path modules are added to this path
188 orca = register_module('ParticleKinematicFitter')
189 orca.set_name(
'ParticleKinematicFitter_' + list_name)
190 orca.param(
'debugFitter',
False)
191 orca.param(
'orcaTracer',
'None')
192 orca.param(
'orcaFitterEngine', fitterEngine)
193 orca.param(
'orcaConstraint', constraint)
194 orca.param(
'recoilMass', recoilMass)
195 orca.param(
'listName', list_name)
196 orca.param(
'updateDaughters', daughtersUpdate)
197 orca.param(
'addUnmeasuredPhoton',
False)
198 orca.param(
'variablePrefix', variablePrefix)
199 path.add_module(orca)
202def MassfitKinematic1C(
205 fitterEngine='NewFitterGSL',
207 daughtersUpdate=True,
212 Perform recoil mass kinematic fit for particles
in the given ParticleList.
214 @param list_name name of the input ParticleList
215 @param fitterEngine which fitter engine to use?
'NewFitterGSL' or 'OPALFitterGSL'
216 @param constraint HardBeam
or RecoilMass
or Mass
217 @param invMass Invariant Mass (GeV)
218 @param daughtersUpdate make copy of the daughters
and update them after the vertex fit
219 @param variablePrefix prepended to fit variables stored
in extra info. Required
if ParticleKinematicFitter
is run multiple times
220 @param path modules are added to this path
223 orca = register_module('ParticleKinematicFitter')
224 orca.set_name(
'ParticleKinematicFitter_' + list_name)
225 orca.param(
'debugFitter',
False)
226 orca.param(
'orcaTracer',
'None')
227 orca.param(
'orcaFitterEngine', fitterEngine)
228 orca.param(
'orcaConstraint', constraint)
229 orca.param(
'invMass', invMass)
230 orca.param(
'listName', list_name)
231 orca.param(
'updateDaughters', daughtersUpdate)
232 orca.param(
'addUnmeasuredPhoton',
False)
233 orca.param(
'variablePrefix', variablePrefix)
234 path.add_module(orca)
237if __name__ ==
'__main__':
239 pretty_print_module(__name__,
"kinfit")