Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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)
 

Public Attributes

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() [1/2]

G4GIDI_target::G4GIDI_target ( const char *  fileName)

Definition at line 75 of file G4GIDI_target.cc.

75 {
76
77 init( fileName );
78}
void init(const char *fileName)

◆ G4GIDI_target() [2/2]

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

Definition at line 82 of file G4GIDI_target.cc.

82 {
83
84 init( fileName.c_str( ) );
85}

◆ ~G4GIDI_target()

G4GIDI_target::~G4GIDI_target ( )

Definition at line 150 of file G4GIDI_target.cc.

150 {
151
154 smr_release( &smr );
155}
GIDI::statusMessageReporting smr
GIDI::tpia_target * target
int * elasticIndices
int smr_release(statusMessageReporting *smr)
tpia_target * tpia_target_free(statusMessageReporting *smr, tpia_target *target)
Definition: tpia_target.cc:108
void * xData_free(statusMessageReporting *smr, void *p)
Definition: xDataMisc.cc:89

Member Function Documentation

◆ getA()

int G4GIDI_target::getA ( void  )

Definition at line 174 of file G4GIDI_target.cc.

174 {
175
176 return( target->targetID->A );
177}

◆ getCaptureCrossSectionAtE()

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

Definition at line 300 of file G4GIDI_target.cc.

300 {
301
302 return( sumChannelCrossSectionAtE( nCaptureIndices, captureIndices, e_in, temperature ) );
303}
int * captureIndices
double sumChannelCrossSectionAtE(int nIndices, int *indices, double e_in, double temperature)

◆ getCaptureFinalState()

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.

369 {
370
371 return( getFinalState( nCaptureIndices, captureIndices, e_in, temperature, rng, rngState ) );
372}
std::vector< G4GIDI_Product > * getFinalState(int nIndices, int *indices, double e_in, double temperature, double(*rng)(void *), void *rngState)

Referenced by G4LENDCapture::ApplyYourself().

◆ getChannelIDs()

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

Definition at line 244 of file G4GIDI_target.cc.

244 {
245
246 return( getChannelIDs2( target->baseHeatedTarget->channels, tpia_target_numberOfChannels( &smr, target ) ) );
247}
std::vector< channelID > * getChannelIDs2(GIDI::tpia_channel **channels, int n)
int tpia_target_numberOfChannels(statusMessageReporting *smr, tpia_target *target)
Definition: tpia_target.cc:317

◆ getChannelIDs2()

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

Definition at line 258 of file G4GIDI_target.cc.

258 {
259
260 int i = 0;
261 vector<channelID> *listOfChannels;
262
263 listOfChannels = new vector<channelID>( n );
264 for( i = 0; i < n; i++ ) (*listOfChannels)[i].ID = channels[i]->outputChannel;
265 return( listOfChannels );
266}

Referenced by getChannelIDs(), and getProductionChannelIDs().

◆ getElasticCrossSectionAtE()

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

Definition at line 293 of file G4GIDI_target.cc.

293 {
294
295 return( sumChannelCrossSectionAtE( nElasticIndices, elasticIndices, e_in, temperature ) );
296}

◆ getElasticFinalState()

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

Definition at line 349 of file G4GIDI_target.cc.

349 {
350
351 tpia_decaySamplingInfo decaySamplingInfo;
353 tpia_product *product;
354
355 decaySamplingInfo.e_in = e_in;
356 decaySamplingInfo.isVelocity = 0;
357 tpia_frame_setColumn( &smr, &(decaySamplingInfo.frame), 0, tpia_referenceFrame_lab );
358 decaySamplingInfo.samplingMethods = &(target->samplingMethods);
359 decaySamplingInfo.rng = rng;
360 decaySamplingInfo.rngState = rngState;
361 product = tpia_decayChannel_getFirstProduct( &(channel->decayChannel) );
362 tpia_angular_SampleMu( &smr, &(product->angular), &decaySamplingInfo );
363
364 return( decaySamplingInfo.mu );
365}
tpia_decayChannel decayChannel
Definition: tpia_target.h:264
tpia_samplingMethods * samplingMethods
Definition: tpia_target.h:150
double(* rng)(void *)
Definition: tpia_target.h:153
tpia_data_frame frame
Definition: tpia_target.h:152
tpia_angular angular
Definition: tpia_target.h:244
#define tpia_referenceFrame_lab
Definition: tpia_target.h:85
tpia_product * tpia_decayChannel_getFirstProduct(tpia_decayChannel *decayChannel)
tpia_channel * tpia_target_heated_getChannelAtIndex_smr(statusMessageReporting *smr, tpia_target_heated *target, int index)
int tpia_frame_setColumn(statusMessageReporting *smr, tpia_data_frame *frame, int column, int value)
Definition: tpia_frame.cc:190
int tpia_angular_SampleMu(statusMessageReporting *smr, tpia_angular *angular, tpia_decaySamplingInfo *decaySamplingInfo)
Definition: tpia_angular.cc:87

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

