G4GIDI_target Class Reference

#include <G4GIDI_target.hh>


Public Member Functions

void init (const char *fileName)
 G4GIDI_target (const char *fileName)
 G4GIDI_target (std::string &fileName)
 ~G4GIDI_target ()
std::string * getName (void)
std::string * getFilename (void)
int getZ (void)
int getA (void)
int getM (void)
double getMass (void)
int getTemperatures (double *temperatures)
int readTemperature (int index)
std::string getEqualProbableBinSampleMethod (void)
int setEqualProbableBinSampleMethod (std::string method)
int getNumberOfChannels (void)
int getNumberOfProductionChannels (void)
std::vector< channelID > * getChannelIDs (void)
std::vector< channelID > * getProductionChannelIDs (void)
std::vector< channelID > * getChannelIDs2 (GIDI::tpia_channel **channels, int n)
std::vector< double > * getEnergyGridAtTIndex (int index)
double getTotalCrossSectionAtE (double e_in, double temperature)
double getElasticCrossSectionAtE (double e_in, double temperature)
double getCaptureCrossSectionAtE (double e_in, double temperature)
double getFissionCrossSectionAtE (double e_in, double temperature)
double getOthersCrossSectionAtE (double e_in, double temperature)
double sumChannelCrossSectionAtE (int nIndices, int *indices, double e_in, double temperature)
int sampleChannelCrossSectionAtE (int nIndices, int *indices, double e_in, double temperature, double(*rng)(void *), void *rngState)
double getElasticFinalState (double e_in, double temperature, double(*rng)(void *), void *rngState)
std::vector< G4GIDI_Product > * getCaptureFinalState (double e_in, double temperature, double(*rng)(void *), void *rngState)
std::vector< G4GIDI_Product > * getFissionFinalState (double e_in, double temperature, double(*rng)(void *), void *rngState)
std::vector< G4GIDI_Product > * getOthersFinalState (double e_in, double temperature, double(*rng)(void *), void *rngState)
std::vector< G4GIDI_Product > * getFinalState (int nIndices, int *indices, double e_in, double temperature, double(*rng)(void *), void *rngState)

Data Fields

std::string equalProbableBinSampleMethod
int nElasticIndices
int nCaptureIndices
int nFissionIndices
int nOthersIndices
int * elasticIndices
int * captureIndices
int * fissionIndices
int * othersIndices
GIDI::statusMessageReporting smr
std::string name
std::string sourceFilename
double mass
GIDI::tpia_target * target


Detailed Description

Definition at line 88 of file G4GIDI_target.hh.


Constructor & Destructor Documentation

G4GIDI_target::G4GIDI_target ( const char *  fileName  ) 

Definition at line 75 of file G4GIDI_target.cc.

References init().

00075                                                    {
00076 
00077     init( fileName );
00078 }

G4GIDI_target::G4GIDI_target ( std::string &  fileName  ) 

G4GIDI_target::~G4GIDI_target (  ) 

Definition at line 150 of file G4GIDI_target.cc.

References elasticIndices, smr, smr_release(), target, tpia_target_free(), and xData_free().

00150                                {
00151 
00152     tpia_target_free( &smr, target );
00153     xData_free( &smr, elasticIndices );
00154     smr_release( &smr );
00155 }


Member Function Documentation

int G4GIDI_target::getA ( void   ) 

Definition at line 174 of file G4GIDI_target.cc.

References target.

00174                               {
00175    
00176     return( target->targetID->A );
00177 }

double G4GIDI_target::getCaptureCrossSectionAtE ( double  e_in,
double  temperature 
)

Definition at line 300 of file G4GIDI_target.cc.

References captureIndices, and sumChannelCrossSectionAtE().

00300                                                                                  {
00301 
00302     return( sumChannelCrossSectionAtE( nCaptureIndices, captureIndices, e_in, temperature ) );
00303 }

vector< G4GIDI_Product > * G4GIDI_target::getCaptureFinalState ( double  e_in,
double  temperature,
double(*)(void *)  rng,
void *  rngState 
)

