Member of particle in EvtGen.
108{
109
110
111
112
113
114
115
116
117
118
119
120
121
122 double ReB_over_A = getArg(0);
123 double ImB_over_A = getArg(1);
124
125 p->makeDaughters(getNDaug(), getDaugs());
126 EvtParticle* v, *s1, *s2;
127 v = p->getDaug(0);
128 s1 = p->getDaug(1);
129 s2 = p->getDaug(2);
130
131 double m_pi = s1->getP4().mass();
132 double M_mS = p->getP4().mass();
133 double M_nS = v->getP4().mass();
134
135
136
137 EvtVector4R P_nS;
138 EvtVector4R P_pi1;
139 EvtVector4R P_pi2;
140
141
142
143 bool acceptX = false;
144
145 while (false == acceptX) {
146
147
148
149
150 double mX = EvtRandom::Flat(2.0 * m_pi, M_mS - M_nS);
151
152
153
154
155
156
157 double masses[30];
158 masses[0] = M_nS;
159 masses[1] = mX;
160
161 EvtVector4R p4[2];
162
163 EvtGenKine::PhaseSpace(2, masses, p4, M_mS);
164
165 P_nS = p4[0];
166 EvtVector4R P_X = p4[1];
167
168
169
170
171 masses[0] = s1->mass();
172 masses[1] = s2->mass();
173
174 EvtGenKine::PhaseSpace(2, masses, p4, P_X.mass());
175
176
177
178
179
180 EvtVector4R P_YmS_X = boostTo(p->getP4Restframe(), P_X);
181 double costheta = - p4[0].dot(P_YmS_X) / (p4[0].d3mag() * P_YmS_X.d3mag());
182 if (EvtPDL::name(s1->getId()) == "pi0") {
183 if (costheta < 0) {
184 costheta = - p4[1].dot(P_YmS_X) / (p4[1].d3mag() * P_YmS_X.d3mag());
185 }
186 }
187 if (EvtPDL::name(s1->getId()) == "pi-") {
188 costheta = - p4[1].dot(P_YmS_X) / (p4[1].d3mag() * P_YmS_X.d3mag());
189 }
190
191
192
193
194
195
196 P_pi1 = boostTo(p4[0], P_YmS_X);
197 P_pi2 = boostTo(p4[1], P_YmS_X);
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215 double Q = (mX * mX - 2.0 * m_pi * m_pi);
216
217 double deltaEmax =
218 - 2.0 *
219 sqrt(P_nS.get(0) * P_nS.get(0) - M_nS * M_nS) *
220 sqrt(0.25 - pow(m_pi / mX, 2.0));
221
222 double sumE = (M_mS * M_mS - M_nS * M_nS + mX * mX) / (2.0 * M_mS);
223
224 double E1E2 = 0.25 * (pow(sumE, 2.0) - pow(deltaEmax * costheta, 2.0));
225
226 double M2 = Q * Q + (pow(ReB_over_A, 2.0) + pow(ImB_over_A, 2.0)) * E1E2 * E1E2 + 2.0 * ReB_over_A * Q * E1E2;
227
228
229
230
231
232
233
234
235
236 double dPS =
237 sqrt((M_mS * M_mS - pow(M_nS + mX, 2.0)) * (M_mS * M_mS - pow(M_nS - mX, 2.0))) *
238 sqrt(mX * mX - 4 * m_pi * m_pi);
239
240
241 double dG = M2 * dPS;
242
243
244
245 double rnd = EvtRandom::Flat(0.0, getProbMax(0.0));
246
247 if (rnd < dG)
248 acceptX = true;
249
250 }
251
252
253
254 v->init(getDaugs()[0], P_nS);
255 s1->init(getDaugs()[1], P_pi1);
256 s2->init(getDaugs()[2], P_pi2);
257
258
259
260
261
262
263
264 EvtVector4C ep0, ep1, ep2;
265
266 ep0 = p->eps(0);
267 ep1 = p->eps(1);
268 ep2 = p->eps(2);
269
270
271 vertex(0, 0, (ep0 * v->epsParent(0).conj()));
272 vertex(0, 1, (ep0 * v->epsParent(1).conj()));
273 vertex(0, 2, (ep0 * v->epsParent(2).conj()));
274
275 vertex(1, 0, (ep1 * v->epsParent(0).conj()));
276 vertex(1, 1, (ep1 * v->epsParent(1).conj()));
277 vertex(1, 2, (ep1 * v->epsParent(2).conj()));
278
279 vertex(2, 0, (ep2 * v->epsParent(0).conj()));
280 vertex(2, 1, (ep2 * v->epsParent(1).conj()));
281 vertex(2, 2, (ep2 * v->epsParent(2).conj()));
282
283
284 return ;
285
286}
double sqrt(double a)
sqrt for double