◆ getEnergyGridAtTIndex()

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

Definition at line 270 of file G4GIDI_target.cc.

270 {
271
272 xData_Int i, n;
273 double *dEnergyGrid;
274 vector<double> *energyGrid;
275 vector<double>::iterator iter;
276
277 n = tpia_target_getEnergyGridAtTIndex( &smr, target, index, &dEnergyGrid );
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 );
282}
xData_Int tpia_target_getEnergyGridAtTIndex(statusMessageReporting *smr, tpia_target *target, int index, double **energyGrid)
Definition: tpia_target.cc:331
int xData_Int
Definition: xData.h:50

◆ getEqualProbableBinSampleMethod()

string G4GIDI_target::getEqualProbableBinSampleMethod ( void  )

Definition at line 209 of file G4GIDI_target.cc.

209 {
210
212}
std::string equalProbableBinSampleMethod

◆ getFilename()

string * G4GIDI_target::getFilename ( void  )

Definition at line 163 of file G4GIDI_target.cc.

163{ return( &sourceFilename ); }
std::string sourceFilename

◆ getFinalState()

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.

390 {
391
392#define nProductsMax 50
393 int index = 0, i, n;
394 vector<G4GIDI_Product> *products = NULL;
395 tpia_decaySamplingInfo decaySamplingInfo;
396 tpia_productOutgoingData productDatas[nProductsMax], *productData;
397
398 decaySamplingInfo.e_in = e_in;
399 decaySamplingInfo.samplingMethods = &(target->samplingMethods);
400 decaySamplingInfo.isVelocity = 0;
401 tpia_frame_setColumn( &smr, &(decaySamplingInfo.frame), 0, tpia_referenceFrame_lab );
402 decaySamplingInfo.rng = rng;
403 decaySamplingInfo.rngState = rngState;
404
405 if( nIndices == 0 ) {
406 return( NULL ); }
407 else {
408 if( nIndices == 1 ) {
409 index = indices[0]; }
410 else {
411 index = sampleChannelCrossSectionAtE( nIndices, indices, e_in, temperature, rng, rngState );
412 }
413 }
414 n = tpia_target_heated_sampleIndexChannelProductsAtE( &smr, target->baseHeatedTarget, index, &decaySamplingInfo, nProductsMax, productDatas );
415 if( n > 0 ) {
416 if( ( products = new vector<G4GIDI_Product>( n ) ) != NULL ) {
417 for( i = 0; i < n; i++ ) {
418 productData = &(productDatas[i]);
419 (*products)[i].A = productData->productID->A;
420 (*products)[i].Z = productData->productID->Z;
421 (*products)[i].m = productData->productID->m;
422 (*products)[i].kineticEnergy = productData->kineticEnergy;
423 (*products)[i].px = productData->px_vx;
424 (*products)[i].py = productData->py_vy;
425 (*products)[i].pz = productData->pz_vz;
426 }
427 }
428 }
429
430 return( products );
431#undef nProductsMax
432}
#define nProductsMax
int sampleChannelCrossSectionAtE(int nIndices, int *indices, double e_in, double temperature, double(*rng)(void *), void *rngState)
tpia_particle * productID
Definition: tpia_target.h:165
int tpia_target_heated_sampleIndexChannelProductsAtE(statusMessageReporting *smr, tpia_target_heated *target, int index, tpia_decaySamplingInfo *decaySamplingInfo, int nProductData, tpia_productOutgoingData *productData)

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

◆ getFissionCrossSectionAtE()

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

Definition at line 307 of file G4GIDI_target.cc.

307 {
308
309 return( sumChannelCrossSectionAtE( nFissionIndices, fissionIndices, e_in, temperature ) );
310}
int * fissionIndices

◆ getFissionFinalState()

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.

376 {
377
378 return( getFinalState( nFissionIndices, fissionIndices, e_in, temperature, rng, rngState ) );
379}

Referenced by G4LENDFission::ApplyYourself().

◆ getM()

int G4GIDI_target::getM ( void  )

Definition at line 181 of file G4GIDI_target.cc.

181 {
182
183 return( target->targetID->m );
184}

◆ getMass()

double G4GIDI_target::getMass ( void  )