Definition at line 369 of file G4GIDI_target.cc.

References captureIndices, and getFinalState().

Referenced by G4LENDCapture::ApplyYourself().

00369                                                                                                                                       {
00370 
00371     return( getFinalState( nCaptureIndices, captureIndices, e_in, temperature, rng, rngState ) );
00372 }

vector< channelID > * G4GIDI_target::getChannelIDs ( void   ) 

Definition at line 244 of file G4GIDI_target.cc.

References getChannelIDs2(), smr, target, and tpia_target_numberOfChannels().

00244                                                       { 
00245 
00246     return( getChannelIDs2( target->baseHeatedTarget->channels, tpia_target_numberOfChannels( &smr, target ) ) );
00247 }

std::vector<channelID>* G4GIDI_target::getChannelIDs2 ( GIDI::tpia_channel **  channels,
int  n 
)

Referenced by getChannelIDs(), and getProductionChannelIDs().

double G4GIDI_target::getElasticCrossSectionAtE ( double  e_in,
double  temperature 
)

Definition at line 293 of file G4GIDI_target.cc.

References elasticIndices, and sumChannelCrossSectionAtE().

00293                                                                                  {
00294 
00295     return( sumChannelCrossSectionAtE( nElasticIndices, elasticIndices, e_in, temperature ) );
00296 }

double G4GIDI_target::getElasticFinalState ( double  e_in,
double  temperature,
double(*)(void *)  rng,
void *  rngState 
)

Definition at line 349 of file G4GIDI_target.cc.

References elasticIndices, smr, target, tpia_angular_SampleMu(), tpia_decayChannel_getFirstProduct(), tpia_frame_setColumn(), and tpia_target_heated_getChannelAtIndex_smr().

Referenced by G4LENDModel::ApplyYourself(), and G4LENDElastic::ApplyYourself().

00349                                                                                                           {
00350 
00351     tpia_decaySamplingInfo decaySamplingInfo;
00352     tpia_channel *channel = tpia_target_heated_getChannelAtIndex_smr( &smr, target->baseHeatedTarget, elasticIndices[0] );
00353     tpia_product *product;
00354 
00355     decaySamplingInfo.e_in = e_in;
00356     decaySamplingInfo.isVelocity = 0;
00357     tpia_frame_setColumn( &smr, &(decaySamplingInfo.frame), 0, tpia_referenceFrame_lab );
00358     decaySamplingInfo.samplingMethods = &(target->samplingMethods);
00359     decaySamplingInfo.rng = rng;
00360     decaySamplingInfo.rngState = rngState;
00361     product = tpia_decayChannel_getFirstProduct( &(channel->decayChannel) );
00362     tpia_angular_SampleMu( &smr, &(product->angular), &decaySamplingInfo );
00363 
00364     return( decaySamplingInfo.mu );
00365 }

vector< double > * G4GIDI_target::getEnergyGridAtTIndex ( int  index  ) 

Definition at line 270 of file G4GIDI_target.cc.

References smr, target, and tpia_target_getEnergyGridAtTIndex().

00270                                                                 {
00271 
00272     xData_Int i, n;
00273     double *dEnergyGrid;
00274     vector<double> *energyGrid;
00275     vector<double>::iterator iter;
00276 
00277     n = tpia_target_getEnergyGridAtTIndex( &smr, target, index, &dEnergyGrid );
00278     if( n < 0 ) return( NULL );
00279     energyGrid = new vector<double>( n );
00280     for( i = 0, iter = energyGrid->begin( ); i < n; i++, iter++ ) *iter = dEnergyGrid[i];
00281     return( energyGrid );
00282 }

string G4GIDI_target::getEqualProbableBinSampleMethod ( void   ) 

Definition at line 209 of file G4GIDI_target.cc.

References equalProbableBinSampleMethod.

00209                                                             {
00210 
00211     return( equalProbableBinSampleMethod );
00212 }

