154 static int iniflag = 0;
172 if ( istdheppar != 443 && istdheppar != 100443 && istdheppar != 10441 &&
173 istdheppar != 20443 && istdheppar != 445 && istdheppar != 10443 && istdheppar != 441 &&
174 istdheppar != 30443 )
176 std::cout <<
"EvtGen: EvtLundCharm cann't not decay the particle pid= " << istdheppar
193 EvtId evtnumstable[100], evtnumparton[100];
194 int stableindex[100], partonindex[100];
200 static double px[100], py[100], pz[100], e[100];
203 lundcrm_( &iniflag, &istdheppar, &xmp, &ndaugjs, kf, km, px, py, pz, e, &myflag );
214 iniflag = iniflag + 1;
215 lundcrm_( &iniflag, &istdheppar, &xmp, &ndaugjs, kf, km, px, py, pz, e, &myflag );
225 for ( i = 0; i < ndaugjs; i++ )
235 report(
ERROR,
"EvtGen" ) <<
"LundCharm returned particle:" << kf[i] << endl;
236 report(
ERROR,
"EvtGen" ) <<
"This can not be translated to evt number" << endl;
237 report(
ERROR,
"EvtGen" ) <<
"and the decay will be rejected!" << endl;
238 report(
ERROR,
"EvtGen" ) <<
"The decay was of particle:" << ip << endl;
242 if (
abs( kf[i] ) <= 6 || kf[i] == 21 )
244 partonindex[numparton] = i;
250 stableindex[numstable] = i;
259 if ( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] >= e[i] * e[i] )
260 { e[i] = sqrt( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] ) + 0.0000000001; }
262 p4[i].
set( e[i], px[i], py[i], pz[i] );
277 if ( parityi != 0 && parityf != 0 ) { pflag = ( parityi != parityf ); }
280 bool eck = fabs( xmp - totEn ) > 0.01;
282 more = ( channel != -1 || pflag == 1 || eck );
291 }
while ( more && (
count < 10000 ) );
302 report(
INFO,
"EvtGen" ) <<
"Too many loops in EvtLundCharm!!!" << endl;
304 for ( i = 0; i < numstable; i++ )
306 report(
INFO,
"EvtGen" ) <<
"Daug(" << i <<
")"
311 if ( numparton == 0 )
316 for ( i = 0; i < numstable; i++ )
318 p->
getDaug( i )->
init( evtnumstable[i], p4[stableindex[i]] );
321 if ( ndaugFound == 0 )
323 report(
ERROR,
"EvtGen" ) <<
"Lundcharm has failed to do a decay ";
329 fixPolarizations( p );
340 for ( i = 0; i < numparton; i++ ) { p4string += p4[partonindex[i]]; }
344 for ( i = 0; i < numstable; i++ )
346 if ( km[stableindex[i]] == 0 ) {
type[nprimary++] = evtnumstable[i]; }
355 for ( i = 0; i < numparton; i++ ) { p4partons[i] = p4[partonindex[i]]; }
361 for ( i = 0; i < numstable; i++ )
364 if ( km[stableindex[i]] == 0 )
365 { p->
getDaug( nprimary++ )->
init( evtnumstable[i], p4[stableindex[i]] ); }
369 for ( i = 0; i < numstable; i++ )
371 if ( km[stableindex[i]] != 0 ) {
type[nsecond++] = evtnumstable[i]; }
377 -p4string.
get( 3 ) );
380 for ( i = 0; i < numstable; i++ )
382 if ( km[stableindex[i]] != 0 )
384 p4[stableindex[i]] =
boostTo( p4[stableindex[i]], p4stringboost );
394 report(
ERROR,
"EvtGen" ) <<
"Jetset has failed to do a decay ";
400 fixPolarizations( p );
void lundcrm_(int *, int *, float *, int *, int *, int *, double *, double *, double *, double *, int *)
void setSpinDensityForwardHelicityBasis(const EvtSpinDensity &rho)
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
void setGeneratorFlag(int flag)
void setDiagonalSpinDensity()
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
void deleteDaughters(bool keepChannel=false)