44 #ifdef CEXMC_USE_GENBOD
52 extern int genbod_(
void );
56 extern struct genbod_in_data
65 extern struct genbod_out_data
72 CexmcGenbod::CexmcGenbod()
79 G4bool CexmcGenbod::CheckKinematics(
void )
82 for ( CexmcPhaseSpaceInVector::const_iterator k( inVec.begin() );
83 k != inVec.end(); ++k )
85 totalEnergy += ( *k )->e();
91 const float epsilon( 3E-6 );
93 return totalEnergy - totalMass > 0.0f + epsilon;
97 G4double CexmcGenbod::Generate(
void )
99 genin_.tecm = totalEnergy /
GeV;
103 float ( *pcm )[ 5 ]( &genout_.pcm[ 0 ] );
105 for ( CexmcPhaseSpaceOutVector::iterator k( outVec.begin() );
106 k != outVec.end(); ++k )
108 k->lVec->setPx( ( *pcm )[ 0 ] *
GeV );
109 k->lVec->setPy( ( *pcm )[ 1 ] * GeV );
110 k->lVec->setPz( ( *pcm )[ 2 ] * GeV );
111 k->lVec->setE( ( *pcm++ )[ 3 ] * GeV );
118 void CexmcGenbod::ParticleChangeHook(
void )
120 size_t nmbOfOutputParticles( outVec.size() );
122 if ( nmbOfOutputParticles < 2 || nmbOfOutputParticles > 18 )
125 genin_.np = nmbOfOutputParticles;
127 float * amass( genin_.amass );
129 for ( CexmcPhaseSpaceOutVector::const_iterator k( outVec.begin() );
130 k != outVec.end(); ++k )
132 *amass++ = k->mass /
GeV;
137 void CexmcGenbod::FermiEnergyDepStatusChangeHook(
void )
139 genin_.kgenev = fermiEnergyDepIsOn ? 2 : 1;