string * G4GIDI_target::getFilename ( void   ) 

Definition at line 163 of file G4GIDI_target.cc.

References sourceFilename.

00163 { return( &sourceFilename ); }

vector< G4GIDI_Product > * G4GIDI_target::getFinalState ( int  nIndices,
int *  indices,
double  e_in,
double  temperature,
double(*)(void *)  rng,
void *  rngState 
)

Definition at line 390 of file G4GIDI_target.cc.

References nProductsMax, sampleChannelCrossSectionAtE(), smr, target, tpia_frame_setColumn(), and tpia_target_heated_sampleIndexChannelProductsAtE().

Referenced by getCaptureFinalState(), getFissionFinalState(), and getOthersFinalState().

00390                                                                                                                                                            {
00391 
00392 #define nProductsMax 50
00393     int index = 0, i, n;
00394     vector<G4GIDI_Product> *products = NULL;
00395     tpia_decaySamplingInfo decaySamplingInfo;
00396     tpia_productOutgoingData productDatas[nProductsMax], *productData;
00397 
00398     decaySamplingInfo.e_in = e_in;
00399     decaySamplingInfo.samplingMethods = &(target->samplingMethods);
00400     decaySamplingInfo.isVelocity = 0;
00401     tpia_frame_setColumn( &smr, &(decaySamplingInfo.frame), 0, tpia_referenceFrame_lab );
00402     decaySamplingInfo.rng = rng;
00403     decaySamplingInfo.rngState = rngState;
00404 
00405     if( nIndices == 0 ) {
00406         return( NULL ); }
00407     else {
00408         if( nIndices == 1 ) {
00409             index = indices[0]; }
00410         else {
00411             index = sampleChannelCrossSectionAtE( nIndices, indices, e_in, temperature, rng, rngState );
00412         }
00413     }
00414     n = tpia_target_heated_sampleIndexChannelProductsAtE( &smr, target->baseHeatedTarget, index, &decaySamplingInfo, nProductsMax, productDatas );
00415     if( n > 0 ) {
00416         if( ( products = new vector<G4GIDI_Product>( n ) ) != NULL ) {
00417             for( i = 0; i < n; i++ ) {
00418                 productData = &(productDatas[i]);
00419                 (*products)[i].A = productData->productID->A;
00420                 (*products)[i].Z = productData->productID->Z;
00421                 (*products)[i].m = productData->productID->m;
00422                 (*products)[i].kineticEnergy = productData->kineticEnergy;
00423                 (*products)[i].px = productData->px_vx;
00424                 (*products)[i].py = productData->py_vy;
00425                 (*products)[i].pz = productData->pz_vz;
00426             }
00427         }
00428     }
00429 
00430     return( products );
00431 #undef nProductsMax
00432 }

double G4GIDI_target::getFissionCrossSectionAtE ( double  e_in,
double  temperature 
)

Definition at line 307 of file G4GIDI_target.cc.

References fissionIndices, nFissionIndices, and sumChannelCrossSectionAtE().

00307                                                                                  {
00308 
00309     return( sumChannelCrossSectionAtE( nFissionIndices, fissionIndices, e_in, temperature ) );
00310 }

vector< G4GIDI_Product > * G4GIDI_target::getFissionFinalState ( double  e_in,
double  temperature,
double(*)(void *)  rng,
void *  rngState 
)

Definition at line 376 of file G4GIDI_target.cc.

References fissionIndices, getFinalState(), and nFissionIndices.

Referenced by G4LENDFission::ApplyYourself().

00376                                                                                                                                       {
00377 
00378     return( getFinalState( nFissionIndices, fissionIndices, e_in, temperature, rng, rngState ) );
00379 }

int G4GIDI_target::getM ( void   ) 

Definition at line 181 of file G4GIDI_target.cc.

References target.

00181                               {
00182    
00183     return( target->targetID->m );
00184 }

double G4GIDI_target::getMass ( void   ) 

