Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
MCGIDI.h File Reference
#include <GIDI_settings.hh>
#include <map>
#include <vector>
#include <statusMessageReporting.h>
#include <ptwXY.h>
#include <xDataTOM.h>
#include "MCGIDI_mass.h"
#include "MCGIDI_map.h"

Go to the source code of this file.

Classes

class  MCGIDI_quantitiesLookupModes
 
struct  MCGIDI_samplingMultiplicityBias_s
 
class  MCGIDI_samplingMethods
 
class  MCGIDI_samplingSettings
 
struct  MCGIDI_GammaBranching_s
 
struct  MCGIDI_POP_s
 
struct  MCGIDI_POPs_s
 
struct  MCGIDI_particle_s
 
struct  MCGIDI_decaySamplingInfo_s
 
struct  MCGIDI_productInfo_s
 
struct  MCGIDI_productsInfo_s
 
struct  MCGIDI_sampledProductsData_s
 
struct  MCGIDI_sampledProductsDatas_s
 
struct  MCGIDI_pdfOfX_s
 
struct  MCGIDI_pdfsOfXGivenW_s
 
struct  MCGIDI_pdfsOfXGivenW_sampled_s
 
struct  MCGIDI_angular_s
 
struct  MCGIDI_energyWeightedFunctional_s
 
struct  MCGIDI_energyWeightedFunctionals_s
 
struct  MCGIDI_energyNBodyPhaseSpace_s
 
struct  MCGIDI_energy_s
 
struct  MCGIDI_energyAngular_s
 
struct  MCGIDI_angularEnergy_s
 
struct  MCGIDI_KalbachMann_ras_s
 
struct  MCGIDI_KalbachMann_s
 
struct  MCGIDI_distribution_s
 
struct  MCGIDI_outputChannel_s
 
struct  MCGIDI_product_s
 
struct  MCGIDI_reaction_s
 
struct  MCGIDI_target_heated_s
 
struct  MCGIDI_target_heated_info_s
 
struct  MCGIDI_target_s
 

Macros

#define MCGIDI_VERSION_MAJOR   1
 
#define MCGIDI_VERSION_MINOR   0
 
#define MCGIDI_VERSION_PATCHLEVEL   0
 
#define MCGIDI_crossSectionType_grouped   1
 
#define MCGIDI_crossSectionType_pointwise   2
 
#define MCGIDI_nullReaction   -10001
 
#define MCGIDI_speedOfLight_cm_sec   2.99792458e10
 
#define MCGIDI_AMU2MeV   931.494028
 
#define MCGIDI_particleLevel_continuum   -1
 
#define MCGIDI_particleLevel_sum   -2
 

Typedefs

typedef struct MCGIDI_GammaBranching_s MCGIDI_GammaBranching
 
typedef struct MCGIDI_POP_s MCGIDI_POP
 
typedef struct MCGIDI_POPs_s MCGIDI_POPs
 
typedef struct MCGIDI_particle_s MCGIDI_particle
 
typedef struct MCGIDI_target_s MCGIDI_target
 
typedef struct MCGIDI_target_heated_info_s MCGIDI_target_heated_info
 
typedef struct MCGIDI_target_heated_sorted_s MCGIDI_target_heated_sorted
 
typedef struct MCGIDI_target_heated_s MCGIDI_target_heated
 
typedef struct MCGIDI_reaction_s MCGIDI_reaction
 
typedef struct MCGIDI_outputChannel_s MCGIDI_outputChannel
 
typedef struct MCGIDI_product_s MCGIDI_product
 
typedef struct MCGIDI_distribution_s MCGIDI_distribution
 
typedef struct MCGIDI_KalbachMann_s MCGIDI_KalbachMann
 
typedef struct MCGIDI_KalbachMann_ras_s MCGIDI_KalbachMann_ras
 
typedef struct MCGIDI_pdfOfX_s MCGIDI_pdfOfX
 
typedef struct MCGIDI_pdfsOfXGivenW_s MCGIDI_pdfsOfXGivenW
 
typedef struct MCGIDI_pdfsOfXGivenW_sampled_s MCGIDI_pdfsOfXGivenW_sampled
 
typedef struct MCGIDI_angular_s MCGIDI_angular
 
typedef struct MCGIDI_energyWeightedFunctional_s MCGIDI_energyWeightedFunctional
 
typedef struct MCGIDI_energyWeightedFunctionals_s MCGIDI_energyWeightedFunctionals
 
typedef struct MCGIDI_energyNBodyPhaseSpace_s MCGIDI_energyNBodyPhaseSpace
 
typedef struct MCGIDI_energy_s MCGIDI_energy
 
typedef struct MCGIDI_energyAngular_s MCGIDI_energyAngular
 
typedef struct MCGIDI_angularEnergy_s MCGIDI_angularEnergy
 
typedef struct MCGIDI_decaySamplingInfo_s MCGIDI_decaySamplingInfo
 
typedef struct MCGIDI_productsInfo_s MCGIDI_productsInfo
 
typedef struct MCGIDI_productInfo_s MCGIDI_productInfo
 
typedef struct MCGIDI_sampledProductsData_s MCGIDI_sampledProductsData
 
typedef struct MCGIDI_sampledProductsDatas_s MCGIDI_sampledProductsDatas
 
typedef struct MCGIDI_samplingMultiplicityBias_s MCGIDI_samplingMultiplicityBias
 
typedef std::map< int, enum GIDI::MCGIDI_transportabilitytransportabilitiesMap
 

Enumerations

enum  MCGIDI_quantityLookupMode { MCGIDI_quantityLookupMode_pointwise , MCGIDI_quantityLookupMode_grouped }
 
enum  MCGIDI_transportability { MCGIDI_transportability_unknown , MCGIDI_transportability_none , MCGIDI_transportability_partial , MCGIDI_transportability_full }
 
enum  MCGIDI_reactionType {
  MCGIDI_reactionType_unknown_e , MCGIDI_reactionType_null_e , MCGIDI_reactionType_elastic_e , MCGIDI_reactionType_scattering_e ,
  MCGIDI_reactionType_nuclearIsomerTransmutation_e , MCGIDI_reactionType_nuclearLevelTransition_e , MCGIDI_reactionType_capture_e , MCGIDI_reactionType_fission_e ,
  MCGIDI_reactionType_sumOfRemainingOutputChannels_e , MCGIDI_reactionType_atomic_e
}
 
enum  MCGIDI_channelGenre {
  MCGIDI_channelGenre_undefined_e , MCGIDI_channelGenre_twoBody_e , MCGIDI_channelGenre_uncorrelated_e , MCGIDI_channelGenre_sumOfRemaining_e ,
  MCGIDI_channelGenre_twoBodyDecay_e , MCGIDI_channelGenre_uncorrelatedDecay_e
}
 
enum  MCGIDI_productMultiplicityType {
  MCGIDI_productMultiplicityType_invalid_e , MCGIDI_productMultiplicityType_unknown_e , MCGIDI_productMultiplicityType_integer_e , MCGIDI_productMultiplicityType_energyDependent_e ,
  MCGIDI_productMultiplicityType_gammaBranching_e , MCGIDI_productMultiplicityType_mixed_e
}
 
enum  MCGIDI_distributionType {
  MCGIDI_distributionType_none_e , MCGIDI_distributionType_unknown_e , MCGIDI_distributionType_angular_e , MCGIDI_distributionType_KalbachMann_e ,
  MCGIDI_distributionType_uncorrelated_e , MCGIDI_distributionType_energyAngular_e , MCGIDI_distributionType_angularEnergy_e
}
 
enum  MCGIDI_angularType { MCGIDI_angularType_isotropic , MCGIDI_angularType_recoil , MCGIDI_angularType_linear }
 
enum  MCGIDI_energyType {
  MCGIDI_energyType_unknown , MCGIDI_energyType_primaryGamma , MCGIDI_energyType_discreteGamma , MCGIDI_energyType_linear ,
  MCGIDI_energyType_generalEvaporation , MCGIDI_energyType_simpleMaxwellianFission , MCGIDI_energyType_evaporation , MCGIDI_energyType_Watt ,
  MCGIDI_energyType_MadlandNix , MCGIDI_energyType_NBodyPhaseSpace , MCGIDI_energyType_weightedFunctional
}
 

Functions

char const * MCGIDI_version (void)
 
int MCGIDI_versionMajor (void)
 
int MCGIDI_versionMinor (void)
 
int MCGIDI_versionPatchLevel (void)
 
MCGIDI_targetMCGIDI_target_new (statusMessageReporting *smr)
 
int MCGIDI_target_initialize (statusMessageReporting *smr, MCGIDI_target *target)
 
MCGIDI_targetMCGIDI_target_newRead (statusMessageReporting *smr, const char *fileName)
 
int MCGIDI_target_readFromMapViaPoPIDs (statusMessageReporting *smr, MCGIDI_target *target, MCGIDI_map *map, const char *evaluation, int projectile_PoPID, int target_PoPID)
 
int MCGIDI_target_readFromMap (statusMessageReporting *smr, MCGIDI_target *target, MCGIDI_map *map, const char *evaluation, const char *projectileName, const char *targetName)
 
MCGIDI_targetMCGIDI_target_newReadFromMapViaPoPIDs (statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, int projectile_PoPID, int target_PoPID)
 
MCGIDI_targetMCGIDI_target_newReadFromMap (statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, const char *projectileName, const char *targetName)
 
MCGIDI_targetMCGIDI_target_free (statusMessageReporting *smr, MCGIDI_target *target)
 
int MCGIDI_target_release (statusMessageReporting *smr, MCGIDI_target *target)
 
int MCGIDI_target_read (statusMessageReporting *smr, MCGIDI_target *target, const char *fileName)
 
char const * MCGIDI_target_getAttributesValue (statusMessageReporting *smr, MCGIDI_target *target, char const *name)
 
int MCGIDI_target_getTemperatures (statusMessageReporting *smr, MCGIDI_target *target, double *temperatures)
 
int MCGIDI_target_readHeatedTarget (statusMessageReporting *smr, MCGIDI_target *target, int index)
 
MCGIDI_target_heatedMCGIDI_target_getHeatedTargetAtIndex_ReadIfNeeded (statusMessageReporting *smr, MCGIDI_target *target, int index)
 
MCGIDI_target_heatedMCGIDI_target_getHeatedTargetAtTIndex (statusMessageReporting *smr, MCGIDI_target *target, int index)
 
int MCGIDI_target_numberOfReactions (statusMessageReporting *smr, MCGIDI_target *target)
 
enum MCGIDI_reactionType MCGIDI_target_getReactionTypeAtIndex (statusMessageReporting *smr, MCGIDI_target *target, int index)
 
MCGIDI_reactionMCGIDI_target_getReactionAtIndex (MCGIDI_target *target, int index)
 
MCGIDI_reactionMCGIDI_target_getReactionAtIndex_smr (statusMessageReporting *smr, MCGIDI_target *target, int index)
 
int MCGIDI_target_numberOfProductionReactions (statusMessageReporting *smr, MCGIDI_target *target)
 
transportabilitiesMap const * MCGIDI_target_getUniqueProducts (statusMessageReporting *smr, MCGIDI_target *target)
 
int MCGIDI_target_recast (statusMessageReporting *smr, MCGIDI_target *target, GIDI_settings &settings)
 
int MCGIDI_target_getDomain (statusMessageReporting *smr, MCGIDI_target *target, double *EMin, double *EMax)
 
double MCGIDI_target_getTotalCrossSectionAtTAndE (statusMessageReporting *smr, MCGIDI_target *target, MCGIDI_quantitiesLookupModes &modes, bool sampling)
 
double MCGIDI_target_getIndexReactionCrossSectionAtE (statusMessageReporting *smr, MCGIDI_target *target, int index, MCGIDI_quantitiesLookupModes &modes, bool sampling)
 
int MCGIDI_target_sampleReaction (statusMessageReporting *smr, MCGIDI_target *target, MCGIDI_quantitiesLookupModes &modes, double totalXSec, double(*userrng)(void *), void *rngState)
 
int MCGIDI_target_sampleNullReactionProductsAtE (statusMessageReporting *smr, MCGIDI_target *target, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas)
 
int MCGIDI_target_sampleIndexReactionProductsAtE (statusMessageReporting *smr, MCGIDI_target *target, int index, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productData)
 
double MCGIDI_target_getIndexReactionFinalQ (statusMessageReporting *smr, MCGIDI_target *target, int index, MCGIDI_quantitiesLookupModes &modes)
 
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 *smr, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_read (statusMessageReporting *smr, MCGIDI_target_heated *target, const char *fileName)
 