Definition at line 188 of file G4GIDI_target.cc.

188 {
189
190 return( mass );
191}

◆ getName()

string * G4GIDI_target::getName ( void  )

Definition at line 159 of file G4GIDI_target.cc.

159{ return( &name ); }
std::string name

◆ getNumberOfChannels()

int G4GIDI_target::getNumberOfChannels ( void  )

Definition at line 230 of file G4GIDI_target.cc.

230 {
231
233}

◆ getNumberOfProductionChannels()

int G4GIDI_target::getNumberOfProductionChannels ( void  )

Definition at line 237 of file G4GIDI_target.cc.

237 {
238
240}
int tpia_target_numberOfProductionChannels(statusMessageReporting *smr, tpia_target *target)
Definition: tpia_target.cc:324

◆ getOthersCrossSectionAtE()

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

Definition at line 314 of file G4GIDI_target.cc.

314 {
315
316 return( sumChannelCrossSectionAtE( nOthersIndices, othersIndices, e_in, temperature ) );
317}

◆ getOthersFinalState()

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.

383 {
384
385 return( getFinalState( nOthersIndices, othersIndices, e_in, temperature, rng, rngState ) );
386}

Referenced by G4LENDInelastic::ApplyYourself().

◆ getProductionChannelIDs()

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

Definition at line 251 of file G4GIDI_target.cc.

251 {
252
253 return( getChannelIDs2( target->baseHeatedTarget->productionChannels, tpia_target_numberOfProductionChannels( &smr, target ) ) );
254}

◆ getTemperatures()

int G4GIDI_target::getTemperatures ( double *  temperatures)

Definition at line 195 of file G4GIDI_target.cc.

195 {
196
197 return( tpia_target_getTemperatures( &smr, target, temperatures ) );
198}
int tpia_target_getTemperatures(statusMessageReporting *smr, tpia_target *target, double *temperatures)
Definition: tpia_target.cc:256

◆ getTotalCrossSectionAtE()

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

Definition at line 286 of file G4GIDI_target.cc.

286 {
287
288 return( tpia_target_getTotalCrossSectionAtTAndE( NULL, target, temperature, -1, e_in, tpia_crossSectionType_pointwise ) );
289}
#define tpia_crossSectionType_pointwise
Definition: tpia_target.h:89
double tpia_target_getTotalCrossSectionAtTAndE(statusMessageReporting *smr, tpia_target *target, double T, xData_Int iEg, double e_in, int crossSectionType)
Definition: tpia_target.cc:357

◆ getZ()

int G4GIDI_target::getZ ( void  )

Definition at line 167 of file G4GIDI_target.cc.

167 {
168
169 return( target->targetID->Z );
170}

◆ init()

void G4GIDI_target::init ( const char *  fileName)

Definition at line 89 of file G4GIDI_target.cc.

89 {
90
91 int i, j, n, *p, *q;
92 tpia_channel *channel;
93
95 sourceFilename = fileName;
96 target = tpia_target_createRead( &smr, fileName );
97 if( !smr_isOk( &smr ) ) {
98 smr_print( &smr, stderr, 1 );
99 throw 1;
100 }
101 name = target->targetID->name;
102 mass = G4GIDI_targetMass( target->targetID->name );
103 equalProbableBinSampleMethod = "constant";
104 elasticIndices = NULL;
106
107 if( ( n = tpia_target_numberOfChannels( &smr, target ) ) > 0 ) {
108 p = elasticIndices = (int *) xData_malloc2( NULL, n * sizeof( double ), 1, "elasticIndices" );
109 for( i = 0; i < n; i++ ) { /* Find elastic channel(s). */
110 channel = tpia_target_heated_getChannelAtIndex( target->baseHeatedTarget, i );
111 if( channel->ENDL_C == 10 ) {
112 *(p++) = i;
114 }
115 }
116 captureIndices = p;
117 for( i = 0; i < n; i++ ) { /* Find capture channel(s). */
118 channel = tpia_target_heated_getChannelAtIndex( target->baseHeatedTarget, i );
119 if( channel->ENDL_C == 46 ) {
120 *(p++) = i;
122 }
123 }
124
125 fissionIndices = p;
126 for( i = 0; i < n; i++ ) { /* Find fission channel(s). */
127 channel = tpia_target_heated_getChannelAtIndex( target->baseHeatedTarget, i );
128 if( channel->fission != NULL ) {
129 *(p++) = i;
131 }
132 }
133 othersIndices = p;
134 for( i = 0; i < n; i++ ) { /* Find other channel(s). */
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;
141 *p = i;
142 p++;
144 }
145 }
146}
double G4GIDI_targetMass(const char *targetSymbol)
Definition: G4GIDI_mass.cc:903
int smr_initialize(statusMessageReporting *smr)
void smr_print(statusMessageReporting *smr, FILE *f, int clear)
int smr_isOk(statusMessageReporting *smr)
tpia_target * tpia_target_createRead(statusMessageReporting *smr, const char *fileName)
Definition: tpia_target.cc:70
tpia_channel * tpia_target_heated_getChannelAtIndex(tpia_target_heated *target, int index)
#define xData_malloc2(smr, size, zero, forItem)
Definition: xData.h:313

