Geant4-11
Functions
MCGIDI_target_heated.cc File Reference
#include <map>
#include <string.h>
#include <cmath>
#include <xDataTOM.h>
#include "MCGIDI.h"
#include "MCGIDI_misc.h"
#include "MCGIDI_private.h"

Go to the source code of this file.

Functions

MCGIDI_target_heatedMCGIDI_target_heated_free (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
double MCGIDI_target_heated_getIndexReactionCrossSectionAtE (statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes, bool sampling)
 
double MCGIDI_target_heated_getIndexReactionFinalQ (statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes)
 
MCGIDI_POPMCGIDI_target_heated_getPOPForProjectile (statusMessageReporting *, MCGIDI_target_heated *target)
 
MCGIDI_POPMCGIDI_target_heated_getPOPForTarget (statusMessageReporting *, MCGIDI_target_heated *target)
 
double MCGIDI_target_heated_getProjectileMass_MeV (statusMessageReporting *, MCGIDI_target_heated *target)
 
MCGIDI_reactionMCGIDI_target_heated_getReactionAtIndex (MCGIDI_target_heated *target, int index)
 
MCGIDI_reactionMCGIDI_target_heated_getReactionAtIndex_smr (statusMessageReporting *smr, MCGIDI_target_heated *target, int index)
 
int MCGIDI_target_heated_getReactionsDomain (statusMessageReporting *, MCGIDI_target_heated *target, int index, double *EMin, double *EMax)
 
double MCGIDI_target_heated_getReactionsThreshold (statusMessageReporting *, MCGIDI_target_heated *target, int index)
 
double MCGIDI_target_heated_getTargetMass_MeV (statusMessageReporting *, MCGIDI_target_heated *target)
 
double MCGIDI_target_heated_getTotalCrossSectionAtE (statusMessageReporting *smr, MCGIDI_target_heated *target, MCGIDI_quantitiesLookupModes &modes, bool sampling)
 
std::map< int, enum MCGIDI_transportability > const * MCGIDI_target_heated_getUniqueProducts (statusMessageReporting *, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_initialize (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
MCGIDI_target_heatedMCGIDI_target_heated_new (statusMessageReporting *smr)
 
MCGIDI_target_heatedMCGIDI_target_heated_newRead (statusMessageReporting *smr, const char *fileName)
 
int MCGIDI_target_heated_numberOfProductionReactions (statusMessageReporting *, MCGIDI_target_heated *)
 
int MCGIDI_target_heated_numberOfReactions (statusMessageReporting *, MCGIDI_target_heated *target)
 
static int MCGIDI_target_heated_parseParticle (statusMessageReporting *smr, MCGIDI_target_heated *target, xDataTOM_element *element, xDataTOM_element *particleAliases)
 
static int MCGIDI_target_heated_parseParticleGammas (statusMessageReporting *smr, MCGIDI_target_heated *target, xDataTOM_element *element, char const *name)
 
static int MCGIDI_target_heated_parseParticleLevel (statusMessageReporting *smr, MCGIDI_target_heated *target, xDataTOM_element *element, MCGIDI_POP *parent, double mass_MeV, xDataTOM_element *particleAliases)
 
static int MCGIDI_target_heated_parsePOPs (statusMessageReporting *smr, MCGIDI_target_heated *target, xDataTOM_element *element, xDataTOM_element *particleAliases)
 
static int MCGIDI_target_heated_parseReaction (statusMessageReporting *smr, xDataTOM_element *child, MCGIDI_target_heated *target, MCGIDI_POPs *pops, MCGIDI_reaction *reaction)
 
int MCGIDI_target_heated_read (statusMessageReporting *smr, MCGIDI_target_heated *target, const char *fileName)
 
int MCGIDI_target_heated_recast (statusMessageReporting *smr, MCGIDI_target_heated *target, GIDI_settings &settings)
 
int MCGIDI_target_heated_release (statusMessageReporting *, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_sampleIndexReactionProductsAtE (statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas)
 

Function Documentation

◆ MCGIDI_target_heated_free()

MCGIDI_target_heated * MCGIDI_target_heated_free ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 64 of file MCGIDI_target_heated.cc.

64 {
65
66 MCGIDI_target_heated_release( smr, target );
67 smr_freeMemory( (void **) &target );
68 return( NULL );
69}
int MCGIDI_target_heated_release(statusMessageReporting *, MCGIDI_target_heated *target)
void * smr_freeMemory(void **p)

References MCGIDI_target_heated_release(), and smr_freeMemory().

Referenced by MCGIDI_target_release().

◆ MCGIDI_target_heated_getIndexReactionCrossSectionAtE()

double MCGIDI_target_heated_getIndexReactionCrossSectionAtE ( statusMessageReporting smr,
MCGIDI_target_heated target,
int  index,
MCGIDI_quantitiesLookupModes modes,
bool  sampling 
)

Definition at line 496 of file MCGIDI_target_heated.cc.

497 {
498
499 double xsec = 0.;
500 MCGIDI_reaction *reaction = MCGIDI_target_heated_getReactionAtIndex_smr( smr, target, index );
501
502 if( reaction != NULL ) xsec = MCGIDI_reaction_getCrossSectionAtE( smr, reaction, modes, sampling );
503 return( xsec );
504}
double MCGIDI_reaction_getCrossSectionAtE(statusMessageReporting *smr, MCGIDI_reaction *reaction, MCGIDI_quantitiesLookupModes &modes, bool sampling)
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex_smr(statusMessageReporting *smr, MCGIDI_target_heated *target, int index)

References MCGIDI_reaction_getCrossSectionAtE(), and MCGIDI_target_heated_getReactionAtIndex_smr().

Referenced by MCGIDI_target_getIndexReactionCrossSectionAtE().

◆ MCGIDI_target_heated_getIndexReactionFinalQ()

double MCGIDI_target_heated_getIndexReactionFinalQ ( statusMessageReporting smr,
MCGIDI_target_heated target,
int  index,
MCGIDI_quantitiesLookupModes modes 
)

Definition at line 542 of file MCGIDI_target_heated.cc.

543 {
544
545 MCGIDI_reaction *reaction = MCGIDI_target_heated_getReactionAtIndex_smr( smr, target, index );
546
547 if( reaction == NULL ) return( 0. );
548 return( MCGIDI_reaction_getFinalQ( smr, reaction, modes ) );
549}
double MCGIDI_reaction_getFinalQ(statusMessageReporting *smr, MCGIDI_reaction *reaction, MCGIDI_quantitiesLookupModes &modes)

References MCGIDI_reaction_getFinalQ(), and MCGIDI_target_heated_getReactionAtIndex_smr().

Referenced by MCGIDI_target_getIndexReactionFinalQ().

◆ MCGIDI_target_heated_getPOPForProjectile()

MCGIDI_POP * MCGIDI_target_heated_getPOPForProjectile ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 433 of file MCGIDI_target_heated.cc.

433 {
434
435 return( target->projectilePOP );
436}
MCGIDI_POP * projectilePOP
Definition: MCGIDI.h:438

References MCGIDI_target_heated_s::projectilePOP.

Referenced by MCGIDI_KalbachMann_parseFromTOM().

◆ MCGIDI_target_heated_getPOPForTarget()

MCGIDI_POP * MCGIDI_target_heated_getPOPForTarget ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 440 of file MCGIDI_target_heated.cc.

440 {
441
442 return( target->targetPOP );
443}
MCGIDI_POP * targetPOP
Definition: MCGIDI.h:439

References MCGIDI_target_heated_s::targetPOP.

Referenced by MCGIDI_KalbachMann_parseFromTOM().

◆ MCGIDI_target_heated_getProjectileMass_MeV()

double MCGIDI_target_heated_getProjectileMass_MeV ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 447 of file MCGIDI_target_heated.cc.

447 {
448
449 return( MCGIDI_POP_getMass_MeV( target->projectilePOP ) );
450}
double MCGIDI_POP_getMass_MeV(MCGIDI_POP *pop)
Definition: MCGIDI_pop.cc:212

References MCGIDI_POP_getMass_MeV(), and MCGIDI_target_heated_s::projectilePOP.

Referenced by MCGIDI_reaction_getProjectileMass_MeV().

◆ MCGIDI_target_heated_getReactionAtIndex()

MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex ( MCGIDI_target_heated target,
int  index 
)

Definition at line 401 of file MCGIDI_target_heated.cc.

401 {
402
403 if( ( index >= 0 ) && ( index < target->numberOfReactions ) ) return( &(target->reactions[index]) );
404 return( NULL );
405}
MCGIDI_reaction * reactions
Definition: MCGIDI.h:448

References MCGIDI_target_heated_s::reactions.

Referenced by G4GIDI_target::getChannelIDs(), G4GIDI_target::init(), MCGIDI_target_getReactionAtIndex(), MCGIDI_target_heated_getReactionAtIndex_smr(), MCGIDI_target_heated_getReactionsDomain(), MCGIDI_target_heated_getReactionsThreshold(), and MCGIDI_target_sampleReaction().

◆ MCGIDI_target_heated_getReactionAtIndex_smr()

MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex_smr ( statusMessageReporting smr,
MCGIDI_target_heated target,
int  index 
)

Definition at line 409 of file MCGIDI_target_heated.cc.

409 {
410
411 MCGIDI_reaction *reaction = MCGIDI_target_heated_getReactionAtIndex( target, index );
412
413 if( reaction == NULL ) {
414 smr_setReportError2( smr, smr_unknownID, 1, "bad reaction index = %d for %s + %s", index, target->projectilePOP->name, target->targetPOP->name );
415 }
416 return( reaction );
417}
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex(MCGIDI_target_heated *target, int index)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
char * name
Definition: MCGIDI.h:232

References MCGIDI_target_heated_getReactionAtIndex(), MCGIDI_POP_s::name, MCGIDI_target_heated_s::projectilePOP, smr_setReportError2, smr_unknownID, and MCGIDI_target_heated_s::targetPOP.

Referenced by G4GIDI_target::getChannelsID(), G4GIDI_target::getElasticFinalState(), MCGIDI_target_getReactionAtIndex_smr(), MCGIDI_target_getReactionTypeAtIndex(), MCGIDI_target_heated_getIndexReactionCrossSectionAtE(), MCGIDI_target_heated_getIndexReactionFinalQ(), and MCGIDI_target_heated_sampleIndexReactionProductsAtE().

◆ MCGIDI_target_heated_getReactionsDomain()

int MCGIDI_target_heated_getReactionsDomain ( statusMessageReporting smr,
MCGIDI_target_heated target,
int  index,
double *  EMin,
double *  EMax 
)

Definition at line 530 of file MCGIDI_target_heated.cc.

530 {
531
532 MCGIDI_reaction *reaction = MCGIDI_target_heated_getReactionAtIndex( target, index );
533
534 if( reaction == NULL ) return( -1 );
535 *EMin = reaction->EMin;
536 *EMax = reaction->EMax;
537 return( 0 );
538}

References MCGIDI_reaction_s::EMax, MCGIDI_reaction_s::EMin, and MCGIDI_target_heated_getReactionAtIndex().

Referenced by G4GIDI_target::getReactionsDomain(), and MCGIDI_target_getDomain().

◆ MCGIDI_target_heated_getReactionsThreshold()

double MCGIDI_target_heated_getReactionsThreshold ( statusMessageReporting smr,
MCGIDI_target_heated target,
int  index 
)

Definition at line 520 of file MCGIDI_target_heated.cc.

520 {
521
522 MCGIDI_reaction *reaction = MCGIDI_target_heated_getReactionAtIndex( target, index );
523
524 if( reaction == NULL ) return( -1 );
525 return( reaction->EMin );
526}

References MCGIDI_reaction_s::EMin, and MCGIDI_target_heated_getReactionAtIndex().

Referenced by G4GIDI_target::getReactionsThreshold().

◆ MCGIDI_target_heated_getTargetMass_MeV()

double MCGIDI_target_heated_getTargetMass_MeV ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 454 of file MCGIDI_target_heated.cc.

454 {
455
456 return( MCGIDI_POP_getMass_MeV( target->targetPOP ) );
457}

References MCGIDI_POP_getMass_MeV(), and MCGIDI_target_heated_s::targetPOP.

Referenced by MCGIDI_reaction_getTargetMass_MeV().

◆ MCGIDI_target_heated_getTotalCrossSectionAtE()

double MCGIDI_target_heated_getTotalCrossSectionAtE ( statusMessageReporting smr,
MCGIDI_target_heated target,
MCGIDI_quantitiesLookupModes modes,
bool  sampling 
)

Definition at line 461 of file MCGIDI_target_heated.cc.

462 {
463
464 double xsec;
465
467 double e_in = modes.getProjectileEnergy( );
468
469 if( e_in < target->EMin ) e_in = target->EMin;
470 if( e_in > target->EMax ) e_in = target->EMax;
471 ptwXY_getValueAtX( target->crossSection, e_in, &xsec ); }
473 int index = modes.getGroupIndex( );
474 double *xSecP;
475
476 if( sampling ) {
477 xSecP = ptwX_getPointAtIndex( target->crossSectionGroupedForSampling, index ); }
478 else {
479 xSecP = ptwX_getPointAtIndex( target->crossSectionGrouped, index );
480 }
481
482 if( xSecP != NULL ) {
483 xsec = *xSecP; }
484 else {
485 xsec = 0.;
486 smr_setReportError2( smr, smr_unknownID, 1, "Invalid cross section group index %d", index, (int) ptwX_length( target->crossSectionGrouped ) );
487 } }
488 else {
489 xsec = 0.;
490 }
491 return( xsec );
492}
@ MCGIDI_quantityLookupMode_pointwise
Definition: MCGIDI.h:78
@ MCGIDI_quantityLookupMode_grouped
Definition: MCGIDI.h:79
int getGroupIndex(void) const
Definition: MCGIDI.h:100
enum MCGIDI_quantityLookupMode getCrossSectionMode(void) const
Definition: MCGIDI.h:107
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97
nfu_status ptwXY_getValueAtX(ptwXYPoints *ptwXY, double x, double *y)
Definition: ptwXY_core.cc:844
double * ptwX_getPointAtIndex(ptwXPoints *ptwX, int64_t index)
Definition: ptwX_core.cc:206
int64_t ptwX_length(ptwXPoints *ptwX)
Definition: ptwX_core.cc:166
ptwXYPoints * crossSection
Definition: MCGIDI.h:444
ptwXPoints * crossSectionGrouped
Definition: MCGIDI.h:445
ptwXPoints * crossSectionGroupedForSampling
Definition: MCGIDI.h:446

References MCGIDI_target_heated_s::crossSection, MCGIDI_target_heated_s::crossSectionGrouped, MCGIDI_target_heated_s::crossSectionGroupedForSampling, MCGIDI_target_heated_s::EMax, MCGIDI_target_heated_s::EMin, MCGIDI_quantitiesLookupModes::getCrossSectionMode(), MCGIDI_quantitiesLookupModes::getGroupIndex(), MCGIDI_quantitiesLookupModes::getProjectileEnergy(), MCGIDI_quantityLookupMode_grouped, MCGIDI_quantityLookupMode_pointwise, ptwX_getPointAtIndex(), ptwX_length(), ptwXY_getValueAtX(), smr_setReportError2, and smr_unknownID.

Referenced by MCGIDI_target_getTotalCrossSectionAtTAndE().

◆ MCGIDI_target_heated_getUniqueProducts()

std::map< int, enum MCGIDI_transportability > const * MCGIDI_target_heated_getUniqueProducts ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 553 of file MCGIDI_target_heated.cc.

553 {
554
555 return( target->transportabilities );
556}
transportabilitiesMap * transportabilities
Definition: MCGIDI.h:449

References MCGIDI_target_heated_s::transportabilities.

Referenced by MCGIDI_target_getUniqueProducts().

◆ MCGIDI_target_heated_initialize()

int MCGIDI_target_heated_initialize ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 43 of file MCGIDI_target_heated.cc.

43 {
44
45 memset( target, 0, sizeof( MCGIDI_target_heated ) );
46 MCGIDI_POPs_initial( smr, &(target->pops), 100 );
48 return( 0 );
49}
std::map< int, enum GIDI::MCGIDI_transportability > transportabilitiesMap
Definition: MCGIDI.h:171
int MCGIDI_POPs_initial(statusMessageReporting *smr, MCGIDI_POPs *pops, int size)
Definition: MCGIDI_pop.cc:30
MCGIDI_POPs pops
Definition: MCGIDI.h:437

References MCGIDI_POPs_initial(), MCGIDI_target_heated_s::pops, and MCGIDI_target_heated_s::transportabilities.

Referenced by MCGIDI_target_heated_new().

◆ MCGIDI_target_heated_new()

MCGIDI_target_heated * MCGIDI_target_heated_new ( statusMessageReporting smr)

Definition at line 32 of file MCGIDI_target_heated.cc.

32 {
33
35
36 if( ( target = (MCGIDI_target_heated *) smr_malloc2( smr, sizeof( MCGIDI_target_heated ), 0, "target" ) ) == NULL ) return( NULL );
37 if( MCGIDI_target_heated_initialize( smr, target ) ) target = (MCGIDI_target_heated *) smr_freeMemory( (void **) &target );
38 return( target );
39}
int MCGIDI_target_heated_initialize(statusMessageReporting *smr, MCGIDI_target_heated *target)
#define smr_malloc2(smr, size, zero, forItem)

References MCGIDI_target_heated_initialize(), smr_freeMemory(), and smr_malloc2.

Referenced by MCGIDI_target_heated_newRead().

◆ MCGIDI_target_heated_newRead()

MCGIDI_target_heated * MCGIDI_target_heated_newRead ( statusMessageReporting smr,
const char *  fileName 
)

Definition at line 53 of file MCGIDI_target_heated.cc.

53 {
54
56
57 if( ( target = MCGIDI_target_heated_new( smr ) ) == NULL ) return( NULL );
58 if( MCGIDI_target_heated_read( smr, target, fileName ) != 0 ) target = (MCGIDI_target_heated *) smr_freeMemory( (void **) &target );
59 return( target );
60}
MCGIDI_target_heated * MCGIDI_target_heated_new(statusMessageReporting *smr)
int MCGIDI_target_heated_read(statusMessageReporting *smr, MCGIDI_target_heated *target, const char *fileName)

References MCGIDI_target_heated_new(), MCGIDI_target_heated_read(), and smr_freeMemory().

Referenced by MCGIDI_target_readHeatedTarget().

◆ MCGIDI_target_heated_numberOfProductionReactions()

int MCGIDI_target_heated_numberOfProductionReactions ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 394 of file MCGIDI_target_heated.cc.

394 {
395
396 return( 0 );
397}

Referenced by MCGIDI_target_numberOfProductionReactions().

◆ MCGIDI_target_heated_numberOfReactions()

int MCGIDI_target_heated_numberOfReactions ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 387 of file MCGIDI_target_heated.cc.

387 {
388
389 return( target->numberOfReactions );
390}

References MCGIDI_target_heated_s::numberOfReactions.

Referenced by MCGIDI_target_numberOfReactions().

◆ MCGIDI_target_heated_parseParticle()

static int MCGIDI_target_heated_parseParticle ( statusMessageReporting smr,
MCGIDI_target_heated target,
xDataTOM_element element,
xDataTOM_element particleAliases 
)
static

Definition at line 235 of file MCGIDI_target_heated.cc.

236 {
237/*
238 This routine, MCGIDI_target_heated_parseParticleLevel, MCGIDI_target_heated_parseParticleGammas handle the parsing of a
239 particle which can have one of the following three forms:
240
2411)
242 <particle name="Sc47" genre="nucleus" mass="46.9524440292728 amu"/>
2432)
244 <particle name="Sc46" genre="nucleus" mass="45.9551770270807 amu">
245 <level name="Sc46_e0" label="0" energy="0 eV"/>
246 <level name="Sc46_e1" label="1" energy="142500 eV"/></particle>
2473)
248 <particle name="S36" genre="nucleus" mass="35.9669735654569 amu">
249 <level name="S36_e0" label="0" energy="0 eV" spin="0"/>
250 <level name="S36_e1" label="1" energy="3.291e6 eV">
251 <gamma finalLevel="S36_e0" probability="1.0"/></level>
252 <level name="S36_e2" label="2" energy="3.346e6 eV">
253 <gamma finalLevel="S36_e0" probability="1.0"/></level>
254 <level name="S36_e3" label="3" energy="4191990 eV">
255 <gamma finalLevel="S36_e1" probability="1.0"/></level>
256 <level name="S36_e4" label="4" energy="4522990 eV">
257 <gamma finalLevel="S36_e1" probability="0.248"/>
258 <gamma finalLevel="S36_e0" probability="0.752"/></level>
259 <level name="S36_e5" label="5" energy="4574990 eV">
260 <gamma finalLevel="S36_e1" probability="1.0"/></level>
261 <level name="S36_c" label="c" energy="u:4999990 eV"/></particle>
262*/
263 int globalParticle = 1;
264 char const *name = NULL, *mass = NULL; /* Do not free name or mass, do not own them. */
265 double mass_MeV;
266 xDataTOM_element *child;
267 MCGIDI_POP *pop;
268
269 if( ( name = xDataTOM_getAttributesValueInElement( element, "name" ) ) == NULL ) {
270 smr_setReportError2p( smr, smr_unknownID, 1, "particle missing name attribute" );
271 goto err;
272 }
273 if( ( mass = xDataTOM_getAttributesValueInElement( element, "mass" ) ) == NULL ) {
274 smr_setReportError2( smr, smr_unknownID, 1, "particle '%s' missing mass attribute", name );
275 goto err;
276 }
277 if( MCGIDI_misc_PQUStringToDouble( smr, mass, "amu", MCGIDI_AMU2MeV, &mass_MeV ) ) goto err;
278 if( ( pop = MCGIDI_POPs_addParticleIfNeeded( smr, &(target->pops), name, mass_MeV, 0., NULL, globalParticle ) ) == NULL ) goto err;
279
280 for( child = xDataTOME_getFirstElement( element ); child != NULL; child = xDataTOME_getNextElement( child ) ) {
281 if( strcmp( child->name, "level" ) ) {
282 smr_setReportError2( smr, smr_unknownID, 1, "invalid element '%s' in %s", child->name, element->name );
283 goto err;
284 }
285 if( MCGIDI_target_heated_parseParticleLevel( smr, target, child, pop, mass_MeV, particleAliases ) ) goto err;
286 }
287
288 return( 0 );
289
290err:
291 return( 1 );
292}
MCGIDI_POP * MCGIDI_POPs_addParticleIfNeeded(statusMessageReporting *smr, MCGIDI_POPs *pops, char const *name, double mass_MeV, double level_MeV, MCGIDI_POP *parent, int globalParticle)
Definition: MCGIDI_pop.cc:67
int MCGIDI_misc_PQUStringToDouble(statusMessageReporting *smr, char const *str, char const *unit, double conversion, double *value)
Definition: MCGIDI_misc.cc:330
#define MCGIDI_AMU2MeV
Definition: MCGIDI.h:184
static int MCGIDI_target_heated_parseParticleLevel(statusMessageReporting *smr, MCGIDI_target_heated *target, xDataTOM_element *element, MCGIDI_POP *parent, double mass_MeV, xDataTOM_element *particleAliases)
const char * name(G4int ptype)
#define smr_setReportError2p(smr, libraryID, code, fmt)
xDataTOM_element * xDataTOME_getNextElement(xDataTOM_element *element)
Definition: xDataTOM.cc:238
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:286
xDataTOM_element * xDataTOME_getFirstElement(xDataTOM_element *element)
Definition: xDataTOM.cc:230

References MCGIDI_AMU2MeV, MCGIDI_misc_PQUStringToDouble(), MCGIDI_POPs_addParticleIfNeeded(), MCGIDI_target_heated_parseParticleLevel(), G4InuclParticleNames::name(), xDataTOM_element_s::name, MCGIDI_target_heated_s::pops, smr_setReportError2, smr_setReportError2p, smr_unknownID, xDataTOM_getAttributesValueInElement(), xDataTOME_getFirstElement(), and xDataTOME_getNextElement().

Referenced by MCGIDI_target_heated_parsePOPs().

◆ MCGIDI_target_heated_parseParticleGammas()

static int MCGIDI_target_heated_parseParticleGammas ( statusMessageReporting smr,
MCGIDI_target_heated target,
xDataTOM_element element,
char const *  name 
)
static

Definition at line 331 of file MCGIDI_target_heated.cc.

331 {
332
333 int gammaCounts = 0;
334 MCGIDI_POP *pop = MCGIDI_POPs_findParticle( &(target->pops), name );
335 xDataTOM_element *child;
336 MCGIDI_GammaBranching *gammas = NULL;
337 char const *finalLevelString;
338 double probability;
339
340 for( child = xDataTOME_getFirstElement( element ); child != NULL; child = xDataTOME_getNextElement( child ) ) {
341 if( strcmp( child->name, "gamma" ) ) {
342 smr_setReportError2( smr, smr_unknownID, 1, "invalid element '%s' in %s", child->name, element->name );
343 goto err;
344 }
345 gammaCounts++;
346 }
347 if( gammaCounts > 0 ) {
348 if( ( gammas = (MCGIDI_GammaBranching *) smr_malloc2( smr, gammaCounts * sizeof( MCGIDI_GammaBranching), 0, "gammas" ) ) == NULL ) goto err;
349 for( child = xDataTOME_getFirstElement( element ); child != NULL; child = xDataTOME_getNextElement( child ) ) {
350 if( ( finalLevelString = xDataTOM_getAttributesValueInElement( child, "finalLevel" ) ) == NULL ) {
351 smr_setReportError2p( smr, smr_unknownID, 1, "gamma missing 'finalLevel'" );
352 goto err;
353 }
354 if( xDataTOME_convertAttributeToDouble( smr, child, "probability", &probability ) != 0 ) {
355 smr_setReportError2p( smr, smr_unknownID, 1, "gamma missing 'probability' attribute" );
356 goto err;
357 }
358 }
359 }
360 pop->numberOfGammaBranchs = gammaCounts;
361 pop->gammas = gammas;
362
363 return( 0 );
364
365err:
366 if( gammas != NULL ) smr_freeMemory( (void **) &gammas );
367 return( 1 );
368}
MCGIDI_POP * MCGIDI_POPs_findParticle(MCGIDI_POPs *pops, char const *name)
Definition: MCGIDI_pop.cc:133
MCGIDI_GammaBranching * gammas
Definition: MCGIDI.h:238
int numberOfGammaBranchs
Definition: MCGIDI.h:237
int xDataTOME_convertAttributeToDouble(statusMessageReporting *smr, xDataTOM_element *element, char const *name, double *d)
Definition: xDataTOM.cc:307

References MCGIDI_POP_s::gammas, MCGIDI_POPs_findParticle(), G4InuclParticleNames::name(), xDataTOM_element_s::name, MCGIDI_POP_s::numberOfGammaBranchs, MCGIDI_target_heated_s::pops, smr_freeMemory(), smr_malloc2, smr_setReportError2, smr_setReportError2p, smr_unknownID, xDataTOM_getAttributesValueInElement(), xDataTOME_convertAttributeToDouble(), xDataTOME_getFirstElement(), and xDataTOME_getNextElement().

Referenced by MCGIDI_target_heated_parseParticleLevel().

◆ MCGIDI_target_heated_parseParticleLevel()

static int MCGIDI_target_heated_parseParticleLevel ( statusMessageReporting smr,
MCGIDI_target_heated target,
xDataTOM_element element,
MCGIDI_POP parent,
double  mass_MeV,
xDataTOM_element particleAliases 
)
static

Definition at line 296 of file MCGIDI_target_heated.cc.

297 {
298
299 int globalParticle = 0;
300 char const *name, *level, *aliasValue; /* Do not free any of these as they are owned by called routine. */
301 double level_MeV = 0.;
302 xDataTOM_element *alias;
303
304 if( ( name = xDataTOM_getAttributesValueInElement( element, "name" ) ) == NULL ) {
305 smr_setReportError2p( smr, smr_unknownID, 1, "particle missing name attribute" );
306 goto err;
307 }
308 if( ( level = xDataTOM_getAttributesValueInElement( element, "energy" ) ) == NULL ) {
309 smr_setReportError2( smr, smr_unknownID, 1, "particle '%s' level missing energy attribute", name );
310 goto err;
311 }
312 /* Special case for 'c' labels. Correct mass is only needed for two-body. */
313 if( level[0] != 'u' ) if( MCGIDI_misc_PQUStringToDoubleInUnitOf( smr, level, "MeV", &level_MeV ) ) goto err;
314 for( alias = xDataTOME_getFirstElement( particleAliases ); alias != NULL; alias = xDataTOME_getNextElement( alias ) ) {
315 if( ( aliasValue = xDataTOM_getAttributesValueInElement( alias, "value" ) ) == NULL ) {
316 smr_setReportError2p( smr, smr_unknownID, 1, "particle missing name attribute" );
317 goto err;
318 }
319 if( strcmp( aliasValue, name ) == 0 ) globalParticle = 1;
320 }
321 if( MCGIDI_POPs_addParticleIfNeeded( smr, &(target->pops), name, mass_MeV + level_MeV, level_MeV, parent, globalParticle ) == NULL ) goto err;
322
323 return( MCGIDI_target_heated_parseParticleGammas( smr, target, element, name ) );
324
325err:
326 return( 1 );
327}
int MCGIDI_misc_PQUStringToDoubleInUnitOf(statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
Definition: MCGIDI_misc.cc:356
static int MCGIDI_target_heated_parseParticleGammas(statusMessageReporting *smr, MCGIDI_target_heated *target, xDataTOM_element *element, char const *name)

References MCGIDI_misc_PQUStringToDoubleInUnitOf(), MCGIDI_POPs_addParticleIfNeeded(), MCGIDI_target_heated_parseParticleGammas(), G4InuclParticleNames::name(), MCGIDI_target_heated_s::pops, smr_setReportError2, smr_setReportError2p, smr_unknownID, xDataTOM_getAttributesValueInElement(), xDataTOME_getFirstElement(), and xDataTOME_getNextElement().

Referenced by MCGIDI_target_heated_parseParticle().

◆ MCGIDI_target_heated_parsePOPs()

static int MCGIDI_target_heated_parsePOPs ( statusMessageReporting smr,
MCGIDI_target_heated target,
xDataTOM_element element,
xDataTOM_element particleAliases 
)
static

Definition at line 215 of file MCGIDI_target_heated.cc.

216 {
217
218 xDataTOM_element *child;
219
220 for( child = xDataTOME_getFirstElement( element ); child != NULL; child = xDataTOME_getNextElement( child ) ) {
221 if( strcmp( child->name, "particle" ) ) {
222 smr_setReportError2( smr, smr_unknownID, 1, "invalid element '%s' in %s", child->name, element->name );
223 goto err;
224 }
225 if( MCGIDI_target_heated_parseParticle( smr, target, child, particleAliases ) ) goto err;
226 }
227 return( 0 );
228
229err:
230 return( 1 );
231}
static int MCGIDI_target_heated_parseParticle(statusMessageReporting *smr, MCGIDI_target_heated *target, xDataTOM_element *element, xDataTOM_element *particleAliases)

References MCGIDI_target_heated_parseParticle(), xDataTOM_element_s::name, smr_setReportError2, smr_unknownID, xDataTOME_getFirstElement(), and xDataTOME_getNextElement().

Referenced by MCGIDI_target_heated_read().

◆ MCGIDI_target_heated_parseReaction()

static int MCGIDI_target_heated_parseReaction ( statusMessageReporting smr,
xDataTOM_element child,
MCGIDI_target_heated target,
MCGIDI_POPs pops,
MCGIDI_reaction reaction 
)
static

Definition at line 372 of file MCGIDI_target_heated.cc.

373 {
374
375 if( MCGIDI_reaction_parseFromTOM( smr, element, target, pops, reaction ) ) goto err;
376 target->numberOfReactions++;
377
378 return( 0 );
379
380err:
381 smr_setReportError2( smr, smr_unknownID, 1, "%s\n", xDataTOM_getAttributesValueInElement( element, "outputChannel" ) );
382 return( 1 );
383}
int MCGIDI_reaction_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_target_heated *target, MCGIDI_POPs *pops, MCGIDI_reaction *reaction)

References MCGIDI_reaction_parseFromTOM(), MCGIDI_target_heated_s::numberOfReactions, smr_setReportError2, smr_unknownID, and xDataTOM_getAttributesValueInElement().

Referenced by MCGIDI_target_heated_read().

◆ MCGIDI_target_heated_read()

int MCGIDI_target_heated_read ( statusMessageReporting smr,
MCGIDI_target_heated target,
const char *  fileName 
)

Definition at line 92 of file MCGIDI_target_heated.cc.

92 {
93/*
94* If a target has already been read into this target, user must have called MCGIDI_target_heated_release before calling this routine.
95* Otherwise, there will be memory leaks.
96*/
97 int n, ir;
98 xDataTOM_TOM *doc = NULL;
99 xDataTOM_element *element, *child, *particles, *particleAliases;
100 char const *name, *version, *temperatureStr;
101 char *e1;
102 MCGIDI_reaction *reaction;
103 double crossSectionInit[4] = { 0., 0., 0., 0., };
104 nfu_status status;
105 ptwXYPoints *crossSection;
106int subtag1_Notice = 0;
107
108 if( ( target->path = smr_allocateCopyString2( smr, fileName, "path" ) ) == NULL ) goto err;
109 if( ( target->absPath = xDataTOMMisc_getAbsPath( smr, fileName ) ) == NULL ) goto err;
110 if( ( doc = xDataTOM_importFile( smr, fileName ) ) == NULL ) goto err;
111 element = xDataTOM_getDocumentsElement( doc );
112 if( ( version = xDataTOM_getAttributesValueInElement( element, "version" ) ) == NULL ) {
113 smr_setReportError2( smr, smr_unknownID, 1, "version attribute missing from element '%s'", element->name );
114 goto err; }
115 else {
116 if( strcmp( version, "GND 1.3" ) != 0 ) {
117 smr_setReportError2( smr, smr_unknownID, 1, "Unsupported version '%s' for element %s", version, element->name );
118 goto err;
119 }
120 }
121 if( strcmp( element->name, "reactionSuite" ) != 0 ) {
122 smr_setReportError2( smr, smr_unknownID, 1, "input file's top element must be reactionSuite and not %s", element->name );
123 goto err; }
124 else {
125 xDataTOMAL_copyAttributionList( smr, &(target->attributes), &(element->attributes) );
126 particleAliases = xDataTOME_getOneElementByName( smr, element, "aliases", 0 );
127 if( ( particles = xDataTOME_getOneElementByName( smr, element, "particles", 1 ) ) == NULL ) goto err;
128 if( MCGIDI_target_heated_parsePOPs( smr, target, particles, particleAliases ) != 0 ) goto err;
129
130 if( ( temperatureStr = MCGIDI_misc_pointerToTOMAttributeIfAllOk3( smr, target->absPath, 1, &(target->attributes), "temperature" ) ) == NULL ) goto err;
131 target->temperature_MeV = strtod( temperatureStr, &e1 );
132 while( isspace( *e1 ) ) ++e1; // Loop checking, 11.06.2015, T. Koi
133 target->temperature_MeV *= MCGIDI_misc_getUnitConversionFactor( smr, e1, "MeV/k" );
134 if( !smr_isOk( smr ) ) goto err;
135
136 if( ( name = MCGIDI_misc_pointerToTOMAttributeIfAllOk3( smr, target->absPath, 1, &(target->attributes), "projectile" ) ) != NULL )
137 target->projectilePOP = MCGIDI_POPs_findParticle( &(target->pops), name );
138 if( !smr_isOk( smr ) ) goto err;
139
140 if( ( name = MCGIDI_misc_pointerToTOMAttributeIfAllOk3( smr, target->absPath, 1, &(target->attributes), "target" ) ) != NULL )
141 if( !smr_isOk( smr ) ) goto err;
142 target->targetPOP = MCGIDI_POPs_findParticle( &(target->pops), name );
143
144 n = xDataTOM_numberOfElementsByName( smr, element, "reaction" );
145 if( n == 0 ) {
146 smr_setReportError2( smr, smr_unknownID, 1, "target does not have any reactions: file = '%s'", fileName );
147 goto err;
148 }
149 if( ( target->reactions = (MCGIDI_reaction *) smr_malloc2( smr, n * sizeof( MCGIDI_reaction ), 1, "target->reactions" ) ) == NULL ) goto err;
150
151 for( ir = 0, child = xDataTOME_getFirstElement( element ); child != NULL; child = xDataTOME_getNextElement( child ) ) {
152 if( strcmp( child->name, "particles" ) == 0 ) continue;
153 if( strcmp( child->name, "styles" ) == 0 ) continue;
154 if( strcmp( child->name, "documentations" ) == 0 ) continue;
155 if( strcmp( child->name, "resonances" ) == 0 ) continue;
156 if( strcmp( child->name, "summedReaction" ) == 0 ) continue;
157 if( strcmp( child->name, "fissionComponent" ) == 0 ) continue;
158 if( strcmp( child->name, "reaction" ) == 0 ) {
159 double EMin, EMax;
160
161 reaction = &(target->reactions[ir]);
162 if( MCGIDI_target_heated_parseReaction( smr, child, target, &(target->pops), reaction ) ) goto err;
163 if( MCGIDI_reaction_getDomain( smr, reaction, &EMin, &EMax ) ) goto err;
164 if( ir == 0 ) { target->EMin = EMin; target->EMax = EMax; }
165 if( EMin < target->EMin ) target->EMin = EMin;
166 if( EMax > target->EMax ) target->EMax = EMax;
167 for( transportabilitiesMap::const_iterator iter = reaction->transportabilities->begin( );
168 iter != reaction->transportabilities->end( ); ++iter ) {
169 MCGIDI_misc_updateTransportabilitiesMap( target->transportabilities, iter->first, iter->second );
170 }
171 ir++; }
172 else if( strcmp( child->name, "production" ) == 0 ) {
173 continue; }
174 else if( strcmp( child->name, "aliases" ) == 0 ) {
175 continue; }
176 else if( strcmp( child->name, "partialGammaProduction" ) == 0 ) {
177 if( subtag1_Notice == 0 ) printf( "Unsupported reactionSuite sub-tag = '%s'\n", child->name );
178 subtag1_Notice++; }
179 else {
180 printf( "Unsupported reactionSuite sub-tag = '%s'\n", child->name );
181 }
182 }
183 crossSectionInit[0] = target->EMin;
184 crossSectionInit[2] = target->EMax;
185 if( ( target->crossSection = ptwXY_create( ptwXY_interpolationLinLin, NULL, 2., 1e-3, 2, 10, 2, crossSectionInit, &status, 0 ) ) == NULL ) {
186 smr_setReportError2( smr, smr_unknownID, 1, "ptwXY_create err = %d: %s\n", status, nfu_statusMessage( status ) );
187 goto err;
188 }
189 for( ir = 0; ir < target->numberOfReactions; ir++ ) {
190 reaction = &(target->reactions[ir]);
191 if( MCGIDI_reaction_fixDomains( smr, reaction, target->EMin, target->EMax, &status ) ) {
192 smr_setReportError2( smr, smr_unknownID, 1, "ptwXY_add_ptwXY err = %d: %s\n", status, nfu_statusMessage( status ) );
193 goto err;
194 }
195 if( ( crossSection = ptwXY_add_ptwXY( target->crossSection, reaction->crossSection, &status ) ) == NULL ) {
196 smr_setReportError2( smr, smr_unknownID, 1, "ptwXY_add_ptwXY err = %d: %s\n", status, nfu_statusMessage( status ) );
197 goto err;
198 }
199 target->crossSection = ptwXY_free( target->crossSection );
200 target->crossSection = crossSection;
201 }
202 }
203 xDataTOM_freeTOM( smr, &doc );
204 return( 0 );
205
206err:
207 smr_setReportError2( smr, smr_unknownID, 1, "Sub-error while reading file '%s'", fileName );
208 if( doc != NULL ) xDataTOM_freeTOM( smr, &doc );
209 MCGIDI_target_heated_release( smr, target );
210 return( 1 );
211}
static const G4double e1[44]
void MCGIDI_misc_updateTransportabilitiesMap(transportabilitiesMap *transportabilities, int PoPID, enum MCGIDI_transportability transportability)
Definition: MCGIDI_misc.cc:482
int MCGIDI_reaction_fixDomains(statusMessageReporting *smr, MCGIDI_reaction *reaction, double EMin, double EMax, nfu_status *status)
int MCGIDI_reaction_getDomain(statusMessageReporting *smr, MCGIDI_reaction *reaction, double *EMin, double *EMax)
#define MCGIDI_misc_pointerToTOMAttributeIfAllOk3(smr, path, required, attributes, name)
Definition: MCGIDI_misc.h:28
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
Definition: MCGIDI_misc.cc:381
static int MCGIDI_target_heated_parsePOPs(statusMessageReporting *smr, MCGIDI_target_heated *target, xDataTOM_element *element, xDataTOM_element *particleAliases)
static int MCGIDI_target_heated_parseReaction(statusMessageReporting *smr, xDataTOM_element *child, MCGIDI_target_heated *target, MCGIDI_POPs *pops, MCGIDI_reaction *reaction)
enum nfu_status_e nfu_status
const char * nfu_statusMessage(nfu_status status)
Definition: nf_utilities.cc:76
@ ptwXY_interpolationLinLin
Definition: ptwXY.h:35
ptwXYPoints * ptwXY_create(ptwXY_interpolation interpolation, ptwXY_interpolationOtherInfo const *interpolationOtherInfo, double biSectionMax, double accuracy, int64_t primarySize, int64_t secondarySize, int64_t length, double const *xy, nfu_status *status, int userFlag)
Definition: ptwXY_core.cc:108
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:574
ptwXYPoints * ptwXY_add_ptwXY(ptwXYPoints *ptwXY1, ptwXYPoints *ptwXY2, nfu_status *status)
#define smr_allocateCopyString2(smr, s, forItem)
int smr_isOk(statusMessageReporting *smr)
transportabilitiesMap * transportabilities
Definition: MCGIDI.h:430
ptwXYPoints * crossSection
Definition: MCGIDI.h:426
xDataTOM_attributionList attributes
Definition: MCGIDI.h:440
double temperature_MeV
Definition: MCGIDI.h:442
xDataTOM_attributionList attributes
Definition: xDataTOM.h:184
int xDataTOM_numberOfElementsByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:268
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
xDataTOM_TOM * xDataTOM_importFile(statusMessageReporting *smr, const char *fileName)
Definition: xDataTOM.cc:44
void * xDataTOM_freeTOM(statusMessageReporting *smr, xDataTOM_TOM **TOM)
Definition: xDataTOM.cc:78
xDataTOM_element * xDataTOM_getDocumentsElement(xDataTOM_TOM *TOM)
Definition: xDataTOM.cc:223
int xDataTOMAL_copyAttributionList(statusMessageReporting *smr, xDataTOM_attributionList *desc, xDataTOM_attributionList *src)
Definition: xDataTOM.cc:415
char * xDataTOMMisc_getAbsPath(statusMessageReporting *smr, const char *fileName)

References MCGIDI_target_heated_s::absPath, MCGIDI_target_heated_s::attributes, xDataTOM_element_s::attributes, MCGIDI_reaction_s::crossSection, MCGIDI_target_heated_s::crossSection, e1, MCGIDI_target_heated_s::EMax, MCGIDI_target_heated_s::EMin, MCGIDI_misc_getUnitConversionFactor(), MCGIDI_misc_pointerToTOMAttributeIfAllOk3, MCGIDI_misc_updateTransportabilitiesMap(), MCGIDI_POPs_findParticle(), MCGIDI_reaction_fixDomains(), MCGIDI_reaction_getDomain(), MCGIDI_target_heated_parsePOPs(), MCGIDI_target_heated_parseReaction(), MCGIDI_target_heated_release(), CLHEP::detail::n, G4InuclParticleNames::name(), xDataTOM_element_s::name, nfu_statusMessage(), MCGIDI_target_heated_s::numberOfReactions, MCGIDI_target_heated_s::path, MCGIDI_target_heated_s::pops, MCGIDI_target_heated_s::projectilePOP, ptwXY_add_ptwXY(), ptwXY_create(), ptwXY_free(), ptwXY_interpolationLinLin, MCGIDI_target_heated_s::reactions, smr_allocateCopyString2, smr_isOk(), smr_malloc2, smr_setReportError2, smr_unknownID, MCGIDI_target_heated_s::targetPOP, MCGIDI_target_heated_s::temperature_MeV, MCGIDI_reaction_s::transportabilities, MCGIDI_target_heated_s::transportabilities, xDataTOM_freeTOM(), xDataTOM_getAttributesValueInElement(), xDataTOM_getDocumentsElement(), xDataTOM_importFile(), xDataTOM_numberOfElementsByName(), xDataTOMAL_copyAttributionList(), xDataTOME_getFirstElement(), xDataTOME_getNextElement(), xDataTOME_getOneElementByName(), and xDataTOMMisc_getAbsPath().

Referenced by MCGIDI_target_heated_newRead().

◆ MCGIDI_target_heated_recast()

int MCGIDI_target_heated_recast ( statusMessageReporting smr,
MCGIDI_target_heated target,
GIDI_settings settings 
)

Definition at line 560 of file MCGIDI_target_heated.cc.

560 {
561
562 int ir, projectilePoPID = target->projectilePOP->globalPoPsIndex;
563 ptwXPoints *totalGroupedCrossSection = NULL;
564 GIDI_settings_particle const *projectileSettings = settings.getParticle( projectilePoPID );
565 nfu_status status_nf;
566
567 if( projectileSettings == NULL ) {
568 smr_setReportError2( smr, smr_unknownID, 1, "Settings missing for projectile %s", target->projectilePOP->name );
569 return( 1 );
570 }
573 if( projectileSettings->isEnergyMode_grouped( ) ) {
574 int64_t numberOfGroups = projectileSettings->getNumberOfGroups( );
575
576 if( ( totalGroupedCrossSection = ptwX_createLine( numberOfGroups, numberOfGroups, 0, 0, &status_nf ) ) == NULL ) {
577 smr_setReportError2( smr, smr_unknownID, 1, "totalGroupedCrossSection allocation failed: status_nf = %d, '%s'",
578 status_nf, nfu_statusMessage( status_nf ) );
579 goto err;
580 }
581 }
582
583 for( ir = 0; ir < target->numberOfReactions; ++ir ) {
584 if( MCGIDI_reaction_recast( smr, &(target->reactions[ir]), settings, projectileSettings, target->temperature_MeV, totalGroupedCrossSection ) != 0 ) goto err;
585 }
586 if( projectileSettings->isEnergyMode_grouped( ) ) {
587 if( ( target->crossSectionGroupedForSampling = ptwX_clone( totalGroupedCrossSection, &status_nf ) ) == NULL ) {
588 smr_setReportError2( smr, smr_unknownID, 1, "totalGroupedCrossSection allocation failed: status_nf = %d, '%s'",
589 status_nf, nfu_statusMessage( status_nf ) );
590 goto err;
591 }
592 for( ir = 0; ir < target->numberOfReactions; ++ir ) {
593 int index = target->reactions[ir].thresholdGroupIndex;
594
595 if( index > -1 ) {
596 double xSec = target->reactions[ir].thresholdGroupedDeltaCrossSection +
598
600 }
601 }
602 }
603 target->crossSectionGrouped = totalGroupedCrossSection;
604 totalGroupedCrossSection = NULL;
605
606 return( 0 );
607
608err:
609 ptwX_free( totalGroupedCrossSection );
611 return( 1 );
612}
int MCGIDI_reaction_recast(statusMessageReporting *smr, MCGIDI_reaction *reaction, GIDI_settings &settings, GIDI_settings_particle const *projectileSettings, double temperature_MeV, ptwXPoints *totalGroupedCrossSection)
bool isEnergyMode_grouped(void) const
int getNumberOfGroups(void) const
GIDI_settings_particle const * getParticle(int PoPId) const
ptwXPoints * ptwX_createLine(int64_t size, int64_t length, double slope, double offset, nfu_status *status)
Definition: ptwX_core.cc:62
double ptwX_getPointAtIndex_Unsafely(ptwXPoints *ptwX, int64_t index)
Definition: ptwX_core.cc:215
ptwXPoints * ptwX_clone(ptwXPoints *ptwX, nfu_status *status)
Definition: ptwX_core.cc:88
nfu_status ptwX_setPointAtIndex(ptwXPoints *ptwX, int64_t index, double x)
Definition: ptwX_core.cc:222
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158
int globalPoPsIndex
Definition: MCGIDI.h:233
int thresholdGroupIndex
Definition: MCGIDI.h:422
double thresholdGroupedDeltaCrossSection
Definition: MCGIDI.h:424

References MCGIDI_target_heated_s::crossSectionGrouped, MCGIDI_target_heated_s::crossSectionGroupedForSampling, GIDI_settings_particle::getNumberOfGroups(), GIDI_settings::getParticle(), MCGIDI_POP_s::globalPoPsIndex, GIDI_settings_particle::isEnergyMode_grouped(), MCGIDI_reaction_recast(), MCGIDI_POP_s::name, nfu_statusMessage(), MCGIDI_target_heated_s::numberOfReactions, MCGIDI_target_heated_s::projectilePOP, ptwX_clone(), ptwX_createLine(), ptwX_free(), ptwX_getPointAtIndex_Unsafely(), ptwX_setPointAtIndex(), MCGIDI_target_heated_s::reactions, smr_setReportError2, smr_unknownID, MCGIDI_target_heated_s::temperature_MeV, MCGIDI_reaction_s::thresholdGroupedDeltaCrossSection, and MCGIDI_reaction_s::thresholdGroupIndex.

Referenced by MCGIDI_target_recast().

◆ MCGIDI_target_heated_release()

int MCGIDI_target_heated_release ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 73 of file MCGIDI_target_heated.cc.

73 {
74
75 int ir;
76
77 ptwXY_free( target->crossSection );
80 for( ir = 0; ir < target->numberOfReactions; ir++ ) MCGIDI_reaction_release( NULL, &(target->reactions[ir]) );
81 smr_freeMemory( (void **) &(target->reactions) );
82 MCGIDI_POPs_release( &(target->pops) );
83 smr_freeMemory( (void **) &(target->path) );
84 smr_freeMemory( (void **) &(target->absPath) );
85 xDataTOMAL_release( &(target->attributes) );
86 delete target->transportabilities;
87 return( 0 );
88}
int MCGIDI_POPs_release(MCGIDI_POPs *pops)
Definition: MCGIDI_pop.cc:51
int MCGIDI_reaction_release(statusMessageReporting *smr, MCGIDI_reaction *reaction)
void xDataTOMAL_release(xDataTOM_attributionList *attributes)
Definition: xDataTOM.cc:361

References MCGIDI_target_heated_s::absPath, MCGIDI_target_heated_s::attributes, MCGIDI_target_heated_s::crossSection, MCGIDI_target_heated_s::crossSectionGrouped, MCGIDI_target_heated_s::crossSectionGroupedForSampling, MCGIDI_POPs_release(), MCGIDI_reaction_release(), MCGIDI_target_heated_s::numberOfReactions, MCGIDI_target_heated_s::path, MCGIDI_target_heated_s::pops, ptwX_free(), ptwXY_free(), MCGIDI_target_heated_s::reactions, smr_freeMemory(), MCGIDI_target_heated_s::transportabilities, and xDataTOMAL_release().

Referenced by MCGIDI_target_heated_free(), and MCGIDI_target_heated_read().

◆ MCGIDI_target_heated_sampleIndexReactionProductsAtE()

int MCGIDI_target_heated_sampleIndexReactionProductsAtE ( statusMessageReporting smr,
MCGIDI_target_heated target,
int  index,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo,
MCGIDI_sampledProductsDatas productDatas 
)

Definition at line 508 of file MCGIDI_target_heated.cc.

509 {
510
511 MCGIDI_reaction *reaction = MCGIDI_target_heated_getReactionAtIndex_smr( smr, target, index );
512
513 productDatas->numberOfProducts = 0;
514 if( reaction == NULL ) return( -1 );
515 return( MCGIDI_outputChannel_sampleProductsAtE( smr, &(reaction->outputChannel), modes, decaySamplingInfo, productDatas, NULL ) );
516}
int MCGIDI_outputChannel_sampleProductsAtE(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas, double *masses)
MCGIDI_outputChannel outputChannel
Definition: MCGIDI.h:428

References MCGIDI_outputChannel_sampleProductsAtE(), MCGIDI_target_heated_getReactionAtIndex_smr(), MCGIDI_sampledProductsDatas_s::numberOfProducts, and MCGIDI_reaction_s::outputChannel.

Referenced by G4GIDI_target::getFinalState(), and MCGIDI_target_sampleIndexReactionProductsAtE().