int MCGIDI_target_heated_numberOfReactions (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_numberOfProductionReactions (statusMessageReporting *smr, 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)
 
MCGIDI_POPMCGIDI_target_heated_getPOPForProjectile (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
MCGIDI_POPMCGIDI_target_heated_getPOPForTarget (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
double MCGIDI_target_heated_getProjectileMass_MeV (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
double MCGIDI_target_heated_getTargetMass_MeV (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_getEnergyGrid (statusMessageReporting *smr, MCGIDI_target_heated *target, double **energyGrid)
 
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 *productData)
 
double MCGIDI_target_heated_getReactionsThreshold (statusMessageReporting *smr, MCGIDI_target_heated *target, int index)
 
int MCGIDI_target_heated_getReactionsDomain (statusMessageReporting *smr, 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)
 
transportabilitiesMap const * MCGIDI_target_heated_getUniqueProducts (statusMessageReporting *smr, MCGIDI_target_heated *target)
 
int MCGIDI_target_heated_recast (statusMessageReporting *smr, MCGIDI_target_heated *target, GIDI_settings &settings)
 
MCGIDI_reactionMCGIDI_reaction_new (statusMessageReporting *smr)
 
int MCGIDI_reaction_initialize (statusMessageReporting *smr, MCGIDI_reaction *reaction)
 
MCGIDI_reactionMCGIDI_reaction_free (statusMessageReporting *smr, MCGIDI_reaction *reaction)
 
int MCGIDI_reaction_release (statusMessageReporting *smr, MCGIDI_reaction *reaction)
 
int MCGIDI_reaction_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_target_heated *target, MCGIDI_POPs *pops, MCGIDI_reaction *reaction)
 
enum MCGIDI_reactionType MCGIDI_reaction_getReactionType (statusMessageReporting *smr, MCGIDI_reaction *reaction)
 
MCGIDI_target_heatedMCGIDI_reaction_getTargetHeated (statusMessageReporting *smr, MCGIDI_reaction *reaction)
 
double MCGIDI_reaction_getProjectileMass_MeV (statusMessageReporting *smr, MCGIDI_reaction *reaction)
 
double MCGIDI_reaction_getTargetMass_MeV (statusMessageReporting *smr, MCGIDI_reaction *reaction)
 
int MCGIDI_reaction_getDomain (statusMessageReporting *smr, MCGIDI_reaction *reaction, double *EMin, double *EMax)
 
int MCGIDI_reaction_fixDomains (statusMessageReporting *smr, MCGIDI_reaction *reaction, double EMin, double EMax, nfu_status *status)
 
double MCGIDI_reaction_getCrossSectionAtE (statusMessageReporting *smr, MCGIDI_reaction *reaction, MCGIDI_quantitiesLookupModes &modes, bool sampling)
 
double MCGIDI_reaction_getFinalQ (statusMessageReporting *smr, MCGIDI_reaction *reaction, MCGIDI_quantitiesLookupModes &modes)
 
int MCGIDI_reaction_getENDF_MTNumber (MCGIDI_reaction *reaction)
 
int MCGIDI_reaction_getENDL_CSNumbers (MCGIDI_reaction *reaction, int *S)
 
int MCGIDI_reaction_recast (statusMessageReporting *smr, MCGIDI_reaction *reaction, GIDI_settings &settings, GIDI_settings_particle const *projectileSettings, double temperature_MeV, ptwXPoints *totalGroupedCrossSection)
 
MCGIDI_productsInfoMCGIDI_reaction_getProductsInfo (MCGIDI_reaction *reaction)
 
int MCGIDI_productsInfo_getNumberOfUniqueProducts (MCGIDI_productsInfo *productsInfo)
 
int MCGIDI_productsInfo_getPoPsIndexAtIndex (MCGIDI_productsInfo *productsInfo, int index)
 
enum MCGIDI_productMultiplicityType MCGIDI_productsInfo_getMultiplicityTypeAtIndex (MCGIDI_productsInfo *productsInfo, int index)
 
int MCGIDI_productsInfo_getIntegerMultiplicityAtIndex (MCGIDI_productsInfo *productsInfo, int index)
 
int MCGIDI_productsInfo_getTransportableAtIndex (MCGIDI_productsInfo *productsInfo, int index)
 
MCGIDI_POPsMCGIDI_POPs_new (statusMessageReporting *smr, int size)
 
int MCGIDI_POPs_initial (statusMessageReporting *smr, MCGIDI_POPs *pops, int size)
 
void * MCGIDI_POPs_free (MCGIDI_POPs *pops)
 
int MCGIDI_POPs_release (MCGIDI_POPs *pops)
 
MCGIDI_POPMCGIDI_POPs_addParticleIfNeeded (statusMessageReporting *smr, MCGIDI_POPs *pops, char const *name, double mass_MeV, double level_MeV, MCGIDI_POP *parent, int globalParticle)
 
int MCGIDI_POPs_findParticleIndex (MCGIDI_POPs *pops, char const *name)
 
MCGIDI_POPMCGIDI_POPs_findParticle (MCGIDI_POPs *pops, char const *name)
 
void MCGIDI_POPs_writeSortedList (MCGIDI_POPs *pops, FILE *f)
 
void MCGIDI_POPs_printSortedList (MCGIDI_POPs *pops)
 
MCGIDI_POPMCGIDI_POP_new (statusMessageReporting *smr, char const *name, double mass_MeV, double level_MeV, MCGIDI_POP *parent)
 
MCGIDI_POPMCGIDI_POP_free (MCGIDI_POP *pop)
 
MCGIDI_POPMCGIDI_POP_release (MCGIDI_POP *pop)
 
double MCGIDI_POP_getMass_MeV (MCGIDI_POP *pop)
 
MCGIDI_particleMCGIDI_particle_new (statusMessageReporting *smr)
 
int MCGIDI_particle_initialize (statusMessageReporting *smr, MCGIDI_particle *particle)
 
MCGIDI_particleMCGIDI_particle_free (statusMessageReporting *smr, MCGIDI_particle *particle)
 
int MCGIDI_particle_release (statusMessageReporting *smr, MCGIDI_particle *particle)
 
int MCGIDI_particle_freeInternalList (statusMessageReporting *smr)
 
MCGIDI_particleMCGIDI_particle_getInternalID (statusMessageReporting *smr, const char *const name, MCGIDI_POPs *pops)
 
int MCGIDI_particle_printInternalSortedList (statusMessageReporting *smr)
 
MCGIDI_outputChannelMCGIDI_outputChannel_new (statusMessageReporting *smr)
 
int MCGIDI_outputChannel_initialize (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
 
MCGIDI_outputChannelMCGIDI_outputChannel_free (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
 
int MCGIDI_outputChannel_release (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
 
int MCGIDI_outputChannel_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_POPs *pops, MCGIDI_outputChannel *outputChannel, MCGIDI_reaction *reaction, MCGIDI_product *parent)
 
int MCGIDI_outputChannel_numberOfProducts (MCGIDI_outputChannel *outputChannel)
 
MCGIDI_productMCGIDI_outputChannel_getProductAtIndex (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, int i)
 
int MCGIDI_outputChannel_getDomain (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double *EMin, double *EMax)
 
MCGIDI_target_heatedMCGIDI_outputChannel_getTargetHeated (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
 
double MCGIDI_outputChannel_getProjectileMass_MeV (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
 
double MCGIDI_outputChannel_getTargetMass_MeV (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
 
double MCGIDI_outputChannel_getQ_MeV (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
 
double MCGIDI_outputChannel_getFinalQ (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
 
int MCGIDI_outputChannel_sampleProductsAtE (statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas, double *masses)
 
MCGIDI_productMCGIDI_product_new (statusMessageReporting *smr)
 
int MCGIDI_product_initialize (statusMessageReporting *smr, MCGIDI_product *product)
 
MCGIDI_productMCGIDI_product_free (statusMessageReporting *smr, MCGIDI_product *product)
 
int MCGIDI_product_release (statusMessageReporting *smr, MCGIDI_product *product)
 
int MCGIDI_product_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_outputChannel *outputChannel, MCGIDI_POPs *pops, MCGIDI_product *product, int *delayedNeutronIndex)
 
int MCGIDI_product_getDomain (statusMessageReporting *smr, MCGIDI_product *product, double *EMin, double *EMax)
 
int MCGIDI_product_setTwoBodyMasses (statusMessageReporting *smr, MCGIDI_product *product, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)
 
double MCGIDI_product_getMass_MeV (statusMessageReporting *smr, MCGIDI_product *product)
 
MCGIDI_target_heatedMCGIDI_product_getTargetHeated (statusMessageReporting *smr, MCGIDI_product *product)
 
double MCGIDI_product_getProjectileMass_MeV (statusMessageReporting *smr, MCGIDI_product *product)
 
double MCGIDI_product_getTargetMass_MeV (statusMessageReporting *smr, MCGIDI_product *product)
 
int MCGIDI_product_sampleMultiplicity (statusMessageReporting *smr, MCGIDI_product *product, double e_in, double r)
 
int MCGIDI_product_sampleMu (statusMessageReporting *smr, MCGIDI_product *product, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 
int MCGIDI_sampledProducts_initialize (statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, int incrementSize)
 
int MCGIDI_sampledProducts_release (statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas)
 
int MCGIDI_sampledProducts_remalloc (statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas)
 
int MCGIDI_sampledProducts_addProduct (statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, MCGIDI_sampledProductsData *sampledProductsData)
 
int MCGIDI_sampledProducts_number (MCGIDI_sampledProductsDatas *sampledProductsDatas)
 
MCGIDI_sampledProductsDataMCGIDI_sampledProducts_getProductAtIndex (MCGIDI_sampledProductsDatas *sampledProductsDatas, int index)
 
MCGIDI_distributionMCGIDI_distribution_new (statusMessageReporting *smr)
 
int MCGIDI_distribution_initialize (statusMessageReporting *smr, MCGIDI_distribution *distribution)
 
MCGIDI_distributionMCGIDI_distribution_free (statusMessageReporting *smr, MCGIDI_distribution *distribution)
 
int MCGIDI_distribution_release (statusMessageReporting *smr, MCGIDI_distribution *distribution)
 
int MCGIDI_distribution_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_product *product, MCGIDI_POPs *pops, ptwXYPoints *norms)
 
MCGIDI_angularMCGIDI_angular_new (statusMessageReporting *smr)
 
int MCGIDI_angular_initialize (statusMessageReporting *smr, MCGIDI_angular *angular)
 
MCGIDI_angularMCGIDI_angular_free (statusMessageReporting *smr, MCGIDI_angular *angular)
 
int MCGIDI_angular_release (statusMessageReporting *smr, MCGIDI_angular *angular)
 
int MCGIDI_angular_setTwoBodyMasses (statusMessageReporting *smr, MCGIDI_angular *angular, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)
 
int MCGIDI_angular_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms)
 
int MCGIDI_angular_sampleMu (statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 
MCGIDI_energyMCGIDI_energy_new (statusMessageReporting *smr)
 
int MCGIDI_energy_initialize (statusMessageReporting *smr, MCGIDI_energy *energy)
 
MCGIDI_energyMCGIDI_energy_free (statusMessageReporting *smr, MCGIDI_energy *energy)
 
int MCGIDI_energy_release (statusMessageReporting *smr, MCGIDI_energy *energy)
 
int MCGIDI_energy_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms, enum MCGIDI_energyType energyType, double gammaEnergy_MeV)
 
int MCGIDI_energy_sampleEnergy (statusMessageReporting *smr, MCGIDI_energy *energy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 
int MCGIDI_energyAngular_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
 
MCGIDI_energyAngularMCGIDI_energyAngular_new (statusMessageReporting *smr)
 
int MCGIDI_energyAngular_initialize (statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
 
MCGIDI_energyAngularMCGIDI_energyAngular_free (statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
 
int MCGIDI_energyAngular_release (statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
 
int MCGIDI_energyAngular_sampleDistribution (statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 
MCGIDI_angularEnergyMCGIDI_angularEnergy_new (statusMessageReporting *smr)
 
int MCGIDI_angularEnergy_initialize (statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)
 
MCGIDI_angularEnergyMCGIDI_angularEnergy_free (statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)
 
int MCGIDI_angularEnergy_release (statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)
 
int MCGIDI_angularEnergy_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
 
int MCGIDI_angularEnergy_sampleDistribution (statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 
MCGIDI_KalbachMannMCGIDI_KalbachMann_new (statusMessageReporting *smr, ptwXY_interpolation interpolationWY, ptwXY_interpolation interpolationXY)
 
int MCGIDI_KalbachMann_initialize (statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann, ptwXY_interpolation interpolationWY, ptwXY_interpolation interpolationXY)
 
MCGIDI_KalbachMannMCGIDI_KalbachMann_free (statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann)
 
int MCGIDI_KalbachMann_release (statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann)
 
int MCGIDI_KalbachMann_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
 
int MCGIDI_KalbachMann_sampleEp (statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 
int MCGIDI_uncorrelated_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms, enum MCGIDI_energyType energyType, double gammaEnergy_MeV)
 
int MCGIDI_uncorrelated_sampleDistribution (statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 
int MCGIDI_LLNLAngular_angularEnergy_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
 
int MCGIDI_kinetics_2BodyReaction (statusMessageReporting *smr, MCGIDI_angular *angular, double K, double mu, double phi, MCGIDI_sampledProductsData *outgoingData)
 
int MCGIDI_kinetics_COMKineticEnergy2LabEnergyAndMomentum (statusMessageReporting *smr, double beta, double e_kinetic_com, double mu, double phi, double m3cc, double m4cc, MCGIDI_sampledProductsData *outgoingData)
 
int MCGIDI_kinetics_COM2Lab (statusMessageReporting *smr, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, double masses[3])
 
int MCGIDI_sampling_pdfsOfXGivenW_initialize (statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
 
int MCGIDI_sampling_pdfsOfXGivenW_release (statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
 
int MCGIDI_sampling_pdfsOfX_release (statusMessageReporting *smr, MCGIDI_pdfOfX *dist)
 
int MCGIDI_sampling_sampleX_from_pdfsOfXGivenW (MCGIDI_pdfsOfXGivenW *dists, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
 
int MCGIDI_sampling_sampleX_from_pdfOfX (MCGIDI_pdfOfX *dist, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
 
int MCGIDI_sampling_doubleDistribution (statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *pdfOfWGivenV, MCGIDI_pdfsOfXGivenW *pdfOfXGivenVAndW, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 
int MCGIDI_sampling_interpolationValues (statusMessageReporting *smr, ptwXY_interpolation interpolation, double *ws, double y1, double y2, double *y)
 
double MCGIDI_sampling_ptwXY_getValueAtX (ptwXYPoints *ptwXY, double x1)
 
int MCGIDI_misc_NumberOfZSymbols (void)
 
const char * MCGIDI_misc_ZToSymbol (int iZ)
 
int MCGIDI_misc_symbolToZ (const char *Z)
 
int MCGIDI_miscNameToZAm (statusMessageReporting *smr, const char *name, int *Z, int *A, int *m, int *level)
 
xDataTOM_Int MCGIDI_misc_binarySearch (xDataTOM_Int n, double *ds, double d)
 
int MCGIDI_misc_PQUStringToDouble (statusMessageReporting *smr, char const *str, char const *unit, double conversion, double *value)
 
int MCGIDI_misc_PQUStringToDoubleInUnitOf (statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
 
void MCGIDI_misc_updateTransportabilitiesMap (transportabilitiesMap *transportabilities, int PoPID, enum MCGIDI_transportability transportability)
 
void MCGIDI_misc_updateTransportabilitiesMap2 (transportabilitiesMap *transportabilities, int PoPID, int transportable)
 

Variables

const char * MCGIDI_productGenre_unknown
 
const char * MCGIDI_productGenre_twoBody_angular
 
const char * MCGIDI_productGenre_twoBody_formFactor
 
const char * MCGIDI_productGenre_NBody_angular_energy
 
const char * MCGIDI_productGenre_NBody_pairProduction
 

Macro Definition Documentation

◆ MCGIDI_AMU2MeV

#define MCGIDI_AMU2MeV   931.494028

Definition at line 184 of file MCGIDI.h.

◆ MCGIDI_crossSectionType_grouped

#define MCGIDI_crossSectionType_grouped   1

Definition at line 178 of file MCGIDI.h.

◆ MCGIDI_crossSectionType_pointwise

#define MCGIDI_crossSectionType_pointwise   2

Definition at line 179 of file MCGIDI.h.

◆ MCGIDI_nullReaction

#define MCGIDI_nullReaction   -10001

Definition at line 181 of file MCGIDI.h.

◆ MCGIDI_particleLevel_continuum

#define MCGIDI_particleLevel_continuum   -1

Definition at line 221 of file MCGIDI.h.

◆ MCGIDI_particleLevel_sum

#define MCGIDI_particleLevel_sum   -2

Definition at line 222 of file MCGIDI.h.

◆ MCGIDI_speedOfLight_cm_sec

#define MCGIDI_speedOfLight_cm_sec   2.99792458e10

Definition at line 183 of file MCGIDI.h.

◆ MCGIDI_VERSION_MAJOR

#define MCGIDI_VERSION_MAJOR   1

Definition at line 8 of file MCGIDI.h.

◆ MCGIDI_VERSION_MINOR

#define MCGIDI_VERSION_MINOR   0

Definition at line 9 of file MCGIDI.h.

◆ MCGIDI_VERSION_PATCHLEVEL

#define MCGIDI_VERSION_PATCHLEVEL   0

Definition at line 10 of file MCGIDI.h.

Typedef Documentation

◆ MCGIDI_angular

Definition at line 58 of file MCGIDI.h.

◆ MCGIDI_angularEnergy

Definition at line 64 of file MCGIDI.h.

◆ MCGIDI_decaySamplingInfo

Definition at line 66 of file MCGIDI.h.

◆ MCGIDI_distribution

Definition at line 52 of file MCGIDI.h.

◆ MCGIDI_energy

Definition at line 62 of file MCGIDI.h.

◆ MCGIDI_energyAngular

Definition at line 63 of file MCGIDI.h.

◆ MCGIDI_energyNBodyPhaseSpace

Definition at line 61 of file MCGIDI.h.

◆ MCGIDI_energyWeightedFunctional

◆ MCGIDI_energyWeightedFunctionals

◆ MCGIDI_GammaBranching

Definition at line 41 of file MCGIDI.h.

◆ MCGIDI_KalbachMann

Definition at line 53 of file MCGIDI.h.

◆ MCGIDI_KalbachMann_ras

Definition at line 54 of file MCGIDI.h.

◆ MCGIDI_outputChannel

Definition at line 50 of file MCGIDI.h.

◆ MCGIDI_particle

Definition at line 44 of file MCGIDI.h.

◆ MCGIDI_pdfOfX

Definition at line 55 of file MCGIDI.h.

◆ MCGIDI_pdfsOfXGivenW

Definition at line 56 of file MCGIDI.h.

◆ MCGIDI_pdfsOfXGivenW_sampled

Definition at line 57 of file MCGIDI.h.

◆ MCGIDI_POP

typedef struct MCGIDI_POP_s MCGIDI_POP

Definition at line 42 of file MCGIDI.h.

◆ MCGIDI_POPs

typedef struct MCGIDI_POPs_s MCGIDI_POPs

Definition at line 43 of file MCGIDI.h.

◆ MCGIDI_product

Definition at line 51 of file MCGIDI.h.

◆ MCGIDI_productInfo

Definition at line 68 of file MCGIDI.h.

◆ MCGIDI_productsInfo

Definition at line 67 of file MCGIDI.h.

◆ MCGIDI_reaction

Definition at line 49 of file MCGIDI.h.

◆ MCGIDI_sampledProductsData

Definition at line 69 of file MCGIDI.h.

◆ MCGIDI_sampledProductsDatas

Definition at line 70 of file MCGIDI.h.

◆ MCGIDI_samplingMultiplicityBias

◆ MCGIDI_target

Definition at line 45 of file MCGIDI.h.

◆ MCGIDI_target_heated

Definition at line 48 of file MCGIDI.h.

◆ MCGIDI_target_heated_info

Definition at line 46 of file MCGIDI.h.

◆ MCGIDI_target_heated_sorted

typedef struct MCGIDI_target_heated_sorted_s MCGIDI_target_heated_sorted

Definition at line 47 of file MCGIDI.h.

◆ transportabilitiesMap

Definition at line 171 of file MCGIDI.h.

Enumeration Type Documentation

◆ MCGIDI_angularType

Enumerator
MCGIDI_angularType_isotropic 
MCGIDI_angularType_recoil 
MCGIDI_angularType_linear 

Definition at line 212 of file MCGIDI.h.

@ MCGIDI_angularType_isotropic
Definition: MCGIDI.h:212
@ MCGIDI_angularType_recoil
Definition: MCGIDI.h:212
@ MCGIDI_angularType_linear
Definition: MCGIDI.h:212

◆ MCGIDI_channelGenre

Enumerator
MCGIDI_channelGenre_undefined_e 
MCGIDI_channelGenre_twoBody_e 
MCGIDI_channelGenre_uncorrelated_e 
MCGIDI_channelGenre_sumOfRemaining_e 
MCGIDI_channelGenre_twoBodyDecay_e 
MCGIDI_channelGenre_uncorrelatedDecay_e 

Definition at line 202 of file MCGIDI.h.

◆ MCGIDI_distributionType

Enumerator
MCGIDI_distributionType_none_e 
MCGIDI_distributionType_unknown_e 
MCGIDI_distributionType_angular_e 
MCGIDI_distributionType_KalbachMann_e 
MCGIDI_distributionType_uncorrelated_e 
MCGIDI_distributionType_energyAngular_e 
MCGIDI_distributionType_angularEnergy_e 

Definition at line 208 of file MCGIDI.h.

◆ MCGIDI_energyType

Enumerator
MCGIDI_energyType_unknown 
MCGIDI_energyType_primaryGamma 
MCGIDI_energyType_discreteGamma 
MCGIDI_energyType_linear 
MCGIDI_energyType_generalEvaporation 
MCGIDI_energyType_simpleMaxwellianFission 
MCGIDI_energyType_evaporation 
MCGIDI_energyType_Watt 
MCGIDI_energyType_MadlandNix 
MCGIDI_energyType_NBodyPhaseSpace 
MCGIDI_energyType_weightedFunctional 

Definition at line 214 of file MCGIDI.h.

@ MCGIDI_energyType_unknown
Definition: MCGIDI.h:214
@ MCGIDI_energyType_NBodyPhaseSpace
Definition: MCGIDI.h:216
@ MCGIDI_energyType_primaryGamma
Definition: MCGIDI.h:214
@ MCGIDI_energyType_weightedFunctional
Definition: MCGIDI.h:216
@ MCGIDI_energyType_simpleMaxwellianFission
Definition: MCGIDI.h:215
@ MCGIDI_energyType_discreteGamma
Definition: MCGIDI.h:214
@ MCGIDI_energyType_generalEvaporation
Definition: MCGIDI.h:215
@ MCGIDI_energyType_MadlandNix
Definition: MCGIDI.h:216
@ MCGIDI_energyType_evaporation
Definition: MCGIDI.h:215
@ MCGIDI_energyType_Watt
Definition: MCGIDI.h:216
@ MCGIDI_energyType_linear
Definition: MCGIDI.h:215

◆ MCGIDI_productMultiplicityType

Enumerator
MCGIDI_productMultiplicityType_invalid_e 
MCGIDI_productMultiplicityType_unknown_e 
MCGIDI_productMultiplicityType_integer_e 
MCGIDI_productMultiplicityType_energyDependent_e 
MCGIDI_productMultiplicityType_gammaBranching_e 
MCGIDI_productMultiplicityType_mixed_e 

Definition at line 205 of file MCGIDI.h.

◆ MCGIDI_quantityLookupMode

Enumerator
MCGIDI_quantityLookupMode_pointwise 

Pointwise data are used to determine a quantity's value an energy E.

MCGIDI_quantityLookupMode_grouped 

Grouped data are used to determine a quantity's value an energy E.

Definition at line 77 of file MCGIDI.h.

77 {
78 MCGIDI_quantityLookupMode_pointwise /**< Pointwise data are used to determine a quantity's value an energy E. */,
79 MCGIDI_quantityLookupMode_grouped /**< Grouped data are used to determine a quantity's value an energy E. */
80};
@ MCGIDI_quantityLookupMode_pointwise
Definition: MCGIDI.h:78
@ MCGIDI_quantityLookupMode_grouped
Definition: MCGIDI.h:79

◆ MCGIDI_reactionType

Enumerator
MCGIDI_reactionType_unknown_e 
MCGIDI_reactionType_null_e 
MCGIDI_reactionType_elastic_e 
MCGIDI_reactionType_scattering_e 
MCGIDI_reactionType_nuclearIsomerTransmutation_e 
MCGIDI_reactionType_nuclearLevelTransition_e 
MCGIDI_reactionType_capture_e 
MCGIDI_reactionType_fission_e 
MCGIDI_reactionType_sumOfRemainingOutputChannels_e 
MCGIDI_reactionType_atomic_e 

Definition at line 186 of file MCGIDI.h.

186 {
187 MCGIDI_reactionType_unknown_e, /* This should never happen. */
188 MCGIDI_reactionType_null_e, /* Only occurs when sampling with from grouped cross sections and the projectile is below threshold. */
189 MCGIDI_reactionType_elastic_e, /* A nuclear elastic reaction. */
190 MCGIDI_reactionType_scattering_e, /* A nuclear reaction where the projectile and target are products as well as gammas,
191 excluding reactions that are MCGIDI_reactionType_elastic_e and
192 MCGIDI_reactionType_nuclearLevelTransition_e. */
193 MCGIDI_reactionType_nuclearIsomerTransmutation_e, /* A nuclear that changes N or Z and is not one of the others.*/
194 MCGIDI_reactionType_nuclearLevelTransition_e, /* Reaction in which the residual is the same isotope as the target but in a
195 different nuclear level. Mainly for meta-stables. */
196 MCGIDI_reactionType_capture_e, /* A nuclear capture reaction. */
197 MCGIDI_reactionType_fission_e, /* A nuclear fission reaction. */
200};
@ MCGIDI_reactionType_nuclearIsomerTransmutation_e
Definition: MCGIDI.h:193
@ MCGIDI_reactionType_unknown_e
Definition: MCGIDI.h:187
@ MCGIDI_reactionType_elastic_e
Definition: MCGIDI.h:189
@ MCGIDI_reactionType_nuclearLevelTransition_e
Definition: MCGIDI.h:194
@ MCGIDI_reactionType_null_e
Definition: MCGIDI.h:188
@ MCGIDI_reactionType_scattering_e
Definition: MCGIDI.h:190
@ MCGIDI_reactionType_atomic_e
Definition: MCGIDI.h:199
@ MCGIDI_reactionType_capture_e
Definition: MCGIDI.h:196
@ MCGIDI_reactionType_sumOfRemainingOutputChannels_e
Definition: MCGIDI.h:198
@ MCGIDI_reactionType_fission_e
Definition: MCGIDI.h:197

◆ MCGIDI_transportability

Enumerator
MCGIDI_transportability_unknown 

This enum is used to give the transportability status for a particle in a reaction or target. Particle is not a product of this reaction or target.

MCGIDI_transportability_none 

Particle is a product but has not distribution data.

MCGIDI_transportability_partial 

Particle is a product and has some distribution data.

MCGIDI_transportability_full 

Definition at line 160 of file MCGIDI.h.

160 { /**< This enum is used to give the transportability status for a particle in a reaction or target. */
161 MCGIDI_transportability_unknown, /**< Particle is not a product of this reaction or target. */
162 MCGIDI_transportability_none, /**< Particle is a product but has not distribution data. */
163 MCGIDI_transportability_partial, /**< Particle is a product and has some distribution data. */
164 MCGIDI_transportability_full }; /**< Particle is a product and all needed distribution data. */
@ MCGIDI_transportability_unknown
Definition: MCGIDI.h:161
@ MCGIDI_transportability_none
Definition: MCGIDI.h:162
@ MCGIDI_transportability_partial
Definition: MCGIDI.h:163
@ MCGIDI_transportability_full
Definition: MCGIDI.h:164

Function Documentation

◆ MCGIDI_angular_free()

MCGIDI_angular * MCGIDI_angular_free ( statusMessageReporting smr,
MCGIDI_angular angular 
)

Definition at line 39 of file MCGIDI_angular.cc.

39 {
40
41 MCGIDI_angular_release( smr, angular );
42 smr_freeMemory( (void **) &angular );
43 return( NULL );
44}
int MCGIDI_angular_release(statusMessageReporting *smr, MCGIDI_angular *angular)
void * smr_freeMemory(void **p)

Referenced by MCGIDI_angular_new(), MCGIDI_angular_parseFromTOM(), MCGIDI_distribution_release(), and MCGIDI_LLNLAngular_angularEnergy_parseFromTOM().

◆ MCGIDI_angular_initialize()

int MCGIDI_angular_initialize ( statusMessageReporting smr,
MCGIDI_angular angular 
)

Definition at line 31 of file MCGIDI_angular.cc.

31 {
32
33 memset( angular, 0, sizeof( MCGIDI_angular ) );
34 return( 0 );
35}

Referenced by MCGIDI_angular_new(), and MCGIDI_angular_release().

◆ MCGIDI_angular_new()

MCGIDI_angular * MCGIDI_angular_new ( statusMessageReporting smr)

Definition at line 20 of file MCGIDI_angular.cc.

20 {
21
22 MCGIDI_angular *angular;
23
24 if( ( angular = (MCGIDI_angular *) smr_malloc2( smr, sizeof( MCGIDI_angular ), 0, "angular" ) ) == NULL ) return( NULL );
25 if( MCGIDI_angular_initialize( smr, angular ) ) angular = MCGIDI_angular_free( smr, angular );
26 return( angular );
27}
int MCGIDI_angular_initialize(statusMessageReporting *, MCGIDI_angular *angular)
MCGIDI_angular * MCGIDI_angular_free(statusMessageReporting *smr, MCGIDI_angular *angular)
#define smr_malloc2(smr, size, zero, forItem)

Referenced by MCGIDI_angular_parseFromTOM().

◆ MCGIDI_angular_parseFromTOM()

int MCGIDI_angular_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_distribution distribution,
ptwXYPoints norms 
)

Definition at line 72 of file MCGIDI_angular.cc.

72 {
73
74 MCGIDI_angular *angular = NULL;
75 xDataTOM_element *angularElement, *linearElement, *frameElement = NULL;
76 char const *nativeData;
77 ptwXYPoints *pdfXY = NULL;
78 ptwXPoints *cdfX = NULL;
79 ptwXY_interpolation interpolationXY, interpolationWY;
80
81 if( ( angularElement = xDataTOME_getOneElementByName( smr, element, "angular", 1 ) ) == NULL ) goto err;
82 if( ( angular = MCGIDI_angular_new( smr ) ) == NULL ) goto err;
83
84 if( ( nativeData = xDataTOM_getAttributesValueInElement( angularElement, "nativeData" ) ) == NULL ) goto err;
85 if( strcmp( nativeData, "isotropic" ) == 0 ) {
86 if( ( frameElement = xDataTOME_getOneElementByName( smr, angularElement, "isotropic", 1 ) ) == NULL ) {
87 smr_setReportError2( smr, smr_unknownID, 1, "angular type missing for nativeData = '%s'", nativeData );
88 goto err;
89 }
91 else if( strcmp( nativeData, "recoil" ) == 0 ) { /* BRB. Needs work to get referenced product data?????? */
93 else {
94 int i, j, n;
95 double norm, energyFactor;
96 nfu_status status;
97 xDataTOM_XYs *XYs;
98 xDataTOM_W_XYs *W_XYs;
99 ptwXYPoint *point;
100 MCGIDI_pdfsOfXGivenW *dists = &(angular->dists);
101 MCGIDI_pdfOfX *dist;
102 char const *energyUnit, *multiplicityProbabilityUnits[2] = { "", "" };
103
104 if( ( linearElement = xDataTOME_getOneElementByName( NULL, angularElement, "linear", 0 ) ) == NULL ) {
105 if( ( linearElement = xDataTOME_getOneElementByName( smr, angularElement, "pointwise", 1 ) ) == NULL ) {
106 smr_setReportError2( smr, smr_unknownID, 1, "unsupported angular type: nativeData = '%s'", nativeData );
107 goto err;
108 }
109 }
110 frameElement = linearElement;
111
112 if( MCGIDI_fromTOM_interpolation( smr, linearElement, 0, &interpolationWY ) ) goto err;
113 if( MCGIDI_fromTOM_interpolation( smr, linearElement, 1, &interpolationXY ) ) goto err;
114 dists->interpolationWY = interpolationWY;
115 dists->interpolationXY = interpolationXY;
116
117 if( ( W_XYs = (xDataTOM_W_XYs *) xDataTOME_getXDataIfID( smr, linearElement, "W_XYs" ) ) == NULL ) goto err;
118 if( ( dists->Ws = (double *) smr_malloc2( smr, W_XYs->length * sizeof( double ), 1, "dists->Ws" ) ) == NULL ) goto err;
119 if( ( dists->dist = (MCGIDI_pdfOfX *) smr_malloc2( smr, W_XYs->length * sizeof( MCGIDI_pdfOfX ), 0, "dists->dist" ) ) == NULL ) goto err;
120
121 energyUnit = xDataTOM_subAxes_getUnit( smr, &(W_XYs->subAxes), 0 );
122 if( !smr_isOk( smr ) ) goto err;
123 energyFactor = MCGIDI_misc_getUnitConversionFactor( smr, energyUnit, "MeV" );
124 if( !smr_isOk( smr ) ) goto err;
125
126 for( i = 0; i < W_XYs->length; i++ ) {
127 XYs = &(W_XYs->XYs[i]);
128 dist = &(dists->dist[i]);
129 dists->Ws[i] = XYs->value * energyFactor;
130 if( ( pdfXY = MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf( smr, XYs, interpolationXY, multiplicityProbabilityUnits ) ) == NULL ) goto err;
131 if( ptwXY_simpleCoalescePoints( pdfXY ) != nfu_Okay ) goto err;
132 dist->numberOfXs = n = (int) ptwXY_length( pdfXY );
133
134 if( ( dist->Xs = (double *) smr_malloc2( smr, 3 * n * sizeof( double ), 0, "dist->Xs" ) ) == NULL ) goto err;
135 dists->numberOfWs++;
136 dist->pdf = &(dist->Xs[n]);
137 dist->cdf = &(dist->pdf[n]);
138
139 for( j = 0; j < n; j++ ) {
140 point = ptwXY_getPointAtIndex_Unsafely( pdfXY, j );
141 dist->Xs[j] = point->x;
142 dist->pdf[j] = point->y;
143 }
144
145 if( ( cdfX = ptwXY_runningIntegral( pdfXY, &status ) ) == NULL ) {
146 smr_setReportError2( smr, smr_unknownID, 1, "ptwXY_runningIntegral err = %d: %s\n", status, nfu_statusMessage( status ) );
147 goto err;
148 }
149 norm = ptwX_getPointAtIndex_Unsafely( cdfX, n - 1 );
150 if( norms != NULL ) {
151 ptwXY_setValueAtX( norms, XYs->value, norm ); }
152 else if( std::fabs( 1. - norm ) > 0.99 ) {
153 smr_setReportError2( smr, smr_unknownID, 1, "bad norm = %e for angular.linear data", norm );
154 goto err;
155 }
156 for( j = 0; j < n; j++ ) dist->cdf[j] = ptwX_getPointAtIndex_Unsafely( cdfX, j ) / norm;
157 for( j = 0; j < n; j++ ) dist->pdf[j] /= norm;
158 pdfXY = ptwXY_free( pdfXY );
159 cdfX = ptwX_free( cdfX );
160 }
162 }
163
164 if( frameElement != NULL ) {
165 if( ( angular->frame = MCGIDI_misc_getProductFrame( smr, frameElement ) ) == xDataTOM_frame_invalid ) goto err;
166 }
167
168 distribution->angular = angular;
170
171 return( 0 );
172
173err:
174 if( pdfXY != NULL ) ptwXY_free( pdfXY );
175 if( cdfX != NULL ) cdfX = ptwX_free( cdfX );
176 if ( angular != NULL ) MCGIDI_angular_free( smr, angular );
177 return( 1 );
178}
MCGIDI_angular * MCGIDI_angular_new(statusMessageReporting *smr)
int MCGIDI_fromTOM_interpolation(statusMessageReporting *smr, xDataTOM_element *element, int index, enum ptwXY_interpolation_e *interpolation)
ptwXYPoints * MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf(statusMessageReporting *smr, xDataTOM_XYs *XYs, ptwXY_interpolation interpolation, char const *units[2])
Definition: MCGIDI_misc.cc:405
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
Definition: MCGIDI_misc.cc:381
enum xDataTOM_frame MCGIDI_misc_getProductFrame(statusMessageReporting *smr, xDataTOM_element *frameElement)
Definition: MCGIDI_misc.cc:315
@ nfu_Okay
Definition: nf_utilities.h:25
enum nfu_status_e nfu_status
const char * nfu_statusMessage(nfu_status status)
Definition: nf_utilities.cc:76
nfu_status ptwXY_setValueAtX(ptwXYPoints *ptwXY, double x, double y)
Definition: ptwXY_core.cc:876
nfu_status ptwXY_simpleCoalescePoints(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:529
ptwXYPoint * ptwXY_getPointAtIndex_Unsafely(ptwXYPoints *ptwXY, int64_t index)
Definition: ptwXY_core.cc:684
enum ptwXY_interpolation_e ptwXY_interpolation
int64_t ptwXY_length(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:583
ptwXPoints * ptwXY_runningIntegral(ptwXYPoints *ptwXY, nfu_status *status)
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:574
double ptwX_getPointAtIndex_Unsafely(ptwXPoints *ptwX, int64_t index)
Definition: ptwX_core.cc:215
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158
#define smr_setReportError2(smr, libraryID, code, fmt,...)
int smr_isOk(statusMessageReporting *smr)
#define smr_unknownID
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:322
enum xDataTOM_frame frame
Definition: MCGIDI.h:319
enum MCGIDI_angularType type
Definition: MCGIDI.h:320
MCGIDI_angular * angular
Definition: MCGIDI.h:383
enum MCGIDI_distributionType type
Definition: MCGIDI.h:382
double * Xs
Definition: MCGIDI.h:299
double * pdf
Definition: MCGIDI.h:300
int numberOfXs
Definition: MCGIDI.h:298
double * cdf
Definition: MCGIDI.h:301
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:306
MCGIDI_pdfOfX * dist
Definition: MCGIDI.h:308
ptwXY_interpolation interpolationWY
Definition: MCGIDI.h:306
double y
Definition: ptwXY.h:62
double x
Definition: ptwXY.h:62
xDataTOM_subAxes subAxes
Definition: xDataTOM.h:96
xDataTOM_XYs * XYs
Definition: xDataTOM.h:97
double value
Definition: xDataTOM.h:82
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:286
char const * xDataTOM_subAxes_getUnit(statusMessageReporting *smr, xDataTOM_subAxes *subAxes, int index)
@ xDataTOM_frame_invalid
Definition: xDataTOM.h:23
void * xDataTOME_getXDataIfID(statusMessageReporting *smr, xDataTOM_element *TE, char const *ID)
Definition: xDataTOM.cc:512

Referenced by MCGIDI_distribution_parseFromTOM(), MCGIDI_LLNLAngular_angularEnergy_parseFromTOM(), and MCGIDI_uncorrelated_parseFromTOM().

◆ MCGIDI_angular_release()

int MCGIDI_angular_release ( statusMessageReporting smr,
MCGIDI_angular angular 
)

Definition at line 48 of file MCGIDI_angular.cc.

48 {
49
50
52
53 MCGIDI_angular_initialize( smr, angular );
54 return( 0 );
55}
int MCGIDI_sampling_pdfsOfXGivenW_release(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)

Referenced by MCGIDI_angular_free().

◆ MCGIDI_angular_sampleMu()

int MCGIDI_angular_sampleMu ( statusMessageReporting smr,
MCGIDI_angular angular,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo 
)

Definition at line 182 of file MCGIDI_angular.cc.

183 {
184
185 double randomMu = decaySamplingInfo->rng( decaySamplingInfo->rngState );
187
188 switch( angular->type ) {
190 decaySamplingInfo->frame = angular->frame;
191 decaySamplingInfo->mu = 1. - 2. * decaySamplingInfo->rng( decaySamplingInfo->rngState );
192 break;
194 decaySamplingInfo->frame = angular->frame;
195 sampled.smr = smr;
196 sampled.w = modes.getProjectileEnergy( );
197 MCGIDI_sampling_sampleX_from_pdfsOfXGivenW( &(angular->dists), &sampled, randomMu );
198 decaySamplingInfo->mu = sampled.x;
199 break;
201 default :
202 smr_setReportError2( smr, smr_unknownID, 1, "angular type = %d not supported", angular->type );
203 }
204 return( !smr_isOk( smr ) );
205}
int MCGIDI_sampling_sampleX_from_pdfsOfXGivenW(MCGIDI_pdfsOfXGivenW *dists, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97
double(* rng)(void *)
Definition: MCGIDI.h:258
enum xDataTOM_frame frame
Definition: MCGIDI.h:256
statusMessageReporting * smr
Definition: MCGIDI.h:312

Referenced by MCGIDI_outputChannel_sampleProductsAtE(), MCGIDI_product_sampleMu(), and MCGIDI_uncorrelated_sampleDistribution().

◆ MCGIDI_angular_setTwoBodyMasses()

int MCGIDI_angular_setTwoBodyMasses ( statusMessageReporting smr,
MCGIDI_angular angular,
double  projectileMass_MeV,
double  targetMass_MeV,
double  productMass_MeV,
double  residualMass_MeV 
)

Definition at line 59 of file MCGIDI_angular.cc.

60 {
61
62 if( angular == NULL ) return( 0 ); /* ???????? This needs work. Happens when first product of a two-body reaction as no distribution. */
63 angular->projectileMass_MeV = projectileMass_MeV;
64 angular->targetMass_MeV = targetMass_MeV;
65 angular->productMass_MeV = productMass_MeV;
66 angular->residualMass_MeV = residualMass_MeV;
67 return( 0 );
68}
double residualMass_MeV
Definition: MCGIDI.h:323
double productMass_MeV
Definition: MCGIDI.h:323
double projectileMass_MeV
Definition: MCGIDI.h:323
double targetMass_MeV
Definition: MCGIDI.h:323

Referenced by MCGIDI_product_setTwoBodyMasses().

◆ MCGIDI_angularEnergy_free()

MCGIDI_angularEnergy * MCGIDI_angularEnergy_free ( statusMessageReporting smr,
MCGIDI_angularEnergy energyAngular 
)

Definition at line 40 of file MCGIDI_angularEnergy.cc.

40 {
41
42 MCGIDI_angularEnergy_release( smr, angularEnergy );
43 smr_freeMemory( (void **) &angularEnergy );
44 return( NULL );
45}
int MCGIDI_angularEnergy_release(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy)

Referenced by MCGIDI_angularEnergy_new(), and MCGIDI_distribution_release().

◆ MCGIDI_angularEnergy_initialize()

int MCGIDI_angularEnergy_initialize ( statusMessageReporting smr,
MCGIDI_angularEnergy energyAngular 
)

Definition at line 32 of file MCGIDI_angularEnergy.cc.

32 {
33
34 memset( angularEnergy, 0, sizeof( MCGIDI_angularEnergy ) );
35 return( 0 );
36}

Referenced by MCGIDI_angularEnergy_new(), and MCGIDI_angularEnergy_release().

◆ MCGIDI_angularEnergy_new()

MCGIDI_angularEnergy * MCGIDI_angularEnergy_new ( statusMessageReporting smr)

Definition at line 21 of file MCGIDI_angularEnergy.cc.

21 {
22
23 MCGIDI_angularEnergy *angularEnergy;
24
25 if( ( angularEnergy = (MCGIDI_angularEnergy *) smr_malloc2( smr, sizeof( MCGIDI_angularEnergy ), 0, "angularEnergy" ) ) == NULL ) return( NULL );
26 if( MCGIDI_angularEnergy_initialize( smr, angularEnergy ) ) angularEnergy = MCGIDI_angularEnergy_free( smr, angularEnergy );
27 return( angularEnergy );
28}
MCGIDI_angularEnergy * MCGIDI_angularEnergy_free(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy)
int MCGIDI_angularEnergy_initialize(statusMessageReporting *, MCGIDI_angularEnergy *angularEnergy)

◆ MCGIDI_angularEnergy_parseFromTOM()

int MCGIDI_angularEnergy_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_distribution distribution 
)

Definition at line 65 of file MCGIDI_angularEnergy.cc.

65 {
66
67 xDataTOM_element *angularEnergyElement, *pointwise = NULL;
68 char const *nativeData;
69
70 if( ( angularEnergyElement = xDataTOME_getOneElementByName( smr, element, "angularEnergy", 1 ) ) == NULL ) goto err;
71
72 if( ( nativeData = xDataTOM_getAttributesValueInElement( angularEnergyElement, "nativeData" ) ) == NULL ) goto err;
73 if( strcmp( nativeData, "pointwise" ) == 0 ) {
74 if( ( pointwise = xDataTOME_getOneElementByName( smr, angularEnergyElement, "pointwise", 1 ) ) == NULL ) goto err; }
75 else if( strcmp( nativeData, "linear" ) == 0 ) {
76 if( ( pointwise = xDataTOME_getOneElementByName( smr, angularEnergyElement, "linear", 1 ) ) == NULL ) goto err; }
77 else {
78 smr_setReportError2( smr, smr_unknownID, 1, "angularEnergy nativeData = '%s' not supported", nativeData );
79 goto err;
80 }
81 if( pointwise != NULL ) return( MCGIDI_angularEnergy_parsePointwiseFromTOM( smr, pointwise, distribution ) );
82
83 return( 0 );
84
85err:
86 return( 1 );
87}

Referenced by MCGIDI_distribution_parseFromTOM().

◆ MCGIDI_angularEnergy_release()

int MCGIDI_angularEnergy_release ( statusMessageReporting smr,
MCGIDI_angularEnergy energyAngular 
)

Definition at line 49 of file MCGIDI_angularEnergy.cc.

49 {
50
51 int i;
52
53 for( i = 0; i < angularEnergy->pdfOfMuGivenE.numberOfWs; i++ ) {
54 MCGIDI_sampling_pdfsOfXGivenW_release( smr, &(angularEnergy->pdfOfEpGivenEAndMu[i]) );
55 }
56 smr_freeMemory( (void **) &(angularEnergy->pdfOfEpGivenEAndMu) );
57 MCGIDI_sampling_pdfsOfXGivenW_release( smr, &(angularEnergy->pdfOfMuGivenE) );
58 MCGIDI_angularEnergy_initialize( smr, angularEnergy );
59
60 return( 0 );
61}

Referenced by MCGIDI_angularEnergy_free().

◆ MCGIDI_angularEnergy_sampleDistribution()

int MCGIDI_angularEnergy_sampleDistribution ( statusMessageReporting smr,
MCGIDI_angularEnergy angularEnergy,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo 
)

Definition at line 175 of file MCGIDI_angularEnergy.cc.

176 {
177
178 int status = MCGIDI_sampling_doubleDistribution( smr, &(angularEnergy->pdfOfMuGivenE), angularEnergy->pdfOfEpGivenEAndMu, modes, decaySamplingInfo );
179
180 decaySamplingInfo->frame = angularEnergy->frame;
181 return( status );
182}
int MCGIDI_sampling_doubleDistribution(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *pdfOfWGivenV, MCGIDI_pdfsOfXGivenW *pdfOfXGivenVAndW, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
MCGIDI_pdfsOfXGivenW * pdfOfEpGivenEAndMu
Definition: MCGIDI.h:365
enum xDataTOM_frame frame
Definition: MCGIDI.h:363
MCGIDI_pdfsOfXGivenW pdfOfMuGivenE
Definition: MCGIDI.h:364

Referenced by MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_distribution_free()

MCGIDI_distribution * MCGIDI_distribution_free ( statusMessageReporting smr,
MCGIDI_distribution distribution 
)

Definition at line 38 of file MCGIDI_distribution.cc.

38 {
39
40 MCGIDI_distribution_release( smr, distribution );
41 smr_freeMemory( (void **) &distribution );
42 return( NULL );
43}
int MCGIDI_distribution_release(statusMessageReporting *smr, MCGIDI_distribution *distribution)

Referenced by MCGIDI_distribution_new().

◆ MCGIDI_distribution_initialize()

int MCGIDI_distribution_initialize ( statusMessageReporting smr,
MCGIDI_distribution distribution 
)

Definition at line 30 of file MCGIDI_distribution.cc.

30 {
31
32 memset( distribution, 0, sizeof( MCGIDI_distribution ) );
33 return( 0 );
34}

Referenced by MCGIDI_distribution_new(), MCGIDI_distribution_parseFromTOM(), and MCGIDI_distribution_release().

◆ MCGIDI_distribution_new()

MCGIDI_distribution * MCGIDI_distribution_new ( statusMessageReporting smr)

Definition at line 19 of file MCGIDI_distribution.cc.

19 {
20
21 MCGIDI_distribution *distribution;
22
23 if( ( distribution = (MCGIDI_distribution *) smr_malloc2( smr, sizeof( MCGIDI_distribution ), 0, "distribution" ) ) == NULL ) return( NULL );
24 if( MCGIDI_distribution_initialize( smr, distribution ) ) distribution = MCGIDI_distribution_free( smr, distribution );
25 return( distribution );
26}
MCGIDI_distribution * MCGIDI_distribution_free(statusMessageReporting *smr, MCGIDI_distribution *distribution)
int MCGIDI_distribution_initialize(statusMessageReporting *, MCGIDI_distribution *distribution)

◆ MCGIDI_distribution_parseFromTOM()

int MCGIDI_distribution_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_product product,
MCGIDI_POPs pops,
ptwXYPoints norms 
)

Definition at line 61 of file MCGIDI_distribution.cc.

61 {
62
63 char const *nativeData, *gammaEnergy;
64 double gammaEnergy_MeV;
65 MCGIDI_distribution *distribution = &(product->distribution);
66 xDataTOM_element *distributionElement;
68
69 MCGIDI_distribution_initialize( smr, distribution );
70
71 distribution->product = product;
72 if( ( distributionElement = xDataTOME_getOneElementByName( smr, element, "distributions", 1 ) ) == NULL ) goto err;
73 if( ( nativeData = xDataTOM_getAttributesValueInElement( distributionElement, "nativeData" ) ) == NULL ) goto err;
74
75 if( strcmp( product->pop->name, "gamma" ) == 0 ) {
76 if( ( gammaEnergy = xDataTOM_getAttributesValueInElement( element, "discrete" ) ) != NULL ) {
77 if( MCGIDI_misc_PQUStringToDoubleInUnitOf( smr, gammaEnergy, "MeV", &gammaEnergy_MeV ) ) goto err;
79 else if( ( gammaEnergy = xDataTOM_getAttributesValueInElement( element, "primary" ) ) != NULL ) {
80 if( MCGIDI_misc_PQUStringToDoubleInUnitOf( smr, gammaEnergy, "MeV", &gammaEnergy_MeV ) ) goto err;
82 }
83 if( gammaEnergy != NULL ) {
84 if( strcmp( nativeData, "angular" ) ) {
85 smr_setReportError2( smr, smr_unknownID, 1, "%s gamma can only have a distribution with 'nativeData' = 'angular' and not '%s'",
86 gammaEnergy, nativeData );
87 goto err;
88 }
89 nativeData = "uncorrelated";
90 }
91 }
92
93 if( strcmp( nativeData, "angular" ) == 0 ) {
94 if( MCGIDI_angular_parseFromTOM( smr, distributionElement, distribution, norms ) ) goto err; }
95 else if( strcmp( nativeData, "uncorrelated" ) == 0 ) {
96 if( MCGIDI_uncorrelated_parseFromTOM( smr, distributionElement, distribution, norms, energyType, gammaEnergy_MeV ) ) goto err; }
97 else if( strcmp( nativeData, "energyAngular" ) == 0 ) {
98 if( MCGIDI_energyAngular_parseFromTOM( smr, distributionElement, distribution ) ) goto err; }
99 else if( strcmp( nativeData, "angularEnergy" ) == 0 ) {
100 if( MCGIDI_angularEnergy_parseFromTOM( smr, distributionElement, distribution ) ) goto err; }
101 else if( strcmp( nativeData, "Legendre" ) == 0 ) {
102 if( MCGIDI_energyAngular_parseFromTOM( smr, distributionElement, distribution ) ) goto err; }
103 else if( strcmp( nativeData, "LLNLAngular_angularEnergy" ) == 0 ) {
104 if( MCGIDI_LLNLAngular_angularEnergy_parseFromTOM( smr, distributionElement, distribution ) ) goto err; }
105 else if( strcmp( nativeData, "none" ) == 0 ) {
106 distribution->type = MCGIDI_distributionType_none_e; }
107 else if( strcmp( nativeData, "unknown" ) == 0 ) {
108 distribution->type = MCGIDI_distributionType_unknown_e; }
109 else {
110 smr_setReportError2( smr, smr_unknownID, 1, "Unsupported distribution = '%s'\n", nativeData );
111 goto err;
112 }
113
114 return( 0 );
115
116err:
117 MCGIDI_distribution_release( smr, distribution );
118 return( 1 );
119}
int MCGIDI_LLNLAngular_angularEnergy_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
int MCGIDI_uncorrelated_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms, enum MCGIDI_energyType energyType, double gammaEnergy_MeV)
int MCGIDI_angular_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms)
int MCGIDI_angularEnergy_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
int MCGIDI_energyAngular_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
int MCGIDI_misc_PQUStringToDoubleInUnitOf(statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
Definition: MCGIDI_misc.cc:356
MCGIDI_energyType
Definition: MCGIDI.h:214
char * name
Definition: MCGIDI.h:232
MCGIDI_product * product
Definition: MCGIDI.h:381
MCGIDI_POP * pop
Definition: MCGIDI.h:401
MCGIDI_distribution distribution
Definition: MCGIDI.h:411

Referenced by MCGIDI_product_parseFromTOM().

◆ MCGIDI_distribution_release()

int MCGIDI_distribution_release ( statusMessageReporting smr,
MCGIDI_distribution distribution 
)

Definition at line 47 of file MCGIDI_distribution.cc.

47 {
48
49 if( distribution->angular ) distribution->angular = MCGIDI_angular_free( smr, distribution->angular );
50 if( distribution->energy ) distribution->energy = MCGIDI_energy_free( smr, distribution->energy );
51 if( distribution->KalbachMann ) distribution->KalbachMann = MCGIDI_KalbachMann_free( smr, distribution->KalbachMann );
52 if( distribution->energyAngular ) distribution->energyAngular = MCGIDI_energyAngular_free( smr, distribution->energyAngular );
53 if( distribution->angularEnergy ) distribution->angularEnergy = MCGIDI_angularEnergy_free( smr, distribution->angularEnergy );
54
55 MCGIDI_distribution_initialize( smr, distribution );
56 return( 0 );
57}
MCGIDI_energyAngular * MCGIDI_energyAngular_free(statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
MCGIDI_angularEnergy * MCGIDI_angularEnergy_free(statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)
MCGIDI_energy * MCGIDI_energy_free(statusMessageReporting *smr, MCGIDI_energy *energy)
MCGIDI_angular * MCGIDI_angular_free(statusMessageReporting *smr, MCGIDI_angular *angular)
MCGIDI_KalbachMann * MCGIDI_KalbachMann_free(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann)
MCGIDI_angularEnergy * angularEnergy
Definition: MCGIDI.h:386
MCGIDI_energy * energy
Definition: MCGIDI.h:384
MCGIDI_energyAngular * energyAngular
Definition: MCGIDI.h:385
MCGIDI_KalbachMann * KalbachMann
Definition: MCGIDI.h:387

Referenced by MCGIDI_distribution_free(), MCGIDI_distribution_parseFromTOM(), and MCGIDI_product_release().

◆ MCGIDI_energy_free()

MCGIDI_energy * MCGIDI_energy_free ( statusMessageReporting smr,
MCGIDI_energy energy 
)

Definition at line 65 of file MCGIDI_energy.cc.

65 {
66
67 MCGIDI_energy_release( smr, energy );
68 smr_freeMemory( (void **) &energy );
69 return( NULL );
70}
int MCGIDI_energy_release(statusMessageReporting *smr, MCGIDI_energy *energy)

Referenced by MCGIDI_distribution_release(), MCGIDI_energy_new(), MCGIDI_energy_parseFromTOM(), and MCGIDI_energy_release().

◆ MCGIDI_energy_initialize()

int MCGIDI_energy_initialize ( statusMessageReporting smr,
MCGIDI_energy energy 
)

Definition at line 57 of file MCGIDI_energy.cc.

57 {
58
59 memset( energy, 0, sizeof( MCGIDI_energy ) );
60 return( 0 );
61}

Referenced by MCGIDI_energy_new(), and MCGIDI_energy_release().

◆ MCGIDI_energy_new()

MCGIDI_energy * MCGIDI_energy_new ( statusMessageReporting smr)

Definition at line 46 of file MCGIDI_energy.cc.

46 {
47
49
50 if( ( energy = (MCGIDI_energy *) smr_malloc2( smr, sizeof( MCGIDI_energy ), 0, "energy" ) ) == NULL ) return( NULL );
51 if( MCGIDI_energy_initialize( smr, energy ) ) energy = MCGIDI_energy_free( smr, energy );
52 return( energy );
53}
MCGIDI_energy * MCGIDI_energy_free(statusMessageReporting *smr, MCGIDI_energy *energy)
int MCGIDI_energy_initialize(statusMessageReporting *, MCGIDI_energy *energy)
G4double energy(const ThreeVector &p, const G4double m)

Referenced by MCGIDI_energy_parseFromTOM().

◆ MCGIDI_energy_parseFromTOM()

int MCGIDI_energy_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_distribution distribution,
ptwXYPoints norms,
enum MCGIDI_energyType  energyType,
double  gammaEnergy_MeV 
)

Definition at line 97 of file MCGIDI_energy.cc.

98 {
99
100 MCGIDI_energy *energy = NULL;
101 xDataTOM_element *energyElement, *linearElement, *functional, *frameElement;
102 char const *nativeData;
103 double projectileMass_MeV, targetMass_MeV;
104
105 if( ( energy = MCGIDI_energy_new( smr ) ) == NULL ) goto err;
106
107 projectileMass_MeV = MCGIDI_product_getProjectileMass_MeV( smr, distribution->product );
108 targetMass_MeV = MCGIDI_product_getTargetMass_MeV( smr, distribution->product );
109 energy->e_inCOMFactor = targetMass_MeV / ( projectileMass_MeV + targetMass_MeV );
110
111 if( ( energyType == MCGIDI_energyType_primaryGamma ) || ( energyType == MCGIDI_energyType_discreteGamma ) ) {
112 energy->type = energyType;
113 energy->gammaEnergy_MeV = gammaEnergy_MeV;
114 energy->frame = xDataTOM_frame_lab; /* BRB. This should not be hardwired?????? Probably needs to be changed in GND also. */
115 if( energyType == MCGIDI_energyType_primaryGamma ) energy->primaryGammaMassFactor = energy->e_inCOMFactor; }
116 else {
117 if( ( energyElement = xDataTOME_getOneElementByName( smr, element, "energy", 1 ) ) == NULL ) goto err;
118 if( ( nativeData = xDataTOM_getAttributesValueInElement( energyElement, "nativeData" ) ) == NULL ) goto err;
119 if( ( linearElement = xDataTOME_getOneElementByName( NULL, energyElement, "linear", 0 ) ) == NULL )
120 linearElement = xDataTOME_getOneElementByName( NULL, energyElement, "pointwise", 0 );
121 if( linearElement == NULL ) {
122 if( ( functional = xDataTOME_getOneElementByName( NULL, energyElement, "generalEvaporation", 0 ) ) != NULL ) {
123 if( MCGIDI_energy_parseGeneralEvaporationFromTOM( smr, functional, energy ) ) goto err; }
124 else if( ( functional = xDataTOME_getOneElementByName( NULL, energyElement, "simpleMaxwellianFission", 0 ) ) != NULL ) {
125 if( MCGIDI_energy_parseSimpleMaxwellianFissionFromTOM( smr, functional, energy ) ) goto err; }
126 else if( ( functional = xDataTOME_getOneElementByName( NULL, energyElement, "evaporation", 0 ) ) != NULL ) {
127 if( MCGIDI_energy_parseEvaporationFromTOM( smr, functional, energy ) ) goto err; }
128 else if( ( functional = xDataTOME_getOneElementByName( NULL, energyElement, "Watt", 0 ) ) != NULL ) {
129 if( MCGIDI_energy_parseWattFromTOM( smr, functional, energy ) ) goto err; }
130 else if( ( functional = xDataTOME_getOneElementByName( NULL, energyElement, "MadlandNix", 0 ) ) != NULL ) {
131 if( MCGIDI_energy_parseMadlandNixFromTOM( smr, functional, energy ) ) goto err; }
132 else if( ( functional = xDataTOME_getOneElementByName( NULL, energyElement, "NBodyPhaseSpace", 0 ) ) != NULL ) {
133 if( MCGIDI_energy_parseNBodyPhaseSpaceFromTOM( smr, functional, energy, distribution ) ) goto err; }
134 else if( ( functional = xDataTOME_getOneElementByName( NULL, energyElement, "weightedFunctionals", 0 ) ) != NULL ) {
135 if( MCGIDI_energy_parseWeightedFunctionalsFromTOM( smr, functional, energy ) ) goto err; }
136 else {
137 smr_setReportError2( smr, smr_unknownID, 1, "unsupported energy type: nativeData = '%s'", nativeData );
138 goto err;
139 }
140 frameElement = functional; }
141 else {
142 char const *toUnits[3] = { "MeV", "MeV", "1/MeV" };
143
144 frameElement = linearElement;
145 if( MCGIDI_fromTOM_pdfsOfXGivenW( smr, linearElement, &(energy->dists), norms, toUnits ) ) goto err;
147 }
148 if( ( energy->frame = MCGIDI_misc_getProductFrame( smr, frameElement ) ) == xDataTOM_frame_invalid ) goto err;
149 }
150 distribution->energy = energy;
151
152 return( 0 );
153
154err:
155 if( energy != NULL ) MCGIDI_energy_free( smr, energy );
156 return( 1 );
157}
double MCGIDI_product_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
double MCGIDI_product_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
MCGIDI_energy * MCGIDI_energy_new(statusMessageReporting *smr)
int MCGIDI_fromTOM_pdfsOfXGivenW(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_pdfsOfXGivenW *dists, ptwXYPoints *norms, char const *toUnits[3])
@ xDataTOM_frame_lab
Definition: xDataTOM.h:23

Referenced by MCGIDI_uncorrelated_parseFromTOM().

◆ MCGIDI_energy_release()

int MCGIDI_energy_release ( statusMessageReporting smr,
MCGIDI_energy energy 
)

Definition at line 74 of file MCGIDI_energy.cc.

74 {
75
76 int i;
77
79 if( energy->theta ) energy->theta = ptwXY_free( energy->theta );
80 if( energy->Watt_a ) energy->Watt_a = ptwXY_free( energy->Watt_a );
81 if( energy->Watt_b ) energy->Watt_b = ptwXY_free( energy->Watt_b );
85 for( i = 0; i < energy->weightedFunctionals.numberOfWeights; i++ ) {
86 ptwXY_free( energy->weightedFunctionals.weightedFunctional[i].weight );
87 MCGIDI_energy_free( smr, energy->weightedFunctionals.weightedFunctional[i].energy );
88 }
89 }
90
91 MCGIDI_energy_initialize( smr, energy );
92 return( 0 );
93}
int MCGIDI_sampling_pdfsOfX_release(statusMessageReporting *smr, MCGIDI_pdfOfX *dist)

Referenced by MCGIDI_energy_free().

◆ MCGIDI_energy_sampleEnergy()

int MCGIDI_energy_sampleEnergy ( statusMessageReporting smr,
MCGIDI_energy energy,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo 
)

Definition at line 498 of file MCGIDI_energy.cc.

499 {
500/*
501* This function must be called before angular sampling as it sets the frame but does not test it.
502*/
503 double theta, randomEp, Watt_a, Watt_b, e_in = modes.getProjectileEnergy( );
505
506 decaySamplingInfo->frame = energy->frame;
507 switch( energy->type ) {
509 decaySamplingInfo->Ep = energy->gammaEnergy_MeV + e_in * energy->primaryGammaMassFactor;
510 break;
512 decaySamplingInfo->Ep = energy->gammaEnergy_MeV;
513 break;
515 randomEp = decaySamplingInfo->rng( decaySamplingInfo->rngState );
516 sampled.smr = smr;
517 sampled.w = e_in;
518 MCGIDI_sampling_sampleX_from_pdfsOfXGivenW( &(energy->dists), &sampled, randomEp );
519 decaySamplingInfo->Ep = sampled.x;
520 break;
522 sampled.interpolationXY = energy->gInterpolation;
523 MCGIDI_sampling_sampleX_from_pdfOfX( &(energy->g), &sampled, decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
524 theta = MCGIDI_sampling_ptwXY_getValueAtX( energy->theta, e_in );
525 decaySamplingInfo->Ep = theta * sampled.x;
526 break;
528 theta = MCGIDI_sampling_ptwXY_getValueAtX( energy->theta, e_in );
529 MCGIDI_energy_sampleSimpleMaxwellianFission( smr, ( e_in - energy->U ) / theta, decaySamplingInfo );
530 decaySamplingInfo->Ep *= theta;
531 break;
533 theta = MCGIDI_sampling_ptwXY_getValueAtX( energy->theta, e_in );
534 MCGIDI_energy_sampleEvaporation( smr, ( e_in - energy->U ) / theta, decaySamplingInfo );
535 decaySamplingInfo->Ep *= theta;
536 break;
538 Watt_a = MCGIDI_sampling_ptwXY_getValueAtX( energy->Watt_a, e_in );
539 Watt_b = MCGIDI_sampling_ptwXY_getValueAtX( energy->Watt_b, e_in );
540 MCGIDI_energy_sampleWatt( smr, e_in - energy->U, Watt_a, Watt_b, decaySamplingInfo );
541 break;
543 MCGIDI_sampling_sampleX_from_pdfsOfXGivenW( &(energy->dists), &sampled, decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
544 decaySamplingInfo->Ep = sampled.x;
545 break;
547 MCGIDI_sampling_sampleX_from_pdfOfX( &(energy->g), &sampled, decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
548 decaySamplingInfo->Ep = ( energy->e_inCOMFactor * e_in + energy->NBodyPhaseSpace.Q_MeV ) * energy->NBodyPhaseSpace.massFactor * sampled.x;
549 break;
551 MCGIDI_energy_sampleWeightedFunctional( smr, energy, modes, decaySamplingInfo );
552 break;
553 default :
554 smr_setReportError2( smr, smr_unknownID, 1, "energy type = %d not supported", energy->type );
555 }
556
557 return( !smr_isOk( smr ) );
558}
double MCGIDI_sampling_ptwXY_getValueAtX(ptwXYPoints *ptwXY, double x1)
int MCGIDI_sampling_sampleX_from_pdfOfX(MCGIDI_pdfOfX *dist, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:313

Referenced by MCGIDI_uncorrelated_sampleDistribution().

◆ MCGIDI_energyAngular_free()

MCGIDI_energyAngular * MCGIDI_energyAngular_free ( statusMessageReporting smr,
MCGIDI_energyAngular energyAngular 
)

Definition at line 39 of file MCGIDI_energyAngular.cc.

39 {
40
41 MCGIDI_energyAngular_release( smr, energyAngular );
42 smr_freeMemory( (void **) &energyAngular );
43 return( NULL );
44}
int MCGIDI_energyAngular_release(statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)

Referenced by MCGIDI_distribution_release(), and MCGIDI_energyAngular_new().

◆ MCGIDI_energyAngular_initialize()

int MCGIDI_energyAngular_initialize ( statusMessageReporting smr,
MCGIDI_energyAngular energyAngular 
)

Definition at line 31 of file MCGIDI_energyAngular.cc.

31 {
32
33 memset( energyAngular, 0, sizeof( MCGIDI_energyAngular ) );
34 return( 0 );
35}

Referenced by MCGIDI_energyAngular_new(), and MCGIDI_energyAngular_release().

◆ MCGIDI_energyAngular_new()

MCGIDI_energyAngular * MCGIDI_energyAngular_new ( statusMessageReporting smr)

Definition at line 20 of file MCGIDI_energyAngular.cc.

20 {
21
22 MCGIDI_energyAngular *energyAngular;
23
24 if( ( energyAngular = (MCGIDI_energyAngular *) smr_malloc2( smr, sizeof( MCGIDI_energyAngular ), 0, "energyAngular" ) ) == NULL ) return( NULL );
25 if( MCGIDI_energyAngular_initialize( smr, energyAngular ) ) energyAngular = MCGIDI_energyAngular_free( smr, energyAngular );
26 return( energyAngular );
27}
MCGIDI_energyAngular * MCGIDI_energyAngular_free(statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
int MCGIDI_energyAngular_initialize(statusMessageReporting *, MCGIDI_energyAngular *energyAngular)

◆ MCGIDI_energyAngular_parseFromTOM()

int MCGIDI_energyAngular_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_distribution distribution 
)

Definition at line 64 of file MCGIDI_energyAngular.cc.

64 {
65
66 xDataTOM_element *energyAngularElement;
67 char const *nativeData;
68
69 if( ( energyAngularElement = xDataTOME_getOneElementByName( smr, element, "energyAngular", 1 ) ) == NULL ) goto err;
70
71 if( ( nativeData = xDataTOM_getAttributesValueInElement( energyAngularElement, "nativeData" ) ) == NULL ) goto err;
72 if( strcmp( nativeData, "KalbachMann" ) == 0 ) {
73 return( MCGIDI_KalbachMann_parseFromTOM( smr, energyAngularElement, distribution ) ); }
74 else if( strcmp( nativeData, "linear" ) == 0 ) {
75 return( MCGIDI_energyAngular_linear_parseFromTOM( smr, energyAngularElement, distribution ) ); }
76 else {
77 smr_setReportError2( smr, smr_unknownID, 1, "energyAngular nativeData = '%s' not supported", nativeData );
78 goto err;
79 }
80
81 return( 0 );
82
83err:
84 return( 1 );
85}
int MCGIDI_KalbachMann_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)

Referenced by MCGIDI_distribution_parseFromTOM().

◆ MCGIDI_energyAngular_release()

int MCGIDI_energyAngular_release ( statusMessageReporting smr,
MCGIDI_energyAngular energyAngular 
)

Definition at line 48 of file MCGIDI_energyAngular.cc.

48 {
49
50 int i;
51
52 for( i = 0; i < energyAngular->pdfOfEpGivenE.numberOfWs; i++ ) {
54 }
55 smr_freeMemory( (void **) &(energyAngular->pdfOfMuGivenEAndEp) );
57 MCGIDI_energyAngular_initialize( smr, energyAngular );
58
59 return( 0 );
60}
MCGIDI_pdfsOfXGivenW * pdfOfMuGivenEAndEp
Definition: MCGIDI.h:359
MCGIDI_pdfsOfXGivenW pdfOfEpGivenE
Definition: MCGIDI.h:358

Referenced by MCGIDI_energyAngular_free().

◆ MCGIDI_energyAngular_sampleDistribution()

int MCGIDI_energyAngular_sampleDistribution ( statusMessageReporting smr,
MCGIDI_distribution distribution,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo 
)

Definition at line 180 of file MCGIDI_energyAngular.cc.

181 {
182
183 double Ep;
184 MCGIDI_energyAngular *energyAngular = distribution->energyAngular;
185
186 MCGIDI_sampling_doubleDistribution( smr, &(energyAngular->pdfOfEpGivenE), energyAngular->pdfOfMuGivenEAndEp, modes, decaySamplingInfo );
187 Ep = decaySamplingInfo->mu;
188 decaySamplingInfo->mu = decaySamplingInfo->Ep;
189 decaySamplingInfo->Ep = Ep;
190 decaySamplingInfo->frame = energyAngular->frame;
191
192 return( 0 );
193}
enum xDataTOM_frame frame
Definition: MCGIDI.h:357

Referenced by MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_KalbachMann_free()

MCGIDI_KalbachMann * MCGIDI_KalbachMann_free ( statusMessageReporting smr,
MCGIDI_KalbachMann KalbachMann 
)

Definition at line 61 of file MCGIDI_KalbachMann.cc.

61 {
62
63 MCGIDI_KalbachMann_release( smr, KalbachMann );
64 smr_freeMemory( (void **) &KalbachMann );
65 return( NULL );
66}
int MCGIDI_KalbachMann_release(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann)

Referenced by MCGIDI_distribution_release(), MCGIDI_KalbachMann_new(), and MCGIDI_KalbachMann_parseFromTOM().

◆ MCGIDI_KalbachMann_initialize()

int MCGIDI_KalbachMann_initialize ( statusMessageReporting smr,
MCGIDI_KalbachMann KalbachMann,
ptwXY_interpolation  interpolationWY,
ptwXY_interpolation  interpolationXY 
)

Definition at line 51 of file MCGIDI_KalbachMann.cc.

51 {
52
53 memset( KalbachMann, 0, sizeof( MCGIDI_KalbachMann ) );
54 KalbachMann->dists.interpolationWY = interpolationWY;
55 KalbachMann->dists.interpolationXY = interpolationXY;
56 return( 0 );
57}
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:376

Referenced by MCGIDI_KalbachMann_new(), and MCGIDI_KalbachMann_release().

◆ MCGIDI_KalbachMann_new()

MCGIDI_KalbachMann * MCGIDI_KalbachMann_new ( statusMessageReporting smr,
ptwXY_interpolation  interpolationWY,
ptwXY_interpolation  interpolationXY 
)

Definition at line 39 of file MCGIDI_KalbachMann.cc.

40 {
41
42 MCGIDI_KalbachMann *KalbachMann;
43
44 if( ( KalbachMann = (MCGIDI_KalbachMann *) smr_malloc2( smr, sizeof( MCGIDI_KalbachMann ), 0, "KalbachMann" ) ) == NULL ) return( NULL );
45 if( MCGIDI_KalbachMann_initialize( smr, KalbachMann, interpolationWY, interpolationXY ) ) KalbachMann = MCGIDI_KalbachMann_free( smr, KalbachMann );
46 return( KalbachMann );
47}
int MCGIDI_KalbachMann_initialize(statusMessageReporting *, MCGIDI_KalbachMann *KalbachMann, ptwXY_interpolation interpolationWY, ptwXY_interpolation interpolationXY)
MCGIDI_KalbachMann * MCGIDI_KalbachMann_free(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann)

Referenced by MCGIDI_KalbachMann_parseFromTOM().

◆ MCGIDI_KalbachMann_parseFromTOM()

int MCGIDI_KalbachMann_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_distribution distribution 
)

Definition at line 89 of file MCGIDI_KalbachMann.cc.

89 {
90
91 MCGIDI_KalbachMann *KalbachMann = NULL;
92 xDataTOM_element *KalbachMannElement;
93 int index, dataPerEout = 3;
94 double energyInFactor, energyOutFactor;
95 xDataTOM_xDataInfo *xDataInfo;
96 xDataTOM_KalbachMann *KalbachMannXData;
97 ptwXY_interpolation interpolationXY, interpolationWY;
98 char const *energyFromUnit, *energyToUnit = "MeV";
99
100 MCGIDI_POP *productPOP = distribution->product->pop;
101 double productZ = productPOP->Z, productA = productPOP->A, productN = productA - productZ;
102 MCGIDI_target_heated *targetHeated = MCGIDI_product_getTargetHeated( smr, distribution->product );
103 MCGIDI_POP *projectilePOP = MCGIDI_target_heated_getPOPForProjectile( smr, targetHeated );
104 double projectileZ = projectilePOP->Z, projectileA = projectilePOP->A, projectileN = projectileA - projectileZ;
105 MCGIDI_POP *targetPOP = MCGIDI_target_heated_getPOPForTarget( smr, targetHeated );
106 double targetZ = targetPOP->Z, targetA = targetPOP->A, targetN = targetA - targetZ;
107 double Ia = 0., Ib = 0., Ma = -1, mb = -1;
108
109 if( ( targetA == 0 ) && ( targetZ == 6 ) ) { /* Special case for C_000 evaluation. */
110 targetN = 6;
111 targetA = 12;
112 }
113 if( ( KalbachMannElement = xDataTOME_getOneElementByName( smr, element, "KalbachMann", 1 ) ) == NULL ) goto err;
114
115 if( MCGIDI_fromTOM_interpolation( smr, KalbachMannElement, 0, &interpolationWY ) ) goto err;
116 if( MCGIDI_fromTOM_interpolation( smr, KalbachMannElement, 1, &interpolationXY ) ) goto err;
117
118 xDataInfo = &(KalbachMannElement->xDataInfo);
119 KalbachMannXData = (xDataTOM_KalbachMann *) xDataInfo->data;
120 if( KalbachMannXData->type == xDataTOM_KalbachMannType_fra ) dataPerEout = 4;
121
122 energyFromUnit = xDataTOM_axes_getUnit( smr, &(xDataInfo->axes), 0 );
123 if( !smr_isOk( smr ) ) goto err;
124 energyInFactor = MCGIDI_misc_getUnitConversionFactor( smr, energyFromUnit, energyToUnit );
125 if( !smr_isOk( smr ) ) goto err;
126
127 energyFromUnit = xDataTOM_axes_getUnit( smr, &(xDataInfo->axes), 1 );
128 if( !smr_isOk( smr ) ) goto err;
129 energyOutFactor = MCGIDI_misc_getUnitConversionFactor( smr, energyFromUnit, energyToUnit );
130 if( !smr_isOk( smr ) ) goto err;
131
132 if( ( KalbachMann = distribution->KalbachMann = MCGIDI_KalbachMann_new( smr, interpolationWY, interpolationXY ) ) == NULL ) goto err;
133
134/*
135 double productMass MCGIDI_product_getMass_MeV( smr, distribution->product ), residualMass;
136*/
137 KalbachMann->energyToMeVFactor = MCGIDI_misc_getUnitConversionFactor( smr, energyToUnit, "MeV" );
138 KalbachMann->massFactor = (double) productZ + productN; /* This is not correct as masses are needed not Z and N. */
139 KalbachMann->massFactor /= projectileN + projectileZ + targetZ + targetN - productZ + productN;
140 KalbachMann->massFactor += 1.;
141
142 if( projectileZ == 0 ) {
143 if( projectileN == 1 ) Ma = 1; }
144 else if( projectileZ == 1 ) {
145 if( projectileN == 1 ) {
146 Ma = 1; }
147 else if( projectileN == 2 ) {
148 Ia = 2.22;
149 Ma = 1; } }
150 else if( projectileZ == 2 ) {
151 if( projectileN == 2 ) {
152 Ia = 28.3;
153 Ma = 0;
154 }
155 }
156
157 if( productZ == 0 ) {
158 if( productN == 1 ) mb = 0.5; }
159 else if( productZ == 1 ) {
160 if( productN == 1 ) {
161 mb = 1; }
162 else if( productN == 2 ) {
163 Ia = 2.22;
164 mb = 1; }
165 else if( productN == 3 ) {
166 Ib = 8.48;
167 mb = 1; } }
168 else if( productZ == 2 ) {
169 if( productN == 1 ) {
170 Ib = 7.72;
171 mb = 1; }
172 else if( productN == 2 ) {
173 Ib = 28.3;
174 mb = 2;
175 }
176 }
177
178 KalbachMann->Ma = Ma;
179 KalbachMann->mb = mb;
180
181 KalbachMann->Sa = MCGIDI_KalbachMann_S_a_or_b( targetZ, targetN, targetZ + projectileZ, targetN + projectileN, Ia );
182 KalbachMann->Sb = MCGIDI_KalbachMann_S_a_or_b( projectileZ + targetZ - productZ, projectileN + targetN - productN,
183 targetZ + projectileZ, targetN + projectileN, Ib );
184
185 KalbachMann->dists.numberOfWs = 0;
186 if( ( KalbachMann->dists.Ws = (double *) smr_malloc2( smr, KalbachMannXData->numberOfEnergies * sizeof( double ), 0, "KalbachMann->dists->Ws" ) ) == NULL ) goto err;
187 if( ( KalbachMann->dists.dist = (MCGIDI_pdfOfX *) smr_malloc2( smr, KalbachMannXData->numberOfEnergies * sizeof( MCGIDI_pdfOfX ), 0, "KalbachMann->dists->dist" ) ) == NULL ) goto err;
188 if( ( KalbachMann->ras = (MCGIDI_KalbachMann_ras *) smr_malloc2( smr, KalbachMannXData->numberOfEnergies * sizeof( MCGIDI_KalbachMann_ras ), 0, "KalbachMann->ras" ) ) == NULL ) goto err;
189
190 for( index = 0; index < KalbachMannXData->numberOfEnergies; index++ ) {
191 if( MCGIDI_KalbachMann_parseFromTOM2( smr, dataPerEout, index, &(KalbachMannXData->coefficients[index]),
192 energyInFactor, energyOutFactor, KalbachMann ) ) goto err;
193 }
194
195 if( ( KalbachMann->frame = MCGIDI_misc_getProductFrame( smr, KalbachMannElement ) ) == xDataTOM_frame_invalid ) goto err;
197
198 return( 0 );
199
200err:
201 if( KalbachMann != NULL ) MCGIDI_KalbachMann_free( smr, KalbachMann );
202 return( 1 );
203}
MCGIDI_POP * MCGIDI_target_heated_getPOPForProjectile(statusMessageReporting *smr, MCGIDI_target_heated *target)
MCGIDI_POP * MCGIDI_target_heated_getPOPForTarget(statusMessageReporting *smr, MCGIDI_target_heated *target)
MCGIDI_target_heated * MCGIDI_product_getTargetHeated(statusMessageReporting *smr, MCGIDI_product *product)
MCGIDI_KalbachMann * MCGIDI_KalbachMann_new(statusMessageReporting *smr, ptwXY_interpolation interpolationWY, ptwXY_interpolation interpolationXY)
enum xDataTOM_frame frame
Definition: MCGIDI.h:374
double energyToMeVFactor
Definition: MCGIDI.h:375
MCGIDI_KalbachMann_ras * ras
Definition: MCGIDI.h:377
enum xDataTOM_KalbachMannType type
Definition: xDataTOM.h:138
xDataTOM_KalbachMannCoefficients * coefficients
Definition: xDataTOM.h:141
xDataTOM_xDataInfo xDataInfo
Definition: xDataTOM.h:187
xDataTOM_axes axes
Definition: xDataTOM.h:153
char const * xDataTOM_axes_getUnit(statusMessageReporting *smr, xDataTOM_axes *axes, int index)
@ xDataTOM_KalbachMannType_fra
Definition: xDataTOM.h:25

Referenced by MCGIDI_energyAngular_parseFromTOM().

◆ MCGIDI_KalbachMann_release()

int MCGIDI_KalbachMann_release ( statusMessageReporting smr,
MCGIDI_KalbachMann KalbachMann 
)

Definition at line 70 of file MCGIDI_KalbachMann.cc.

70 {
71
72 int i;
73 MCGIDI_pdfsOfXGivenW *dists = &(KalbachMann->dists);
74
75 for( i = 0; i < dists->numberOfWs; i++ ) {
76 smr_freeMemory( (void **) &(KalbachMann->ras[i].rs) );
77 smr_freeMemory( (void **) &(dists->dist[i].Xs) );
78 }
79 smr_freeMemory( (void **) &(KalbachMann->ras) );
80 smr_freeMemory( (void **) &(dists->Ws) );
81 smr_freeMemory( (void **) &(dists->dist) );
82
84 return( 0 );
85}
@ ptwXY_interpolationLinLin
Definition: ptwXY.h:35

Referenced by MCGIDI_KalbachMann_free().

◆ MCGIDI_KalbachMann_sampleEp()

int MCGIDI_KalbachMann_sampleEp ( statusMessageReporting smr,
MCGIDI_KalbachMann KalbachMann,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo 
)

Definition at line 294 of file MCGIDI_KalbachMann.cc.

295 {
296
297 double Epl, Epu, Ep, r, r2, rl, ru, a, a2, al, au, mu, randomEp = decaySamplingInfo->rng( decaySamplingInfo->rngState );
299 MCGIDI_pdfsOfXGivenW *dists = &(KalbachMann->dists);
300 ptwXY_interpolation interpolationWY;
301
302 sampled.smr = smr;
303 sampled.w = modes.getProjectileEnergy( );
304 MCGIDI_sampling_sampleX_from_pdfsOfXGivenW( dists, &sampled, randomEp );
305
306 interpolationWY = sampled.interpolationWY;
307 if( sampled.iW < 0 ) {
308 interpolationWY = ptwXY_interpolationFlat;
309 if( sampled.iW == -2 ) { /* ???????????? This should probably report a warning. */
310 sampled.iW = 0; }
311 else if( sampled.iW == -1 ) {
312 sampled.iW = dists->numberOfWs - 1;
313 }
314 }
315
316 Ep = sampled.x; /* Sampled Ep. */
317 if( sampled.interpolationXY == ptwXY_interpolationFlat ) { /* Now sample r. */
318 r = KalbachMann->ras[sampled.iW].rs[sampled.iX1]; }
319 else {
320 Epl = dists->dist[sampled.iW].Xs[sampled.iX1];
321 Epu = dists->dist[sampled.iW].Xs[sampled.iX1+1];
322 rl = KalbachMann->ras[sampled.iW].rs[sampled.iX1];
323 ru = KalbachMann->ras[sampled.iW].rs[sampled.iX1+1];
324 r = ( ru - rl ) / ( Epu - Epl ) * ( Ep - Epl ) + rl;
325 }
326 if( interpolationWY == ptwXY_interpolationLinLin ) {
328 r2 = KalbachMann->ras[sampled.iW+1].rs[sampled.iX2]; }
329 else {
330 Epl = dists->dist[sampled.iW+1].Xs[sampled.iX2];
331 Epu = dists->dist[sampled.iW+1].Xs[sampled.iX2+1];
332 rl = KalbachMann->ras[sampled.iW+1].rs[sampled.iX2];
333 ru = KalbachMann->ras[sampled.iW+1].rs[sampled.iX2+1];
334 r2 = ( ru - rl ) / ( Epu - Epl ) * ( Ep - Epl ) + rl;
335 }
336 r = sampled.frac * r + ( 1. - sampled.frac ) * r2;
337 }
338
339 if( KalbachMann->ras[0].as == NULL ) { /* Now determine a. */
340 double X1, X3_2;
341 double eb = KalbachMann->massFactor * KalbachMann->energyToMeVFactor * Ep + KalbachMann->Sb;
342
343 X1 = eb; /* Not valid for ea > Et1. */
344 X3_2 = eb * eb; /* Not valid for ea > Et3. */
345 a = X1 * ( C1 + C2 * X1 * X1 ) + C2 * KalbachMann->Ma * KalbachMann->mb * X3_2 * X3_2; }
346 else {
348 a = KalbachMann->ras[sampled.iW].as[sampled.iX1]; }
349 else {
350 Epl = dists->dist[sampled.iW].Xs[sampled.iX1];
351 Epu = dists->dist[sampled.iW].Xs[sampled.iX1+1];
352 al = KalbachMann->ras[sampled.iW].as[sampled.iX1];
353 au = KalbachMann->ras[sampled.iW].as[sampled.iX1+1];
354 a = ( au - al ) / ( Epu - Epl ) * ( Ep - Epl ) + al;
355 }
356 a2 = 0.;
357 if( interpolationWY == ptwXY_interpolationLinLin ) {
359 a2 = KalbachMann->ras[sampled.iW+1].as[sampled.iX2]; }
360 else {
361 Epl = dists->dist[sampled.iW+1].Xs[sampled.iX2];
362 Epu = dists->dist[sampled.iW+1].Xs[sampled.iX2+1];
363 al = KalbachMann->ras[sampled.iW+1].as[sampled.iX2];
364 au = KalbachMann->ras[sampled.iW+1].as[sampled.iX2+1];
365 a2 = ( au - al ) / ( Epu - Epl ) * ( Ep - Epl ) + al;
366 }
367 }
368 a = sampled.frac * a + ( 1. - sampled.frac ) * a2;
369 }
370
371 /* In the following: Cosh[ a mu ] + r Sinh[ a mu ] = ( 1 - r ) Cosh[ a mu ] + r ( Cosh[ a mu ] + Sinh[ a mu ] ). */
372 if( decaySamplingInfo->rng( decaySamplingInfo->rngState ) >= r ) { /* Sample the '( 1 - r ) Cosh[ a mu ]' term. */
373 double T = ( 2. * decaySamplingInfo->rng( decaySamplingInfo->rngState ) - 1. ) * std::sinh( a );
374
375 mu = G4Log( T + std::sqrt( T * T + 1. ) ) / a; }
376 else { /* Sample the 'r ( Cosh[ a mu ] + Sinh[ a mu ]' term. */
377 double rng1 = decaySamplingInfo->rng( decaySamplingInfo->rngState ), exp_a = G4Exp( a );
378
379 mu = G4Log( rng1 * exp_a + ( 1. - rng1 ) / exp_a ) / a;
380 }
381 if( mu < -1 ) {
382 mu = -1;}
383 else if( mu > 1 ) {
384 mu = 1;
385 }
386
387 decaySamplingInfo->frame = KalbachMann->frame;
388 decaySamplingInfo->Ep = Ep;
389 decaySamplingInfo->mu = mu;
390 return( !smr_isOk( smr ) );
391}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:180
G4double G4Log(G4double x)
Definition: G4Log.hh:227
const double C2
const double C1
@ ptwXY_interpolationFlat
Definition: ptwXY.h:36
ptwXY_interpolation interpolationWY
Definition: MCGIDI.h:313

Referenced by MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_kinetics_2BodyReaction()

int MCGIDI_kinetics_2BodyReaction ( statusMessageReporting smr,
MCGIDI_angular angular,
double  K,
double  mu,
double  phi,
MCGIDI_sampledProductsData outgoingData 
)

Definition at line 18 of file MCGIDI_kinetics.cc.

19 {
20
21 double m1 = angular->projectileMass_MeV, m2 = angular->targetMass_MeV, m3 = angular->productMass_MeV, m4 = angular->residualMass_MeV, mi, mf, Kp, x, beta;
22
23 mi = m1 + m2;
24 mf = m3 + m4;
25 beta = std::sqrt( K * ( K + 2. * m1 ) ) / ( K + mi );
26 x = K * m2 / ( mi * mi );
27 if( x < 2e-5 ) { /* Kp is the total kinetic energy for m3 and m4 in the COM frame. */
28 Kp = mi - mf + K * m2 / mi * ( 1 - 0.5 * x * ( 1 - x ) ); }
29 else {
30 Kp = std::sqrt( mi * mi + 2 * K * m2 ) - mf;
31 }
32 if( Kp < 0 ) Kp = 0.; /* ???? There needs to be a better test here. */
33 return( MCGIDI_kinetics_COMKineticEnergy2LabEnergyAndMomentum( smr, beta, Kp, mu, phi, m3, m4, outgoingData ) );
34}
int MCGIDI_kinetics_COMKineticEnergy2LabEnergyAndMomentum(statusMessageReporting *, double beta, double e_kinetic_com, double mu, double phi, double m3cc, double m4cc, MCGIDI_sampledProductsData *outgoingData)

Referenced by MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_kinetics_COM2Lab()

int MCGIDI_kinetics_COM2Lab ( statusMessageReporting smr,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo,
double  masses[3] 
)

Definition at line 105 of file MCGIDI_kinetics.cc.

105 {
106/*
107* massProjectile = masses[0], massTarget = masses[1], massProduct = masses[2];
108*/
109 double a = masses[0] + masses[1], b, e_in = modes.getProjectileEnergy( ) * masses[0] * masses[2] / ( a * a ), Ep;
110
111 if( decaySamplingInfo->frame != xDataTOM_frame_centerOfMass ) {
112 smr_setReportError2( smr, smr_unknownID, 1, "bad frame = %d for COM to lab conversion of mu/energy", decaySamplingInfo->frame );
113 return( 1 );
114 }
115 a = std::sqrt( e_in );
116 b = std::sqrt( decaySamplingInfo->Ep );
117 Ep = decaySamplingInfo->Ep + e_in + 2. * decaySamplingInfo->mu * a * b;
118 if( Ep != 0 ) {
119 decaySamplingInfo->mu = ( a + decaySamplingInfo->mu * b ) / std::sqrt( Ep );
120 }
121 decaySamplingInfo->Ep = Ep;
122 decaySamplingInfo->frame = xDataTOM_frame_lab;
123 return( 0 );
124}
@ xDataTOM_frame_centerOfMass
Definition: xDataTOM.h:23

Referenced by MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_kinetics_COMKineticEnergy2LabEnergyAndMomentum()

int MCGIDI_kinetics_COMKineticEnergy2LabEnergyAndMomentum ( statusMessageReporting smr,
double  beta,
double  e_kinetic_com,
double  mu,
double  phi,
double  m3cc,
double  m4cc,
MCGIDI_sampledProductsData outgoingData 
)

Definition at line 38 of file MCGIDI_kinetics.cc.

39 {
40/*
41* beta the velocity/speedOflight of the com frame relative to the lab frame.
42* e_kinetic_com Total kinetic energy (K1 + K2) in the COM frame.
43* mu cos( theta ) in the COM frame.
44*/
45 double x, v_p, p, pp3, pp4, px3, py3, pz3, pz4, pz, p_perp2, E3, E4, gamma, m3cc2 = m3cc * m3cc, m4cc2 = m4cc * m4cc;
46
47 p = std::sqrt( e_kinetic_com * ( e_kinetic_com + 2. * m3cc ) * ( e_kinetic_com + 2. * m4cc ) * ( e_kinetic_com + 2. * ( m3cc + m4cc ) ) ) /
48 ( 2. * ( e_kinetic_com + m3cc + m4cc ) );
49 py3 = p * std::sqrt( 1 - mu * mu );
50 px3 = py3 * std::cos( phi );
51 py3 *= std::sin( phi );
52 pz = p * mu;
53 if( 1 ) { /* ????????? Assuming the answer is wanted in the lab frame for now. */
54 E3 = std::sqrt( p * p + m3cc2 );
55 E4 = std::sqrt( p * p + m4cc2 );
56 gamma = std::sqrt( 1. / ( 1. - beta * beta ) );
57 pz3 = gamma * ( pz + beta * E3 );
58 pz4 = gamma * ( -pz + beta * E4 ); }
59 else { /* COM frame. */
60 pz3 = pz;
61 pz4 = -pz;
62 }
63 outgoingData[1].isVelocity = outgoingData[0].isVelocity;
64
65 p_perp2 = px3 * px3 + py3 * py3;
66
67 outgoingData[0].px_vx = px3;
68 outgoingData[0].py_vy = py3;
69 outgoingData[0].pz_vz = pz3;
70 pp3 = p_perp2 + pz3 * pz3;
71 x = ( m3cc > 0 ) ? pp3 / ( 2 * m3cc2 ) : 1.;
72 if( x < 1e-5 ) {
73 outgoingData[0].kineticEnergy = m3cc * x * ( 1 - 0.5 * x * ( 1 - x ) ); }
74 else {
75 outgoingData[0].kineticEnergy = std::sqrt( m3cc2 + pp3 ) - m3cc;
76 }
77 outgoingData[1].px_vx = -px3;
78 outgoingData[1].py_vy = -py3;
79 outgoingData[1].pz_vz = pz4;
80 pp4 = p_perp2 + pz4 * pz4;
81 x = ( m4cc > 0 ) ? pp4 / ( 2 * m4cc2 ) : 1.;
82 if( x < 1e-5 ) {
83 outgoingData[1].kineticEnergy = m4cc * x * ( 1 - 0.5 * x * ( 1 - x ) ); }
84 else {
85 outgoingData[1].kineticEnergy = std::sqrt( m4cc2 + pp4 ) - m4cc;
86 }
87
88 if( outgoingData[0].isVelocity ) {
89 v_p = MCGIDI_speedOfLight_cm_sec / std::sqrt( pp3 + m3cc2 );
90 outgoingData[0].px_vx *= v_p;
91 outgoingData[0].py_vy *= v_p;
92 outgoingData[0].pz_vz *= v_p;
93
94 v_p = MCGIDI_speedOfLight_cm_sec / std::sqrt( pp4 + m4cc2 );
95 outgoingData[1].px_vx *= v_p;
96 outgoingData[1].py_vy *= v_p;
97 outgoingData[1].pz_vz *= v_p;
98 }
99
100 return( 0 );
101}
#define MCGIDI_speedOfLight_cm_sec
Definition: MCGIDI.h:183

Referenced by MCGIDI_kinetics_2BodyReaction().

◆ MCGIDI_LLNLAngular_angularEnergy_parseFromTOM()

int MCGIDI_LLNLAngular_angularEnergy_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_distribution distribution 
)

Definition at line 22 of file MCGIDI_LLNLAngular_angularEnergy.cc.

22 {
23
24 xDataTOM_element *angularEnergyElement;
25
26 if( ( angularEnergyElement = xDataTOME_getOneElementByName( smr, element, "LLNLAngular_angularEnergy", 1 ) ) == NULL ) return( 1 );
27
28 if( MCGIDI_angular_parseFromTOM( smr, angularEnergyElement, distribution, NULL ) ) goto err;
29 if( MCGIDI_LLNL_angularEnergy_parseFromTOM( smr, angularEnergyElement, distribution ) ) goto err;
30
31 return( 0 );
32
33err:
34 if( distribution->angular ) distribution->angular = MCGIDI_angular_free( smr, distribution->angular );
35 return( 1 );
36}

Referenced by MCGIDI_distribution_parseFromTOM().

◆ MCGIDI_misc_binarySearch()

xDataTOM_Int MCGIDI_misc_binarySearch ( xDataTOM_Int  n,
double *  ds,
double  d 
)

Definition at line 228 of file MCGIDI_misc.cc.

228 {
229/*
230* Returns -2 is d < first point of ds, -1 if > last point of ds and the lower index of ds otherwise.
231*/
232 xDataTOM_Int imin = 0, imid, imax = n - 1;
233
234 if( d < ds[0] ) return( -2 );
235 if( d > ds[n-1] ) return( -1 );
236 while( 1 ) { // Loop checking, 11.06.2015, T. Koi
237 imid = ( imin + imax ) >> 1;
238 if( imid == imin ) break;
239 if( d < ds[imid] ) {
240 imax = imid; }
241 else {
242 imin = imid;
243 }
244 }
245 return( imin );
246}
int xDataTOM_Int
Definition: xDataTOM.h:16

Referenced by MCGIDI_sampling_doubleDistribution(), MCGIDI_sampling_sampleX_from_pdfOfX(), and MCGIDI_sampling_sampleX_from_pdfsOfXGivenW().

◆ MCGIDI_misc_NumberOfZSymbols()

int MCGIDI_misc_NumberOfZSymbols ( void  )

Definition at line 54 of file MCGIDI_misc.cc.

54 {
55
56 return( sizeof( ZSymbols ) / sizeof( struct ZSymbol ) );
57}

Referenced by MCGIDI_misc_symbolToZ(), and MCGIDI_misc_ZToSymbol().

◆ MCGIDI_misc_PQUStringToDouble()

int MCGIDI_misc_PQUStringToDouble ( statusMessageReporting smr,
char const *  str,
char const *  unit,
double  conversion,
double *  value 
)

Definition at line 330 of file MCGIDI_misc.cc.

330 {
331/*
332* Currently, white spaces are not allowed after the unit.
333*
334* Examples of allowed strings are: "2.39e6 eV", " 2.39e6eV" and " 2.39e6 eV".
335*/
336 char const *s = str;
337 char *e;
338
339
340 while( isspace( *s ) ) s++; // Loop checking, 11.06.2015, T. Koi
341 *value = strtod( s, &e ) * conversion;
342 if( e == s ) {
343 smr_setReportError2( smr, smr_unknownID, 1, "no number at start of string = <%s>", str );
344 return( 1 );
345 }
346 while( isspace( *e ) ) e++; // Loop checking, 11.06.2015, T. Koi
347 if( strcmp( e, unit ) != 0 ) {
348 smr_setReportError2( smr, smr_unknownID, 1, "unit = '%s' not '%s' in '%s'", e, unit, str );
349 return( 1 );
350 }
351 return( 0 );
352}

◆ MCGIDI_misc_PQUStringToDoubleInUnitOf()

int MCGIDI_misc_PQUStringToDoubleInUnitOf ( statusMessageReporting smr,
char const *  str,
char const *  toUnit,
double *  value 
)

Definition at line 356 of file MCGIDI_misc.cc.

356 {
357/*
358* Currently, white spaces are not allowed after the unit.
359*
360* Examples of allowed strings are: "2.39e6 eV", " 2.39e6eV" and " 2.39e6 eV".
361*/
362 char const *s1 = str;
363 char *e1;
364 double factor;
365
366 while( isspace( *s1 ) ) s1++; // Loop checking, 11.06.2015, T. Koi
367 *value = strtod( s1, &e1 );
368 if( e1 == s1 ) {
369 smr_setReportError2( smr, smr_unknownID, 1, "no number at start of string = <%s>", str );
370 return( 1 );
371 }
372 while( isspace( *e1 ) ) e1++; // Loop checking, 11.06.2015, T. Koi
373
374 factor = MCGIDI_misc_getUnitConversionFactor( smr, e1, toUnit );
375 *value *= factor;
376 return( !smr_isOk( smr ) );
377}
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
Definition: MCGIDI_misc.cc:381

Referenced by MCGIDI_distribution_parseFromTOM(), MCGIDI_outputChannel_parseFromTOM(), and MCGIDI_product_parseFromTOM().

◆ MCGIDI_misc_symbolToZ()

int MCGIDI_misc_symbolToZ ( const char *  Z)

Definition at line 69 of file MCGIDI_misc.cc.

69 {
70
72
73 for( i = 0; i < n; i++ ) {
74 if( strcmp( Z, ZSymbols[i].symbol ) == 0 ) return( ZSymbols[i].Z );
75 }
76 return( -1 );
77}
const G4int Z[17]
int MCGIDI_misc_NumberOfZSymbols(void)
Definition: MCGIDI_misc.cc:54

Referenced by MCGIDI_miscNameToZAm().

◆ MCGIDI_misc_updateTransportabilitiesMap()

void MCGIDI_misc_updateTransportabilitiesMap ( transportabilitiesMap transportabilities,
int  PoPID,
enum MCGIDI_transportability  transportability 
)

Definition at line 482 of file MCGIDI_misc.cc.

482 {
483
484 transportabilitiesMap::iterator iter = transportabilities->find( PoPID );
485
486 if( iter != transportabilities->end( ) ) {
487 switch ( iter->second ) {
489 break;
491 switch( transportability ) {
494 transportability = MCGIDI_transportability_none;
495 break;
497 break;
499 transportability = MCGIDI_transportability_partial;
500 break;
501 }
502 break;
504 transportability = MCGIDI_transportability_partial;
505 break;
507 switch( transportability ) {
510 transportability = MCGIDI_transportability_partial;
511 break;
514 break;
515 }
516 break;
517 }
518 }
519 (*transportabilities)[PoPID] = transportability;
520}

Referenced by MCGIDI_misc_updateTransportabilitiesMap2(), and MCGIDI_target_heated_read().

◆ MCGIDI_misc_updateTransportabilitiesMap2()

void MCGIDI_misc_updateTransportabilitiesMap2 ( transportabilitiesMap transportabilities,
int  PoPID,
int  transportable 
)

Definition at line 524 of file MCGIDI_misc.cc.

524 {
525
527}
void MCGIDI_misc_updateTransportabilitiesMap(transportabilitiesMap *transportabilities, int PoPID, enum MCGIDI_transportability transportability)
Definition: MCGIDI_misc.cc:482

◆ MCGIDI_misc_ZToSymbol()

const char * MCGIDI_misc_ZToSymbol ( int  iZ)

Definition at line 61 of file MCGIDI_misc.cc.

61 {
62
63 if( ( iZ < 0 ) || ( iZ >= MCGIDI_misc_NumberOfZSymbols( ) ) ) return( NULL );
64 return( ZSymbols[iZ].symbol );
65}

Referenced by G4GIDI_Misc_Z_A_m_ToName().

◆ MCGIDI_miscNameToZAm()

int MCGIDI_miscNameToZAm ( statusMessageReporting smr,
const char *  name,
int *  Z,
int *  A,
int *  m,
int *  level 
)

Definition at line 81 of file MCGIDI_misc.cc.

81 {
82
83 const char *p;
84 char s[1024] = "", *q, *e; /* Note 1) routine will fail when parts of a particle name can be longer than 1024. */
85
86 if( strlen( name ) >= ( sizeof( s ) - 1 ) ) {
87 smr_setReportError2( smr, smr_unknownID, 0, "particle name too long: '%s'", name );
88 return( 1 );
89 }
90
91 *Z = *A = *m = *level = 0;
92 if( ( !strncmp( "FissionProduct", name, 14 ) ) || !strncmp( "99120", name, 5 ) ) {
93 *Z = 99;
94 *A = 120;
95 return( 0 );
96 }
97 if( strcmp( "gamma", name ) == 0 ) return( 0 );
98 if( strcmp( "n", name ) == 0 ) { *A = 1; return( 0 ); }
99
100 for( p = name, q = s; ( *p != 0 ) && !isdigit( *p ) && ( *p != '_' ); p++, q++ ) *q = *p; /* '_' only for "natural". */
101 if( *p == 0 ) {
102 smr_setReportError2( smr, smr_unknownID, 0, "unsupported particle name = '%s'", name );
103 return( 1 );
104 }
105 *q = 0;
106 if( ( *Z = MCGIDI_misc_symbolToZ( s ) ) < 0 ) {
107 smr_setReportError2( smr, smr_unknownID, 1, "Particle %s's symbol = '%s' not found", name, s ); }
108 else { /* Getting here implies that *p is a digit. */
109 if( *p == '_' ) {
110 if( strncmp( p, "_natural", 8 ) == 0 ) {
111 p += 8;
112 if( *p ) *level = MCGIDI_miscNameToZAm_getLevel( smr, name, p ); }
113 else {
114 smr_setReportError2( smr, smr_unknownID, 0, "expecting 'natural': %s", name );
115 } }
116 else {
117 for( q = s; isdigit( *p ); p++, q++ ) *q = *p;
118 *q = 0;
119 if( strcmp( s, "natural" ) == 0 ) {
120 e = s;
121 while( *e ) e++; /* Loop checking, 11.06.2015, T. Koi*/ }
122 else {
123 *A = (int) strtol( s, &e, 10 );
124 }
125 if( *e != 0 ) {
126 smr_setReportError2( smr, smr_unknownID, 1, "Failed to convert A to integer in particle name %s", name ); }
127 else { /* Getting here implies that *p == '_' or 0. */
128 if( *p ) *level = MCGIDI_miscNameToZAm_getLevel( smr, name, p );
129 }
130 }
131 }
132
133 return( !smr_isOk( smr ) );
134}
const G4double A[17]
int MCGIDI_misc_symbolToZ(const char *Z)
Definition: MCGIDI_misc.cc:69

Referenced by G4GIDI_Misc_channelCompound(), MCGIDI_particle_getInternalID(), and MCGIDI_POP_new().

◆ MCGIDI_outputChannel_free()

MCGIDI_outputChannel * MCGIDI_outputChannel_free ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel 
)

Definition at line 39 of file MCGIDI_outputChannel.cc.

39 {
40
41 MCGIDI_outputChannel_release( smr, outputChannel );
42 smr_freeMemory( (void **) &outputChannel );
43 return( NULL );
44}
int MCGIDI_outputChannel_release(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)

Referenced by MCGIDI_outputChannel_new().

◆ MCGIDI_outputChannel_getDomain()

int MCGIDI_outputChannel_getDomain ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel,
double *  EMin,
double *  EMax 
)

Definition at line 153 of file MCGIDI_outputChannel.cc.

153 {
154
155 if( outputChannel->reaction != NULL ) return( MCGIDI_reaction_getDomain( smr, outputChannel->reaction, EMin, EMax ) );
156 return( MCGIDI_product_getDomain( smr, outputChannel->parent, EMin, EMax ) );
157}
int MCGIDI_product_getDomain(statusMessageReporting *smr, MCGIDI_product *product, double *EMin, double *EMax)
int MCGIDI_reaction_getDomain(statusMessageReporting *smr, MCGIDI_reaction *reaction, double *EMin, double *EMax)
MCGIDI_reaction * reaction
Definition: MCGIDI.h:392
MCGIDI_product * parent
Definition: MCGIDI.h:393

Referenced by MCGIDI_product_getDomain().

◆ MCGIDI_outputChannel_getFinalQ()

double MCGIDI_outputChannel_getFinalQ ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel,
double  e_in 
)

Definition at line 192 of file MCGIDI_outputChannel.cc.

192 {
193
194 int iProduct;
195 double Q = outputChannel->Q;
196 MCGIDI_product *product;
197
198 for( iProduct = 0; iProduct < outputChannel->numberOfProducts; iProduct++ ) {
199 product = &(outputChannel->products[iProduct]);
201 if( !smr_isOk( smr ) ) break;
202 }
203 return( Q );
204}
double MCGIDI_outputChannel_getFinalQ(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
enum MCGIDI_channelGenre genre
Definition: MCGIDI.h:391
MCGIDI_product * products
Definition: MCGIDI.h:397
MCGIDI_outputChannel decayChannel
Definition: MCGIDI.h:412

Referenced by MCGIDI_outputChannel_getFinalQ().

◆ MCGIDI_outputChannel_getProductAtIndex()

MCGIDI_product * MCGIDI_outputChannel_getProductAtIndex ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel,
int  i 
)

Definition at line 142 of file MCGIDI_outputChannel.cc.

142 {
143
144 if( ( i < 0 ) || ( i >= outputChannel->numberOfProducts ) ) {
145 smr_setReportError2( smr, smr_unknownID, 1, "bad product index = %d: outputChannel as only %d products", i, outputChannel->numberOfProducts );
146 return( NULL );
147 }
148 return( &(outputChannel->products[i]) );
149}

Referenced by G4GIDI_target::getElasticFinalState().

◆ MCGIDI_outputChannel_getProjectileMass_MeV()

double MCGIDI_outputChannel_getProjectileMass_MeV ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel 
)

Definition at line 169 of file MCGIDI_outputChannel.cc.

169 {
170
171 if( outputChannel->reaction != NULL ) return( MCGIDI_reaction_getProjectileMass_MeV( smr, outputChannel->reaction ) );
172 return( MCGIDI_product_getProjectileMass_MeV( smr, outputChannel->parent ) );
173}
double MCGIDI_reaction_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)

Referenced by MCGIDI_product_getProjectileMass_MeV().

◆ MCGIDI_outputChannel_getQ_MeV()

double MCGIDI_outputChannel_getQ_MeV ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel,
double  e_in 
)

Definition at line 185 of file MCGIDI_outputChannel.cc.

185 {
186
187 return( outputChannel->Q );
188}

◆ MCGIDI_outputChannel_getTargetHeated()

MCGIDI_target_heated * MCGIDI_outputChannel_getTargetHeated ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel 
)

Definition at line 161 of file MCGIDI_outputChannel.cc.

161 {
162
163 if( outputChannel->reaction != NULL ) return( MCGIDI_reaction_getTargetHeated( smr, outputChannel->reaction ) );
164 return( MCGIDI_product_getTargetHeated( smr, outputChannel->parent ) );
165}
MCGIDI_target_heated * MCGIDI_reaction_getTargetHeated(statusMessageReporting *smr, MCGIDI_reaction *reaction)

Referenced by MCGIDI_product_getTargetHeated().

◆ MCGIDI_outputChannel_getTargetMass_MeV()

double MCGIDI_outputChannel_getTargetMass_MeV ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel 
)

Definition at line 177 of file MCGIDI_outputChannel.cc.

177 {
178
179 if( outputChannel->reaction != NULL ) return( MCGIDI_reaction_getTargetMass_MeV( smr, outputChannel->reaction ) );
180 return( MCGIDI_product_getTargetMass_MeV( smr, outputChannel->parent ) );
181}
double MCGIDI_reaction_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)

Referenced by MCGIDI_product_getTargetMass_MeV().

◆ MCGIDI_outputChannel_initialize()

int MCGIDI_outputChannel_initialize ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel 
)

Definition at line 31 of file MCGIDI_outputChannel.cc.

31 {
32
33 memset( outputChannel, 0, sizeof( MCGIDI_outputChannel ) );
34 return( 0 );
35}

Referenced by MCGIDI_outputChannel_new(), MCGIDI_outputChannel_parseFromTOM(), and MCGIDI_outputChannel_release().

◆ MCGIDI_outputChannel_new()

MCGIDI_outputChannel * MCGIDI_outputChannel_new ( statusMessageReporting smr)

Definition at line 20 of file MCGIDI_outputChannel.cc.

20 {
21
22 MCGIDI_outputChannel *outputChannel;
23
24 if( ( outputChannel = (MCGIDI_outputChannel *) smr_malloc2( smr, sizeof( MCGIDI_outputChannel ), 0, "outputChannel" ) ) == NULL ) return( NULL );
25 if( MCGIDI_outputChannel_initialize( smr, outputChannel ) ) outputChannel = MCGIDI_outputChannel_free( smr, outputChannel );
26 return( outputChannel );
27}
MCGIDI_outputChannel * MCGIDI_outputChannel_free(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_outputChannel_initialize(statusMessageReporting *, MCGIDI_outputChannel *outputChannel)

◆ MCGIDI_outputChannel_numberOfProducts()

int MCGIDI_outputChannel_numberOfProducts ( MCGIDI_outputChannel outputChannel)

Definition at line 135 of file MCGIDI_outputChannel.cc.

135 {
136
137 return( outputChannel->numberOfProducts );
138}

◆ MCGIDI_outputChannel_parseFromTOM()

int MCGIDI_outputChannel_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_POPs pops,
MCGIDI_outputChannel outputChannel,
MCGIDI_reaction reaction,
MCGIDI_product parent 
)

Definition at line 61 of file MCGIDI_outputChannel.cc.

62 {
63
64 int n, delayedNeutronIndex = 0;
65 char const *genre, *Q;
66 xDataTOM_element *child;
67
68 MCGIDI_outputChannel_initialize( smr, outputChannel );
69
70 outputChannel->reaction = reaction;
71 outputChannel->parent = parent;
72 if( ( genre = xDataTOM_getAttributesValueInElement( element, "genre" ) ) == NULL ) goto err;
73 if( ( parent != NULL ) && ( strcmp( genre, "NBody" ) ) ) {
74 smr_setReportError2( smr, smr_unknownID, 1, "decay channel's genre can only be 'uncorreclated' (a.k.a. 'NBody') and not '%s'", genre );
75 goto err;
76 }
77 if( strcmp( genre, "twoBody" ) == 0 ) {
78 outputChannel->genre = MCGIDI_channelGenre_twoBody_e; }
79 else if( strcmp( genre, "NBody" ) == 0 ) {
81 else if( strcmp( genre, "sumOfRemainingOutputChannels" ) == 0 ) {
83 else {
84 smr_setReportError2( smr, smr_unknownID, 1, "unsupported genre = '%s'", genre );
85 goto err;
86 }
87 if( ( Q = xDataTOM_getAttributesValueInElement( element, "Q" ) ) == NULL ) goto err;
88 outputChannel->QIsFloat = !MCGIDI_misc_PQUStringToDoubleInUnitOf( smr, Q, "MeV", &(outputChannel->Q) );
89
90 if( ( n = xDataTOM_numberOfElementsByName( smr, element, "product" ) ) == 0 ) {
91 smr_setReportError2p( smr, smr_unknownID, 1, "outputChannel does not have any products" );
92 goto err;
93 }
94 if( ( outputChannel->products = (MCGIDI_product *) smr_malloc2( smr, n * sizeof( MCGIDI_product ), 0, "outputChannel->products" ) ) == NULL ) goto err;
95
96 for( child = xDataTOME_getFirstElement( element ); child != NULL; child = xDataTOME_getNextElement( child ) ) {
97 if( strcmp( child->name, "product" ) == 0 ) {
98 if( MCGIDI_product_parseFromTOM( smr, child, outputChannel, pops, &(outputChannel->products[outputChannel->numberOfProducts]),
99 &delayedNeutronIndex ) ) goto err;
100 outputChannel->numberOfProducts++; }
101 else if( strcmp( child->name, "fissionEnergyReleased" ) == 0 ) { /* ????????? Need to support. */
102 continue; }
103 else {
104 printf( "outputChannel child not currently supported = %s\n", child->name );
105 }
106 }
107 if( outputChannel->genre == MCGIDI_channelGenre_twoBody_e ) {
108 double projectileMass_MeV, targetMass_MeV, productMass_MeV, residualMass_MeV;
109
110 projectileMass_MeV = MCGIDI_reaction_getProjectileMass_MeV( smr, reaction );
111 targetMass_MeV = MCGIDI_reaction_getTargetMass_MeV( smr, reaction );
112 productMass_MeV = MCGIDI_product_getMass_MeV( smr, &(outputChannel->products[0]) );
113 residualMass_MeV = MCGIDI_product_getMass_MeV( smr, &(outputChannel->products[1]) );
114
115 //TK 17-11-10 for v1.3
116 //A temporary fix for emission of gamma(2.2MeV) from n captured by H
117 // capture gamma D
118 if ( reaction->ENDF_MT == 102 && productMass_MeV == 0 && ( outputChannel->products[1].pop->A == 2 && outputChannel->products[1].pop->Z == 1 ) ) {
119 //include/PoPs_data.h:#define e_Mass 5.4857990943e-4 /* electron mass in AMU */
120 residualMass_MeV += 5.4857990943e-4*MCGIDI_AMU2MeV;
121 }
122
123 MCGIDI_product_setTwoBodyMasses( smr, &(outputChannel->products[0]), projectileMass_MeV, targetMass_MeV, productMass_MeV, residualMass_MeV );
124 }
125
126 return( 0 );
127
128err:
129 MCGIDI_outputChannel_release( smr, outputChannel );
130 return( 1 );
131}
double MCGIDI_product_getMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
#define MCGIDI_AMU2MeV
Definition: MCGIDI.h:184
int MCGIDI_product_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_outputChannel *outputChannel, MCGIDI_POPs *pops, MCGIDI_product *product, int *delayedNeutronIndex)
int MCGIDI_product_setTwoBodyMasses(statusMessageReporting *smr, MCGIDI_product *product, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)
#define smr_setReportError2p(smr, libraryID, code, fmt)
int xDataTOM_numberOfElementsByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:268
xDataTOM_element * xDataTOME_getNextElement(xDataTOM_element *element)
Definition: xDataTOM.cc:238
xDataTOM_element * xDataTOME_getFirstElement(xDataTOM_element *element)
Definition: xDataTOM.cc:230

Referenced by MCGIDI_product_parseFromTOM(), and MCGIDI_reaction_parseFromTOM().

◆ MCGIDI_outputChannel_release()

int MCGIDI_outputChannel_release ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel 
)

Definition at line 48 of file MCGIDI_outputChannel.cc.

48 {
49
50 int i;
51
52 for( i = 0; i < outputChannel->numberOfProducts; i++ ) MCGIDI_product_release( smr, &(outputChannel->products[i]) );
53 smr_freeMemory( (void **) &(outputChannel->products) );
54 MCGIDI_outputChannel_initialize( smr, outputChannel );
55
56 return( 0 );
57}
int MCGIDI_product_release(statusMessageReporting *smr, MCGIDI_product *product)

Referenced by MCGIDI_outputChannel_free(), MCGIDI_outputChannel_parseFromTOM(), MCGIDI_product_release(), and MCGIDI_reaction_release().

◆ MCGIDI_outputChannel_sampleProductsAtE()

int MCGIDI_outputChannel_sampleProductsAtE ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo,
MCGIDI_sampledProductsDatas productDatas,
double *  masses 
)

Definition at line 208 of file MCGIDI_outputChannel.cc.

214{
215 int i1;
216 int multiplicity(0);
217 int secondTwoBody = 0, isDecayChannel = ( outputChannel->reaction == NULL );
218 double e_in = modes.getProjectileEnergy( );
219 MCGIDI_product *product;
220 double phi, p, masses[3];
221 MCGIDI_distribution *distribution;
222 MCGIDI_sampledProductsData productData[2];
223
224 if (isDecayChannel) {
225 masses[0] = masses_[0]; /* More work may be needed here. */
226 masses[1] = masses_[1];
227 } else {
228 masses[0] = MCGIDI_reaction_getProjectileMass_MeV( smr, outputChannel->reaction );
229 masses[1] = MCGIDI_reaction_getTargetMass_MeV( smr, outputChannel->reaction );
230 }
231
232 // Loop over all possible final state particles reachable from initial state
233 // List of these particles (products) was read in from GIDI
234 // Note: all particles satifying the sampling criteria are included in the
235 // final state, regardless of charge, energy or baryon number conservation
236
237 for (i1 = 0; i1 < outputChannel->numberOfProducts; i1++) {
238 product = &(outputChannel->products[i1]);
241 modes, decaySamplingInfo,
242 productDatas, masses ) < 0 ) return( -1 );
243 } else {
244 distribution = &(product->distribution);
245 if( distribution->type == MCGIDI_distributionType_none_e ) continue;
246
247 if (!secondTwoBody) {
248 // Sample multiplicity of final state particle at kinetic energy of projectile
249 // The multiplicity stored in GIDI is a real number whose fractional part is
250 // compared to a random number to decide what integer value is returned
251 if ((multiplicity = product->multiplicity) == 0) multiplicity =
252 MCGIDI_product_sampleMultiplicity(smr, product, e_in,
253 decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
254 while (multiplicity > 0) {
255
256 multiplicity--;
257 decaySamplingInfo->pop = product->pop;
258 decaySamplingInfo->mu = 0;
259 decaySamplingInfo->Ep = 0;
260 productData[0].isVelocity = decaySamplingInfo->isVelocity;
261 productData[0].pop = product->pop;
262 productData[0].delayedNeutronIndex = product->delayedNeutronIndex;
263 productData[0].delayedNeutronRate = product->delayedNeutronRate;
264 productData[0].birthTimeSec = 0;
265 if (product->delayedNeutronRate > 0) {
266 productData[0].birthTimeSec =
267 -G4Log( decaySamplingInfo->rng( decaySamplingInfo->rngState ) ) / product->delayedNeutronRate;
268 }
269
270 switch( outputChannel->genre ) {
271
273 secondTwoBody = 1;
274 MCGIDI_angular_sampleMu( smr, distribution->angular, modes, decaySamplingInfo );
275 if (smr_isOk(smr) ) {
276 phi = 2. * M_PI * decaySamplingInfo->rng( decaySamplingInfo->rngState );
277 MCGIDI_kinetics_2BodyReaction( smr, distribution->angular, e_in, decaySamplingInfo->mu, phi, productData );
278 if (!smr_isOk(smr) ) return( -1 );
279 productData[1].pop = product[1].pop;
280 productData[1].delayedNeutronIndex = product[1].delayedNeutronIndex;
281 productData[1].delayedNeutronRate = product->delayedNeutronRate;
282 productData[1].birthTimeSec = 0;
283 MCGIDI_sampledProducts_addProduct( smr, productDatas, productData );
284 if( !smr_isOk( smr ) ) return( -1 );
285 MCGIDI_sampledProducts_addProduct( smr, productDatas, &(productData[1]) );
286 if( !smr_isOk( smr ) ) return( -1 );
287 }
288 break;
289
291
293 // Get mass of final state particle, then get its distribution
294 // masses[0] and masses[1] are incident and target masses
295 masses[2] = MCGIDI_product_getMass_MeV( smr, product );
296 switch( distribution->type ) {
298 MCGIDI_uncorrelated_sampleDistribution( smr, distribution, modes, decaySamplingInfo );
299 break;
301 MCGIDI_energyAngular_sampleDistribution( smr, distribution, modes, decaySamplingInfo );
302 break;
304 MCGIDI_KalbachMann_sampleEp( smr, distribution->KalbachMann, modes, decaySamplingInfo );
305 break;
307 MCGIDI_angularEnergy_sampleDistribution( smr, distribution->angularEnergy, modes, decaySamplingInfo );
308 break;
309 default :
310 printf( "Unknown spectral data form product name = %s, channel genre = %d\n", product->pop->name, outputChannel->genre );
311 break;
312 }
313 break;
314
316 printf( "Channel is undefined\n" );
317 break;
318
320 printf( "Channel is twoBodyDecay\n" );
321 break;
322
324 printf( "Channel is uncorrelatedDecay\n" );
325 break;
326
327 default :
328 printf( "Unsupported channel genre = %d\n", outputChannel->genre );
329 break;
330 }
331
332 if (!smr_isOk(smr) ) return( -1 );
333 if (!secondTwoBody) {
334 if (decaySamplingInfo->frame == xDataTOM_frame_centerOfMass) {
335 if (MCGIDI_kinetics_COM2Lab( smr, modes, decaySamplingInfo, masses) != 0 ) return( -1 );
336 }
337
338 // Assign kinematics to final state product
339 productData[0].kineticEnergy = decaySamplingInfo->Ep;
340 p = std::sqrt( decaySamplingInfo->Ep * ( decaySamplingInfo->Ep + 2. * product->pop->mass_MeV ) );
341 if (productData[0].isVelocity) p *= MCGIDI_speedOfLight_cm_sec / std::sqrt( p * p + product->pop->mass_MeV * product->pop->mass_MeV );
342 productData[0].pz_vz = p * decaySamplingInfo->mu;
343 p = std::sqrt( 1. - decaySamplingInfo->mu * decaySamplingInfo->mu ) * p;
344 phi = 2. * M_PI * decaySamplingInfo->rng( decaySamplingInfo->rngState );
345 productData[0].px_vx = p * std::sin( phi );
346 productData[0].py_vy = p * std::cos( phi );
347 MCGIDI_sampledProducts_addProduct( smr, productDatas, productData );
348 if (!smr_isOk(smr) ) return( -1 );
349 }
350 } // while multiplicity
351
352 } // if !secondTwoBody
353 } // if decay channel genre
354
355 } // loop over possible final state products
356 return( productDatas->numberOfProducts );
357
358}
int MCGIDI_KalbachMann_sampleEp(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_kinetics_2BodyReaction(statusMessageReporting *smr, MCGIDI_angular *angular, double K, double mu, double phi, MCGIDI_sampledProductsData *outgoingData)
int MCGIDI_angular_sampleMu(statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_kinetics_COM2Lab(statusMessageReporting *smr, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, double masses[3])
int MCGIDI_product_sampleMultiplicity(statusMessageReporting *smr, MCGIDI_product *product, double e_in, double r)
int MCGIDI_uncorrelated_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_sampledProducts_addProduct(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, MCGIDI_sampledProductsData *sampledProductsData)
int MCGIDI_energyAngular_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_angularEnergy_sampleDistribution(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_outputChannel_sampleProductsAtE(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas, double *masses_)
#define M_PI
Definition: SbMath.h:33
double mass_MeV
Definition: MCGIDI.h:235
int delayedNeutronIndex
Definition: MCGIDI.h:405
double delayedNeutronRate
Definition: MCGIDI.h:406
int multiplicity
Definition: MCGIDI.h:404

Referenced by MCGIDI_outputChannel_sampleProductsAtE(), and MCGIDI_target_heated_sampleIndexReactionProductsAtE().

◆ MCGIDI_particle_free()

MCGIDI_particle * MCGIDI_particle_free ( statusMessageReporting smr,
MCGIDI_particle particle 
)

Definition at line 39 of file MCGIDI_particle.cc.

39 {
40
41 int i, j;
43
44 for( i = 0, p = particleSortedList; i < numberOfParticles; i++, p++ ) {
45 if( *p == particle ) {
46 numberOfParticles--;
47 for( j = i; j < numberOfParticles; j++, p++ ) *p = p[1];
48 break;
49 }
50 }
51 if( particle == particleListEnd ) particleListEnd = particle->prior;
52 if( particle == particleList ) particleList = particle->next;
53 if( particle->prior != NULL ) particle->prior->next = particle->next;
54 if( particle->next != NULL ) particle->next->prior = particle->prior;
55 MCGIDI_particle_release( smr, particle );
56 smr_freeMemory( (void **) &particle );
57 return( NULL );
58}
int MCGIDI_particle_release(statusMessageReporting *, MCGIDI_particle *particle)
MCGIDI_particle * prior
Definition: MCGIDI.h:247
MCGIDI_particle * next
Definition: MCGIDI.h:248

Referenced by MCGIDI_particle_freeInternalList(), and MCGIDI_particle_getInternalID().

◆ MCGIDI_particle_freeInternalList()

int MCGIDI_particle_freeInternalList ( statusMessageReporting smr)

Definition at line 70 of file MCGIDI_particle.cc.

70 {
71
72 while( particleList != NULL ) MCGIDI_particle_free( smr, particleList ); // Loop checking, 11.06.2015, T. Koi
73 particleSortedList = (MCGIDI_particle **) smr_freeMemory( (void **) &particleSortedList );
74 return( 0 );
75}
MCGIDI_particle * MCGIDI_particle_free(statusMessageReporting *smr, MCGIDI_particle *particle)

◆ MCGIDI_particle_getInternalID()

MCGIDI_particle * MCGIDI_particle_getInternalID ( statusMessageReporting smr,
const char *const  name,
MCGIDI_POPs pops 
)

Definition at line 79 of file MCGIDI_particle.cc.

79 {
80
81 int i, iCmp, min, mid, max, Z, A, m, level;
82 MCGIDI_particle *particle;
83 MCGIDI_POP *pop;
84
85 iCmp = 0;
86 min = mid = 0;
87 max = numberOfParticles;
88 while( min != max ) { // Loop checking, 11.06.2015, T. Koi
89 mid = ( min + max ) / 2;
90 iCmp = strcmp( name, particleSortedList[mid]->name );
91 if( iCmp == 0 ) return( particleSortedList[mid] );
92 if( iCmp < 0 ) {
93 max = mid - 1;
94 if( mid == 0 ) max = 0; }
95 else {
96 min = mid + 1;
97 if( min > max ) min = max;
98 }
99 }
100 mid = min;
101 if( numberOfParticles > 0 ) {
102 iCmp = strcmp( name, particleSortedList[mid]->name );
103 if( iCmp == 0 ) return( particleSortedList[mid] );
104 if( ( iCmp < 0 ) && ( mid != 0 ) ) {
105 mid--;
106 iCmp = strcmp( name, particleSortedList[mid]->name );
107 }
108 }
109
110 if( ( particle = MCGIDI_particle_new( smr ) ) == NULL ) return( NULL );
111 if( ( particle->name = smr_allocateCopyString( smr, name, "particle->name", __FILE__, __LINE__, __func__ ) ) == NULL ) goto err;
112 if( MCGIDI_miscNameToZAm( smr, name, &Z, &A, &m, &level ) != 0 ) goto err;
113 particle->prior = NULL;
114 particle->next = NULL;
115 particle->Z = Z;
116 particle->A = A;
117 particle->m = m;
118 if( ( pop = MCGIDI_POPs_findParticle( pops, name ) ) == NULL ) { /* This should not happend. */
119 particle->mass_MeV = MCGIDI_AMU2MeV * MCGIDI_particleMass_AMU( smr, name ); }
120 else {
121 particle->mass_MeV = pop->mass_MeV;
122 }
123 if( !smr_isOk( smr ) ) goto err;
124
125 if( sizeOfParticleSortedList < ( numberOfParticles + 1 ) ) {
126 if( sizeOfParticleSortedList == 0 ) {
127 sizeOfParticleSortedList = initialSizeOfList; }
128 else {
129 sizeOfParticleSortedList += incrementalSizeOfList;
130 }
131 if( ( particleSortedList = (MCGIDI_particle **) smr_realloc2( smr, particleSortedList, sizeOfParticleSortedList * sizeof( MCGIDI_particle * ),
132 "particleSortedList" ) ) == NULL ) goto err;
133 }
134
135 if( particleList == NULL ) {
136 particle->ordinal = 0;
137 particleListEnd = particleList = particle; }
138 else {
139 particle->ordinal = particleListEnd->ordinal + 1;
140 particle->prior = particleListEnd;
141 particleListEnd->next = particle;
142 particleListEnd = particle;
143 }
144
145 if( ( mid != 0 ) || ( iCmp > 0 ) ) mid++;
146 for( i = numberOfParticles; i > mid; i-- ) particleSortedList[i] = particleSortedList[i-1];
147 particleSortedList[mid] = particle;
148 numberOfParticles++;
149
150 return( particle );
151
152err:
153 MCGIDI_particle_free( smr, particle );
154 return( NULL );
155}
int MCGIDI_miscNameToZAm(statusMessageReporting *smr, const char *name, int *Z, int *A, int *m, int *level)
Definition: MCGIDI_misc.cc:81
MCGIDI_POP * MCGIDI_POPs_findParticle(MCGIDI_POPs *pops, char const *name)
Definition: MCGIDI_pop.cc:133
double MCGIDI_particleMass_AMU(statusMessageReporting *smr, const char *name)
Definition: MCGIDI_mass.cc:853
MCGIDI_particle * MCGIDI_particle_new(statusMessageReporting *smr)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
char * smr_allocateCopyString(statusMessageReporting *smr, char const *s, char const *forItem, char const *file, int line, char const *function)
#define smr_realloc2(smr, old, size, forItem)
double mass_MeV
Definition: MCGIDI.h:251

◆ MCGIDI_particle_initialize()

int MCGIDI_particle_initialize ( statusMessageReporting smr,
MCGIDI_particle particle 
)

Definition at line 31 of file MCGIDI_particle.cc.

31 {
32
33 memset( particle, 0, sizeof( MCGIDI_particle ) );
34 return( 0 );
35}

Referenced by MCGIDI_particle_new().

◆ MCGIDI_particle_new()

MCGIDI_particle * MCGIDI_particle_new ( statusMessageReporting smr)

Definition at line 20 of file MCGIDI_particle.cc.

20 {
21
22 MCGIDI_particle *particle = (MCGIDI_particle *) smr_malloc2( smr, sizeof( MCGIDI_particle ), 0, "particle" );
23
24 if( particle == NULL ) return( NULL );
25 MCGIDI_particle_initialize( smr, particle );
26 return( particle );
27}
int MCGIDI_particle_initialize(statusMessageReporting *, MCGIDI_particle *particle)

Referenced by MCGIDI_particle_getInternalID().

◆ MCGIDI_particle_printInternalSortedList()

int MCGIDI_particle_printInternalSortedList ( statusMessageReporting smr)

Definition at line 159 of file MCGIDI_particle.cc.

159 {
160
161 int i;
162
163 for( i = 0; i < numberOfParticles; i++ ) printf( "%s\n", particleSortedList[i]->name );
164 return( 0 );
165}

◆ MCGIDI_particle_release()

int MCGIDI_particle_release ( statusMessageReporting smr,
MCGIDI_particle particle 
)

Definition at line 62 of file MCGIDI_particle.cc.

62 {
63
64 smr_freeMemory( (void **) &(particle->name) );
65 return( 0 );
66}

Referenced by MCGIDI_particle_free().

◆ MCGIDI_POP_free()

MCGIDI_POP * MCGIDI_POP_free ( MCGIDI_POP pop)

Definition at line 191 of file MCGIDI_pop.cc.

191 {
192
193 if( pop == NULL ) return( NULL );
194 MCGIDI_POP_release( pop );
195 smr_freeMemory( (void **) &pop );
196 return( NULL );
197}
MCGIDI_POP * MCGIDI_POP_release(MCGIDI_POP *pop)
Definition: MCGIDI_pop.cc:201

Referenced by MCGIDI_POPs_release().

◆ MCGIDI_POP_getMass_MeV()

double MCGIDI_POP_getMass_MeV ( MCGIDI_POP pop)

Definition at line 212 of file MCGIDI_pop.cc.

212 {
213
214 return( pop->mass_MeV );
215}

Referenced by MCGIDI_product_getMass_MeV(), MCGIDI_target_heated_getProjectileMass_MeV(), and MCGIDI_target_heated_getTargetMass_MeV().

◆ MCGIDI_POP_new()

MCGIDI_POP * MCGIDI_POP_new ( statusMessageReporting smr,
char const *  name,
double  mass_MeV,
double  level_MeV,
MCGIDI_POP parent 
)

Definition at line 165 of file MCGIDI_pop.cc.

165 {
166
167 int Z, A, m, level;
168 MCGIDI_POP *pop = (MCGIDI_POP *) smr_malloc2( smr, sizeof( MCGIDI_POP ), 0, "pop" );
169
170 if( pop == NULL ) return( NULL );
171 pop->next = NULL;
172 pop->parent = parent;
173 if( ( pop->name = smr_allocateCopyString2( smr, name, "pop->name" ) ) == NULL ) {
174 smr_freeMemory( (void **) &pop );
175 return( NULL );
176 }
177 MCGIDI_miscNameToZAm( smr, name, &Z, &A, &m, &level );
178 pop->Z = Z;
179 pop->A = A;
180 pop->level = level;
181 pop->m = m;
182 pop->mass_MeV = mass_MeV;
183 pop->level_MeV = level_MeV;
184 pop->numberOfGammaBranchs = 0;
185 pop->gammas = NULL;
186 return( pop );
187}
#define smr_allocateCopyString2(smr, s, forItem)
int level
Definition: MCGIDI.h:234
double level_MeV
Definition: MCGIDI.h:236
MCGIDI_POP * next
Definition: MCGIDI.h:230
MCGIDI_GammaBranching * gammas
Definition: MCGIDI.h:238
MCGIDI_POP * parent
Definition: MCGIDI.h:231
int numberOfGammaBranchs
Definition: MCGIDI.h:237

Referenced by MCGIDI_POPs_addParticleIfNeeded().

◆ MCGIDI_POP_release()

MCGIDI_POP * MCGIDI_POP_release ( MCGIDI_POP pop)

Definition at line 201 of file MCGIDI_pop.cc.

201 {
202
203 if( pop == NULL ) return( NULL );
204 smr_freeMemory( (void **) &(pop->name) );
205 pop->numberOfGammaBranchs = 0;
206 if( pop->gammas != NULL ) smr_freeMemory( (void **) &(pop->gammas) );
207 return( NULL );
208}

Referenced by MCGIDI_POP_free().

◆ MCGIDI_POPs_addParticleIfNeeded()

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 at line 67 of file MCGIDI_pop.cc.

68 {
69
70 int i, index;
71 MCGIDI_POP *pop;
72
73 if( ( index = MCGIDI_POPs_findParticleIndex( pops, name ) ) >= 0 ) return( pops->sorted[index] );
74 if( pops->size == pops->numberOfPOPs ) {
75 int size = pops->size + pops->increment;
76 MCGIDI_POP **sorted = (MCGIDI_POP **) smr_malloc2( smr, size * sizeof( MCGIDI_POP * ), 0, "sorted" );
77
78 if( sorted == NULL ) return( NULL );
79 for( i = 0; i < pops->numberOfPOPs; i++ ) sorted[i] = pops->sorted[i];
80 smr_freeMemory( (void **) &(pops->sorted) );
81 pops->sorted = sorted;
82 pops->size = size;
83 }
84 index = -index - 1;
85 if( ( pop = MCGIDI_POP_new( smr, name, mass_MeV, level_MeV, parent ) ) == NULL ) return( NULL );
86 for( i = pops->numberOfPOPs; i > index; i-- ) pops->sorted[i] = pops->sorted[i-1];
87 pops->sorted[index] = pop;
88 if( pops->first == NULL ) {
89 pops->first = pop; }
90 else {
91 pops->last->next = pop;
92 }
93 pops->last = pop;
94 pops->numberOfPOPs++;
95 pop->globalPoPsIndex = -1;
96 if( globalParticle ) {
97 if( ( pop->globalPoPsIndex = lPoPs_addParticleIfNeeded( smr, name, "LLNL" ) ) < 0 ) return( NULL );
98 }
99 return( pop );
100}
MCGIDI_POP * MCGIDI_POP_new(statusMessageReporting *smr, char const *name, double mass_MeV, double level_MeV, MCGIDI_POP *parent)
Definition: MCGIDI_pop.cc:165
int MCGIDI_POPs_findParticleIndex(MCGIDI_POPs *pops, char const *name)
Definition: MCGIDI_pop.cc:104
int lPoPs_addParticleIfNeeded(statusMessageReporting *smr, char const *name, char const *special)
Definition: lPoPs.cc:36
int globalPoPsIndex
Definition: MCGIDI.h:233
int numberOfPOPs
Definition: MCGIDI.h:242
MCGIDI_POP ** sorted
Definition: MCGIDI.h:243
MCGIDI_POP * last
Definition: MCGIDI.h:243
MCGIDI_POP * first
Definition: MCGIDI.h:243
int increment
Definition: MCGIDI.h:242

◆ MCGIDI_POPs_findParticle()

MCGIDI_POP * MCGIDI_POPs_findParticle ( MCGIDI_POPs pops,
char const *  name 
)

Definition at line 133 of file MCGIDI_pop.cc.

133 {
134
135 int index = MCGIDI_POPs_findParticleIndex( pops, name );
136
137 if( index < 0 ) return( NULL );
138 return( pops->sorted[index] );
139}

Referenced by MCGIDI_particle_getInternalID(), MCGIDI_product_parseFromTOM(), and MCGIDI_target_heated_read().

◆ MCGIDI_POPs_findParticleIndex()

int MCGIDI_POPs_findParticleIndex ( MCGIDI_POPs pops,
char const *  name 
)

Definition at line 104 of file MCGIDI_pop.cc.

104 {
105
106 int iCmp = 0, min = 0, mid = 0, max = pops->numberOfPOPs;
107
108 if( max == 0 ) return( -1 );
109 while( ( max - min ) > 1 ) {
110 mid = ( min + max ) / 2;
111 iCmp = strcmp( name, pops->sorted[mid]->name );
112 if( iCmp == 0 ) return( mid );
113 if( iCmp < 0 ) {
114 max = mid; }
115 else {
116 min = mid;
117 }
118 } // Loop checking, 11.05.2015, T. Koi
119 if( max == 1 ) { /* First point is not checked as loop exits when ( max = 1 ) - ( min = 0 ) !> 1 ). */
120 if( strcmp( name, pops->sorted[0]->name ) == 0 ) return( 0 );
121 }
122 if( max < pops->numberOfPOPs ) {
123 if( strcmp( name, pops->sorted[max]->name ) == 0 ) return( max );
124 }
125 if( max == 1 ) {
126 if( strcmp( name, pops->sorted[0]->name ) < 0 ) return( -1 );
127 }
128 return( -max - 1 );
129}

Referenced by MCGIDI_POPs_addParticleIfNeeded(), and MCGIDI_POPs_findParticle().

◆ MCGIDI_POPs_free()

void * MCGIDI_POPs_free ( MCGIDI_POPs pops)

Definition at line 41 of file MCGIDI_pop.cc.

41 {
42
43 if( pops == NULL ) return( NULL );
44 MCGIDI_POPs_release( pops );
45 smr_freeMemory( (void **) &pops );
46 return( NULL );
47}
int MCGIDI_POPs_release(MCGIDI_POPs *pops)
Definition: MCGIDI_pop.cc:51

◆ MCGIDI_POPs_initial()

int MCGIDI_POPs_initial ( statusMessageReporting smr,
MCGIDI_POPs pops,
int  size 
)

Definition at line 30 of file MCGIDI_pop.cc.

30 {
31
32 memset( pops, 0, sizeof( MCGIDI_POPs ) );
33 if( size < 10 ) size = 10;
34 pops->increment = size;
35
36 return( 0 );
37}

Referenced by MCGIDI_POPs_new(), MCGIDI_POPs_release(), and MCGIDI_target_heated_initialize().

◆ MCGIDI_POPs_new()

MCGIDI_POPs * MCGIDI_POPs_new ( statusMessageReporting smr,
int  size 
)

Definition at line 19 of file MCGIDI_pop.cc.

19 {
20
21 MCGIDI_POPs *pops;
22
23 if( ( pops = (MCGIDI_POPs *) smr_malloc2( smr, sizeof( MCGIDI_POPs ), 0, "pops->sorted" ) ) == NULL ) return( NULL );
24 if( MCGIDI_POPs_initial( smr, pops, size ) ) smr_freeMemory( (void **) &pops );
25 return( pops );
26}
int MCGIDI_POPs_initial(statusMessageReporting *, MCGIDI_POPs *pops, int size)
Definition: MCGIDI_pop.cc:30

◆ MCGIDI_POPs_printSortedList()

void MCGIDI_POPs_printSortedList ( MCGIDI_POPs pops)

Definition at line 153 of file MCGIDI_pop.cc.

153 {
154
155 MCGIDI_POPs_writeSortedList( pops, stdout );
156}
void MCGIDI_POPs_writeSortedList(MCGIDI_POPs *pops, FILE *f)
Definition: MCGIDI_pop.cc:143

◆ MCGIDI_POPs_release()

int MCGIDI_POPs_release ( MCGIDI_POPs pops)

Definition at line 51 of file MCGIDI_pop.cc.

51 {
52
53 MCGIDI_POP *pop, *next;
54
55 if( pops == NULL ) return( 0 );
56 for( pop = pops->first; pop != NULL; pop = next ) {
57 next = pop->next;
58 MCGIDI_POP_free( pop );
59 }
60 smr_freeMemory( (void **) &(pops->sorted) );
61 MCGIDI_POPs_initial( NULL, pops, 0 );
62 return( 0 );
63}
MCGIDI_POP * MCGIDI_POP_free(MCGIDI_POP *pop)
Definition: MCGIDI_pop.cc:191

Referenced by MCGIDI_POPs_free(), and MCGIDI_target_heated_release().

◆ MCGIDI_POPs_writeSortedList()

void MCGIDI_POPs_writeSortedList ( MCGIDI_POPs pops,
FILE *  f 
)

Definition at line 143 of file MCGIDI_pop.cc.

143 {
144
145 int i;
146
147 fprintf( f, "POPs Information: n = %d\n", pops->numberOfPOPs );
148 for( i = 0; i < pops->numberOfPOPs; i++ ) fprintf( f, " %-20s %e\n", pops->sorted[i]->name, pops->sorted[i]->mass_MeV );
149}

Referenced by MCGIDI_POPs_printSortedList().

◆ MCGIDI_product_free()

MCGIDI_product * MCGIDI_product_free ( statusMessageReporting smr,
MCGIDI_product product 
)

Definition at line 51 of file MCGIDI_product.cc.

51 {
52
53 MCGIDI_product_release( smr, product );
54 smr_freeMemory( (void **) &product );
55 return( NULL );
56}
int MCGIDI_product_release(statusMessageReporting *smr, MCGIDI_product *product)

Referenced by MCGIDI_product_new().

◆ MCGIDI_product_getDomain()

int MCGIDI_product_getDomain ( statusMessageReporting smr,
MCGIDI_product product,
double *  EMin,
double *  EMax 
)

Definition at line 282 of file MCGIDI_product.cc.

282 {
283
284 return( MCGIDI_outputChannel_getDomain( smr, product->outputChannel, EMin, EMax ) );
285}
int MCGIDI_outputChannel_getDomain(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double *EMin, double *EMax)
MCGIDI_outputChannel * outputChannel
Definition: MCGIDI.h:403

Referenced by MCGIDI_outputChannel_getDomain().

◆ MCGIDI_product_getMass_MeV()

double MCGIDI_product_getMass_MeV ( statusMessageReporting smr,
MCGIDI_product product 
)

Definition at line 297 of file MCGIDI_product.cc.

297 {
298
299 return( MCGIDI_POP_getMass_MeV( product->pop ) );
300}
double MCGIDI_POP_getMass_MeV(MCGIDI_POP *pop)
Definition: MCGIDI_pop.cc:212

Referenced by MCGIDI_outputChannel_parseFromTOM(), and MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_product_getProjectileMass_MeV()

double MCGIDI_product_getProjectileMass_MeV ( statusMessageReporting smr,
MCGIDI_product product 
)

Definition at line 311 of file MCGIDI_product.cc.

311 {
312
314}
double MCGIDI_outputChannel_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)

Referenced by MCGIDI_energy_parseFromTOM(), and MCGIDI_outputChannel_getProjectileMass_MeV().

◆ MCGIDI_product_getTargetHeated()

MCGIDI_target_heated * MCGIDI_product_getTargetHeated ( statusMessageReporting smr,
MCGIDI_product product 
)

Definition at line 304 of file MCGIDI_product.cc.

304 {
305
306 return( MCGIDI_outputChannel_getTargetHeated( smr, product->outputChannel ) );
307}
MCGIDI_target_heated * MCGIDI_outputChannel_getTargetHeated(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)

Referenced by MCGIDI_KalbachMann_parseFromTOM(), and MCGIDI_outputChannel_getTargetHeated().

◆ MCGIDI_product_getTargetMass_MeV()

double MCGIDI_product_getTargetMass_MeV ( statusMessageReporting smr,
MCGIDI_product product 
)

Definition at line 318 of file MCGIDI_product.cc.

318 {
319
320 return( MCGIDI_outputChannel_getTargetMass_MeV( smr, product->outputChannel ) );
321}
double MCGIDI_outputChannel_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)

Referenced by MCGIDI_energy_parseFromTOM(), and MCGIDI_outputChannel_getTargetMass_MeV().

◆ MCGIDI_product_initialize()

int MCGIDI_product_initialize ( statusMessageReporting smr,
MCGIDI_product product 
)

Definition at line 42 of file MCGIDI_product.cc.

42 {
43
44 memset( product, 0, sizeof( MCGIDI_product ) );
45 product->delayedNeutronIndex = -1;
46 return( 0 );
47}

Referenced by MCGIDI_product_new(), MCGIDI_product_parseFromTOM(), and MCGIDI_product_release().

◆ MCGIDI_product_new()

MCGIDI_product * MCGIDI_product_new ( statusMessageReporting smr)

Definition at line 31 of file MCGIDI_product.cc.

31 {
32
33 MCGIDI_product *product;
34
35 if( ( product = (MCGIDI_product *) smr_malloc2( smr, sizeof( MCGIDI_product ), 0, "product" ) ) == NULL ) return( NULL );
36 if( MCGIDI_product_initialize( smr, product ) ) product = MCGIDI_product_free( smr, product );
37 return( product );
38}
int MCGIDI_product_initialize(statusMessageReporting *, MCGIDI_product *product)
MCGIDI_product * MCGIDI_product_free(statusMessageReporting *smr, MCGIDI_product *product)

◆ MCGIDI_product_parseFromTOM()

int MCGIDI_product_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_outputChannel outputChannel,
MCGIDI_POPs pops,
MCGIDI_product product,
int *  delayedNeutronIndex 
)

Definition at line 82 of file MCGIDI_product.cc.

83 {
84
85 char const *name, *label, *delayedNeutron, *multiplicityStr, *multiplicityUnits[2] = { "MeV", "" };
86 xDataTOM_element *multiplicity, *multiplicityTOM, *decayChannelElement;
87 nfu_status status;
88 ptwXYPoints *multiplicityVsEnergy = NULL, *norms1 = NULL, *norms2 = NULL;
89
90 MCGIDI_product_initialize( smr, product );
91
92 product->outputChannel = outputChannel;
93 if( ( name = xDataTOM_getAttributesValueInElement( element, "name" ) ) == NULL ) goto err;
94 if( ( product->pop = MCGIDI_POPs_findParticle( pops, name ) ) == NULL ) {
95 smr_setReportError2( smr, smr_unknownID, 1, "product '%s' not found in pops", name );
96 goto err;
97 }
98 if( ( label = xDataTOM_getAttributesValueInElement( element, "label" ) ) != NULL ) {
99 if( ( product->label = smr_allocateCopyString2( smr, label, "product->label" ) ) == NULL ) goto err;
100 }
101
102 if( ( delayedNeutron = xDataTOM_getAttributesValueInElement( element, "emissionMode" ) ) != NULL ) {
103 if( strcmp( delayedNeutron, "delayed" ) == 0 ) {
104 if( ( delayedNeutron = xDataTOM_getAttributesValueInElement( element, "decayRate" ) ) == NULL ) {
105 goto err;
106 }
107 if( MCGIDI_misc_PQUStringToDoubleInUnitOf( smr, delayedNeutron, "1/s", &(product->delayedNeutronRate) ) != 0 ) goto err;
108 product->delayedNeutronIndex = *delayedNeutronIndex;
109 (*delayedNeutronIndex)++;
110 }
111 }
112
113 if( ( multiplicityStr = xDataTOM_getAttributesValueInElement( element, "multiplicity" ) ) == NULL ) goto err;
114 if( xDataTOME_convertAttributeToInteger( NULL, element, "multiplicity", &(product->multiplicity) ) ) {
115 if( strcmp( multiplicityStr, "energyDependent" ) ) {
116 smr_setReportError2( smr, smr_unknownID, 1, "invalid multiplicity '%s' for product '%s'", multiplicityStr, name );
117 goto err;
118 }
119 if( ( multiplicity = xDataTOME_getOneElementByName( smr, element, "multiplicity", 1 ) ) == NULL ) goto err;
120 if( ( multiplicityTOM = xDataTOME_getOneElementByName( NULL, multiplicity, "weightedReference", 0 ) ) != NULL ) {
121 if( MCGIDI_product_parseWeightedReferenceMultiplicityFromTOM( smr, multiplicityTOM, product, &multiplicityVsEnergy, &norms1 ) ) goto err; }
122 else if( ( multiplicityTOM = xDataTOME_getOneElementByName( NULL, multiplicity, "piecewise", 0 ) ) != NULL ) {
123 if( MCGIDI_product_parsePiecewiseMultiplicity( smr, multiplicityTOM, product ) ) goto err; }
124 else if( ( multiplicityTOM = xDataTOME_getOneElementByName( NULL, multiplicity, "polynomial", 0 ) ) != NULL ) {
125 if( ( multiplicityVsEnergy = MCGIDI_product_parsePolynomialMultiplicity( smr, multiplicityTOM, product ) ) == NULL ) goto err; }
126 else {
127/* ??????? Need to check interpolation. */
128 if( ( multiplicityTOM = xDataTOME_getOneElementByName( smr, multiplicity, "pointwise", 1 ) ) == NULL ) goto err;
129 if( ( multiplicityVsEnergy = MCGIDI_misc_dataFromElement2ptwXYPointsInUnitsOf( smr, multiplicityTOM, multiplicityUnits ) ) == NULL ) goto err;
130 }
131 }
132
133 if( strcmp( product->pop->name, "gamma" ) == 0 ) {
134 if( ( norms2 = ptwXY_new( ptwXY_interpolationLinLin, NULL, 2., 1e-3, 200, 10, &status, 0 ) ) == NULL ) {
135 smr_setReportError2( smr, smr_unknownID, 1, "ptwXY_new err = %d: %s\n", status, nfu_statusMessage( status ) );
136 goto err;
137 }
138 }
139 if( MCGIDI_distribution_parseFromTOM( smr, element, product, pops, norms2 ) ) goto err;
140 if( norms2 != NULL ) {
141 if( ptwXY_length( norms2 ) < 2 ) {
142 norms2 = ptwXY_free( norms2 ); }
143 else {
144 if( ptwXY_simpleCoalescePoints( norms2 ) != nfu_Okay ) goto err;
145 if( ( ptwXY_getYMin( norms2 ) > 0.99 ) && ( ptwXY_getYMax( norms2 ) < 1.01 ) ) norms2 = ptwXY_free( norms2 );
146 }
147 }
148 if( ( norms1 != NULL ) && ( norms2 != NULL ) ) {
149 smr_setReportError2p( smr, smr_unknownID, 1, "norm1 and norm2 are both not NULL" );
150 goto err;
151 }
152
153 product->multiplicityVsEnergy = multiplicityVsEnergy;
154 product->norms = norms1;
155 if( norms2 != NULL ) product->norms = norms2;
156
157 if( ( decayChannelElement = xDataTOME_getOneElementByName( NULL, element, "decayChannel", 0 ) ) != NULL ) {
158 if( MCGIDI_outputChannel_parseFromTOM( smr, decayChannelElement, pops, &(product->decayChannel), NULL, product ) ) goto err;
159 }
160
161 return( 0 );
162
163err:
164 if( multiplicityVsEnergy != NULL ) ptwXY_free( multiplicityVsEnergy );
165 if( norms1 != NULL ) ptwXY_free( norms1 );
166 if( norms2 != NULL ) ptwXY_free( norms2 );
167 MCGIDI_product_release( smr, product );
168 return( 1 );
169}
int MCGIDI_distribution_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_product *product, MCGIDI_POPs *pops, ptwXYPoints *norms)
int MCGIDI_outputChannel_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_POPs *pops, MCGIDI_outputChannel *outputChannel, MCGIDI_reaction *reaction, MCGIDI_product *parent)
ptwXYPoints * MCGIDI_misc_dataFromElement2ptwXYPointsInUnitsOf(statusMessageReporting *smr, xDataTOM_element *linear, char const *toUnits[2])
Definition: MCGIDI_misc.cc:424
const char * name(G4int ptype)
double ptwXY_getYMax(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1269
ptwXYPoints * ptwXY_new(ptwXY_interpolation interpolation, ptwXY_interpolationOtherInfo const *interpolationOtherInfo, double biSectionMax, double accuracy, int64_t primarySize, int64_t secondarySize, nfu_status *status, int userFlag)
Definition: ptwXY_core.cc:29
double ptwXY_getYMin(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1248
ptwXYPoints * norms
Definition: MCGIDI.h:408
char * label
Definition: MCGIDI.h:402
ptwXYPoints * multiplicityVsEnergy
Definition: MCGIDI.h:407
int xDataTOME_convertAttributeToInteger(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int *n)
Definition: xDataTOM.cc:300

Referenced by MCGIDI_outputChannel_parseFromTOM().

◆ MCGIDI_product_release()

int MCGIDI_product_release ( statusMessageReporting smr,
MCGIDI_product product 
)

Definition at line 60 of file MCGIDI_product.cc.

60 {
61
62 int i;
63
64 if( product->label != NULL ) smr_freeMemory( (void **) &(product->label) );
65
66 if( product->multiplicityVsEnergy != NULL ) ptwXY_free( product->multiplicityVsEnergy );
67 if( product->piecewiseMultiplicities != NULL ) {
68 for( i = 0; i < product->numberOfPiecewiseMultiplicities; i++ ) ptwXY_free( product->piecewiseMultiplicities[i] );
69 smr_freeMemory( (void **) &(product->piecewiseMultiplicities) );
70 }
71 if( product->norms != NULL ) ptwXY_free( product->norms );
72
73 MCGIDI_distribution_release( smr, &(product->distribution) );
75
76 MCGIDI_product_initialize( smr, product );
77 return( 0 );
78}
int MCGIDI_distribution_release(statusMessageReporting *smr, MCGIDI_distribution *distribution)
int MCGIDI_outputChannel_release(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int numberOfPiecewiseMultiplicities
Definition: MCGIDI.h:409
ptwXYPoints ** piecewiseMultiplicities
Definition: MCGIDI.h:410

Referenced by MCGIDI_outputChannel_release(), MCGIDI_product_free(), and MCGIDI_product_parseFromTOM().

◆ MCGIDI_product_sampleMu()

int MCGIDI_product_sampleMu ( statusMessageReporting smr,
MCGIDI_product product,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo 
)

Definition at line 348 of file MCGIDI_product.cc.

349 {
350
352 smr_setReportError2( smr, smr_unknownID, 1, "product distribution is not angular: type = %d", product->distribution.type );
353 return( 1 );
354 }
355 return( MCGIDI_angular_sampleMu( smr, product->distribution.angular, modes, decaySamplingInfo ) );
356}

Referenced by G4GIDI_target::getElasticFinalState().

◆ MCGIDI_product_sampleMultiplicity()

int MCGIDI_product_sampleMultiplicity ( statusMessageReporting smr,
MCGIDI_product product,
double  e_in,
double  r 
)

Definition at line 325 of file MCGIDI_product.cc.

325 {
326
327 int i, multiplicity;
328 double y, norm = 1.0;
329 ptwXYPoints *ptwXY = product->multiplicityVsEnergy;
330
331 if( product->piecewiseMultiplicities != NULL ) {
332 for( i = 0; i < product->numberOfPiecewiseMultiplicities - 1; i++ ) {
333 if( e_in < ptwXY_getXMax( product->piecewiseMultiplicities[i] ) ) break;
334 }
335 ptwXY = product->piecewiseMultiplicities[i];
336 }
337 y = MCGIDI_sampling_ptwXY_getValueAtX( ptwXY, e_in );
338 if( product->norms != NULL ) norm = MCGIDI_sampling_ptwXY_getValueAtX( product->norms, e_in );
339 y *= norm;
340 multiplicity = (int) y;
341 if( r < ( y - multiplicity ) ) multiplicity++;
342
343 return( multiplicity );
344}
double ptwXY_getXMax(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1239

Referenced by MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_product_setTwoBodyMasses()

int MCGIDI_product_setTwoBodyMasses ( statusMessageReporting smr,
MCGIDI_product product,
double  projectileMass_MeV,
double  targetMass_MeV,
double  productMass_MeV,
double  residualMass_MeV 
)

Definition at line 289 of file MCGIDI_product.cc.

290 {
291
292 return( MCGIDI_angular_setTwoBodyMasses( smr, product->distribution.angular, projectileMass_MeV, targetMass_MeV, productMass_MeV, residualMass_MeV ) );
293}
int MCGIDI_angular_setTwoBodyMasses(statusMessageReporting *smr, MCGIDI_angular *angular, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)

Referenced by MCGIDI_outputChannel_parseFromTOM().

◆ MCGIDI_productsInfo_getIntegerMultiplicityAtIndex()

int MCGIDI_productsInfo_getIntegerMultiplicityAtIndex ( MCGIDI_productsInfo productsInfo,
int  index 
)

Definition at line 550 of file MCGIDI_reaction.cc.

550 {
551
552 if( ( index < 0 ) || ( index >= productsInfo->numberOfProducts ) ) return( -1 );
553 return( productsInfo->productInfo[index].multiplicity );
554}
MCGIDI_productInfo * productInfo
Definition: MCGIDI.h:275

◆ MCGIDI_productsInfo_getMultiplicityTypeAtIndex()

enum MCGIDI_productMultiplicityType MCGIDI_productsInfo_getMultiplicityTypeAtIndex ( MCGIDI_productsInfo productsInfo,
int  index 
)

Definition at line 542 of file MCGIDI_reaction.cc.

542 {
543
544 if( ( index < 0 ) || ( index >= productsInfo->numberOfProducts ) ) return( MCGIDI_productMultiplicityType_invalid_e );
545 return( productsInfo->productInfo[index].productMultiplicityType );
546}
enum MCGIDI_productMultiplicityType productMultiplicityType
Definition: MCGIDI.h:267

◆ MCGIDI_productsInfo_getNumberOfUniqueProducts()

int MCGIDI_productsInfo_getNumberOfUniqueProducts ( MCGIDI_productsInfo productsInfo)

Definition at line 527 of file MCGIDI_reaction.cc.

527 {
528
529 return( productsInfo->numberOfProducts );
530}

◆ MCGIDI_productsInfo_getPoPsIndexAtIndex()

int MCGIDI_productsInfo_getPoPsIndexAtIndex ( MCGIDI_productsInfo productsInfo,
int  index 
)

Definition at line 534 of file MCGIDI_reaction.cc.

534 {
535
536 if( ( index < 0 ) || ( index >= productsInfo->numberOfProducts ) ) return( -1 );
537 return( productsInfo->productInfo[index].globalPoPsIndex );
538}

◆ MCGIDI_productsInfo_getTransportableAtIndex()

int MCGIDI_productsInfo_getTransportableAtIndex ( MCGIDI_productsInfo productsInfo,
int  index 
)

Definition at line 558 of file MCGIDI_reaction.cc.

558 {
559
560 if( ( index < 0 ) || ( index >= productsInfo->numberOfProducts ) ) return( -1 );
561 return( productsInfo->productInfo[index].transportable );
562}

◆ MCGIDI_reaction_fixDomains()

int MCGIDI_reaction_fixDomains ( statusMessageReporting smr,
MCGIDI_reaction reaction,
double  EMin,
double  EMax,
nfu_status status 
)

Definition at line 366 of file MCGIDI_reaction.cc.

366 {
367
368 double lowerEps = 1e-14, upperEps = -1e-14;
369
370 if( reaction->EMin == EMin ) lowerEps = 0.;
371 if( reaction->EMax == EMax ) upperEps = 0.;
372 if( ( lowerEps == 0. ) && ( upperEps == 0. ) ) return( 0 );
373
374 *status = ptwXY_dullEdges( reaction->crossSection, lowerEps, upperEps, 1 );
375 return( *status != nfu_Okay );
376}
nfu_status ptwXY_dullEdges(ptwXYPoints *ptwXY, double lowerEps, double upperEps, int positiveXOnly)
ptwXYPoints * crossSection
Definition: MCGIDI.h:426

Referenced by MCGIDI_target_heated_read().

◆ MCGIDI_reaction_free()

MCGIDI_reaction * MCGIDI_reaction_free ( statusMessageReporting smr,
MCGIDI_reaction reaction 
)

Definition at line 60 of file MCGIDI_reaction.cc.

60 {
61
62 MCGIDI_reaction_release( smr, reaction );
63 smr_freeMemory( (void **) &reaction );
64 return( NULL );
65}
int MCGIDI_reaction_release(statusMessageReporting *smr, MCGIDI_reaction *reaction)

Referenced by MCGIDI_reaction_new().

◆ MCGIDI_reaction_getCrossSectionAtE()

double MCGIDI_reaction_getCrossSectionAtE ( statusMessageReporting smr,
MCGIDI_reaction reaction,
MCGIDI_quantitiesLookupModes modes,
bool  sampling 
)

Definition at line 380 of file MCGIDI_reaction.cc.

381 {
382
383 double e_in = modes.getProjectileEnergy( ), xsec;
384
386 if( e_in < reaction->EMin ) e_in = reaction->EMin;
387 if( e_in > reaction->EMax ) e_in = reaction->EMax;
388 ptwXY_getValueAtX( reaction->crossSection, e_in, &xsec ); }
390 int index = modes.getGroupIndex( );
391 double *xSecP = ptwX_getPointAtIndex( reaction->crossSectionGrouped, index );
392
393 if( xSecP != NULL ) {
394 xsec = *xSecP;
395 if( sampling && ( index == reaction->thresholdGroupIndex ) ) xsec += reaction->thresholdGroupedDeltaCrossSection; }
396 else {
397 xsec = 0.;
398 smr_setReportError2( smr, smr_unknownID, 1, "Invalid cross section group index %d", index );
399 } }
400 else {
401 xsec = 0.;
402 }
403 return( xsec );
404}
int getGroupIndex(void) const
Definition: MCGIDI.h:100
enum MCGIDI_quantityLookupMode getCrossSectionMode(void) const
Definition: MCGIDI.h:107
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
int thresholdGroupIndex
Definition: MCGIDI.h:422
double thresholdGroupedDeltaCrossSection
Definition: MCGIDI.h:424
ptwXPoints * crossSectionGrouped
Definition: MCGIDI.h:427

Referenced by MCGIDI_target_heated_getIndexReactionCrossSectionAtE().

◆ MCGIDI_reaction_getDomain()

int MCGIDI_reaction_getDomain ( statusMessageReporting smr,
MCGIDI_reaction reaction,
double *  EMin,
double *  EMax 
)

Definition at line 350 of file MCGIDI_reaction.cc.

350 {
351/*
352* Return value
353* < 0 No cross section data.
354* == 0 Okay and EMin and EMax set.
355* > 0 error, EMin and EMax undefined.
356*/
357
358 if( !reaction->domainValuesPresent ) return( -1 );
359 *EMin = reaction->EMin;
360 *EMax = reaction->EMax;
361 return( 0 );
362}
int domainValuesPresent
Definition: MCGIDI.h:421

Referenced by MCGIDI_outputChannel_getDomain(), and MCGIDI_target_heated_read().

◆ MCGIDI_reaction_getENDF_MTNumber()

int MCGIDI_reaction_getENDF_MTNumber ( MCGIDI_reaction reaction)

Definition at line 415 of file MCGIDI_reaction.cc.

415 {
416
417 return( reaction->ENDF_MT );
418}

Referenced by G4GIDI_target::init().

◆ MCGIDI_reaction_getENDL_CSNumbers()

int MCGIDI_reaction_getENDL_CSNumbers ( MCGIDI_reaction reaction,
int *  S 
)

Definition at line 422 of file MCGIDI_reaction.cc.

422 {
423
424 if( S != NULL ) *S = reaction->ENDL_S;
425 return( reaction->ENDL_C );
426}
G4double S(G4double temp)

◆ MCGIDI_reaction_getFinalQ()

double MCGIDI_reaction_getFinalQ ( statusMessageReporting smr,
MCGIDI_reaction reaction,
MCGIDI_quantitiesLookupModes modes 
)

Definition at line 408 of file MCGIDI_reaction.cc.

408 {
409
410 return( reaction->finalQ );
411}
double finalQ
Definition: MCGIDI.h:425

Referenced by MCGIDI_target_heated_getIndexReactionFinalQ().

◆ MCGIDI_reaction_getProductsInfo()

MCGIDI_productsInfo * MCGIDI_reaction_getProductsInfo ( MCGIDI_reaction reaction)

Definition at line 489 of file MCGIDI_reaction.cc.

489 {
490
491 return( &(reaction->productsInfo) );
492}
MCGIDI_productsInfo productsInfo
Definition: MCGIDI.h:429

◆ MCGIDI_reaction_getProjectileMass_MeV()

double MCGIDI_reaction_getProjectileMass_MeV ( statusMessageReporting smr,
MCGIDI_reaction reaction 
)

Definition at line 336 of file MCGIDI_reaction.cc.

336 {
337
338 return( MCGIDI_target_heated_getProjectileMass_MeV( smr, reaction->target ) );
339}
double MCGIDI_target_heated_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_target_heated *target)
MCGIDI_target_heated * target
Definition: MCGIDI.h:416

Referenced by MCGIDI_outputChannel_getProjectileMass_MeV(), MCGIDI_outputChannel_parseFromTOM(), and MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_reaction_getReactionType()

enum MCGIDI_reactionType MCGIDI_reaction_getReactionType ( statusMessageReporting smr,
MCGIDI_reaction reaction 
)

Definition at line 322 of file MCGIDI_reaction.cc.

322 {
323
324 return( reaction->reactionType );
325}
enum MCGIDI_reactionType reactionType
Definition: MCGIDI.h:418

Referenced by MCGIDI_target_getReactionTypeAtIndex().

◆ MCGIDI_reaction_getTargetHeated()

MCGIDI_target_heated * MCGIDI_reaction_getTargetHeated ( statusMessageReporting smr,
MCGIDI_reaction reaction 
)

Definition at line 329 of file MCGIDI_reaction.cc.

329 {
330
331 return( reaction->target );
332}

Referenced by MCGIDI_outputChannel_getTargetHeated().

◆ MCGIDI_reaction_getTargetMass_MeV()

double MCGIDI_reaction_getTargetMass_MeV ( statusMessageReporting smr,
MCGIDI_reaction reaction 
)

Definition at line 343 of file MCGIDI_reaction.cc.

343 {
344
345 return( MCGIDI_target_heated_getTargetMass_MeV( smr, reaction->target ) );
346}
double MCGIDI_target_heated_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_target_heated *target)

Referenced by MCGIDI_outputChannel_getTargetMass_MeV(), MCGIDI_outputChannel_parseFromTOM(), and MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_reaction_initialize()

int MCGIDI_reaction_initialize ( statusMessageReporting smr,
MCGIDI_reaction reaction 
)

Definition at line 42 of file MCGIDI_reaction.cc.

42 {
43
44 if( MCGIDI_reaction_initialize2( smr, reaction ) != 0 ) return( 1 );
46 return( 0 );
47}
std::map< int, enum GIDI::MCGIDI_transportability > transportabilitiesMap
Definition: MCGIDI.h:171
transportabilitiesMap * transportabilities
Definition: MCGIDI.h:430

Referenced by MCGIDI_reaction_new(), and MCGIDI_reaction_parseFromTOM().

◆ MCGIDI_reaction_new()

MCGIDI_reaction * MCGIDI_reaction_new ( statusMessageReporting smr)

Definition at line 31 of file MCGIDI_reaction.cc.

31 {
32
33 MCGIDI_reaction *reaction;
34
35 if( ( reaction = (MCGIDI_reaction *) smr_malloc2( smr, sizeof( MCGIDI_reaction ), 0, "reaction" ) ) == NULL ) return( NULL );
36 if( MCGIDI_reaction_initialize( smr, reaction ) ) reaction = MCGIDI_reaction_free( smr, reaction );
37 return( reaction );
38}
int MCGIDI_reaction_initialize(statusMessageReporting *smr, MCGIDI_reaction *reaction)
MCGIDI_reaction * MCGIDI_reaction_free(statusMessageReporting *smr, MCGIDI_reaction *reaction)

◆ MCGIDI_reaction_parseFromTOM()

int MCGIDI_reaction_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_target_heated target,
MCGIDI_POPs pops,
MCGIDI_reaction reaction 
)

Definition at line 84 of file MCGIDI_reaction.cc.

85 {
86
87 xDataTOM_element *child, *linear, *outputChannel;
88 enum xDataTOM_interpolationFlag independent, dependent;
90 char const *outputChannelStr, *crossSectionUnits[2] = { "MeV", "b" };
91
92 MCGIDI_reaction_initialize( smr, reaction );
93
94 reaction->target = target;
96 if( xDataTOME_copyAttributionList( smr, &(reaction->attributes), element ) ) goto err;
97 if( xDataTOME_convertAttributeToInteger( smr, element, "ENDF_MT", &(reaction->ENDF_MT) ) ) goto err;
98 if( ( outputChannelStr = xDataTOM_getAttributesValueInElement( element, "outputChannel" ) ) == NULL ) goto err;
99 if( ( reaction->outputChannelStr = smr_allocateCopyString2( smr, outputChannelStr, "reaction->outputChannelStr" ) ) == NULL ) goto err;
100
101 if( ( child = xDataTOME_getOneElementByName( smr, element, "crossSection", 1 ) ) == NULL ) goto err;
102 if( ( linear = xDataTOME_getOneElementByName( smr, child, "linear", 0 ) ) == NULL ) {
103 if( ( linear = xDataTOME_getOneElementByName( smr, child, "pointwise", 1 ) ) == NULL ) goto err;
104 }
105 if( xDataTOME_getInterpolation( smr, linear, 0, &independent, &dependent, &qualifier ) ) goto err;
106 if( ( independent != xDataTOM_interpolationFlag_linear ) || ( dependent != xDataTOM_interpolationFlag_linear ) ) {
107 smr_setReportError2( smr, smr_unknownID, 1, "cross section interpolation (%d,%d) is not linear-linear", independent, dependent );
108 goto err;
109 }
110 if( ( reaction->crossSection = MCGIDI_misc_dataFromElement2ptwXYPointsInUnitsOf( smr, linear, crossSectionUnits ) ) == NULL ) goto err;
111 reaction->domainValuesPresent = 1;
112 reaction->EMin = ptwXY_getXMin( reaction->crossSection );
113 reaction->EMax = ptwXY_getXMax( reaction->crossSection );
114
115 if( ( outputChannel = xDataTOME_getOneElementByName( smr, element, "outputChannel", 1 ) ) == NULL ) goto err;
116 if( MCGIDI_outputChannel_parseFromTOM( smr, outputChannel, pops, &(reaction->outputChannel), reaction, NULL ) ) goto err;
117
118 if( MCGIDI_reaction_ParseReactionTypeAndDetermineProducts( smr, pops, reaction ) != 0 ) goto err;
119
120 return( 0 );
121
122err:
123 MCGIDI_reaction_release( smr, reaction );
124 return( 1 );
125}
double ptwXY_getXMin(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1206
xDataTOM_attributionList attributes
Definition: MCGIDI.h:420
char const * outputChannelStr
Definition: MCGIDI.h:419
MCGIDI_outputChannel outputChannel
Definition: MCGIDI.h:428
int xDataTOME_copyAttributionList(statusMessageReporting *smr, xDataTOM_attributionList *desc, xDataTOM_element *element)
Definition: xDataTOM.cc:293
xDataTOM_interpolationFlag
Definition: xDataTOM.h:19
@ xDataTOM_interpolationFlag_linear
Definition: xDataTOM.h:19
int xDataTOME_getInterpolation(statusMessageReporting *smr, xDataTOM_element *element, int index, enum xDataTOM_interpolationFlag *independent, enum xDataTOM_interpolationFlag *dependent, enum xDataTOM_interpolationQualifier *qualifier)
Definition: xDataTOM.cc:314
xDataTOM_interpolationQualifier
Definition: xDataTOM.h:21

◆ MCGIDI_reaction_recast()

int MCGIDI_reaction_recast ( statusMessageReporting smr,
MCGIDI_reaction reaction,
GIDI_settings settings,
GIDI_settings_particle const *  projectileSettings,
double  temperature_MeV,
ptwXPoints totalGroupedCrossSection 
)

Definition at line 496 of file MCGIDI_reaction.cc.

497 {
498
499 if( totalGroupedCrossSection != NULL ) {
500 nfu_status status_nf;
501 GIDI_settings_group group( projectileSettings->getGroup( ) );
502
503 if( reaction->crossSectionGrouped != NULL ) reaction->crossSectionGrouped = ptwX_free( reaction->crossSectionGrouped );
504 if( ( reaction->crossSectionGrouped = projectileSettings->groupFunction( smr, reaction->crossSection, temperature_MeV, 0 ) ) == NULL ) return( 1 );
505 if( ( status_nf = ptwX_add_ptwX( totalGroupedCrossSection, reaction->crossSectionGrouped ) ) != nfu_Okay ) return( 1 );
506
508 reaction->thresholdGroupIndex = group.getGroupIndexFromEnergy( reaction->EMin, false );
509 if( reaction->thresholdGroupIndex > -1 ) {
510 reaction->thresholdGroupDomain = group[reaction->thresholdGroupIndex+1] - reaction->EMin;
511 if( reaction->thresholdGroupDomain > 0 ) {
512 /* factor 2 for linear reject in bin but above threshold. */
514 ( 2 * ( group[reaction->thresholdGroupIndex+1] - group[reaction->thresholdGroupIndex] ) / reaction->thresholdGroupDomain - 1 );
515 }
516 }
517 }
518 return( 0 );
519}
nfu_status ptwX_add_ptwX(ptwXPoints *ptwX1, ptwXPoints *ptwX2)
Definition: ptwX_core.cc:479
double thresholdGroupDomain
Definition: MCGIDI.h:423

Referenced by MCGIDI_target_heated_recast().

◆ MCGIDI_reaction_release()

int MCGIDI_reaction_release ( statusMessageReporting smr,
MCGIDI_reaction reaction 
)

Definition at line 69 of file MCGIDI_reaction.cc.

69 {
70
71 ptwXY_free( reaction->crossSection );
72 ptwX_free( reaction->crossSectionGrouped );
74 xDataTOMAL_release( &(reaction->attributes) );
75 smr_freeMemory( (void **) &(reaction->outputChannelStr) );
76 if( reaction->productsInfo.productInfo != NULL ) smr_freeMemory( (void **) &(reaction->productsInfo.productInfo) );
77 delete reaction->transportabilities;
78 MCGIDI_reaction_initialize2( smr, reaction );
79 return( 0 );
80}
void xDataTOMAL_release(xDataTOM_attributionList *attributes)
Definition: xDataTOM.cc:361

Referenced by MCGIDI_reaction_free(), MCGIDI_reaction_parseFromTOM(), and MCGIDI_target_heated_release().

◆ MCGIDI_sampledProducts_addProduct()

int MCGIDI_sampledProducts_addProduct ( statusMessageReporting smr,
MCGIDI_sampledProductsDatas sampledProductsDatas,
MCGIDI_sampledProductsData sampledProductsData 
)

Definition at line 398 of file MCGIDI_product.cc.

398 {
399
400 if( sampledProductsDatas->numberOfProducts == sampledProductsDatas->numberAllocated ) {
401 if( ( MCGIDI_sampledProducts_remalloc( smr, sampledProductsDatas ) ) != 0 ) return( 1 );
402 }
403 sampledProductsDatas->products[sampledProductsDatas->numberOfProducts] = *sampledProductsData;
404 sampledProductsDatas->numberOfProducts++;
405 return( 0 );
406}
int MCGIDI_sampledProducts_remalloc(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas)
MCGIDI_sampledProductsData * products
Definition: MCGIDI.h:294

Referenced by MCGIDI_outputChannel_sampleProductsAtE(), and MCGIDI_target_sampleNullReactionProductsAtE().

◆ MCGIDI_sampledProducts_getProductAtIndex()

MCGIDI_sampledProductsData * MCGIDI_sampledProducts_getProductAtIndex ( MCGIDI_sampledProductsDatas sampledProductsDatas,
int  index 
)

Definition at line 417 of file MCGIDI_product.cc.

417 {
418
419 if( index < 0 ) return( NULL );
420 if( index >= sampledProductsDatas->numberOfProducts ) return( NULL );
421 return( &(sampledProductsDatas->products[index]) );
422}

◆ MCGIDI_sampledProducts_initialize()

int MCGIDI_sampledProducts_initialize ( statusMessageReporting smr,
MCGIDI_sampledProductsDatas sampledProductsDatas,
int  incrementSize 
)

Definition at line 362 of file MCGIDI_product.cc.

362 {
363
364 if( incrementSize < 10 ) incrementSize = 10;
365 sampledProductsDatas->numberOfProducts = 0;
366 sampledProductsDatas->numberAllocated = 0;
367 sampledProductsDatas->incrementSize = incrementSize;
368 sampledProductsDatas->products = NULL;
369 return( MCGIDI_sampledProducts_remalloc( smr, sampledProductsDatas ) );
370}

Referenced by G4GIDI_target::getFinalState().

◆ MCGIDI_sampledProducts_number()

int MCGIDI_sampledProducts_number ( MCGIDI_sampledProductsDatas sampledProductsDatas)

Definition at line 410 of file MCGIDI_product.cc.

410 {
411
412 return( sampledProductsDatas->numberOfProducts );
413}

◆ MCGIDI_sampledProducts_release()

int MCGIDI_sampledProducts_release ( statusMessageReporting smr,
MCGIDI_sampledProductsDatas sampledProductsDatas 
)

Definition at line 374 of file MCGIDI_product.cc.

374 {
375
376 smr_freeMemory( (void **) &(sampledProductsDatas->products) );
377 return( 0 );
378}

Referenced by G4GIDI_target::getFinalState().

◆ MCGIDI_sampledProducts_remalloc()

int MCGIDI_sampledProducts_remalloc ( statusMessageReporting smr,
MCGIDI_sampledProductsDatas sampledProductsDatas 
)

Definition at line 382 of file MCGIDI_product.cc.

382 {
383
384 int size = sampledProductsDatas->numberAllocated + sampledProductsDatas->incrementSize;
385
386 if( ( sampledProductsDatas->products = (MCGIDI_sampledProductsData *) smr_realloc2( smr, sampledProductsDatas->products,
387 size * sizeof( MCGIDI_sampledProductsData ), "products" ) ) != NULL ) {
388 sampledProductsDatas->numberAllocated = size;
389 return( 0 );
390 }
391 sampledProductsDatas->numberOfProducts = 0;
392 sampledProductsDatas->numberAllocated = 0;
393 return( 1 );
394}

Referenced by MCGIDI_sampledProducts_addProduct(), and MCGIDI_sampledProducts_initialize().

◆ MCGIDI_sampling_doubleDistribution()

int MCGIDI_sampling_doubleDistribution ( statusMessageReporting smr,
MCGIDI_pdfsOfXGivenW pdfOfWGivenV,
MCGIDI_pdfsOfXGivenW pdfOfXGivenVAndW,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo 
)

Definition at line 141 of file MCGIDI_sampling.cc.

142 {
143
144 int iV;
145 double e_in = modes.getProjectileEnergy( );
146 double randomW = decaySamplingInfo->rng( decaySamplingInfo->rngState ), randomX = decaySamplingInfo->rng( decaySamplingInfo->rngState );
147 MCGIDI_pdfsOfXGivenW_sampled sampledX, sampledW;
148 ptwXY_interpolation interpolationWY = pdfOfWGivenV->interpolationWY;
149
150 sampledX.smr = smr;
151 sampledW.smr = smr;
152 sampledW.interpolationXY = pdfOfWGivenV->interpolationXY;
153 iV = MCGIDI_misc_binarySearch( pdfOfWGivenV->numberOfWs, pdfOfWGivenV->Ws, e_in );
154 if( iV < 0 ) {
155 interpolationWY = ptwXY_interpolationFlat;
156 if( iV == -2 ) {
157 iV = 0; }
158 else {
159 iV = pdfOfWGivenV->numberOfWs - 1;
160 }
161 e_in = pdfOfWGivenV->Ws[iV];
162 }
163
164 MCGIDI_sampling_sampleX_from_pdfOfX( &(pdfOfWGivenV->dist[iV]), &sampledW, randomW );
165 sampledX.w = sampledW.x;
166 MCGIDI_sampling_sampleX_from_pdfsOfXGivenW( &(pdfOfXGivenVAndW[iV]), &sampledX, randomX );
167
168 if( interpolationWY != ptwXY_interpolationFlat ) {
169 double x = sampledX.x, w = sampledW.x, Vs[3] = { e_in, pdfOfWGivenV->Ws[iV], pdfOfWGivenV->Ws[iV+1] };
170
171 MCGIDI_sampling_sampleX_from_pdfOfX( &(pdfOfWGivenV->dist[iV+1]), &sampledW, randomW );
172 sampledX.w = sampledW.x;
173 MCGIDI_sampling_sampleX_from_pdfsOfXGivenW( &(pdfOfXGivenVAndW[iV+1]), &sampledX, randomX );
174
175 MCGIDI_sampling_interpolationValues( smr, interpolationWY, Vs, w, sampledW.x, &sampledW.x );
176 MCGIDI_sampling_interpolationValues( smr, interpolationWY, Vs, x, sampledX.x, &sampledX.x );
177 }
178
179 decaySamplingInfo->mu = sampledW.x;
180 decaySamplingInfo->Ep = sampledX.x;
181
182 return( 0 );
183}
xDataTOM_Int MCGIDI_misc_binarySearch(xDataTOM_Int n, double *ds, double d)
Definition: MCGIDI_misc.cc:228
int MCGIDI_sampling_sampleX_from_pdfOfX(MCGIDI_pdfOfX *dist, MCGIDI_pdfsOfXGivenW_sampled *sampled, double rngValue)
int MCGIDI_sampling_interpolationValues(statusMessageReporting *smr, ptwXY_interpolation interpolation, double *ws, double y1, double y2, double *y)
int MCGIDI_sampling_sampleX_from_pdfsOfXGivenW(MCGIDI_pdfsOfXGivenW *dists, MCGIDI_pdfsOfXGivenW_sampled *sampled, double rngValue)

Referenced by MCGIDI_angularEnergy_sampleDistribution(), and MCGIDI_energyAngular_sampleDistribution().

◆ MCGIDI_sampling_interpolationValues()

int MCGIDI_sampling_interpolationValues ( statusMessageReporting smr,
ptwXY_interpolation  interpolation,
double *  ws,
double  y1,
double  y2,
double *  y 
)

Definition at line 187 of file MCGIDI_sampling.cc.

187 {
188
189 double frac;
190
191 if( interpolation == ptwXY_interpolationLinLin ) {
192 frac = ( ws[2] - ws[0] ) / ( ws[2] - ws[1] );
193 *y = frac * y1 + ( 1 - frac ) * y2; }
194 else if( interpolation == ptwXY_interpolationLogLin ) {
195 frac = G4Log( ws[2] / ws[0] ) / G4Log( ws[2] / ws[1] );
196 *y = frac * y1 + ( 1 - frac ) * y2; }
197 else if( interpolation == ptwXY_interpolationLinLog ) {
198 frac = ( ws[2] - ws[0] ) / ( ws[2] - ws[1] );
199 *y = y1 * G4Pow::GetInstance()->powA( y2 / y1, frac ); }
200 else if( interpolation == ptwXY_interpolationLogLog ) {
201 frac = G4Log( ws[2] / ws[0] ) / G4Log( ws[2] / ws[1] );
202 *y = y2 * G4Pow::GetInstance()->powA( y2 / y1, frac ); }
203 else { // This should never happen.
204 smr_setReportError2( smr, smr_unknownID, 1, "bad interpolation = %d\n", interpolation );
205 return( 1 );
206 }
207 return( 0 );
208}
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:230
@ ptwXY_interpolationLinLog
Definition: ptwXY.h:35
@ ptwXY_interpolationLogLog
Definition: ptwXY.h:35
@ ptwXY_interpolationLogLin
Definition: ptwXY.h:35

Referenced by MCGIDI_sampling_doubleDistribution().

◆ MCGIDI_sampling_pdfsOfX_release()

int MCGIDI_sampling_pdfsOfX_release ( statusMessageReporting smr,
MCGIDI_pdfOfX dist 
)

Definition at line 41 of file MCGIDI_sampling.cc.

41 {
42
43 smr_freeMemory( (void **) &(dist->Xs) );
44 return( 0 );
45}

Referenced by MCGIDI_energy_release(), and MCGIDI_sampling_pdfsOfXGivenW_release().

◆ MCGIDI_sampling_pdfsOfXGivenW_initialize()

int MCGIDI_sampling_pdfsOfXGivenW_initialize ( statusMessageReporting smr,
MCGIDI_pdfsOfXGivenW dists 
)

Definition at line 20 of file MCGIDI_sampling.cc.

20 {
21
22 memset( dists, 0, sizeof( MCGIDI_pdfsOfXGivenW ) );
23 return( 0 );
24}

Referenced by MCGIDI_sampling_pdfsOfXGivenW_release().

◆ MCGIDI_sampling_pdfsOfXGivenW_release()

int MCGIDI_sampling_pdfsOfXGivenW_release ( statusMessageReporting smr,
MCGIDI_pdfsOfXGivenW dists 
)

Definition at line 28 of file MCGIDI_sampling.cc.

28 {
29
30 int i;
31
32 for( i = 0; i < dists->numberOfWs; i++ ) MCGIDI_sampling_pdfsOfX_release( smr, &(dists->dist[i]) );
33 smr_freeMemory( (void **) &(dists->Ws) );
34 smr_freeMemory( (void **) &(dists->dist) );
36 return( 0 );
37}
int MCGIDI_sampling_pdfsOfXGivenW_initialize(statusMessageReporting *, MCGIDI_pdfsOfXGivenW *dists)
int MCGIDI_sampling_pdfsOfX_release(statusMessageReporting *, MCGIDI_pdfOfX *dist)

Referenced by MCGIDI_angular_release(), MCGIDI_angularEnergy_release(), MCGIDI_energy_release(), and MCGIDI_energyAngular_release().

◆ MCGIDI_sampling_ptwXY_getValueAtX()

double MCGIDI_sampling_ptwXY_getValueAtX ( ptwXYPoints ptwXY,
double  x1 
)

Definition at line 212 of file MCGIDI_sampling.cc.

212 {
213
214 double y1;
215
216 if( ptwXY_getValueAtX( ptwXY, x1, &y1 ) == nfu_XOutsideDomain ) {
217 if( x1 < ptwXY_getXMin( ptwXY ) ) {
218 ptwXY_getValueAtX( ptwXY, ptwXY_getXMin( ptwXY ), &y1 ); }
219 else {
220 ptwXY_getValueAtX( ptwXY, ptwXY_getXMax( ptwXY ), &y1 );
221 }
222 }
223 return( y1 );
224}
@ nfu_XOutsideDomain
Definition: nf_utilities.h:26

Referenced by MCGIDI_energy_sampleEnergy(), and MCGIDI_product_sampleMultiplicity().

◆ MCGIDI_sampling_sampleX_from_pdfOfX()

int MCGIDI_sampling_sampleX_from_pdfOfX ( MCGIDI_pdfOfX dist,
MCGIDI_pdfsOfXGivenW_sampled sampled,
double  r 
)

Definition at line 98 of file MCGIDI_sampling.cc.

98 {
99
100 int iX;
101 double d1, d2, frac;
102
103 iX = sampled->iX1 = MCGIDI_misc_binarySearch( dist->numberOfXs, dist->cdf, rngValue );
104
105 if( iX < 0 ) { /* This should never happen. */
106 smr_setReportError2( sampled->smr, smr_unknownID, 1, "bad iX = %d\n", iX );
107 sampled->x = dist->Xs[0];
108 return( 1 );
109 }
110 if( sampled->interpolationXY == ptwXY_interpolationFlat ) {
111 frac = ( dist->cdf[iX+1] - rngValue ) / ( dist->cdf[iX+1] - dist->cdf[iX] );
112 sampled->x = frac * dist->Xs[iX] + ( 1 - frac ) * dist->Xs[iX+1]; }
113 else {
114 double s1 = dist->pdf[iX+1] - dist->pdf[iX];
115
116 if( s1 == 0. ) {
117 if( dist->pdf[iX] == 0 ) {
118 sampled->x = dist->Xs[iX];
119 if( iX == 0 ) sampled->x = dist->Xs[1]; }
120 else {
121 frac = ( dist->cdf[iX+1] - rngValue ) / ( dist->cdf[iX+1] - dist->cdf[iX] );
122 sampled->x = frac * dist->Xs[iX] + ( 1 - frac ) * dist->Xs[iX+1];
123 } }
124 else {
125 s1 = s1 / ( dist->Xs[iX+1] - dist->Xs[iX] );
126 d1 = rngValue - dist->cdf[iX];
127 d2 = dist->cdf[iX+1] - rngValue;
128 if( d2 > d1 ) { /* Closer to iX. */
129 sampled->x = dist->Xs[iX] + ( std::sqrt( dist->pdf[iX] * dist->pdf[iX] + 2. * s1 * d1 ) - dist->pdf[iX] ) / s1; }
130 else { /* Closer to iX + 1. */
131 sampled->x = dist->Xs[iX+1] - ( dist->pdf[iX+1] - std::sqrt( dist->pdf[iX+1] * dist->pdf[iX+1] - 2. * s1 * d2 ) ) / s1;
132 }
133 }
134 }
135
136 return( 0 );
137}

Referenced by MCGIDI_energy_sampleEnergy(), MCGIDI_sampling_doubleDistribution(), and MCGIDI_sampling_sampleX_from_pdfsOfXGivenW().

◆ MCGIDI_sampling_sampleX_from_pdfsOfXGivenW()

int MCGIDI_sampling_sampleX_from_pdfsOfXGivenW ( MCGIDI_pdfsOfXGivenW dists,
MCGIDI_pdfsOfXGivenW_sampled sampled,
double  r 
)

Definition at line 49 of file MCGIDI_sampling.cc.

49 {
50
51 int iW, iX1;
52
53 sampled->interpolationWY = dists->interpolationWY;
54 sampled->interpolationXY = dists->interpolationXY;
55 iW = sampled->iW = MCGIDI_misc_binarySearch( dists->numberOfWs, dists->Ws, sampled->w );
56 sampled->frac = 1;
57
58 if( iW == -2 ) { /* w < first value of Ws. */
59 return( MCGIDI_sampling_sampleX_from_pdfOfX( dists->dist, sampled, rngValue ) ); }
60 else if( iW == -1 ) { /* w > last value of Ws. */
61 return( MCGIDI_sampling_sampleX_from_pdfOfX( &(dists->dist[dists->numberOfWs-1]), sampled, rngValue ) ); }
62 else {
63 if( MCGIDI_sampling_sampleX_from_pdfOfX( &(dists->dist[iW]), sampled, rngValue ) ) return( 1 );
64 if( dists->interpolationWY != ptwXY_interpolationFlat ) { // ptwXY_interpolationOther was not allowed at startup.
65 double xSampled = sampled->x, frac = 1.;
66
67 iX1 = sampled->iX1;
68 if( MCGIDI_sampling_sampleX_from_pdfOfX( &(dists->dist[iW+1]), sampled, rngValue ) ) return( 1 );
69
71 frac = ( dists->Ws[iW+1] - sampled->w ) / ( dists->Ws[iW+1] - dists->Ws[iW] );
72 sampled->x = frac * xSampled + ( 1 - frac ) * sampled->x; }
73 else if( dists->interpolationWY == ptwXY_interpolationLogLin ) {
74 frac = G4Log( dists->Ws[iW+1] / sampled->w ) / G4Log( dists->Ws[iW+1] / dists->Ws[iW] );
75 sampled->x = frac * xSampled + ( 1 - frac ) * sampled->x; }
76 else if( dists->interpolationWY == ptwXY_interpolationLinLog ) {
77 frac = ( dists->Ws[iW+1] - sampled->w ) / ( dists->Ws[iW+1] - dists->Ws[iW] );
78 sampled->x = xSampled * G4Pow::GetInstance()->powA( sampled->x / xSampled, frac ); }
79 else if( dists->interpolationWY == ptwXY_interpolationLogLog ) {
80 frac = G4Log( dists->Ws[iW+1] / sampled->w ) / G4Log( dists->Ws[iW+1] / dists->Ws[iW] );
81 sampled->x = xSampled * G4Pow::GetInstance()->powA( sampled->x / xSampled, frac ); }
82 else { // This should never happen.
83 smr_setReportError2( sampled->smr, smr_unknownID, 1, "bad interpolation = %d\n", dists->interpolationWY );
84 return( 1 );
85 }
86
87 sampled->iX2 = sampled->iX1;
88 sampled->iX1 = iX1;
89 sampled->frac = frac;
90 }
91 }
92
93 return( 0 );
94}

Referenced by MCGIDI_angular_sampleMu(), MCGIDI_energy_sampleEnergy(), MCGIDI_KalbachMann_sampleEp(), and MCGIDI_sampling_doubleDistribution().

◆ MCGIDI_target_free()

MCGIDI_target * MCGIDI_target_free ( statusMessageReporting smr,
MCGIDI_target target 
)

Definition at line 114 of file MCGIDI_target.cc.

114 {
115
116 MCGIDI_target_release( smr, target );
117 smr_freeMemory( (void **) &target );
118 return( NULL );
119}
int MCGIDI_target_release(statusMessageReporting *smr, MCGIDI_target *target)

Referenced by MCGIDI_target_new(), and G4GIDI_target::~G4GIDI_target().

◆ MCGIDI_target_getAttributesValue()

char const * MCGIDI_target_getAttributesValue ( statusMessageReporting smr,
MCGIDI_target target,
char const *  name 
)

Definition at line 245 of file MCGIDI_target.cc.

245 {
246
247 return( xDataTOMAL_getAttributesValue( &(target->attributes), name ) );
248}
xDataTOM_attributionList attributes
Definition: MCGIDI.h:465
char const * xDataTOMAL_getAttributesValue(xDataTOM_attributionList *attributes, char const *name)
Definition: xDataTOM.cc:403

◆ MCGIDI_target_getDomain()

int MCGIDI_target_getDomain ( statusMessageReporting smr,
MCGIDI_target target,
double *  EMin,
double *  EMax 
)

Definition at line 382 of file MCGIDI_target.cc.

382 {
383
384 int ir, nr = MCGIDI_target_numberOfReactions( smr, target );
385 double EMin_, EMax_;
386
387 for( ir = 0; ir < nr; ir++ ) {
388 MCGIDI_target_heated_getReactionsDomain( smr, target->baseHeatedTarget, ir, &EMin_, &EMax_ );
389 if( ir == 0 ) {
390 *EMin = EMin_;
391 *EMax = EMax_; }
392 else {
393 if( *EMin > EMin_ ) *EMin = EMin_;
394 if( *EMax < EMax_ ) *EMax = EMax_;
395 }
396 }
397 return( 0 );
398}
int MCGIDI_target_heated_getReactionsDomain(statusMessageReporting *smr, MCGIDI_target_heated *target, int index, double *EMin, double *EMax)
int MCGIDI_target_numberOfReactions(statusMessageReporting *smr, MCGIDI_target *target)
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467

◆ MCGIDI_target_getHeatedTargetAtIndex_ReadIfNeeded()

MCGIDI_target_heated * MCGIDI_target_getHeatedTargetAtIndex_ReadIfNeeded ( statusMessageReporting smr,
MCGIDI_target target,
int  index 
)

Definition at line 289 of file MCGIDI_target.cc.

289 {
290
291 if( ( index < 0 ) || ( index >= target->nHeatedTargets ) ) {
292 smr_setReportError2( smr, smr_unknownID, 1, "temperature index = %d out of range (0 <= index < %d", index, target->nHeatedTargets );
293 return( NULL );
294 }
295 if( target->heatedTargets[index].heatedTarget == NULL ) MCGIDI_target_readHeatedTarget( smr, target, index );
296 return( target->heatedTargets[index].heatedTarget );
297}
int MCGIDI_target_readHeatedTarget(statusMessageReporting *smr, MCGIDI_target *target, int index)
MCGIDI_target_heated * heatedTarget
Definition: MCGIDI.h:457
MCGIDI_target_heated_info * heatedTargets
Definition: MCGIDI.h:468
int nHeatedTargets
Definition: MCGIDI.h:466

◆ MCGIDI_target_getHeatedTargetAtTIndex()

MCGIDI_target_heated * MCGIDI_target_getHeatedTargetAtTIndex ( statusMessageReporting smr,
MCGIDI_target target,
int  index 
)

Definition at line 301 of file MCGIDI_target.cc.

301 {
302
303 if( ( index < 0 ) || ( index >= target->nHeatedTargets ) ) {
304 smr_setReportError2( smr, smr_unknownID, 1, "temperature index = %d out of range (0 <= index < %d", index, target->nHeatedTargets );
305 return( NULL );
306 }
307 if( target->heatedTargets[index].heatedTarget == NULL ) {
308 smr_setReportError2( smr, smr_unknownID, 1, "temperature index = %d not read in", index );
309 return( NULL );
310 }
311 return( target->heatedTargets[index].heatedTarget );
312}

◆ MCGIDI_target_getIndexReactionCrossSectionAtE()

double MCGIDI_target_getIndexReactionCrossSectionAtE ( statusMessageReporting smr,
MCGIDI_target target,
int  index,
MCGIDI_quantitiesLookupModes modes,
bool  sampling 
)

Definition at line 402 of file MCGIDI_target.cc.

403 {
404
405 int i;
406 double xsec = 0., xsec1, xsec2, temperature = modes.getTemperature( );
407
408 for( i = 0; i < target->nReadHeatedTargets; i++ ) if( target->readHeatedTargets[i]->temperature > temperature ) break;
409 if( i == 0 ) {
410 xsec = MCGIDI_target_heated_getIndexReactionCrossSectionAtE( smr, target->readHeatedTargets[0]->heatedTarget, index, modes, sampling ); }
411 else if( i == target->nReadHeatedTargets ) {
412 xsec = MCGIDI_target_heated_getIndexReactionCrossSectionAtE( smr, target->readHeatedTargets[i-1]->heatedTarget, index, modes, sampling ); }
413 else {
414 xsec1 = MCGIDI_target_heated_getIndexReactionCrossSectionAtE(smr, target->readHeatedTargets[i-1]->heatedTarget, index, modes, sampling );
415 xsec2 = MCGIDI_target_heated_getIndexReactionCrossSectionAtE(smr, target->readHeatedTargets[i ]->heatedTarget, index, modes, sampling );
416 xsec = ( ( target->readHeatedTargets[i]->temperature - temperature ) * xsec1 +
417 ( temperature - target->readHeatedTargets[i-1]->temperature ) * xsec2 ) /
418 ( target->readHeatedTargets[i]->temperature - target->readHeatedTargets[i-1]->temperature );
419 }
420
421 return( xsec );
422}
double MCGIDI_target_heated_getIndexReactionCrossSectionAtE(statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes, bool sampling)
double getTemperature(void) const
Definition: MCGIDI.h:103
MCGIDI_target_heated_info ** readHeatedTargets
Definition: MCGIDI.h:469
int nReadHeatedTargets
Definition: MCGIDI.h:466

Referenced by MCGIDI_target_sampleReaction(), G4GIDI_target::sampleChannelCrossSectionAtE(), and G4GIDI_target::sumChannelCrossSectionAtE().

◆ MCGIDI_target_getIndexReactionFinalQ()

double MCGIDI_target_getIndexReactionFinalQ ( statusMessageReporting smr,
MCGIDI_target target,
int  index,
MCGIDI_quantitiesLookupModes modes 
)

Definition at line 493 of file MCGIDI_target.cc.

494 {
495
496 return( MCGIDI_target_heated_getIndexReactionFinalQ( smr, target->baseHeatedTarget, index, modes ) );
497}
double MCGIDI_target_heated_getIndexReactionFinalQ(statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes)

◆ MCGIDI_target_getReactionAtIndex()

MCGIDI_reaction * MCGIDI_target_getReactionAtIndex ( MCGIDI_target target,
int  index 
)

Definition at line 333 of file MCGIDI_target.cc.

333 {
334
336}
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex(MCGIDI_target_heated *target, int index)

◆ MCGIDI_target_getReactionAtIndex_smr()

MCGIDI_reaction * MCGIDI_target_getReactionAtIndex_smr ( statusMessageReporting smr,
MCGIDI_target target,
int  index 
)

Definition at line 340 of file MCGIDI_target.cc.

340 {
341
342 return( MCGIDI_target_heated_getReactionAtIndex_smr( smr, target->baseHeatedTarget, index ) );
343}
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex_smr(statusMessageReporting *smr, MCGIDI_target_heated *target, int index)

◆ MCGIDI_target_getReactionTypeAtIndex()

enum MCGIDI_reactionType MCGIDI_target_getReactionTypeAtIndex ( statusMessageReporting smr,
MCGIDI_target target,
int  index 
)

Definition at line 323 of file MCGIDI_target.cc.

323 {
324
326
327 if( reaction == NULL ) return( MCGIDI_reactionType_unknown_e );
328 return( MCGIDI_reaction_getReactionType( smr, reaction ) );
329}
enum MCGIDI_reactionType MCGIDI_reaction_getReactionType(statusMessageReporting *smr, MCGIDI_reaction *reaction)

◆ MCGIDI_target_getTemperatures()

int MCGIDI_target_getTemperatures ( statusMessageReporting smr,
MCGIDI_target target,
double *  temperatures 
)

Definition at line 252 of file MCGIDI_target.cc.

252 {
253
254 int i;
255
256 if( temperatures != NULL ) for( i = 0; i < target->nHeatedTargets; i++ ) temperatures[i] = target->heatedTargets[i].temperature;
257 return( target->nHeatedTargets );
258}

Referenced by G4GIDI_target::getTemperatures().

◆ MCGIDI_target_getTotalCrossSectionAtTAndE()

double MCGIDI_target_getTotalCrossSectionAtTAndE ( statusMessageReporting smr,
MCGIDI_target target,
MCGIDI_quantitiesLookupModes modes,
bool  sampling 
)

Definition at line 358 of file MCGIDI_target.cc.

359 {
360
361 int i;
362 double xsec = 0., xsec1, xsec2, temperature = modes.getTemperature( );
363
364 for( i = 0; i < target->nReadHeatedTargets; i++ ) if( target->readHeatedTargets[i]->temperature > temperature ) break;
365 if( i == 0 ) {
366 xsec = MCGIDI_target_heated_getTotalCrossSectionAtE( smr, target->readHeatedTargets[0]->heatedTarget, modes, sampling ); }
367 else if( i == target->nReadHeatedTargets ) {
368 xsec = MCGIDI_target_heated_getTotalCrossSectionAtE( smr, target->readHeatedTargets[i-1]->heatedTarget, modes, sampling ); }
369 else {
370 xsec1 = MCGIDI_target_heated_getTotalCrossSectionAtE( smr, target->readHeatedTargets[i-1]->heatedTarget, modes, sampling );
371 xsec2 = MCGIDI_target_heated_getTotalCrossSectionAtE( smr, target->readHeatedTargets[i ]->heatedTarget, modes, sampling );
372 xsec = ( ( target->readHeatedTargets[i]->temperature - temperature ) * xsec1 +
373 ( temperature - target->readHeatedTargets[i-1]->temperature ) * xsec2 ) /
374 ( target->readHeatedTargets[i]->temperature - target->readHeatedTargets[i-1]->temperature );
375 }
376
377 return( xsec );
378}
double MCGIDI_target_heated_getTotalCrossSectionAtE(statusMessageReporting *smr, MCGIDI_target_heated *target, MCGIDI_quantitiesLookupModes &modes, bool sampling)

Referenced by G4GIDI_target::getTotalCrossSectionAtE().

◆ MCGIDI_target_getUniqueProducts()

transportabilitiesMap const * MCGIDI_target_getUniqueProducts ( statusMessageReporting smr,
MCGIDI_target target 
)

Definition at line 501 of file MCGIDI_target.cc.

501 {
502
504}
transportabilitiesMap const * MCGIDI_target_heated_getUniqueProducts(statusMessageReporting *smr, MCGIDI_target_heated *target)

◆ 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)

Referenced by MCGIDI_target_release().

◆ MCGIDI_target_heated_getEnergyGrid()

int MCGIDI_target_heated_getEnergyGrid ( statusMessageReporting smr,
MCGIDI_target_heated target,
double **  energyGrid 
)

◆ 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}

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)

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}
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()