Referenced by G4GIDI_target().

◆ readTemperature()

int G4GIDI_target::readTemperature ( int  index)

Definition at line 202 of file G4GIDI_target.cc.

202 {
203
204 return( tpia_target_readHeatedTarget( &smr, target, index, 0 ) );
205}
int tpia_target_readHeatedTarget(statusMessageReporting *smr, tpia_target *target, int index, int checkElememtsForAccess)
Definition: tpia_target.cc:266

◆ sampleChannelCrossSectionAtE()

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.

334 {
335
336 int i;
337 double xsec = 0., rxsec = sumChannelCrossSectionAtE( nIndices, indices, e_in, temperature ) * tpia_misc_drng( rng, rngState );
338
339 for( i = 0; i < nIndices - 1; i++ ) {
340 xsec += tpia_target_getIndexChannelCrossSectionAtE( &smr, target, indices[i], temperature, -1, e_in, tpia_crossSectionType_pointwise );
341 if( xsec >= rxsec ) break;
342 }
343 return( indices[i] );
344}
double tpia_target_getIndexChannelCrossSectionAtE(statusMessageReporting *smr, tpia_target *target, int index, double T, xData_Int iEg, double e_in, int crossSectionType)
Definition: tpia_target.cc:380
double tpia_misc_drng(double(*rng)(void *), void *rngState)
Definition: tpia_misc.cc:403

Referenced by getFinalState().

◆ setEqualProbableBinSampleMethod()

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

Definition at line 216 of file G4GIDI_target.cc.

216 {
217
218 if( method == "constant" ) {
219 equalProbableBinSampleMethod = "constant"; }
220 if( method == "linear" ) {
221 equalProbableBinSampleMethod = "linear"; }
222 else {
223 return( 1 );
224 }
225 return( 0 );
226}

◆ sumChannelCrossSectionAtE()

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

Definition at line 321 of file G4GIDI_target.cc.

321 {
322
323 int i;
324 double xsec = 0.;
325
326 for( i = 0; i < nIndices; i++ )
327 xsec += tpia_target_getIndexChannelCrossSectionAtE( &smr, target, indices[i], temperature, -1, e_in, tpia_crossSectionType_pointwise );
328 return( xsec );
329}

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

Member Data Documentation

◆ captureIndices

int * G4GIDI_target::captureIndices

Definition at line 94 of file G4GIDI_target.hh.

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

◆ elasticIndices

int* G4GIDI_target::elasticIndices

◆ equalProbableBinSampleMethod

std::string G4GIDI_target::equalProbableBinSampleMethod

◆ fissionIndices

int * G4GIDI_target::fissionIndices

Definition at line 94 of file G4GIDI_target.hh.

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

◆ mass

double G4GIDI_target::mass

Definition at line 100 of file G4GIDI_target.hh.

Referenced by getMass(), and init().

◆ name

std::string G4GIDI_target::name

Definition at line 98 of file G4GIDI_target.hh.

Referenced by getName(), and init().

◆ nCaptureIndices

int G4GIDI_target::nCaptureIndices

Definition at line 93 of file G4GIDI_target.hh.

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

◆ nElasticIndices

int G4GIDI_target::nElasticIndices

Definition at line 93 of file G4GIDI_target.hh.

Referenced by getElasticCrossSectionAtE(), and init().

◆ nFissionIndices

int G4GIDI_target::nFissionIndices

Definition at line 93 of file G4GIDI_target.hh.

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

◆ nOthersIndices

int G4GIDI_target::nOthersIndices

Definition at line 93 of file G4GIDI_target.hh.

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

◆ othersIndices

int * G4GIDI_target::othersIndices

Definition at line 94 of file G4GIDI_target.hh.

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

◆ smr

◆ sourceFilename

std::string G4GIDI_target::sourceFilename

Definition at line 99 of file G4GIDI_target.hh.

Referenced by getFilename(), and init().

◆ target


The documentation for this class was generated from the following files: