171 static int iniflag = 1;
204 EvtId evtnumstable[100], evtnumparton[100];
205 int stableindex[100], partonindex[100];
214 static double px[4000], py[4000], pz[4000], e[4000];
215 if ( iniflag == 1 )
lundar_( &isr, &iniflag, &xmp, &ndaugjs, kf, km, px, py, pz, e );
224 iniflag = iniflag + 1;
227 lundar_( &isr, &iniflag, &xmp, &ndaugjs, kf, km, px, py, pz, e );
230 if ( mtg ) std::cout <<
"checktag_.decaytag=" <<
checktag_.decaytag << std::endl;
246 for ( i = 0; i < ndaugjs; i++ )
248 if ( fabs( kf[i] ) == 11 || kf[i] == 92 || kf[i] == 22 )
255 report(
ERROR,
"EvtGen" ) <<
"Lunda returned particle:" << kf[i] << endl;
256 report(
ERROR,
"EvtGen" ) <<
"This can not be translated to evt number" << endl;
257 report(
ERROR,
"EvtGen" ) <<
"and the decay will be rejected!" << endl;
258 report(
ERROR,
"EvtGen" ) <<
"The decay was of particle:" << ip << endl;
260 std::cout <<
"xmp= " << xmp << std::endl;
265 if ( fabs( kf[i] ) <= 6 || kf[i] == 21 )
267 partonindex[numparton] = i;
273 stableindex[numstable] = i;
283 if ( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] >= e[i] * e[i] )
284 { e[i] = sqrt( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] ) + 0.0000000001; }
286 p4[i].
set( e[i], px[i], py[i], pz[i] );
293 more = ( channel != -1 );
295 if ( fabs( esum - xmp ) > 0.001 )
297 std::cout <<
"Unexpected final states from Lunda with total energy " << esum
298 <<
" unequal to " << xmp << std::endl;
300 std::cout <<
"xmp= " << xmp << std::endl;
305 }
while ( more && (
count < 10000 ) && mtg );
310 report(
INFO,
"EvtGen" ) <<
"Too many loops in EvtLunda!!!" << endl;
312 for ( i = 0; i < numstable; i++ )
314 report(
INFO,
"EvtGen" ) <<
"Daug(" << i <<
")"
319 if ( numparton == 0 )
324 for ( i = 0; i < numstable; i++ )
326 p->
getDaug( i )->
init( evtnumstable[i], p4[stableindex[i]] );
329 if ( ndaugFound == 0 )
331 report(
ERROR,
"EvtGen" ) <<
"Lunda has failed to do a decay ";
337 fixPolarizations( p );
350 for ( i = 0; i < numparton; i++ ) { p4string += p4[partonindex[i]]; }
354 for ( i = 0; i < numstable; i++ )
356 if ( km[stableindex[i]] == 0 ) {
type[nprimary++] = evtnumstable[i]; }
365 for ( i = 0; i < numparton; i++ ) { p4partons[i] = p4[partonindex[i]]; }
371 for ( i = 0; i < numstable; i++ )
374 if ( km[stableindex[i]] == 0 )
375 { p->
getDaug( nprimary++ )->
init( evtnumstable[i], p4[stableindex[i]] ); }
379 for ( i = 0; i < numstable; i++ )
381 if ( km[stableindex[i]] != 0 ) {
type[nsecond++] = evtnumstable[i]; }
387 -p4string.
get( 3 ) );
390 for ( i = 0; i < numstable; i++ )
392 if ( km[stableindex[i]] != 0 )
394 p4[stableindex[i]] =
boostTo( p4[stableindex[i]], p4stringboost );
404 report(
ERROR,
"EvtGen" ) <<
"Jetset has failed to do a decay ";
410 fixPolarizations( p );
void lundar_(int *, int *, float *, int *, int *, int *, double *, double *, double *, double *)
void setSpinDensityForwardHelicityBasis(const EvtSpinDensity &rho)
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
void setDiagonalSpinDensity()
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
void deleteDaughters(bool keepChannel=false)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)