transportabilitiesMap 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}
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)

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}
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)
#define MCGIDI_misc_pointerToTOMAttributeIfAllOk3(smr, path, required, attributes, name)
Definition: MCGIDI_misc.h:28
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_add_ptwXY(ptwXYPoints *ptwXY1, ptwXYPoints *ptwXY2, nfu_status *status)
xDataTOM_attributionList attributes
Definition: MCGIDI.h:440
double temperature_MeV
Definition: MCGIDI.h:442
xDataTOM_attributionList attributes
Definition: xDataTOM.h:184
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)

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
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

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)

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 productData 
)

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)

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

◆ MCGIDI_target_initialize()

int MCGIDI_target_initialize ( statusMessageReporting smr,
MCGIDI_target target 
)

Definition at line 44 of file MCGIDI_target.cc.

44 {
45
46 memset( target, 0, sizeof( MCGIDI_target ) );
47 return( 0 );
48}

Referenced by MCGIDI_target_new(), MCGIDI_target_read(), and MCGIDI_target_release().

◆ MCGIDI_target_new()

MCGIDI_target * MCGIDI_target_new ( statusMessageReporting smr)

Definition at line 33 of file MCGIDI_target.cc.

33 {
34
35 MCGIDI_target *target;
36
37 if( ( target = (MCGIDI_target *) smr_malloc2( smr, sizeof( MCGIDI_target ), 0, "target" ) ) == NULL ) return( NULL );
38 if( MCGIDI_target_initialize( smr, target ) ) target = MCGIDI_target_free( smr, target );
39 return( target );
40}
int MCGIDI_target_initialize(statusMessageReporting *, MCGIDI_target *target)
MCGIDI_target * MCGIDI_target_free(statusMessageReporting *smr, MCGIDI_target *target)

Referenced by MCGIDI_target_newRead().

◆ MCGIDI_target_newRead()

MCGIDI_target * MCGIDI_target_newRead ( statusMessageReporting smr,
const char *  fileName 
)

Definition at line 52 of file MCGIDI_target.cc.

52 {
53
54 MCGIDI_target *target;
55
56 if( ( target = MCGIDI_target_new( smr ) ) == NULL ) return( NULL );
57 if( MCGIDI_target_read( smr, target, fileName ) != 0 ) smr_freeMemory( (void **) &target );
58 return( target );
59}
MCGIDI_target * MCGIDI_target_new(statusMessageReporting *smr)
int MCGIDI_target_read(statusMessageReporting *smr, MCGIDI_target *target, const char *fileName)

Referenced by G4GIDI_target::init(), MCGIDI_target_newReadFromMap(), and MCGIDI_target_newReadFromMapViaPoPIDs().

◆ MCGIDI_target_newReadFromMap()

MCGIDI_target * MCGIDI_target_newReadFromMap ( statusMessageReporting smr,
MCGIDI_map map,
const char *  evaluation,
const char *  projectileName,
const char *  targetName 
)

Definition at line 99 of file MCGIDI_target.cc.

100 {
101
102 char *targetPath;
103 MCGIDI_target *target;
104
105 targetPath = MCGIDI_map_findTarget( smr, map, evaluation, projectileName, targetName );
106 if( targetPath == NULL ) return( NULL );
107 target = MCGIDI_target_newRead( smr, targetPath );
108 smr_freeMemory( (void **) &targetPath );
109 return( target );
110}
char * MCGIDI_map_findTarget(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, const char *projectile, const char *targetName)
Definition: MCGIDI_map.cc:376
MCGIDI_target * MCGIDI_target_newRead(statusMessageReporting *smr, const char *fileName)

◆ MCGIDI_target_newReadFromMapViaPoPIDs()

MCGIDI_target * MCGIDI_target_newReadFromMapViaPoPIDs ( statusMessageReporting smr,
MCGIDI_map map,
const char *  evaluation,
int  projectile_PoPID,
int  target_PoPID 
)

Definition at line 85 of file MCGIDI_target.cc.

86 {
87
88 char *targetPath;
89 MCGIDI_target *target;
90
91 if( ( targetPath = MCGIDI_map_findTargetViaPoPIDs( smr, map, evaluation, projectile_PoPID, target_PoPID ) ) == NULL ) return( NULL );
92 target = MCGIDI_target_newRead( smr, targetPath );
93 smr_freeMemory( (void **) &targetPath );
94 return( target );
95}
char * MCGIDI_map_findTargetViaPoPIDs(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, int projectile_PoPID, int target_PoPID)
Definition: MCGIDI_map.cc:302

◆ MCGIDI_target_numberOfProductionReactions()

int MCGIDI_target_numberOfProductionReactions ( statusMessageReporting smr,
MCGIDI_target target 
)

Definition at line 347 of file MCGIDI_target.cc.

347 {
348
349#if 0
351#endif
352return( 0 );
353}
int MCGIDI_target_heated_numberOfProductionReactions(statusMessageReporting *smr, MCGIDI_target_heated *target)