Definition at line 188 of file G4GIDI_target.cc.

References mass.

00188                                     {
00189 
00190     return( mass );
00191 }

string * G4GIDI_target::getName ( void   ) 

Definition at line 159 of file G4GIDI_target.cc.

References name.

00159 { return( &name ); }

int G4GIDI_target::getNumberOfChannels ( void   ) 

Definition at line 230 of file G4GIDI_target.cc.

References smr, target, and tpia_target_numberOfChannels().

00230                                              {
00231 
00232     return( tpia_target_numberOfChannels( &smr, target ) );
00233 }

int G4GIDI_target::getNumberOfProductionChannels ( void   ) 

Definition at line 237 of file G4GIDI_target.cc.

References smr, target, and tpia_target_numberOfProductionChannels().

00237                                                        {
00238 
00239     return( tpia_target_numberOfProductionChannels( &smr, target ) );
00240 }

double G4GIDI_target::getOthersCrossSectionAtE ( double  e_in,
double  temperature 
)

Definition at line 314 of file G4GIDI_target.cc.

References nOthersIndices, othersIndices, and sumChannelCrossSectionAtE().

00314                                                                                 {
00315 
00316     return( sumChannelCrossSectionAtE( nOthersIndices, othersIndices, e_in, temperature ) );
00317 }

vector< G4GIDI_Product > * G4GIDI_target::getOthersFinalState ( double  e_in,
double  temperature,
double(*)(void *)  rng,
void *  rngState 
)

Definition at line 383 of file G4GIDI_target.cc.

References getFinalState(), nOthersIndices, and othersIndices.

Referenced by G4LENDInelastic::ApplyYourself().

00383                                                                                                                                      {
00384 
00385     return( getFinalState( nOthersIndices, othersIndices, e_in, temperature, rng, rngState ) );
00386 }

vector< channelID > * G4GIDI_target::getProductionChannelIDs ( void   ) 

Definition at line 251 of file G4GIDI_target.cc.

References getChannelIDs2(), smr, target, and tpia_target_numberOfProductionChannels().

00251                                                                 {
00252 
00253     return( getChannelIDs2( target->baseHeatedTarget->productionChannels, tpia_target_numberOfProductionChannels( &smr, target ) ) );
00254 }

int G4GIDI_target::getTemperatures ( double *  temperatures  ) 

Definition at line 195 of file G4GIDI_target.cc.

References smr, target, and tpia_target_getTemperatures().

00195                                                          {
00196 
00197     return( tpia_target_getTemperatures( &smr, target, temperatures ) );
00198 }

double G4GIDI_target::getTotalCrossSectionAtE ( double  e_in,
double  temperature 
)

Definition at line 286 of file G4GIDI_target.cc.

References target, and tpia_target_getTotalCrossSectionAtTAndE().

00286                                                                                {
00287 
00288     return( tpia_target_getTotalCrossSectionAtTAndE( NULL, target, temperature, -1, e_in, tpia_crossSectionType_pointwise ) );
00289 }

int G4GIDI_target::getZ ( void   ) 

Definition at line 167 of file G4GIDI_target.cc.

References target.

00167                               {
00168    
00169     return( target->targetID->Z );
00170 }

void G4GIDI_target::init ( const char *  fileName  ) 

Definition at line 89 of file G4GIDI_target.cc.

References captureIndices, elasticIndices, equalProbableBinSampleMethod, G4GIDI_targetMass(), mass, CLHEP::detail::n, name, nCaptureIndices, nElasticIndices, nFissionIndices, nOthersIndices, smr, smr_initialize(), smr_isOk(), smr_print(), sourceFilename, target, tpia_target_createRead(), tpia_target_heated_getChannelAtIndex(), and tpia_target_numberOfChannels().

Referenced by G4GIDI_target().

