84 init( fileName.c_str( ) );
95 sourceFilename = fileName;
103 equalProbableBinSampleMethod =
"constant";
104 elasticIndices = NULL;
105 nElasticIndices = nCaptureIndices = nFissionIndices = nOthersIndices = 0;
108 p = elasticIndices = (
int *)
xData_malloc2( NULL, n *
sizeof(
double ), 1,
"elasticIndices" );
109 for( i = 0; i <
n; i++ ) {
111 if( channel->
ENDL_C == 10 ) {
117 for( i = 0; i <
n; i++ ) {
119 if( channel->
ENDL_C == 46 ) {
126 for( i = 0; i <
n; i++ ) {
128 if( channel->
fission != NULL ) {
134 for( i = 0; i <
n; i++ ) {
135 for( j = 0, q = elasticIndices; j < nElasticIndices; j++, q++ )
if( *q == i )
break;
136 if( j < nElasticIndices )
continue;
137 for( j = 0, q = captureIndices; j < nCaptureIndices; j++, q++ )
if( *q == i )
break;
138 if( j < nCaptureIndices )
continue;
139 for( j = 0, q = fissionIndices; j < nFissionIndices; j++, q++ )
if( *q == i )
break;
140 if( j < nFissionIndices )
continue;
169 return(
target->targetID->Z );
176 return(
target->targetID->A );
183 return(
target->targetID->m );
211 return( equalProbableBinSampleMethod );
218 if( method ==
"constant" ) {
219 equalProbableBinSampleMethod =
"constant"; }
220 if( method ==
"linear" ) {
221 equalProbableBinSampleMethod =
"linear"; }
261 vector<channelID> *listOfChannels;
263 listOfChannels =
new vector<channelID>(
n );
264 for( i = 0; i <
n; i++ ) (*listOfChannels)[i].ID = channels[i]->
outputChannel;
265 return( listOfChannels );
274 vector<double> *energyGrid;
275 vector<double>::iterator iter;
278 if( n < 0 )
return( NULL );
279 energyGrid =
new vector<double>(
n );
280 for( i = 0, iter = energyGrid->begin( ); i <
n; i++, iter++ ) *iter = dEnergyGrid[i];
281 return( energyGrid );
295 return( sumChannelCrossSectionAtE( nElasticIndices, elasticIndices, e_in, temperature ) );
302 return( sumChannelCrossSectionAtE( nCaptureIndices, captureIndices, e_in, temperature ) );
309 return( sumChannelCrossSectionAtE( nFissionIndices, fissionIndices, e_in, temperature ) );
316 return( sumChannelCrossSectionAtE( nOthersIndices, othersIndices, e_in, temperature ) );
326 for( i = 0; i < nIndices; i++ )
334 double (*rng)(
void * ),
void *rngState ) {
337 double xsec = 0., rxsec = sumChannelCrossSectionAtE( nIndices, indices, e_in, temperature ) *
tpia_misc_drng( rng, rngState );
339 for( i = 0; i < nIndices - 1; i++ ) {
341 if( xsec >= rxsec )
break;
343 return( indices[i] );
355 decaySamplingInfo.
e_in = e_in;
359 decaySamplingInfo.
rng = rng;
360 decaySamplingInfo.
rngState = rngState;
364 return( decaySamplingInfo.
mu );
371 return( getFinalState( nCaptureIndices, captureIndices, e_in, temperature, rng, rngState ) );
378 return( getFinalState( nFissionIndices, fissionIndices, e_in, temperature, rng, rngState ) );
385 return( getFinalState( nOthersIndices, othersIndices, e_in, temperature, rng, rngState ) );
390 vector<G4GIDI_Product> *
G4GIDI_target::getFinalState(
int nIndices,
int *indices,
double e_in,
double temperature,
double (*rng)(
void * ),
void *rngState ) {
392 #define nProductsMax 50
394 vector<G4GIDI_Product> *products = NULL;
398 decaySamplingInfo.
e_in = e_in;
402 decaySamplingInfo.
rng = rng;
403 decaySamplingInfo.
rngState = rngState;
405 if( nIndices == 0 ) {
408 if( nIndices == 1 ) {
409 index = indices[0]; }
411 index = sampleChannelCrossSectionAtE( nIndices, indices, e_in, temperature, rng, rngState );
416 if( ( products =
new vector<G4GIDI_Product>( n ) ) != NULL ) {
417 for( i = 0; i <
n; i++ ) {
418 productData = &(productDatas[i]);
423 (*products)[i].px = productData->
px_vx;
424 (*products)[i].py = productData->
py_vy;
425 (*products)[i].pz = productData->
pz_vz;