Referenced by G4GIDI_target::getNumberOfProductionChannels().

◆ MCGIDI_target_numberOfReactions()

int MCGIDI_target_numberOfReactions ( statusMessageReporting smr,
MCGIDI_target target 
)

Definition at line 316 of file MCGIDI_target.cc.

316 {
317
319}
int MCGIDI_target_heated_numberOfReactions(statusMessageReporting *smr, MCGIDI_target_heated *target)

Referenced by G4GIDI_target::getChannelIDs(), G4GIDI_target::getNumberOfChannels(), G4GIDI_target::init(), MCGIDI_target_getDomain(), and MCGIDI_target_sampleReaction().

◆ MCGIDI_target_read()

int MCGIDI_target_read ( statusMessageReporting smr,
MCGIDI_target target,
const char *  fileName 
)

Definition at line 143 of file MCGIDI_target.cc.

143 {
144/*
145* If a target has already been read into this target, user must have called MCGIDI_target_release before calling this routine.
146* Otherwise, there will be memory leaks.
147*/
149 xDataXML_element *element, *child;
150 int i, iHeated, nHeated = 0, status = 1;
151 double temperature;
152 /* char *pReturnValue; */
153 char const *version, *contents;
154
155 MCGIDI_target_initialize( smr, target );
156 if( ( target->path = smr_allocateCopyString2( smr, fileName, "path" ) ) == NULL ) return( status );
157 if( ( target->absPath = MCGIDI_misc_getAbsPath( smr, fileName ) ) == NULL ) return( _MCGIDI_target_releaseAndReturnOne( smr, target ) );
158 if( ( doc = xDataXML_importFile2( smr, fileName ) ) == NULL ) return( _MCGIDI_target_releaseAndReturnOne( smr, target ) );
159 element = xDataXML_getDocumentsElement( doc );
160 if( strcmp( element->name, "xTarget" ) != 0 ) {
161 MCGIDI_misc_setMessageError_Element( smr, NULL, element, __FILE__, __LINE__, 1, "input file's top element must be xTarget and not %s", element->name ); }
162 else {
163 status = 0;
164 if( ( version = xDataXML_getAttributesValueInElement( element, "version" ) ) == NULL ) {
165 smr_setReportError2( smr, smr_unknownID, 1, "version attribute missing from element '%s'", element->name );
166 status = 1; }
167 else {
168 if( strcmp( version, "xMCProcess 0.1" ) != 0 ) {
169 smr_setReportError2( smr, smr_unknownID, 1, "Unsupported version '%s' for element %s", version, element->name );
170 status = 1;
171 }
172 }
173 if( status == 0 ) {
174 /* pReturnValue = ( MCGIDI_misc_copyXMLAttributesToTOM( smr, &(target->attributes), &(element->attributes) ) ) ? NULL : target->path; */
175 for( nHeated = 0, child = xDataXML_getFirstElement( element ); child != NULL; nHeated++, child = xDataXML_getNextElement( child ) ) {
176 if( strcmp( child->name, "target" ) != 0 ) {
177 MCGIDI_misc_setMessageError_Element( smr, NULL, element, __FILE__, __LINE__, 1, "element can only have target sub-elements%s",
178 element->name );
179 status = 1;
180 break;
181 }
182 }
183 }
184 if( status == 0 ) {
185 if( ( target->heatedTargets = (MCGIDI_target_heated_info *) smr_malloc2( smr, nHeated * sizeof( MCGIDI_target_heated_info ), 1, "heatedTargets" ) ) == NULL ) {
186 status = 1; }
187 else {
188 if( ( target->readHeatedTargets = (MCGIDI_target_heated_info **) smr_malloc2( smr, nHeated * sizeof( MCGIDI_target_heated_info * ), 1, "heatedTargets" ) ) == NULL )
189 status = 1;
190 }
191 for( nHeated = 0, child = xDataXML_getFirstElement( element ); ( status == 0 ) && ( child != NULL );
192 nHeated++, child = xDataXML_getNextElement( child ) ) {
193 if( ( i = xDataXML_convertAttributeToDouble( smr, child, "temperature", &temperature, 1 ) ) != 0 ) {
194 if( i > 0 ) smr_setReportError2p( smr, smr_unknownID, 1, "target does not have a temperature attribute" );
195 status = 1;
196 break;
197 }
198 for( iHeated = 0; iHeated < nHeated; iHeated++ ) if( target->heatedTargets[iHeated].temperature > temperature ) break;
199 if( iHeated < nHeated ) for( i = nHeated; i >= iHeated; i-- ) target->heatedTargets[i+1] = target->heatedTargets[i];
200 target->heatedTargets[iHeated].temperature = temperature;
201 target->heatedTargets[iHeated].path = NULL;
202 target->heatedTargets[iHeated].contents = NULL;
203 target->heatedTargets[iHeated].heatedTarget = NULL;
204 if( ( contents = xDataXML_getAttributesValueInElement( child, "contents" ) ) != NULL ) {
205 if( ( target->heatedTargets[iHeated].contents = smr_allocateCopyString2( smr, contents, "contents" ) ) == NULL ) {
206 status = 1;
207 break;
208 }
209 }
210 if( ( contents = xDataXML_getAttributesValueInElement( child, "file" ) ) == NULL ) {
211 status = 1;
212 break;
213 }
214 if( ( target->heatedTargets[iHeated].path = (char *) smr_malloc2(smr, strlen( target->absPath ) + strlen( contents ) + 2, 0, "path") ) == NULL) {
215 status = 1;
216 break;
217 }
218 strcpy( target->heatedTargets[iHeated].path, target->absPath );
219 *strrchr( target->heatedTargets[iHeated].path, '/' ) = 0;
220 strcat( target->heatedTargets[iHeated].path, "/" );
221 strcat( target->heatedTargets[iHeated].path, contents );
222 target->nHeatedTargets++;
223 }
224 }
225 }
226 xDataXML_freeDoc( smr, doc );
227 if( status == 0 ) {
228 for( i = 0; i < nHeated; i++ ) target->heatedTargets[i].ordinal = i;
229 for( i = 0; i < nHeated; i++ ) if( target->heatedTargets[i].contents == NULL ) break;
230 if( i == nHeated ) i = 0; /* All heated targets are crossSection only. */
231 if( MCGIDI_target_readHeatedTarget( smr, target, i ) == 0 ) {
232 target->baseHeatedTarget = target->heatedTargets[i].heatedTarget; }
233 else {
234 MCGIDI_target_release( NULL, target );
235 status = 1;
236 } }
237 else {
238 MCGIDI_target_release( smr, target );
239 }
240 return( status );
241}
int MCGIDI_misc_setMessageError_Element(statusMessageReporting *smr, void *userInterface, xDataXML_element *element, char const *file, int line, int code, char const *fmt,...)
Definition: MCGIDI_misc.cc:204
char * MCGIDI_misc_getAbsPath(statusMessageReporting *smr, char const *fileName)
Definition: MCGIDI_misc.cc:250
char * path
Definition: MCGIDI.h:461
char * absPath
Definition: MCGIDI.h:462
void * xDataXML_freeDoc(statusMessageReporting *smr, xDataXML_document *doc)
xDataXML_element * xDataXML_getNextElement(xDataXML_element *element)
xDataXML_element * xDataXML_getDocumentsElement(xDataXML_document *doc)
char const * xDataXML_getAttributesValueInElement(xDataXML_element *element, char const *name)
xDataXML_element * xDataXML_getFirstElement(xDataXML_element *element)
int xDataXML_convertAttributeToDouble(statusMessageReporting *smr, xDataXML_element *element, char const *name, double *d, int required)
xDataXML_document * xDataXML_importFile2(statusMessageReporting *smr, char const *fileName)