00089                                                {
00090 
00091     int i, j, n, *p, *q;
00092     tpia_channel *channel;
00093 
00094     smr_initialize( &smr );
00095     sourceFilename = fileName;
00096     target = tpia_target_createRead( &smr, fileName );
00097     if( !smr_isOk( &smr ) ) {
00098         smr_print( &smr, stderr, 1 );
00099         throw 1;
00100     }
00101     name = target->targetID->name;
00102     mass = G4GIDI_targetMass( target->targetID->name );
00103     equalProbableBinSampleMethod = "constant";
00104     elasticIndices = NULL;
00105     nElasticIndices = nCaptureIndices = nFissionIndices = nOthersIndices = 0;
00106 
00107     if( ( n = tpia_target_numberOfChannels( &smr, target ) ) > 0 ) {
00108         p = elasticIndices = (int *) xData_malloc2( NULL, n * sizeof( double ), 1, "elasticIndices" );
00109         for( i = 0; i < n; i++ ) {      /* Find elastic channel(s). */
00110             channel = tpia_target_heated_getChannelAtIndex( target->baseHeatedTarget, i );
00111             if( channel->ENDL_C == 10 ) {
00112                 *(p++) = i;
00113                 nElasticIndices++;
00114             }
00115         }
00116         captureIndices = p;
00117         for( i = 0; i < n; i++ ) {      /* Find capture channel(s). */
00118             channel = tpia_target_heated_getChannelAtIndex( target->baseHeatedTarget, i );
00119             if( channel->ENDL_C == 46 ) {
00120                 *(p++) = i;
00121                 nCaptureIndices++;
00122             }
00123         }
00124 
00125         fissionIndices = p;
00126         for( i = 0; i < n; i++ ) {      /* Find fission channel(s). */
00127             channel = tpia_target_heated_getChannelAtIndex( target->baseHeatedTarget, i );
00128             if( channel->fission != NULL ) {
00129                 *(p++) = i;
00130                 nFissionIndices++;
00131             }
00132         }
00133         othersIndices = p;
00134         for( i = 0; i < n; i++ ) {      /* Find other channel(s). */
00135             for( j = 0, q = elasticIndices; j < nElasticIndices; j++, q++ ) if( *q == i ) break;
00136             if( j < nElasticIndices ) continue;
00137             for( j = 0, q = captureIndices; j < nCaptureIndices; j++, q++ ) if( *q == i ) break;
00138             if( j < nCaptureIndices ) continue;
00139             for( j = 0, q = fissionIndices; j < nFissionIndices; j++, q++ ) if( *q == i ) break;
00140             if( j < nFissionIndices ) continue;
00141             *p = i;
00142             p++;
00143             nOthersIndices++;
00144         }
00145     }
00146 }

int G4GIDI_target::readTemperature ( int  index  ) 

Definition at line 202 of file G4GIDI_target.cc.

References smr, target, and tpia_target_readHeatedTarget().

00202                                               {
00203 
00204     return( tpia_target_readHeatedTarget( &smr, target, index, 0 ) );
00205 }

int G4GIDI_target::sampleChannelCrossSectionAtE ( int  nIndices,
int *  indices,
double  e_in,
double  temperature,
double(*)(void *)  rng,
void *  rngState 
)

Definition at line 333 of file G4GIDI_target.cc.

References smr, sumChannelCrossSectionAtE(), target, tpia_misc_drng(), and tpia_target_getIndexChannelCrossSectionAtE().

Referenced by getFinalState().

00334                                                   {
00335 
00336     int i;
00337     double xsec = 0., rxsec = sumChannelCrossSectionAtE( nIndices, indices, e_in, temperature ) * tpia_misc_drng( rng, rngState );
00338 
00339     for( i = 0; i < nIndices - 1; i++ ) {
00340         xsec += tpia_target_getIndexChannelCrossSectionAtE( &smr, target, indices[i], temperature, -1, e_in, tpia_crossSectionType_pointwise );
00341         if( xsec >= rxsec ) break;
00342     }
00343     return( indices[i] );
00344 }

int G4GIDI_target::setEqualProbableBinSampleMethod ( std::string  method  ) 

