55 G4int DoubleMax(
const void *
a,
const void *
b )
72 G4double x( ( a - b - c ) * ( a + b + c ) * ( a - b + c ) *
74 x = std::sqrt(
x ) / ( 2 *
a );
82 nmbOfOutputParticles( 0 )
97 if ( nmbOfOutputParticles > 2 )
99 for (
G4int i( 1 ); i < nmbOfOutputParticles - 1; ++i )
103 qsort( rno + 1, nmbOfOutputParticles - 2,
sizeof(
G4double ),
106 rno[ nmbOfOutputParticles - 1 ] = 1;
111 for (
int i( 0 ); i < nmbOfOutputParticles; ++i )
114 invMas[ i ] = rno[ i ] * te_minus_tm /
GeV + sum;
123 for (
int i( 0 ); i < nmbOfOutputParticles - 1; ++i )
125 pd[ i ] = PDK( invMas[ i + 1 ], invMas[ i ],
133 outVec[ 0 ].lVec->setPx( 0. );
134 outVec[ 0 ].lVec->setPy( pd[ 0 ] );
135 outVec[ 0 ].lVec->setPz( 0. );
136 outVec[ 0 ].lVec->setE( std::sqrt( pd[ 0 ] * pd[ 0 ] +
144 outVec[ i ].lVec->setPx( 0. );
145 outVec[ i ].lVec->setPy( -pd[ i - 1 ] );
146 outVec[ i ].lVec->setPz( 0. );
147 outVec[ i ].lVec->setE( std::sqrt( pd[ i - 1 ] * pd[ i - 1 ] +
152 G4double sZ( std::sqrt( 1 - cZ * cZ ) );
157 for (
int j( 0 ); j <= i; ++j )
163 v->
setPy( sZ *
x + cZ * y );
167 v->
setPz( sY *
x + cY * z );
170 if ( i == nmbOfOutputParticles - 1 )
173 G4double beta( pd[ i ] / std::sqrt( pd[ i ] * pd[ i ] +
174 invMas[ i ] * invMas[ i ] ) );
175 for (
int j( 0 ); j <= i; ++j )
176 outVec[ j ].lVec->boost( 0, beta, 0 );
181 for (
int i( 0 ); i < nmbOfOutputParticles; ++i )
191 void CexmcReimplementedGenbod::ParticleChangeHook(
void )
193 nmbOfOutputParticles =
outVec.size();
195 if ( nmbOfOutputParticles < 2 || nmbOfOutputParticles > maxParticles )
202 void CexmcReimplementedGenbod::FermiEnergyDepStatusChangeHook(
void )
208 void CexmcReimplementedGenbod::SetMaxWeight(
void )
216 ,3.141592, 19.73921, 62.01255, 129.8788, 204.0131
217 ,256.3704, 268.4705, 240.9780, 189.2637
218 ,132.1308, 83.0202, 47.4210, 24.8295
219 ,12.0006, 5.3858, 2.2560, 0.8859 };
221 std::pow( te_minus_tm /
GeV, nmbOfOutputParticles - 2 ) *
230 for (
G4int i( 1 ); i < nmbOfOutputParticles; ++i )
234 wtmax *= PDK( emmax, emmin,
outVec[ i ].mass /
GeV );
236 maxWeight = 1 / wtmax;
G4bool fermiEnergyDepIsOn
CexmcPhaseSpaceOutVector outVec
CexmcReimplementedGenbod()