Referenced by MCGIDI_target_newRead(), MCGIDI_target_readFromMap(), and MCGIDI_target_readFromMapViaPoPIDs().

◆ MCGIDI_target_readFromMap()

int MCGIDI_target_readFromMap ( statusMessageReporting smr,
MCGIDI_target target,
MCGIDI_map map,
const char *  evaluation,
const char *  projectileName,
const char *  targetName 
)

Definition at line 74 of file MCGIDI_target.cc.

75 {
76
77 char *targetPath;
78
79 if( ( targetPath = MCGIDI_map_findTarget( smr, map, evaluation, projectileName, targetName ) ) == NULL ) return( 1 );
80 return( MCGIDI_target_read( smr, target, targetPath ) );
81}

◆ MCGIDI_target_readFromMapViaPoPIDs()

int MCGIDI_target_readFromMapViaPoPIDs ( statusMessageReporting smr,
MCGIDI_target target,
MCGIDI_map map,
const char *  evaluation,
int  projectile_PoPID,
int  target_PoPID 
)

Definition at line 63 of file MCGIDI_target.cc.

64 {
65
66 char *targetPath;
67
68 if( ( targetPath = MCGIDI_map_findTargetViaPoPIDs( smr, map, evaluation, projectile_PoPID, target_PoPID ) ) == NULL ) return( 1 );
69 return( MCGIDI_target_read( smr, target, targetPath ) );
70}