double G4GIDI_target::sumChannelCrossSectionAtE ( int  nIndices,
int *  indices,
double  e_in,
double  temperature 
)

Definition at line 321 of file G4GIDI_target.cc.

References smr, target, and tpia_target_getIndexChannelCrossSectionAtE().

Referenced by getCaptureCrossSectionAtE(), getElasticCrossSectionAtE(), getFissionCrossSectionAtE(), getOthersCrossSectionAtE(), and sampleChannelCrossSectionAtE().

00321                                                                                                              {
00322 
00323     int i;
00324     double xsec = 0.;
00325 
00326     for( i = 0; i < nIndices; i++ ) 
00327         xsec += tpia_target_getIndexChannelCrossSectionAtE( &smr, target, indices[i], temperature, -1, e_in, tpia_crossSectionType_pointwise );
00328     return( xsec );
00329 }


Field Documentation

int * G4GIDI_target::captureIndices

Definition at line 94 of file G4GIDI_target.hh.

Referenced by getCaptureCrossSectionAtE(), getCaptureFinalState(), and init().

int* G4GIDI_target::elasticIndices

Definition at line 94 of file G4GIDI_target.hh.

Referenced by getElasticCrossSectionAtE(), getElasticFinalState(), init(), and ~G4GIDI_target().

std::string G4GIDI_target::equalProbableBinSampleMethod

Definition at line 92 of file G4GIDI_target.hh.

Referenced by getEqualProbableBinSampleMethod(), and init().

int * G4GIDI_target::fissionIndices

Definition at line 94 of file G4GIDI_target.hh.

Referenced by getFissionCrossSectionAtE(), and getFissionFinalState().

double G4GIDI_target::mass

Definition at line 100 of file G4GIDI_target.hh.

Referenced by getMass(), and init().

std::string G4GIDI_target::name

Definition at line 98 of file G4GIDI_target.hh.

Referenced by getName(), and init().

int G4GIDI_target::nCaptureIndices

Definition at line 93 of file G4GIDI_target.hh.

Referenced by init().

int G4GIDI_target::nElasticIndices

Definition at line 93 of file G4GIDI_target.hh.

Referenced by init().

int G4GIDI_target::nFissionIndices

Definition at line 93 of file G4GIDI_target.hh.

Referenced by getFissionCrossSectionAtE(), getFissionFinalState(), and init().

int G4GIDI_target::nOthersIndices

Definition at line 93 of file G4GIDI_target.hh.

Referenced by getOthersCrossSectionAtE(), getOthersFinalState(), and init().

int * G4GIDI_target::othersIndices

Definition at line 94 of file G4GIDI_target.hh.

Referenced by getOthersCrossSectionAtE(), and getOthersFinalState().

GIDI::statusMessageReporting G4GIDI_target::smr

Definition at line 97 of file G4GIDI_target.hh.

Referenced by getChannelIDs(), getElasticFinalState(), getEnergyGridAtTIndex(), getFinalState(), getNumberOfChannels(), getNumberOfProductionChannels(), getProductionChannelIDs(), getTemperatures(), init(), readTemperature(), sampleChannelCrossSectionAtE(), sumChannelCrossSectionAtE(), and ~G4GIDI_target().

std::string G4GIDI_target::sourceFilename

Definition at line 99 of file G4GIDI_target.hh.

Referenced by getFilename(), and init().

GIDI::tpia_target* G4GIDI_target::target

Definition at line 101 of file G4GIDI_target.hh.

Referenced by getA(), getChannelIDs(), getElasticFinalState(), getEnergyGridAtTIndex(), getFinalState(), getM(), getNumberOfChannels(), getNumberOfProductionChannels(), getProductionChannelIDs(), getTemperatures(), getTotalCrossSectionAtE(), getZ(), init(), readTemperature(), sampleChannelCrossSectionAtE(), sumChannelCrossSectionAtE(), and ~G4GIDI_target().


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:05 2013 for Geant4 by  doxygen 1.4.7