Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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_new (statusMessageReporting *smr)
 
int MCGIDI_target_heated_initialize (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
MCGIDI_target_heatedMCGIDI_target_heated_newRead (statusMessageReporting *smr, const char *fileName)
 
MCGIDI_target_heatedMCGIDI_target_heated_free (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_release (statusMessageReporting *, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_read (statusMessageReporting *smr, MCGIDI_target_heated *target, const char *fileName)
 
int MCGIDI_target_heated_numberOfReactions (statusMessageReporting *, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_numberOfProductionReactions (statusMessageReporting *, MCGIDI_target_heated *)
 
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)
 
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)
 
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)
 
double MCGIDI_target_heated_getIndexReactionCrossSectionAtE (statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes, bool sampling)
 
int MCGIDI_target_heated_sampleIndexReactionProductsAtE (statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas)
 
double MCGIDI_target_heated_getReactionsThreshold (statusMessageReporting *, 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_getIndexReactionFinalQ (statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes)
 
std::map< int, enum MCGIDI_transportability > const * MCGIDI_target_heated_getUniqueProducts (statusMessageReporting *, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_recast (statusMessageReporting *smr, MCGIDI_target_heated *target, GIDI_settings &settings)
 

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)

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)

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)

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

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

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

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

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

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}

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}

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}

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

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

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

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)

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)

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}

Referenced by MCGIDI_target_numberOfReactions().

◆ 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}
MCGIDI_POP * MCGIDI_POPs_findParticle(MCGIDI_POPs *pops, char const *name)
Definition: MCGIDI_pop.cc:133
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
const char * name(G4int ptype)
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 * 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 * xDataTOM_getDocumentsElement(xDataTOM_TOM *TOM)
Definition: xDataTOM.cc:223
xDataTOM_element * xDataTOME_getFirstElement(xDataTOM_element *element)
Definition: xDataTOM.cc:230
int xDataTOMAL_copyAttributionList(statusMessageReporting *smr, xDataTOM_attributionList *desc, xDataTOM_attributionList *src)
Definition: xDataTOM.cc:415
char * xDataTOMMisc_getAbsPath(statusMessageReporting *smr, const char *fileName)

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

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

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

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