◆ MCGIDI_target_readHeatedTarget()

int MCGIDI_target_readHeatedTarget ( statusMessageReporting smr,
MCGIDI_target target,
int  index 
)

Definition at line 262 of file MCGIDI_target.cc.

262 {
263
264 int i;
265
266 if( ( index < 0 ) || ( index >= target->nHeatedTargets ) ) {
267 smr_setReportError2( smr, smr_unknownID, 1, "temperature index = %d out of range (0 <= index < %d", index, target->nHeatedTargets );
268 return( -1 );
269 }
270 if( target->heatedTargets[index].heatedTarget != NULL ) return( 1 );
271 if( ( target->heatedTargets[index].heatedTarget = MCGIDI_target_heated_newRead( smr, target->heatedTargets[index].path ) ) != NULL ) {
272 target->projectilePOP = target->heatedTargets[index].heatedTarget->projectilePOP;
273 target->targetPOP = target->heatedTargets[index].heatedTarget->targetPOP;
274 if( target->heatedTargets[index].heatedTarget != NULL ) {
275 target->heatedTargets[index].heatedTarget->ordinal = target->heatedTargets[index].ordinal;
276 for( i = target->nReadHeatedTargets; i > 0; i-- ) {
277 if( target->readHeatedTargets[i-1]->temperature < target->heatedTargets[index].temperature ) break;
278 target->readHeatedTargets[i] = target->readHeatedTargets[i-1];
279 }
280 target->readHeatedTargets[i] = &(target->heatedTargets[i]);
281 target->nReadHeatedTargets++;
282 }
283 }
284 return( ( target->heatedTargets[index].heatedTarget == NULL ? -1 : 0 ) );
285}
MCGIDI_target_heated * MCGIDI_target_heated_newRead(statusMessageReporting *smr, const char *fileName)
MCGIDI_POP * targetPOP
Definition: MCGIDI.h:464
MCGIDI_POP * projectilePOP
Definition: MCGIDI.h:463

Referenced by MCGIDI_target_getHeatedTargetAtIndex_ReadIfNeeded(), MCGIDI_target_read(), and G4GIDI_target::readTemperature().

◆ MCGIDI_target_recast()

int MCGIDI_target_recast ( statusMessageReporting smr,
MCGIDI_target target,
GIDI_settings settings 
)

Definition at line 508 of file MCGIDI_target.cc.

508 {
509
510 int i1, status = 0;
511
512 for( i1 = 0; i1 < target->nReadHeatedTargets; i1++ ) {
513 if( ( status = MCGIDI_target_heated_recast( smr, target->readHeatedTargets[i1]->heatedTarget, settings ) ) != 0 ) break;
514 }
515 return( status );
516}
int MCGIDI_target_heated_recast(statusMessageReporting *smr, MCGIDI_target_heated *target, GIDI_settings &settings)

◆ MCGIDI_target_release()

int MCGIDI_target_release ( statusMessageReporting smr,
MCGIDI_target target 
)

Definition at line 123 of file MCGIDI_target.cc.

123 {
124
125 int i;
126
127 smr_freeMemory( (void **) &(target->path) );
128 smr_freeMemory( (void **) &(target->absPath) );
129 xDataTOMAL_release( &(target->attributes) );
130 for( i = 0; i < target->nHeatedTargets; i++ ) {
131 smr_freeMemory( (void **) &(target->heatedTargets[i].path) );
132 smr_freeMemory( (void **) &(target->heatedTargets[i].contents) );
133 if( target->heatedTargets[i].heatedTarget != NULL ) MCGIDI_target_heated_free( smr, target->heatedTargets[i].heatedTarget );
134 }
135 smr_freeMemory( (void **) &(target->heatedTargets) );
136 smr_freeMemory( (void **) &(target->readHeatedTargets) );
137 MCGIDI_target_initialize( smr, target );
138 return( 0 );
139}
MCGIDI_target_heated * MCGIDI_target_heated_free(statusMessageReporting *smr, MCGIDI_target_heated *target)

Referenced by MCGIDI_target_free(), and MCGIDI_target_read().

◆ MCGIDI_target_sampleIndexReactionProductsAtE()

int MCGIDI_target_sampleIndexReactionProductsAtE ( statusMessageReporting smr,
MCGIDI_target target,
int  index,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo,
MCGIDI_sampledProductsDatas productData 
)

Definition at line 485 of file MCGIDI_target.cc.

486 {
487
488 return( MCGIDI_target_heated_sampleIndexReactionProductsAtE( smr, target->baseHeatedTarget, index, modes, decaySamplingInfo, productData ) );
489}
int MCGIDI_target_heated_sampleIndexReactionProductsAtE(statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productData)

◆ MCGIDI_target_sampleNullReactionProductsAtE()

int MCGIDI_target_sampleNullReactionProductsAtE ( statusMessageReporting smr,
MCGIDI_target target,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo,
MCGIDI_sampledProductsDatas productDatas 
)

Definition at line 461 of file MCGIDI_target.cc.

462 {
463
464 MCGIDI_sampledProductsData productData;
465
466 productData.isVelocity = decaySamplingInfo->isVelocity;
467 productData.pop = target->projectilePOP;
468 productData.kineticEnergy = modes.getProjectileEnergy( );
469 productData.px_vx = 0.;
470 productData.py_vy = 0.;
471 productData.pz_vz = std::sqrt( productData.kineticEnergy * ( productData.kineticEnergy + 2. * productData.pop->mass_MeV ) );
472 if( productData.isVelocity ) productData.pz_vz *=
473 MCGIDI_speedOfLight_cm_sec / std::sqrt( productData.pz_vz * productData.pz_vz + productData.pop->mass_MeV * productData.pop->mass_MeV );
474 productData.delayedNeutronIndex = 0;
475 productData.delayedNeutronRate = 0.;
476 productData.birthTimeSec = 0;
477
478 productDatas->numberOfProducts = 0;
479 MCGIDI_sampledProducts_addProduct( smr, productDatas, &productData );
480 return( productDatas->numberOfProducts );
481}

◆ MCGIDI_target_sampleReaction()

int MCGIDI_target_sampleReaction ( statusMessageReporting smr,
MCGIDI_target target,
MCGIDI_quantitiesLookupModes modes,
double  totalXSec,
double(*)(void *)  userrng,
void *  rngState 
)

Definition at line 426 of file MCGIDI_target.cc.

427 {
428
429 int ir, nr = MCGIDI_target_numberOfReactions( smr, target );
430 double rngValue = (*userrng)( rngState );
431 double cumm_xsec = 0., r_xsec = rngValue * totalXSec;
432
433 for( ir = 0; ir < nr; ir++ ) {
434 cumm_xsec += MCGIDI_target_getIndexReactionCrossSectionAtE( smr, target, ir, modes, true );
435 if( cumm_xsec >= r_xsec ) break;
436 }
437 if( ir == nr ) {
438 if( ( totalXSec - cumm_xsec ) >= 1e-12 * totalXSec ) {
440 "Failed to sample a reaction for temperature = %.12e, energy = %.12e, totalXSec = %16.e, rngValue = %16.e, r_xsec = %16.e, cumm_xsec = %16.e",
441 modes.getTemperature( ), modes.getProjectileEnergy( ), totalXSec, rngValue, r_xsec, cumm_xsec );
442 return( -1 );
443 }
444 ir--; /* May not be correct but close. */
445 }
448
449 if( modes.getGroupIndex( ) == reaction->thresholdGroupIndex ) {
450 double dEnergy = modes.getProjectileEnergy( ) - reaction->EMin;
451
452 if( dEnergy <= 0 ) return( MCGIDI_nullReaction );
453 if( ( (*userrng)( rngState ) * reaction->thresholdGroupDomain ) > dEnergy ) return( MCGIDI_nullReaction );
454 }
455 }
456 return( ir );
457}
#define MCGIDI_nullReaction
Definition: MCGIDI.h:181
double MCGIDI_target_getIndexReactionCrossSectionAtE(statusMessageReporting *smr, MCGIDI_target *target, int index, MCGIDI_quantitiesLookupModes &modes, bool sampling)

◆ MCGIDI_uncorrelated_parseFromTOM()

int MCGIDI_uncorrelated_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_distribution distribution,
ptwXYPoints norms,
enum MCGIDI_energyType  energyType,
double  gammaEnergy_MeV 
)

Definition at line 18 of file MCGIDI_uncorrelated.cc.

19 {
20
21 xDataTOM_element *uncorrelatedElement;
22 ptwXYPoints *angularNorms = NULL;
23
24 if( ( energyType == MCGIDI_energyType_primaryGamma ) || ( energyType == MCGIDI_energyType_discreteGamma ) ) {
25 angularNorms = norms;
26 uncorrelatedElement = element; }
27 else {
28 if( ( uncorrelatedElement = xDataTOME_getOneElementByName( smr, element, "uncorrelated", 1 ) ) == NULL ) goto err;
29 }
30
31 if( MCGIDI_angular_parseFromTOM( smr, uncorrelatedElement, distribution, angularNorms ) ) goto err;
32 if( MCGIDI_energy_parseFromTOM( smr, uncorrelatedElement, distribution, norms, energyType, gammaEnergy_MeV ) ) goto err;
34
35 return( 0 );
36
37err:
38 return( 1 );
39}
int MCGIDI_energy_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms, enum MCGIDI_energyType energyType, double gammaEnergy_MeV)

Referenced by MCGIDI_distribution_parseFromTOM().

◆ MCGIDI_uncorrelated_sampleDistribution()

int MCGIDI_uncorrelated_sampleDistribution ( statusMessageReporting smr,
MCGIDI_distribution distribution,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo 
)

Definition at line 43 of file MCGIDI_uncorrelated.cc.

44 {
45
46 enum xDataTOM_frame frame;
47
48 if( MCGIDI_energy_sampleEnergy( smr, distribution->energy, modes, decaySamplingInfo ) ) return( 1 );
49 frame = decaySamplingInfo->frame;
50 if( MCGIDI_angular_sampleMu( smr, distribution->angular, modes, decaySamplingInfo ) ) return( 1 );
51 decaySamplingInfo->frame = frame; /* Discrete and primary gammas in COM are treated as lab for now and energy sets it correctly. */
52 return( 0 );
53}
int MCGIDI_energy_sampleEnergy(statusMessageReporting *smr, MCGIDI_energy *energy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
xDataTOM_frame
Definition: xDataTOM.h:23

Referenced by MCGIDI_outputChannel_sampleProductsAtE().

◆ MCGIDI_version()

char const * MCGIDI_version ( void  )

Definition at line 13 of file MCGIDI_version.cc.

13 {
14
15 if( versionStr[0] == 0 ) snprintf( versionStr, sizeof versionStr, "MCGIDI version %d.%d.%d", MCGIDI_VERSION_MAJOR, MCGIDI_VERSION_MINOR, MCGIDI_VERSION_PATCHLEVEL );
16 return( versionStr );
17}
#define MCGIDI_VERSION_MAJOR
Definition: MCGIDI.h:8
#define MCGIDI_VERSION_PATCHLEVEL
Definition: MCGIDI.h:10
#define MCGIDI_VERSION_MINOR
Definition: MCGIDI.h:9

◆ MCGIDI_versionMajor()

int MCGIDI_versionMajor ( void  )

Definition at line 21 of file MCGIDI_version.cc.

21{ return( MCGIDI_VERSION_MAJOR ); }

◆ MCGIDI_versionMinor()

int MCGIDI_versionMinor ( void  )

Definition at line 22 of file MCGIDI_version.cc.

22{ return( MCGIDI_VERSION_MINOR ); }

◆ MCGIDI_versionPatchLevel()

int MCGIDI_versionPatchLevel ( void  )

Definition at line 23 of file MCGIDI_version.cc.

23{ return( MCGIDI_VERSION_PATCHLEVEL ); }

Variable Documentation

◆ MCGIDI_productGenre_NBody_angular_energy

const char * MCGIDI_productGenre_NBody_angular_energy

Definition at line 219 of file MCGIDI.h.

◆ MCGIDI_productGenre_NBody_pairProduction

const char * MCGIDI_productGenre_NBody_pairProduction

Definition at line 219 of file MCGIDI.h.

◆ MCGIDI_productGenre_twoBody_angular

const char * MCGIDI_productGenre_twoBody_angular

Definition at line 218 of file MCGIDI.h.

◆ MCGIDI_productGenre_twoBody_formFactor

const char * MCGIDI_productGenre_twoBody_formFactor

Definition at line 218 of file MCGIDI.h.

◆ MCGIDI_productGenre_unknown

const char* MCGIDI_productGenre_unknown
extern