178 {
179
180
182
184
185 if (
pycomp_( &istdheppar ) == 0 )
186 {
188 << endl;
189 return;
190 }
191
193
194 EvtVector4R p4[20];
195
196 int i, more;
198
199 int ndaugjs;
200 int kf[100];
201 EvtId evtnumstable[100], evtnumparton[100];
202 int stableindex[100], partonindex[100];
203 int numstable;
204 int numparton;
205 int km[100];
207
210 {
211 std::cout <<
"Particle " <<
EvtPDL::name( p->
getId() ) <<
" has zero mass" << std::endl;
212 abort();
213 }
215
216 double px[100], py[100], pz[100], e[100];
218
220
221 do {
222
223 pythiadec_( &ip, &
mp, &ndaugjs, kf, km, px, py, pz, e );
224
225 numstable = 0;
226 numparton = 0;
227
228 for ( i = 0; i < ndaugjs; i++ )
229 {
230
231
233 {
234 report(
ERROR,
"EvtGen" ) <<
"Pythia returned particle:" << kf[i] << endl;
235 report(
ERROR,
"EvtGen" ) <<
"This can not be translated to evt number" << endl;
236 report(
ERROR,
"EvtGen" ) <<
"and the decay will be rejected!" << endl;
237 report(
ERROR,
"EvtGen" ) <<
"The decay was of particle:" << ip << endl;
238 int i = 1;
240 }
241
242
243 if (
abs( kf[i] ) <= 6 || kf[i] == 21 )
244 {
245 partonindex[numparton] = i;
247 numparton++;
248 }
249 else
250 {
251 stableindex[numstable] = i;
253 numstable++;
254 }
255
256
257
258
259
260 if ( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] >= e[i] * e[i] )
261 { e[i] = sqrt( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] ) + 0.0000000000001; }
262
263 p4[i].
set( e[i], px[i], py[i], pz[i] );
264 }
265
267
268 more = ( channel != -1 );
269
271
272 }
while ( more && (
count < 10000 ) );
273
275 {
276 report(
INFO,
"EvtGen" ) <<
"Too many loops in EvtPythia!!!" << endl;
278 for ( i = 0; i < numstable; i++ )
279 {
280 report(
INFO,
"EvtGen" ) <<
"Daug(" << i <<
")"
282 }
283 }
284
285 if ( numparton == 0 )
286 {
287
289
290 for ( i = 0; i < numstable; i++ )
291 { p->
getDaug( i )->
init( evtnumstable[i], p4[stableindex[i]] ); }
292
293 fixPolarizations( p );
294
295 return;
296 }
297 else
298 {
299
300
301
302 EvtVector4R p4string( 0.0, 0.0, 0.0, 0.0 );
303
304 for ( i = 0; i < numparton; i++ ) { p4string += p4[partonindex[i]]; }
305
306 int nprimary = 1;
307 type[0] = STRNG;
308 for ( i = 0; i < numstable; i++ )
309 {
310 if ( km[stableindex[i]] == 0 ) { type[nprimary++] = evtnumstable[i]; }
311 }
312
314
316
317 EvtVector4R p4partons[10];
318
319 for ( i = 0; i < numparton; i++ ) { p4partons[i] = p4[partonindex[i]]; }
320
321 ( (EvtStringParticle*)p->
getDaug( 0 ) )->initPartons( numparton, p4partons, evtnumparton );
322
323 nprimary = 1;
324
325 for ( i = 0; i < numstable; i++ )
326 {
327
328 if ( km[stableindex[i]] == 0 )
329 { p->
getDaug( nprimary++ )->
init( evtnumstable[i], p4[stableindex[i]] ); }
330 }
331
332 int nsecond = 0;
333 for ( i = 0; i < numstable; i++ )
334 {
335 if ( km[stableindex[i]] != 0 ) { type[nsecond++] = evtnumstable[i]; }
336 }
337
339
340 nsecond = 0;
341 for ( i = 0; i < numstable; i++ )
342 {
343 if ( km[stableindex[i]] != 0 )
344 {
345 p4[stableindex[i]] =
boostTo( p4[stableindex[i]], p4string );
349 nsecond++;
350 }
351 }
352
353 fixPolarizations( p );
354
355 return;
356 }
357}
EvtDiracSpinor boostTo(const EvtDiracSpinor &sp, const EvtVector4R p4)
DOUBLE_PRECISION count[3]
struct @125167362051102326102214011354340031122345135231 cbbeam_
void pythiadec_(int *, double *, int *, int *, int *, double *, double *, double *, double *)
static int inChannelList(EvtId parent, int ndaug, EvtId *daugs)
static int getStdHep(EvtId id)
static EvtId evtIdFromStdHep(int stdhep)
static std::string name(EvtId i)
static EvtId getId(const std::string &name)
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
void setDiagonalSpinDensity()
EvtParticle * getDaug(int i)
void deleteDaughters(bool keepChannel=false)
static void pythiaInit(int f)
void set(int i, double d)