Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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"
Include dependency graph for MCGIDI.h:
This graph shows which files directly or indirectly include this file:

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

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

#define MCGIDI_AMU2MeV   931.494028

Definition at line 184 of file MCGIDI.h.

#define MCGIDI_crossSectionType_grouped   1

Definition at line 178 of file MCGIDI.h.

#define MCGIDI_crossSectionType_pointwise   2

Definition at line 179 of file MCGIDI.h.

#define MCGIDI_nullReaction   -10001

Definition at line 181 of file MCGIDI.h.

#define MCGIDI_particleLevel_continuum   -1

Definition at line 221 of file MCGIDI.h.

#define MCGIDI_particleLevel_sum   -2

Definition at line 222 of file MCGIDI.h.

#define MCGIDI_speedOfLight_cm_sec   2.99792458e10

Definition at line 183 of file MCGIDI.h.

#define MCGIDI_VERSION_MAJOR   1

Definition at line 8 of file MCGIDI.h.

#define MCGIDI_VERSION_MINOR   0

Definition at line 9 of file MCGIDI.h.

#define MCGIDI_VERSION_PATCHLEVEL   0

Definition at line 10 of file MCGIDI.h.

Typedef Documentation

Definition at line 58 of file MCGIDI.h.

Definition at line 64 of file MCGIDI.h.

Definition at line 66 of file MCGIDI.h.

Definition at line 52 of file MCGIDI.h.

Definition at line 62 of file MCGIDI.h.

Definition at line 63 of file MCGIDI.h.

Definition at line 61 of file MCGIDI.h.

Definition at line 41 of file MCGIDI.h.

Definition at line 53 of file MCGIDI.h.

Definition at line 54 of file MCGIDI.h.

Definition at line 50 of file MCGIDI.h.

Definition at line 44 of file MCGIDI.h.

Definition at line 55 of file MCGIDI.h.

Definition at line 56 of file MCGIDI.h.

Definition at line 57 of file MCGIDI.h.

typedef struct MCGIDI_POP_s MCGIDI_POP

Definition at line 42 of file MCGIDI.h.

typedef struct MCGIDI_POPs_s MCGIDI_POPs

Definition at line 43 of file MCGIDI.h.

Definition at line 51 of file MCGIDI.h.

Definition at line 68 of file MCGIDI.h.

Definition at line 67 of file MCGIDI.h.

Definition at line 49 of file MCGIDI.h.

Definition at line 69 of file MCGIDI.h.

Definition at line 70 of file MCGIDI.h.

Definition at line 45 of file MCGIDI.h.

Definition at line 48 of file MCGIDI.h.

Definition at line 46 of file MCGIDI.h.

typedef struct MCGIDI_target_heated_sorted_s MCGIDI_target_heated_sorted

Definition at line 47 of file MCGIDI.h.

Definition at line 171 of file MCGIDI.h.

Enumeration Type Documentation

Enumerator
MCGIDI_angularType_isotropic 
MCGIDI_angularType_recoil 
MCGIDI_angularType_linear 

Definition at line 212 of file MCGIDI.h.

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.

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.

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.

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.

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.

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. */
198  MCGIDI_reactionType_sumOfRemainingOutputChannels_e, /* ENDF MT 5 reactions. */
200 };
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.

Function Documentation

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)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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 }
#define smr_malloc2(smr, size, zero, forItem)
MCGIDI_angular * MCGIDI_angular_free(statusMessageReporting *smr, MCGIDI_angular *angular)
int MCGIDI_angular_initialize(statusMessageReporting *smr, MCGIDI_angular *angular)

Here is the call graph for this function:

Here is the caller graph for this function:

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?????? */
92  angular->type = MCGIDI_angularType_recoil; }
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  }
161  angular->type = MCGIDI_angularType_linear;
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;
169  distribution->type = MCGIDI_distributionType_angular_e;
170 
171  return( 0 );
172 
173 err:
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 }
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:306
double ptwX_getPointAtIndex_Unsafely(ptwXPoints *ptwX, int64_t index)
Definition: ptwX_core.cc:215
xDataTOM_XYs * XYs
Definition: xDataTOM.h:97
double * cdf
Definition: MCGIDI.h:301
xDataTOM_subAxes subAxes
Definition: xDataTOM.h:96
enum MCGIDI_angularType type
Definition: MCGIDI.h:320
int MCGIDI_fromTOM_interpolation(statusMessageReporting *smr, xDataTOM_element *element, int index, enum ptwXY_interpolation_e *interpolation)
ptwXYPoint * ptwXY_getPointAtIndex_Unsafely(ptwXYPoints *ptwXY, int64_t index)
Definition: ptwXY_core.cc:684
int64_t ptwXY_length(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:583
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:574
nfu_status ptwXY_setValueAtX(ptwXYPoints *ptwXY, double x, double y)
Definition: ptwXY_core.cc:876
double * Xs
Definition: MCGIDI.h:299
MCGIDI_angular * angular
Definition: MCGIDI.h:383
#define smr_setReportError2(smr, libraryID, code, fmt,...)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:322
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158
enum xDataTOM_frame frame
Definition: MCGIDI.h:319
enum nfu_status_e nfu_status
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
ptwXY_interpolation interpolationWY
Definition: MCGIDI.h:306
void * xDataTOME_getXDataIfID(statusMessageReporting *smr, xDataTOM_element *TE, char const *ID)
Definition: xDataTOM.cc:512
#define smr_malloc2(smr, size, zero, forItem)
ptwXPoints * ptwXY_runningIntegral(ptwXYPoints *ptwXY, nfu_status *status)
const G4int n
#define smr_unknownID
int smr_isOk(statusMessageReporting *smr)
enum ptwXY_interpolation_e ptwXY_interpolation
double value
Definition: xDataTOM.h:82
double y
Definition: ptwXY.h:62
enum MCGIDI_distributionType type
Definition: MCGIDI.h:382
int numberOfXs
Definition: MCGIDI.h:298
double x
Definition: ptwXY.h:62
ptwXYPoints * MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf(statusMessageReporting *smr, xDataTOM_XYs *XYs, ptwXY_interpolation interpolation, char const *units[2])
Definition: MCGIDI_misc.cc:405
nfu_status ptwXY_simpleCoalescePoints(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:529
enum xDataTOM_frame MCGIDI_misc_getProductFrame(statusMessageReporting *smr, xDataTOM_element *frameElement)
Definition: MCGIDI_misc.cc:315
MCGIDI_angular * MCGIDI_angular_free(statusMessageReporting *smr, MCGIDI_angular *angular)
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
Definition: MCGIDI_misc.cc:381
double * pdf
Definition: MCGIDI.h:300
const char * nfu_statusMessage(nfu_status status)
Definition: nf_utilities.cc:76
MCGIDI_angular * MCGIDI_angular_new(statusMessageReporting *smr)
MCGIDI_pdfOfX * dist
Definition: MCGIDI.h:308
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)

Here is the call graph for this function:

Here is the caller graph for this function:

int MCGIDI_angular_release ( statusMessageReporting smr,
MCGIDI_angular angular 
)

Definition at line 48 of file MCGIDI_angular.cc.

48  {
49 
50 
51  MCGIDI_sampling_pdfsOfXGivenW_release( smr, &(angular->dists) );
52 
53  MCGIDI_angular_initialize( smr, angular );
54  return( 0 );
55 }
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:322
int MCGIDI_sampling_pdfsOfXGivenW_release(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
int MCGIDI_angular_initialize(statusMessageReporting *smr, MCGIDI_angular *angular)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
enum MCGIDI_angularType type
Definition: MCGIDI.h:320
statusMessageReporting * smr
Definition: MCGIDI.h:312
#define smr_setReportError2(smr, libraryID, code, fmt,...)
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:322
enum xDataTOM_frame frame
Definition: MCGIDI.h:319
#define smr_unknownID
int smr_isOk(statusMessageReporting *smr)
int MCGIDI_sampling_sampleX_from_pdfsOfXGivenW(MCGIDI_pdfsOfXGivenW *dists, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
double(* rng)(void *)
Definition: MCGIDI.h:258
enum xDataTOM_frame frame
Definition: MCGIDI.h:256
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97

Here is the call graph for this function:

Here is the caller graph for this function:

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 projectileMass_MeV
Definition: MCGIDI.h:323
double residualMass_MeV
Definition: MCGIDI.h:323
double productMass_MeV
Definition: MCGIDI.h:323
double targetMass_MeV
Definition: MCGIDI.h:323

Here is the caller graph for this function:

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 *energyAngular)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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 *energyAngular)
#define smr_malloc2(smr, size, zero, forItem)
int MCGIDI_angularEnergy_initialize(statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)

Here is the call graph for this function:

Here is the caller graph for this function:

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 
85 err:
86  return( 1 );
87 }
static int MCGIDI_angularEnergy_parsePointwiseFromTOM(statusMessageReporting *smr, xDataTOM_element *pointwise, MCGIDI_distribution *distribution)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
#define smr_unknownID
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:286

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
int MCGIDI_sampling_pdfsOfXGivenW_release(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
void * smr_freeMemory(void **p)
int MCGIDI_angularEnergy_initialize(statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_pdfsOfXGivenW pdfOfMuGivenE
Definition: MCGIDI.h:364
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
enum xDataTOM_frame frame
Definition: MCGIDI.h:256

Here is the call graph for this function:

Here is the caller graph for this function:

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)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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 *smr, MCGIDI_distribution *distribution)
#define smr_malloc2(smr, size, zero, forItem)

Here is the call graph for this function:

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;
78  energyType = MCGIDI_energyType_discreteGamma; }
79  else if( ( gammaEnergy = xDataTOM_getAttributesValueInElement( element, "primary" ) ) != NULL ) {
80  if( MCGIDI_misc_PQUStringToDoubleInUnitOf( smr, gammaEnergy, "MeV", &gammaEnergy_MeV ) ) goto err;
81  energyType = MCGIDI_energyType_primaryGamma;
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 
116 err:
117  MCGIDI_distribution_release( smr, distribution );
118  return( 1 );
119 }
int MCGIDI_energyAngular_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
int MCGIDI_angular_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms)
MCGIDI_energyType
Definition: MCGIDI.h:214
int MCGIDI_distribution_release(statusMessageReporting *smr, 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_LLNLAngular_angularEnergy_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
char * name
Definition: MCGIDI.h:232
#define smr_setReportError2(smr, libraryID, code, fmt,...)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
int MCGIDI_angularEnergy_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
int MCGIDI_distribution_initialize(statusMessageReporting *smr, MCGIDI_distribution *distribution)
#define smr_unknownID
MCGIDI_product * product
Definition: MCGIDI.h:381
enum MCGIDI_distributionType type
Definition: MCGIDI.h:382
MCGIDI_POP * pop
Definition: MCGIDI.h:401
int MCGIDI_misc_PQUStringToDoubleInUnitOf(statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
Definition: MCGIDI_misc.cc:356
MCGIDI_distribution distribution
Definition: MCGIDI.h:411
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:286

Here is the call graph for this function:

Here is the caller graph for this function:

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_angularEnergy * MCGIDI_angularEnergy_free(statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)
MCGIDI_energyAngular * energyAngular
Definition: MCGIDI.h:385
MCGIDI_KalbachMann * MCGIDI_KalbachMann_free(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann)
MCGIDI_angular * angular
Definition: MCGIDI.h:383
MCGIDI_energy * energy
Definition: MCGIDI.h:384
int MCGIDI_distribution_initialize(statusMessageReporting *smr, MCGIDI_distribution *distribution)
MCGIDI_energy * MCGIDI_energy_free(statusMessageReporting *smr, MCGIDI_energy *energy)
MCGIDI_energyAngular * MCGIDI_energyAngular_free(statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
MCGIDI_KalbachMann * KalbachMann
Definition: MCGIDI.h:387
MCGIDI_angular * MCGIDI_angular_free(statusMessageReporting *smr, MCGIDI_angular *angular)
MCGIDI_angularEnergy * angularEnergy
Definition: MCGIDI.h:386

Here is the call graph for this function:

Here is the caller graph for this function:

MCGIDI_energy* MCGIDI_energy_free ( statusMessageReporting smr,
MCGIDI_energy energy 
)

Definition at line 67 of file MCGIDI_energy.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

int MCGIDI_energy_initialize ( statusMessageReporting smr,
MCGIDI_energy energy 
)

Definition at line 59 of file MCGIDI_energy.cc.

59  {
60 
61  memset( energy, 0, sizeof( MCGIDI_energy ) );
62  return( 0 );
63 }

Here is the caller graph for this function:

MCGIDI_energy* MCGIDI_energy_new ( statusMessageReporting smr)

Definition at line 48 of file MCGIDI_energy.cc.

48  {
49 
51 
52  if( ( energy = (MCGIDI_energy *) smr_malloc2( smr, sizeof( MCGIDI_energy ), 0, "energy" ) ) == NULL ) return( NULL );
53  if( MCGIDI_energy_initialize( smr, energy ) ) energy = MCGIDI_energy_free( smr, energy );
54  return( energy );
55 }
#define smr_malloc2(smr, size, zero, forItem)
MCGIDI_energy * MCGIDI_energy_free(statusMessageReporting *smr, MCGIDI_energy *energy)
G4double energy(const ThreeVector &p, const G4double m)
int MCGIDI_energy_initialize(statusMessageReporting *smr, MCGIDI_energy *energy)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 99 of file MCGIDI_energy.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

int MCGIDI_energy_release ( statusMessageReporting smr,
MCGIDI_energy energy 
)

Definition at line 76 of file MCGIDI_energy.cc.

76  {
77 
78  int i;
79 
81  if( energy->theta ) energy->theta = ptwXY_free( energy->theta );
82  if( energy->Watt_a ) energy->Watt_a = ptwXY_free( energy->Watt_a );
83  if( energy->Watt_b ) energy->Watt_b = ptwXY_free( energy->Watt_b );
85  MCGIDI_sampling_pdfsOfX_release( smr, &(energy->g) ); }
86  else if( energy->type == MCGIDI_energyType_weightedFunctional ) {
87  for( i = 0; i < energy->weightedFunctionals.numberOfWeights; i++ ) {
90  }
91  }
92 
93  MCGIDI_energy_initialize( smr, energy );
94  return( 0 );
95 }
MCGIDI_pdfOfX g
Definition: MCGIDI.h:351
enum MCGIDI_energyType type
Definition: MCGIDI.h:343
ptwXYPoints * Watt_b
Definition: MCGIDI.h:349
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:574
MCGIDI_energyWeightedFunctional weightedFunctional[4]
Definition: MCGIDI.h:333
int MCGIDI_sampling_pdfsOfXGivenW_release(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
MCGIDI_energyWeightedFunctionals weightedFunctionals
Definition: MCGIDI.h:352
MCGIDI_energy * MCGIDI_energy_free(statusMessageReporting *smr, MCGIDI_energy *energy)
ptwXYPoints * Watt_a
Definition: MCGIDI.h:349
int MCGIDI_energy_initialize(statusMessageReporting *smr, MCGIDI_energy *energy)
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:347
int MCGIDI_sampling_pdfsOfX_release(statusMessageReporting *smr, MCGIDI_pdfOfX *dist)
ptwXYPoints * theta
Definition: MCGIDI.h:349

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 499 of file MCGIDI_energy.cc.

500  {
501 /*
502 * This function must be called before angular sampling as it sets the frame but does not test it.
503 */
504  double theta, randomEp, Watt_a, Watt_b, e_in = modes.getProjectileEnergy( );
506 
507  decaySamplingInfo->frame = energy->frame;
508  switch( energy->type ) {
510  decaySamplingInfo->Ep = energy->gammaEnergy_MeV + e_in * energy->primaryGammaMassFactor;
511  break;
513  decaySamplingInfo->Ep = energy->gammaEnergy_MeV;
514  break;
516  randomEp = decaySamplingInfo->rng( decaySamplingInfo->rngState );
517  sampled.smr = smr;
518  sampled.w = e_in;
519  MCGIDI_sampling_sampleX_from_pdfsOfXGivenW( &(energy->dists), &sampled, randomEp );
520  decaySamplingInfo->Ep = sampled.x;
521  break;
523  sampled.interpolationXY = energy->gInterpolation;
524  MCGIDI_sampling_sampleX_from_pdfOfX( &(energy->g), &sampled, decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
525  theta = MCGIDI_sampling_ptwXY_getValueAtX( energy->theta, e_in );
526  decaySamplingInfo->Ep = theta * sampled.x;
527  break;
529  theta = MCGIDI_sampling_ptwXY_getValueAtX( energy->theta, e_in );
530  MCGIDI_energy_sampleSimpleMaxwellianFission( smr, ( e_in - energy->U ) / theta, decaySamplingInfo );
531  decaySamplingInfo->Ep *= theta;
532  break;
534  theta = MCGIDI_sampling_ptwXY_getValueAtX( energy->theta, e_in );
535  MCGIDI_energy_sampleEvaporation( smr, ( e_in - energy->U ) / theta, decaySamplingInfo );
536  decaySamplingInfo->Ep *= theta;
537  break;
539  Watt_a = MCGIDI_sampling_ptwXY_getValueAtX( energy->Watt_a, e_in );
540  Watt_b = MCGIDI_sampling_ptwXY_getValueAtX( energy->Watt_b, e_in );
541  MCGIDI_energy_sampleWatt( smr, e_in - energy->U, Watt_a, Watt_b, decaySamplingInfo );
542  break;
544  MCGIDI_sampling_sampleX_from_pdfsOfXGivenW( &(energy->dists), &sampled, decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
545  decaySamplingInfo->Ep = sampled.x;
546  break;
548  MCGIDI_sampling_sampleX_from_pdfOfX( &(energy->g), &sampled, decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
549  decaySamplingInfo->Ep = ( energy->e_inCOMFactor * e_in + energy->NBodyPhaseSpace.Q_MeV ) * energy->NBodyPhaseSpace.massFactor * sampled.x;
550  break;
552  MCGIDI_energy_sampleWeightedFunctional( smr, energy, modes, decaySamplingInfo );
553  break;
554  default :
555  smr_setReportError2( smr, smr_unknownID, 1, "energy type = %d not supported", energy->type );
556  }
557 
558  return( !smr_isOk( smr ) );
559 }
MCGIDI_pdfOfX g
Definition: MCGIDI.h:351
enum MCGIDI_energyType type
Definition: MCGIDI.h:343
ptwXYPoints * Watt_b
Definition: MCGIDI.h:349
MCGIDI_energyNBodyPhaseSpace NBodyPhaseSpace
Definition: MCGIDI.h:353
int MCGIDI_sampling_sampleX_from_pdfOfX(MCGIDI_pdfOfX *dist, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
double primaryGammaMassFactor
Definition: MCGIDI.h:345
statusMessageReporting * smr
Definition: MCGIDI.h:312
#define smr_setReportError2(smr, libraryID, code, fmt,...)
double MCGIDI_sampling_ptwXY_getValueAtX(ptwXYPoints *ptwXY, double x1)
static int MCGIDI_energy_sampleWeightedFunctional(statusMessageReporting *smr, MCGIDI_energy *energy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
#define smr_unknownID
ptwXYPoints * Watt_a
Definition: MCGIDI.h:349
int smr_isOk(statusMessageReporting *smr)
static int MCGIDI_energy_sampleEvaporation(statusMessageReporting *smr, double e_in_U_theta, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_sampling_sampleX_from_pdfsOfXGivenW(MCGIDI_pdfsOfXGivenW *dists, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
enum xDataTOM_frame frame
Definition: MCGIDI.h:342
static int MCGIDI_energy_sampleWatt(statusMessageReporting *smr, double e_in_U, double Watt_a, double Watt_b, MCGIDI_decaySamplingInfo *decaySamplingInfo)
double(* rng)(void *)
Definition: MCGIDI.h:258
enum xDataTOM_frame frame
Definition: MCGIDI.h:256
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:347
static int MCGIDI_energy_sampleSimpleMaxwellianFission(statusMessageReporting *smr, double e_in_U_theta, MCGIDI_decaySamplingInfo *decaySamplingInfo)
double gammaEnergy_MeV
Definition: MCGIDI.h:344
double U
Definition: MCGIDI.h:348
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:313
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97
double e_inCOMFactor
Definition: MCGIDI.h:346
ptwXY_interpolation gInterpolation
Definition: MCGIDI.h:350
ptwXYPoints * theta
Definition: MCGIDI.h:349

Here is the call graph for this function:

Here is the caller graph for this function:

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)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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 }
int MCGIDI_energyAngular_initialize(statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
#define smr_malloc2(smr, size, zero, forItem)
MCGIDI_energyAngular * MCGIDI_energyAngular_free(statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)

Here is the call graph for this function:

Here is the caller graph for this function:

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 
83 err:
84  return( 1 );
85 }
#define smr_setReportError2(smr, libraryID, code, fmt,...)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
#define smr_unknownID
int MCGIDI_KalbachMann_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:286
static int MCGIDI_energyAngular_linear_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)

Here is the call graph for this function:

Here is the caller graph for this function:

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++ ) {
53  MCGIDI_sampling_pdfsOfXGivenW_release( smr, &(energyAngular->pdfOfMuGivenEAndEp[i]) );
54  }
55  smr_freeMemory( (void **) &(energyAngular->pdfOfMuGivenEAndEp) );
56  MCGIDI_sampling_pdfsOfXGivenW_release( smr, &(energyAngular->pdfOfEpGivenE) );
57  MCGIDI_energyAngular_initialize( smr, energyAngular );
58 
59  return( 0 );
60 }
MCGIDI_pdfsOfXGivenW * pdfOfMuGivenEAndEp
Definition: MCGIDI.h:359
int MCGIDI_energyAngular_initialize(statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
int MCGIDI_sampling_pdfsOfXGivenW_release(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
void * smr_freeMemory(void **p)
MCGIDI_pdfsOfXGivenW pdfOfEpGivenE
Definition: MCGIDI.h:358

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_energyAngular * energyAngular
Definition: MCGIDI.h:385
int MCGIDI_sampling_doubleDistribution(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *pdfOfWGivenV, MCGIDI_pdfsOfXGivenW *pdfOfXGivenVAndW, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
enum xDataTOM_frame frame
Definition: MCGIDI.h:357
MCGIDI_pdfsOfXGivenW * pdfOfMuGivenEAndEp
Definition: MCGIDI.h:359
enum xDataTOM_frame frame
Definition: MCGIDI.h:256
MCGIDI_pdfsOfXGivenW pdfOfEpGivenE
Definition: MCGIDI.h:358

Here is the call graph for this function:

Here is the caller graph for this function:

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)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:306
ptwXY_interpolation interpolationWY
Definition: MCGIDI.h:306

Here is the caller graph for this function:

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 }
MCGIDI_KalbachMann * MCGIDI_KalbachMann_free(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann)
#define smr_malloc2(smr, size, zero, forItem)
int MCGIDI_KalbachMann_initialize(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann, ptwXY_interpolation interpolationWY, ptwXY_interpolation interpolationXY)

Here is the call graph for this function:

Here is the caller graph for this function:

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 
200 err:
201  if( KalbachMann != NULL ) MCGIDI_KalbachMann_free( smr, KalbachMann );
202  return( 1 );
203 }
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:376
char const * xDataTOM_axes_getUnit(statusMessageReporting *smr, xDataTOM_axes *axes, int index)
MCGIDI_POP * MCGIDI_target_heated_getPOPForTarget(statusMessageReporting *smr, MCGIDI_target_heated *target)
xDataTOM_KalbachMannCoefficients * coefficients
Definition: xDataTOM.h:141
double energyToMeVFactor
Definition: MCGIDI.h:375
MCGIDI_target_heated * MCGIDI_product_getTargetHeated(statusMessageReporting *smr, MCGIDI_product *product)
int MCGIDI_fromTOM_interpolation(statusMessageReporting *smr, xDataTOM_element *element, int index, enum ptwXY_interpolation_e *interpolation)
MCGIDI_KalbachMann * MCGIDI_KalbachMann_free(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann)
MCGIDI_KalbachMann * MCGIDI_KalbachMann_new(statusMessageReporting *smr, ptwXY_interpolation interpolationWY, ptwXY_interpolation interpolationXY)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
#define smr_malloc2(smr, size, zero, forItem)
int smr_isOk(statusMessageReporting *smr)
enum ptwXY_interpolation_e ptwXY_interpolation
MCGIDI_product * product
Definition: MCGIDI.h:381
MCGIDI_KalbachMann_ras * ras
Definition: MCGIDI.h:377
enum MCGIDI_distributionType type
Definition: MCGIDI.h:382
enum xDataTOM_frame frame
Definition: MCGIDI.h:374
MCGIDI_KalbachMann * KalbachMann
Definition: MCGIDI.h:387
xDataTOM_axes axes
Definition: xDataTOM.h:153
static double MCGIDI_KalbachMann_S_a_or_b(double Z_AB, double N_AB, double Z_C, double N_C, double I_ab)
enum xDataTOM_frame MCGIDI_misc_getProductFrame(statusMessageReporting *smr, xDataTOM_element *frameElement)
Definition: MCGIDI_misc.cc:315
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
Definition: MCGIDI_misc.cc:381
MCGIDI_POP * MCGIDI_target_heated_getPOPForProjectile(statusMessageReporting *smr, MCGIDI_target_heated *target)
xDataTOM_xDataInfo xDataInfo
Definition: xDataTOM.h:187
MCGIDI_POP * pop
Definition: MCGIDI.h:401
static int MCGIDI_KalbachMann_parseFromTOM2(statusMessageReporting *smr, int dataPerEout, int index, xDataTOM_KalbachMannCoefficients *coefficientsXData, double energyInFactor, double energyOutFactor, MCGIDI_KalbachMann *KalbachMann)
enum xDataTOM_KalbachMannType type
Definition: xDataTOM.h:138
MCGIDI_pdfOfX * dist
Definition: MCGIDI.h:308

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:376
double * Xs
Definition: MCGIDI.h:299
MCGIDI_KalbachMann_ras * ras
Definition: MCGIDI.h:377
void * smr_freeMemory(void **p)
int MCGIDI_KalbachMann_initialize(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann, ptwXY_interpolation interpolationWY, ptwXY_interpolation interpolationXY)
MCGIDI_pdfOfX * dist
Definition: MCGIDI.h:308

Here is the call graph for this function:

Here is the caller graph for this function:

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 ) {
327  if( sampled.interpolationXY == ptwXY_interpolationFlat ) {
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 {
347  if( sampled.interpolationXY == ptwXY_interpolationFlat ) {
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 ) {
358  if( sampled.interpolationXY == ptwXY_interpolationFlat ) {
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 }
const double C2
MCGIDI_pdfsOfXGivenW dists
Definition: MCGIDI.h:376
const double C1
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
double energyToMeVFactor
Definition: MCGIDI.h:375
ptwXY_interpolation interpolationWY
Definition: MCGIDI.h:313
double * Xs
Definition: MCGIDI.h:299
statusMessageReporting * smr
Definition: MCGIDI.h:312
int smr_isOk(statusMessageReporting *smr)
enum ptwXY_interpolation_e ptwXY_interpolation
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
MCGIDI_KalbachMann_ras * ras
Definition: MCGIDI.h:377
int MCGIDI_sampling_sampleX_from_pdfsOfXGivenW(MCGIDI_pdfsOfXGivenW *dists, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
enum xDataTOM_frame frame
Definition: MCGIDI.h:374
double(* rng)(void *)
Definition: MCGIDI.h:258
enum xDataTOM_frame frame
Definition: MCGIDI.h:256
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:313
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97
MCGIDI_pdfOfX * dist
Definition: MCGIDI.h:308

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
double projectileMass_MeV
Definition: MCGIDI.h:323
int MCGIDI_kinetics_COMKineticEnergy2LabEnergyAndMomentum(statusMessageReporting *smr, double beta, double e_kinetic_com, double mu, double phi, double m3cc, double m4cc, MCGIDI_sampledProductsData *outgoingData)
tuple x
Definition: test.py:50
static constexpr double m3
Definition: G4SIunits.hh:131
double residualMass_MeV
Definition: MCGIDI.h:323
double productMass_MeV
Definition: MCGIDI.h:323
double targetMass_MeV
Definition: MCGIDI.h:323
static constexpr double m2
Definition: G4SIunits.hh:130

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
tuple b
Definition: test.py:12
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
enum xDataTOM_frame frame
Definition: MCGIDI.h:256
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97

Here is the call graph for this function:

Here is the caller graph for this function:

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
const char * p
Definition: xmltok.h:285
tuple x
Definition: test.py:50

Here is the caller graph for this function:

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 
33 err:
34  if( distribution->angular ) distribution->angular = MCGIDI_angular_free( smr, distribution->angular );
35  return( 1 );
36 }
int MCGIDI_angular_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms)
static int MCGIDI_LLNL_angularEnergy_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
MCGIDI_angular * angular
Definition: MCGIDI.h:383
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
MCGIDI_angular * MCGIDI_angular_free(statusMessageReporting *smr, MCGIDI_angular *angular)

Here is the call graph for this function:

Here is the caller graph for this function:

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
const G4int n
static const G4int imax

Here is the caller graph for this function:

int MCGIDI_misc_NumberOfZSymbols ( void  )

Definition at line 54 of file MCGIDI_misc.cc.

54  {
55 
56  return( sizeof( ZSymbols ) / sizeof( struct ZSymbol ) );
57 }
static struct ZSymbol ZSymbols[]
Definition: MCGIDI_misc.cc:34

Here is the caller graph for this function:

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 }
const XML_Char * s
Definition: expat.h:262
#define smr_setReportError2(smr, libraryID, code, fmt,...)
const XML_Char int const XML_Char * value
Definition: expat.h:331
#define smr_unknownID

Here is the caller graph for this function:

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 }
#define smr_setReportError2(smr, libraryID, code, fmt,...)
const XML_Char int const XML_Char * value
Definition: expat.h:331
#define smr_unknownID
int smr_isOk(statusMessageReporting *smr)
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
Definition: MCGIDI_misc.cc:381

Here is the call graph for this function:

Here is the caller graph for this function:

int MCGIDI_misc_symbolToZ ( const char *  Z)

Definition at line 69 of file MCGIDI_misc.cc.

69  {
70 
71  int i, n = MCGIDI_misc_NumberOfZSymbols( );
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 n
static struct ZSymbol ZSymbols[]
Definition: MCGIDI_misc.cc:34
int MCGIDI_misc_NumberOfZSymbols(void)
Definition: MCGIDI_misc.cc:54

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
static struct ZSymbol ZSymbols[]
Definition: MCGIDI_misc.cc:34
int MCGIDI_misc_NumberOfZSymbols(void)
Definition: MCGIDI_misc.cc:54

Here is the call graph for this function:

Here is the caller graph for this function:

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, "unsupport 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 }
int MCGIDI_misc_symbolToZ(const char *Z)
Definition: MCGIDI_misc.cc:69
const XML_Char * name
Definition: expat.h:151
const char * p
Definition: xmltok.h:285
const XML_Char * s
Definition: expat.h:262
double A(double temperature)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
static constexpr double m
Definition: G4SIunits.hh:129
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
#define smr_unknownID
int smr_isOk(statusMessageReporting *smr)
static int MCGIDI_miscNameToZAm_getLevel(statusMessageReporting *smr, const char *name, const char *p)
Definition: MCGIDI_misc.cc:138

Here is the call graph for this function:

Here is the caller graph for this function:

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)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 144 of file MCGIDI_outputChannel.cc.

144  {
145 
146  if( outputChannel->reaction != NULL ) return( MCGIDI_reaction_getDomain( smr, outputChannel->reaction, EMin, EMax ) );
147  return( MCGIDI_product_getDomain( smr, outputChannel->parent, EMin, EMax ) );
148 }
int MCGIDI_product_getDomain(statusMessageReporting *smr, MCGIDI_product *product, double *EMin, double *EMax)
MCGIDI_product * parent
Definition: MCGIDI.h:393
int MCGIDI_reaction_getDomain(statusMessageReporting *smr, MCGIDI_reaction *reaction, double *EMin, double *EMax)
MCGIDI_reaction * reaction
Definition: MCGIDI.h:392

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 183 of file MCGIDI_outputChannel.cc.

183  {
184 
185  int iProduct;
186  double Q = outputChannel->Q;
187  MCGIDI_product *product;
188 
189  for( iProduct = 0; iProduct < outputChannel->numberOfProducts; iProduct++ ) {
190  product = &(outputChannel->products[iProduct]);
191  if( product->decayChannel.genre != MCGIDI_channelGenre_undefined_e ) Q += MCGIDI_outputChannel_getFinalQ( smr, &(product->decayChannel), e_in );
192  if( !smr_isOk( smr ) ) break;
193  }
194  return( Q );
195 }
static double Q[]
double MCGIDI_outputChannel_getFinalQ(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, double e_in)
int smr_isOk(statusMessageReporting *smr)
enum MCGIDI_channelGenre genre
Definition: MCGIDI.h:391
MCGIDI_outputChannel decayChannel
Definition: MCGIDI.h:412
MCGIDI_product * products
Definition: MCGIDI.h:397

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 133 of file MCGIDI_outputChannel.cc.

133  {
134 
135  if( ( i < 0 ) || ( i >= outputChannel->numberOfProducts ) ) {
136  smr_setReportError2( smr, smr_unknownID, 1, "bad product index = %d: outputChannel as only %d products", i, outputChannel->numberOfProducts );
137  return( NULL );
138  }
139  return( &(outputChannel->products[i]) );
140 }
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
MCGIDI_product * products
Definition: MCGIDI.h:397

Here is the caller graph for this function:

double MCGIDI_outputChannel_getProjectileMass_MeV ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel 
)

Definition at line 160 of file MCGIDI_outputChannel.cc.

160  {
161 
162  if( outputChannel->reaction != NULL ) return( MCGIDI_reaction_getProjectileMass_MeV( smr, outputChannel->reaction ) );
163  return( MCGIDI_product_getProjectileMass_MeV( smr, outputChannel->parent ) );
164 }
MCGIDI_product * parent
Definition: MCGIDI.h:393
double MCGIDI_reaction_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
MCGIDI_reaction * reaction
Definition: MCGIDI.h:392
double MCGIDI_product_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 176 of file MCGIDI_outputChannel.cc.

176  {
177 
178  return( outputChannel->Q );
179 }

Here is the caller graph for this function:

MCGIDI_target_heated* MCGIDI_outputChannel_getTargetHeated ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel 
)

Definition at line 152 of file MCGIDI_outputChannel.cc.

152  {
153 
154  if( outputChannel->reaction != NULL ) return( MCGIDI_reaction_getTargetHeated( smr, outputChannel->reaction ) );
155  return( MCGIDI_product_getTargetHeated( smr, outputChannel->parent ) );
156 }
MCGIDI_target_heated * MCGIDI_product_getTargetHeated(statusMessageReporting *smr, MCGIDI_product *product)
MCGIDI_product * parent
Definition: MCGIDI.h:393
MCGIDI_target_heated * MCGIDI_reaction_getTargetHeated(statusMessageReporting *smr, MCGIDI_reaction *reaction)
MCGIDI_reaction * reaction
Definition: MCGIDI.h:392

Here is the call graph for this function:

Here is the caller graph for this function:

double MCGIDI_outputChannel_getTargetMass_MeV ( statusMessageReporting smr,
MCGIDI_outputChannel outputChannel 
)

Definition at line 168 of file MCGIDI_outputChannel.cc.

168  {
169 
170  if( outputChannel->reaction != NULL ) return( MCGIDI_reaction_getTargetMass_MeV( smr, outputChannel->reaction ) );
171  return( MCGIDI_product_getTargetMass_MeV( smr, outputChannel->parent ) );
172 }
double MCGIDI_product_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
MCGIDI_product * parent
Definition: MCGIDI.h:393
double MCGIDI_reaction_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
MCGIDI_reaction * reaction
Definition: MCGIDI.h:392

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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 }
int MCGIDI_outputChannel_initialize(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
MCGIDI_outputChannel * MCGIDI_outputChannel_free(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
#define smr_malloc2(smr, size, zero, forItem)

Here is the call graph for this function:

int MCGIDI_outputChannel_numberOfProducts ( MCGIDI_outputChannel outputChannel)

Definition at line 126 of file MCGIDI_outputChannel.cc.

126  {
127 
128  return( outputChannel->numberOfProducts );
129 }

Here is the caller graph for this function:

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 ) {
80  outputChannel->genre = MCGIDI_channelGenre_uncorrelated_e; }
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  MCGIDI_product_setTwoBodyMasses( smr, &(outputChannel->products[0]), projectileMass_MeV, targetMass_MeV, productMass_MeV, residualMass_MeV );
115  }
116 
117  return( 0 );
118 
119 err:
120  MCGIDI_outputChannel_release( smr, outputChannel );
121  return( 1 );
122 }
int MCGIDI_outputChannel_release(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
xDataTOM_element * xDataTOME_getFirstElement(xDataTOM_element *element)
Definition: xDataTOM.cc:230
int MCGIDI_outputChannel_initialize(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
double MCGIDI_product_getMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
static double Q[]
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)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
MCGIDI_product * parent
Definition: MCGIDI.h:393
int MCGIDI_product_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_outputChannel *outputChannel, MCGIDI_POPs *pops, MCGIDI_product *product, int *delayedNeutronIndex)
#define smr_malloc2(smr, size, zero, forItem)
const G4int n
#define smr_unknownID
double MCGIDI_reaction_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
enum MCGIDI_channelGenre genre
Definition: MCGIDI.h:391
int xDataTOM_numberOfElementsByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:268
int MCGIDI_misc_PQUStringToDoubleInUnitOf(statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
Definition: MCGIDI_misc.cc:356
xDataTOM_element * xDataTOME_getNextElement(xDataTOM_element *element)
Definition: xDataTOM.cc:238
double MCGIDI_reaction_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
MCGIDI_product * products
Definition: MCGIDI.h:397
MCGIDI_reaction * reaction
Definition: MCGIDI.h:392
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:286

Here is the call graph for this function:

Here is the caller graph for this function:

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_outputChannel_initialize(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_product_release(statusMessageReporting *smr, MCGIDI_product *product)
void * smr_freeMemory(void **p)
MCGIDI_product * products
Definition: MCGIDI.h:397

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 199 of file MCGIDI_outputChannel.cc.

200  {
201 
202  int i1, multiplicity, secondTwoBody = 0, isDecayChannel = ( outputChannel->reaction == NULL );
203  double e_in = modes.getProjectileEnergy( );
204  MCGIDI_product *product;
205  double phi, p, masses[3];
206  MCGIDI_distribution *distribution;
207  MCGIDI_sampledProductsData productData[2];
208 
209  if( isDecayChannel ) {
210  masses[0] = masses_[0]; /* More work may be needed here. */
211  masses[1] = masses_[1]; }
212  else {
213  masses[0] = MCGIDI_reaction_getProjectileMass_MeV( smr, outputChannel->reaction );
214  masses[1] = MCGIDI_reaction_getTargetMass_MeV( smr, outputChannel->reaction );
215  }
216 
217  for( i1 = 0; i1 < outputChannel->numberOfProducts; i1++ ) {
218  product = &(outputChannel->products[i1]);
220  if( MCGIDI_outputChannel_sampleProductsAtE( smr, &(product->decayChannel), modes, decaySamplingInfo, productDatas, masses ) < 0 ) return( -1 ); }
221  else {
222  distribution = &(product->distribution);
223  if( distribution->type == MCGIDI_distributionType_none_e ) continue;
224  if( !secondTwoBody ) {
225  if( ( multiplicity = product->multiplicity ) == 0 ) multiplicity = MCGIDI_product_sampleMultiplicity( smr, product, e_in,
226  decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
227  while( multiplicity > 0 ) {
228 
229  multiplicity--;
230  decaySamplingInfo->pop = product->pop;
231  decaySamplingInfo->mu = 0;
232  decaySamplingInfo->Ep = 0;
233  productData[0].isVelocity = decaySamplingInfo->isVelocity;
234  productData[0].pop = product->pop;
235  productData[0].delayedNeutronIndex = product->delayedNeutronIndex;
236  productData[0].delayedNeutronRate = product->delayedNeutronRate;
237  productData[0].birthTimeSec = 0;
238  if( product->delayedNeutronRate > 0 ) {
239  productData[0].birthTimeSec = -G4Log( decaySamplingInfo->rng( decaySamplingInfo->rngState ) ) / product->delayedNeutronRate;
240  }
241 
242  switch( outputChannel->genre ) {
244  secondTwoBody = 1;
245  MCGIDI_angular_sampleMu( smr, distribution->angular, modes, decaySamplingInfo );
246  if( smr_isOk( smr ) ) {
247  phi = 2. * M_PI * decaySamplingInfo->rng( decaySamplingInfo->rngState );
248  MCGIDI_kinetics_2BodyReaction( smr, distribution->angular, e_in, decaySamplingInfo->mu, phi, productData );
249  if( !smr_isOk( smr ) ) return( -1 );
250  productData[1].pop = product[1].pop;
251  productData[1].delayedNeutronIndex = product[1].delayedNeutronIndex;
252  productData[1].delayedNeutronRate = product->delayedNeutronRate;
253  productData[1].birthTimeSec = 0;
254  MCGIDI_sampledProducts_addProduct( smr, productDatas, productData );
255  if( !smr_isOk( smr ) ) return( -1 );
256  MCGIDI_sampledProducts_addProduct( smr, productDatas, &(productData[1]) );
257  if( !smr_isOk( smr ) ) return( -1 );
258  }
259  break;
262  masses[2] = MCGIDI_product_getMass_MeV( smr, product );
263  switch( distribution->type ) {
265  MCGIDI_uncorrelated_sampleDistribution( smr, distribution, modes, decaySamplingInfo );
266  break;
268  MCGIDI_energyAngular_sampleDistribution( smr, distribution, modes, decaySamplingInfo );
269  break;
271  MCGIDI_KalbachMann_sampleEp( smr, distribution->KalbachMann, modes, decaySamplingInfo );
272  break;
274  MCGIDI_angularEnergy_sampleDistribution( smr, distribution->angularEnergy, modes, decaySamplingInfo );
275  break;
276  default :
277  printf( "Unknown spectral data form product name = %s, channel genre = %d\n", product->pop->name, outputChannel->genre );
278  break;
279  }
280  break;
282  printf( "Channel is undefined\n" );
283  break;
285  printf( "Channel is twoBodyDecay\n" );
286  break;
288  printf( "Channel is uncorrelatedDecay\n" );
289  break;
290  default :
291  printf( "Unsupported channel genre = %d\n", outputChannel->genre );
292  break;
293  }
294  if( !smr_isOk( smr ) ) return( -1 );
295  if( !secondTwoBody ) {
296  if( decaySamplingInfo->frame == xDataTOM_frame_centerOfMass ) {
297  if( MCGIDI_kinetics_COM2Lab( smr, modes, decaySamplingInfo, masses ) != 0 ) return( -1 );
298  }
299  productData[0].kineticEnergy = decaySamplingInfo->Ep;
300  p = std::sqrt( decaySamplingInfo->Ep * ( decaySamplingInfo->Ep + 2. * product->pop->mass_MeV ) );
301  if( productData[0].isVelocity ) p *= MCGIDI_speedOfLight_cm_sec / std::sqrt( p * p + product->pop->mass_MeV * product->pop->mass_MeV );
302  productData[0].pz_vz = p * decaySamplingInfo->mu;
303  p = std::sqrt( 1. - decaySamplingInfo->mu * decaySamplingInfo->mu ) * p;
304  phi = 2. * M_PI * decaySamplingInfo->rng( decaySamplingInfo->rngState );
305  productData[0].px_vx = p * std::sin( phi );
306  productData[0].py_vy = p * std::cos( phi );
307  MCGIDI_sampledProducts_addProduct( smr, productDatas, productData );
308  if( !smr_isOk( smr ) ) return( -1 );
309  }
310  } // Loop checking, 11.06.2015, T. Koi
311  }
312  }
313  }
314  return( productDatas->numberOfProducts );
315 }
#define MCGIDI_speedOfLight_cm_sec
Definition: MCGIDI.h:183
int MCGIDI_product_sampleMultiplicity(statusMessageReporting *smr, MCGIDI_product *product, double e_in, double r)
#define M_PI
Definition: SbMath.h:34
int MCGIDI_angularEnergy_sampleDistribution(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_sampledProducts_addProduct(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, MCGIDI_sampledProductsData *sampledProductsData)
double MCGIDI_product_getMass_MeV(statusMessageReporting *smr, MCGIDI_product *product)
double delayedNeutronRate
Definition: MCGIDI.h:406
const char * p
Definition: xmltok.h:285
char * name
Definition: MCGIDI.h:232
MCGIDI_angular * angular
Definition: MCGIDI.h:383
int MCGIDI_energyAngular_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_uncorrelated_sampleDistribution(statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_angular_sampleMu(statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int multiplicity
Definition: MCGIDI.h:404
double MCGIDI_reaction_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
int smr_isOk(statusMessageReporting *smr)
G4double G4Log(G4double x)
Definition: G4Log.hh:230
double mass_MeV
Definition: MCGIDI.h:235
enum MCGIDI_distributionType type
Definition: MCGIDI.h:382
enum MCGIDI_channelGenre genre
Definition: MCGIDI.h:391
MCGIDI_KalbachMann * KalbachMann
Definition: MCGIDI.h:387
int delayedNeutronIndex
Definition: MCGIDI.h:405
int MCGIDI_kinetics_COM2Lab(statusMessageReporting *smr, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, double masses[3])
double(* rng)(void *)
Definition: MCGIDI.h:258
enum xDataTOM_frame frame
Definition: MCGIDI.h:256
int MCGIDI_kinetics_2BodyReaction(statusMessageReporting *smr, MCGIDI_angular *angular, double K, double mu, double phi, MCGIDI_sampledProductsData *outgoingData)
MCGIDI_outputChannel decayChannel
Definition: MCGIDI.h:412
MCGIDI_POP * pop
Definition: MCGIDI.h:401
MCGIDI_distribution distribution
Definition: MCGIDI.h:411
double MCGIDI_reaction_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_reaction *reaction)
int MCGIDI_outputChannel_sampleProductsAtE(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas, double *masses)
MCGIDI_product * products
Definition: MCGIDI.h:397
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97
MCGIDI_angularEnergy * angularEnergy
Definition: MCGIDI.h:386
MCGIDI_reaction * reaction
Definition: MCGIDI.h:392
int MCGIDI_KalbachMann_sampleEp(statusMessageReporting *smr, MCGIDI_KalbachMann *KalbachMann, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_particle * prior
Definition: MCGIDI.h:247
static int numberOfParticles
static MCGIDI_particle * particleListEnd
const char * p
Definition: xmltok.h:285
static MCGIDI_particle ** particleSortedList
static MCGIDI_particle * particleList
void * smr_freeMemory(void **p)
MCGIDI_particle * next
Definition: MCGIDI.h:248
int MCGIDI_particle_release(statusMessageReporting *smr, MCGIDI_particle *particle)

Here is the call graph for this function:

Here is the caller graph for this function:

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
74  return( 0 );
75 }
static MCGIDI_particle ** particleSortedList
static MCGIDI_particle * particleList
MCGIDI_particle * MCGIDI_particle_free(statusMessageReporting *smr, MCGIDI_particle *particle)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

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 
126  if( sizeOfParticleSortedList == 0 ) {
128  else {
130  }
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;
149 
150  return( particle );
151 
152 err:
153  MCGIDI_particle_free( smr, particle );
154  return( NULL );
155 }
const XML_Char * name
Definition: expat.h:151
MCGIDI_particle * prior
Definition: MCGIDI.h:247
static int numberOfParticles
double MCGIDI_particleMass_AMU(statusMessageReporting *smr, const char *name)
Definition: MCGIDI_mass.cc:853
static MCGIDI_particle * particleListEnd
static int initialSizeOfList
MCGIDI_POP * MCGIDI_POPs_findParticle(MCGIDI_POPs *pops, char const *name)
Definition: MCGIDI_pop.cc:133
static MCGIDI_particle ** particleSortedList
double mass_MeV
Definition: MCGIDI.h:251
static int sizeOfParticleSortedList
#define MCGIDI_AMU2MeV
Definition: MCGIDI.h:184
static MCGIDI_particle * particleList
double A(double temperature)
static constexpr double m
Definition: G4SIunits.hh:129
MCGIDI_particle * MCGIDI_particle_free(statusMessageReporting *smr, MCGIDI_particle *particle)
int smr_isOk(statusMessageReporting *smr)
char * smr_allocateCopyString(statusMessageReporting *smr, char const *s, char const *forItem, char const *file, int line, char const *function)
MCGIDI_particle * MCGIDI_particle_new(statusMessageReporting *smr)
int MCGIDI_miscNameToZAm(statusMessageReporting *smr, const char *name, int *Z, int *A, int *m, int *level)
Definition: MCGIDI_misc.cc:81
double mass_MeV
Definition: MCGIDI.h:235
MCGIDI_particle * next
Definition: MCGIDI.h:248
static int incrementalSizeOfList
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
#define smr_realloc2(smr, old, size, forItem)

Here is the call graph for this function:

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 }

Here is the caller graph for this function:

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 }
#define smr_malloc2(smr, size, zero, forItem)
int MCGIDI_particle_initialize(statusMessageReporting *smr, MCGIDI_particle *particle)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
const XML_Char * name
Definition: expat.h:151
static int numberOfParticles
static MCGIDI_particle ** particleSortedList
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 }
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
double mass_MeV
Definition: MCGIDI.h:235

Here is the caller graph for this function:

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 }
const XML_Char * name
Definition: expat.h:151
#define smr_allocateCopyString2(smr, s, forItem)
char * name
Definition: MCGIDI.h:232
double A(double temperature)
static constexpr double m
Definition: G4SIunits.hh:129
MCGIDI_GammaBranching * gammas
Definition: MCGIDI.h:238
#define smr_malloc2(smr, size, zero, forItem)
int MCGIDI_miscNameToZAm(statusMessageReporting *smr, const char *name, int *Z, int *A, int *m, int *level)
Definition: MCGIDI_misc.cc:81
double mass_MeV
Definition: MCGIDI.h:235
void * smr_freeMemory(void **p)
double level_MeV
Definition: MCGIDI.h:236
int level
Definition: MCGIDI.h:234
MCGIDI_POP * parent
Definition: MCGIDI.h:231
int numberOfGammaBranchs
Definition: MCGIDI.h:237
MCGIDI_POP * next
Definition: MCGIDI.h:230

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
char * name
Definition: MCGIDI.h:232
MCGIDI_GammaBranching * gammas
Definition: MCGIDI.h:238
void * smr_freeMemory(void **p)
int numberOfGammaBranchs
Definition: MCGIDI.h:237

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
const XML_Char * name
Definition: expat.h:151
int MCGIDI_POPs_findParticleIndex(MCGIDI_POPs *pops, char const *name)
Definition: MCGIDI_pop.cc:104
MCGIDI_POP ** sorted
Definition: MCGIDI.h:243
MCGIDI_POP * first
Definition: MCGIDI.h:243
int numberOfPOPs
Definition: MCGIDI.h:242
int lPoPs_addParticleIfNeeded(statusMessageReporting *smr, char const *name, char const *special)
Definition: lPoPs.cc:36
int globalPoPsIndex
Definition: MCGIDI.h:233
int increment
Definition: MCGIDI.h:242
#define smr_malloc2(smr, size, zero, forItem)
MCGIDI_POP * last
Definition: MCGIDI.h:243
void * smr_freeMemory(void **p)
MCGIDI_POP * MCGIDI_POP_new(statusMessageReporting *smr, char const *name, double mass_MeV, double level_MeV, MCGIDI_POP *parent)
Definition: MCGIDI_pop.cc:165
MCGIDI_POP * next
Definition: MCGIDI.h:230

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
const XML_Char * name
Definition: expat.h:151
int MCGIDI_POPs_findParticleIndex(MCGIDI_POPs *pops, char const *name)
Definition: MCGIDI_pop.cc:104
MCGIDI_POP ** sorted
Definition: MCGIDI.h:243

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
const XML_Char * name
Definition: expat.h:151
MCGIDI_POP ** sorted
Definition: MCGIDI.h:243
int numberOfPOPs
Definition: MCGIDI.h:242
char * name
Definition: MCGIDI.h:232
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

Here is the call graph for this function:

Here is the caller graph for this function:

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
void * smr_freeMemory(void **p)

Here is the call graph for this function:

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 }
int increment
Definition: MCGIDI.h:242

Here is the caller graph for this function:

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 }
#define smr_malloc2(smr, size, zero, forItem)
void * smr_freeMemory(void **p)
int MCGIDI_POPs_initial(statusMessageReporting *smr, MCGIDI_POPs *pops, int size)
Definition: MCGIDI_pop.cc:30

Here is the call graph for this function:

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

Here is the call graph for this function:

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 ** sorted
Definition: MCGIDI.h:243
MCGIDI_POP * first
Definition: MCGIDI.h:243
MCGIDI_POP * MCGIDI_POP_free(MCGIDI_POP *pop)
Definition: MCGIDI_pop.cc:191
void * smr_freeMemory(void **p)
int MCGIDI_POPs_initial(statusMessageReporting *smr, MCGIDI_POPs *pops, int size)
Definition: MCGIDI_pop.cc:30
MCGIDI_POP * next
Definition: MCGIDI.h:230

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_POP ** sorted
Definition: MCGIDI.h:243
int numberOfPOPs
Definition: MCGIDI.h:242
char * name
Definition: MCGIDI.h:232
double mass_MeV
Definition: MCGIDI.h:235

Here is the caller graph for this function:

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)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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
MCGIDI_POP * pop
Definition: MCGIDI.h:401

Here is the call graph for this function:

Here is the caller graph for this function:

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)
MCGIDI_outputChannel * outputChannel
Definition: MCGIDI.h:403

Here is the call graph for this function:

Here is the caller graph for this function:

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)
MCGIDI_outputChannel * outputChannel
Definition: MCGIDI.h:403

Here is the call graph for this function:

Here is the caller graph for this function:

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)
MCGIDI_outputChannel * outputChannel
Definition: MCGIDI.h:403

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
int delayedNeutronIndex
Definition: MCGIDI.h:405

Here is the caller graph for this function:

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 }
MCGIDI_product * MCGIDI_product_free(statusMessageReporting *smr, MCGIDI_product *product)
#define smr_malloc2(smr, size, zero, forItem)
int MCGIDI_product_initialize(statusMessageReporting *smr, MCGIDI_product *product)

Here is the call graph for this function:

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 
163 err:
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 }
const XML_Char * name
Definition: expat.h:151
#define smr_allocateCopyString2(smr, s, forItem)
double delayedNeutronRate
Definition: MCGIDI.h:406
int xDataTOME_convertAttributeToInteger(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int *n)
Definition: xDataTOM.cc:300
MCGIDI_POP * MCGIDI_POPs_findParticle(MCGIDI_POPs *pops, char const *name)
Definition: MCGIDI_pop.cc:133
char * label
Definition: MCGIDI.h:402
int64_t ptwXY_length(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:583
double ptwXY_getYMin(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1248
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:574
double ptwXY_getYMax(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1269
char * name
Definition: MCGIDI.h:232
int MCGIDI_product_release(statusMessageReporting *smr, MCGIDI_product *product)
ptwXYPoints * MCGIDI_misc_dataFromElement2ptwXYPointsInUnitsOf(statusMessageReporting *smr, xDataTOM_element *linear, char const *toUnits[2])
Definition: MCGIDI_misc.cc:424
#define smr_setReportError2p(smr, libraryID, code, fmt)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
int multiplicity
Definition: MCGIDI.h:404
enum nfu_status_e nfu_status
static ptwXYPoints * MCGIDI_product_parsePolynomialMultiplicity(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_product *product)
#define smr_unknownID
static int MCGIDI_product_parsePiecewiseMultiplicity(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_product *product)
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
int MCGIDI_outputChannel_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_POPs *pops, MCGIDI_outputChannel *outputChannel, MCGIDI_reaction *reaction, MCGIDI_product *parent)
static int MCGIDI_product_parseWeightedReferenceMultiplicityFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_product *product, ptwXYPoints **multiplicityVsEnergy, ptwXYPoints **norms)
nfu_status ptwXY_simpleCoalescePoints(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:529
int delayedNeutronIndex
Definition: MCGIDI.h:405
int MCGIDI_distribution_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_product *product, MCGIDI_POPs *pops, ptwXYPoints *norms)
ptwXYPoints * multiplicityVsEnergy
Definition: MCGIDI.h:407
int MCGIDI_product_initialize(statusMessageReporting *smr, MCGIDI_product *product)
MCGIDI_outputChannel decayChannel
Definition: MCGIDI.h:412
MCGIDI_POP * pop
Definition: MCGIDI.h:401
int MCGIDI_misc_PQUStringToDoubleInUnitOf(statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
Definition: MCGIDI_misc.cc:356
const char * nfu_statusMessage(nfu_status status)
Definition: nf_utilities.cc:76
MCGIDI_outputChannel * outputChannel
Definition: MCGIDI.h:403
ptwXYPoints * norms
Definition: MCGIDI.h:408
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:286

Here is the call graph for this function:

Here is the caller graph for this function:

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) );
74  MCGIDI_outputChannel_release( smr, &(product->decayChannel) );
75 
76  MCGIDI_product_initialize( smr, product );
77  return( 0 );
78 }
int MCGIDI_outputChannel_release(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
int MCGIDI_distribution_release(statusMessageReporting *smr, MCGIDI_distribution *distribution)
ptwXYPoints ** piecewiseMultiplicities
Definition: MCGIDI.h:410
char * label
Definition: MCGIDI.h:402
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:574
int numberOfPiecewiseMultiplicities
Definition: MCGIDI.h:409
void * smr_freeMemory(void **p)
ptwXYPoints * multiplicityVsEnergy
Definition: MCGIDI.h:407
int MCGIDI_product_initialize(statusMessageReporting *smr, MCGIDI_product *product)
MCGIDI_outputChannel decayChannel
Definition: MCGIDI.h:412
MCGIDI_distribution distribution
Definition: MCGIDI.h:411
ptwXYPoints * norms
Definition: MCGIDI.h:408

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_angular * angular
Definition: MCGIDI.h:383
#define smr_setReportError2(smr, libraryID, code, fmt,...)
int MCGIDI_angular_sampleMu(statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
#define smr_unknownID
enum MCGIDI_distributionType type
Definition: MCGIDI.h:382
MCGIDI_distribution distribution
Definition: MCGIDI.h:411

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
ptwXYPoints ** piecewiseMultiplicities
Definition: MCGIDI.h:410
double MCGIDI_sampling_ptwXY_getValueAtX(ptwXYPoints *ptwXY, double x1)
int numberOfPiecewiseMultiplicities
Definition: MCGIDI.h:409
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
ptwXYPoints * multiplicityVsEnergy
Definition: MCGIDI.h:407
double ptwXY_getXMax(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1239
ptwXYPoints * norms
Definition: MCGIDI.h:408

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_angular * angular
Definition: MCGIDI.h:383
int MCGIDI_angular_setTwoBodyMasses(statusMessageReporting *smr, MCGIDI_angular *angular, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)
MCGIDI_distribution distribution
Definition: MCGIDI.h:411

Here is the call graph for this function:

Here is the caller graph for this function:

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
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_productInfo * productInfo
Definition: MCGIDI.h:275
int MCGIDI_productsInfo_getNumberOfUniqueProducts ( MCGIDI_productsInfo productsInfo)

Definition at line 527 of file MCGIDI_reaction.cc.

527  {
528 
529  return( productsInfo->numberOfProducts );
530 }
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_productInfo * productInfo
Definition: MCGIDI.h:275
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_productInfo * productInfo
Definition: MCGIDI.h:275
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 }
ptwXYPoints * crossSection
Definition: MCGIDI.h:426
nfu_status ptwXY_dullEdges(ptwXYPoints *ptwXY, double lowerEps, double upperEps, int positiveXOnly)

Here is the call graph for this function:

Here is the caller graph for this function:

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)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
ptwXYPoints * crossSection
Definition: MCGIDI.h:426
int thresholdGroupIndex
Definition: MCGIDI.h:422
nfu_status ptwXY_getValueAtX(ptwXYPoints *ptwXY, double x, double *y)
Definition: ptwXY_core.cc:844
double thresholdGroupedDeltaCrossSection
Definition: MCGIDI.h:424
enum MCGIDI_quantityLookupMode getCrossSectionMode(void) const
Definition: MCGIDI.h:107
ptwXPoints * crossSectionGrouped
Definition: MCGIDI.h:427
#define smr_setReportError2(smr, libraryID, code, fmt,...)
int getGroupIndex(void) const
Definition: MCGIDI.h:100
#define smr_unknownID
double * ptwX_getPointAtIndex(ptwXPoints *ptwX, int64_t index)
Definition: ptwX_core.cc:206
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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 }
double S(double temp)
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

Here is the caller graph for this function:

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
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 }
MCGIDI_target_heated * target
Definition: MCGIDI.h:416
double MCGIDI_target_heated_getProjectileMass_MeV(statusMessageReporting *smr, MCGIDI_target_heated *target)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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 }
MCGIDI_target_heated * target
Definition: MCGIDI.h:416

Here is the caller graph for this function:

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 }
MCGIDI_target_heated * target
Definition: MCGIDI.h:416
double MCGIDI_target_heated_getTargetMass_MeV(statusMessageReporting *smr, MCGIDI_target_heated *target)

Here is the call graph for this function:

Here is the caller graph for this function:

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 );
45  reaction->transportabilities = new transportabilitiesMap( );
46  return( 0 );
47 }
transportabilitiesMap * transportabilities
Definition: MCGIDI.h:430
static int MCGIDI_reaction_initialize2(statusMessageReporting *smr, MCGIDI_reaction *reaction)
std::map< int, enum GIDI::MCGIDI_transportability > transportabilitiesMap
Definition: MCGIDI.h:171

Here is the call graph for this function:

Here is the caller graph for this function:

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)
#define smr_malloc2(smr, size, zero, forItem)

Here is the call graph for this function:

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;
89  enum xDataTOM_interpolationQualifier qualifier;
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 
122 err:
123  MCGIDI_reaction_release( smr, reaction );
124  return( 1 );
125 }
#define smr_allocateCopyString2(smr, s, forItem)
int domainValuesPresent
Definition: MCGIDI.h:421
const XML_Char * target
Definition: expat.h:268
ptwXYPoints * crossSection
Definition: MCGIDI.h:426
enum MCGIDI_reactionType reactionType
Definition: MCGIDI.h:418
int MCGIDI_reaction_initialize(statusMessageReporting *smr, MCGIDI_reaction *reaction)
int xDataTOME_convertAttributeToInteger(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int *n)
Definition: xDataTOM.cc:300
char const * outputChannelStr
Definition: MCGIDI.h:419
MCGIDI_outputChannel outputChannel
Definition: MCGIDI.h:428
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
int MCGIDI_reaction_release(statusMessageReporting *smr, MCGIDI_reaction *reaction)
xDataTOM_interpolationFlag
Definition: xDataTOM.h:19
MCGIDI_target_heated * target
Definition: MCGIDI.h:416
ptwXYPoints * MCGIDI_misc_dataFromElement2ptwXYPointsInUnitsOf(statusMessageReporting *smr, xDataTOM_element *linear, char const *toUnits[2])
Definition: MCGIDI_misc.cc:424
#define smr_setReportError2(smr, libraryID, code, fmt,...)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
double ptwXY_getXMin(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1206
static int MCGIDI_reaction_ParseReactionTypeAndDetermineProducts(statusMessageReporting *smr, MCGIDI_POPs *pops, MCGIDI_reaction *reaction)
#define smr_unknownID
xDataTOM_interpolationQualifier
Definition: xDataTOM.h:21
int MCGIDI_outputChannel_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_POPs *pops, MCGIDI_outputChannel *outputChannel, MCGIDI_reaction *reaction, MCGIDI_product *parent)
double ptwXY_getXMax(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1239
xDataTOM_attributionList attributes
Definition: MCGIDI.h:420
int xDataTOME_copyAttributionList(statusMessageReporting *smr, xDataTOM_attributionList *desc, xDataTOM_element *element)
Definition: xDataTOM.cc:293
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:286

Here is the call graph for this function:

Here is the caller graph for this function:

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 
507  reaction->thresholdGroupDomain = reaction->thresholdGroupedDeltaCrossSection = 0.;
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 }
ptwXYPoints * crossSection
Definition: MCGIDI.h:426
int thresholdGroupIndex
Definition: MCGIDI.h:422
double thresholdGroupDomain
Definition: MCGIDI.h:423
nfu_status ptwX_add_ptwX(ptwXPoints *ptwX1, ptwXPoints *ptwX2)
Definition: ptwX_core.cc:479
double thresholdGroupedDeltaCrossSection
Definition: MCGIDI.h:424
ptwXPoints * crossSectionGrouped
Definition: MCGIDI.h:427
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158
enum nfu_status_e nfu_status
double * ptwX_getPointAtIndex(ptwXPoints *ptwX, int64_t index)
Definition: ptwX_core.cc:206

Here is the call graph for this function:

Here is the caller graph for this function:

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 );
73  MCGIDI_outputChannel_release( smr, &(reaction->outputChannel) );
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 }
int MCGIDI_outputChannel_release(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel)
transportabilitiesMap * transportabilities
Definition: MCGIDI.h:430
ptwXYPoints * crossSection
Definition: MCGIDI.h:426
char const * outputChannelStr
Definition: MCGIDI.h:419
MCGIDI_outputChannel outputChannel
Definition: MCGIDI.h:428
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:574
MCGIDI_productsInfo productsInfo
Definition: MCGIDI.h:429
ptwXPoints * crossSectionGrouped
Definition: MCGIDI.h:427
MCGIDI_productInfo * productInfo
Definition: MCGIDI.h:275
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158
void xDataTOMAL_release(xDataTOM_attributionList *attributes)
Definition: xDataTOM.cc:361
static int MCGIDI_reaction_initialize2(statusMessageReporting *smr, MCGIDI_reaction *reaction)
void * smr_freeMemory(void **p)
xDataTOM_attributionList attributes
Definition: MCGIDI.h:420

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_sampledProductsData * products
Definition: MCGIDI.h:294
int MCGIDI_sampledProducts_remalloc(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas)

Here is the call graph for this function:

Here is the caller graph for this function:

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_sampledProductsData * products
Definition: MCGIDI.h:294
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 }
MCGIDI_sampledProductsData * products
Definition: MCGIDI.h:294
int MCGIDI_sampledProducts_remalloc(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas)

Here is the call graph for this function:

Here is the caller graph for this function:

int MCGIDI_sampledProducts_number ( MCGIDI_sampledProductsDatas sampledProductsDatas)

Definition at line 410 of file MCGIDI_product.cc.

410  {
411 
412  return( sampledProductsDatas->numberOfProducts );
413 }
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 }
MCGIDI_sampledProductsData * products
Definition: MCGIDI.h:294
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_sampledProductsData * products
Definition: MCGIDI.h:294
#define smr_realloc2(smr, old, size, forItem)

Here is the caller graph for this function:

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 }
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:306
int MCGIDI_sampling_sampleX_from_pdfOfX(MCGIDI_pdfOfX *dist, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
tuple x
Definition: test.py:50
statusMessageReporting * smr
Definition: MCGIDI.h:312
int MCGIDI_sampling_interpolationValues(statusMessageReporting *smr, ptwXY_interpolation interpolation, double *ws, double y1, double y2, double *y)
ptwXY_interpolation interpolationWY
Definition: MCGIDI.h:306
xDataTOM_Int MCGIDI_misc_binarySearch(xDataTOM_Int n, double *ds, double d)
Definition: MCGIDI_misc.cc:228
enum ptwXY_interpolation_e ptwXY_interpolation
int MCGIDI_sampling_sampleX_from_pdfsOfXGivenW(MCGIDI_pdfsOfXGivenW *dists, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
double(* rng)(void *)
Definition: MCGIDI.h:258
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:313
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97
MCGIDI_pdfOfX * dist
Definition: MCGIDI.h:308

Here is the call graph for this function:

Here is the caller graph for this function:

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:55
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
G4double G4Log(G4double x)
Definition: G4Log.hh:230

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
double * Xs
Definition: MCGIDI.h:299
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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 *smr, MCGIDI_pdfsOfXGivenW *dists)
void * smr_freeMemory(void **p)
int MCGIDI_sampling_pdfsOfX_release(statusMessageReporting *smr, MCGIDI_pdfOfX *dist)
MCGIDI_pdfOfX * dist
Definition: MCGIDI.h:308

Here is the call graph for this function:

Here is the caller graph for this function:

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_status ptwXY_getValueAtX(ptwXYPoints *ptwXY, double x, double *y)
Definition: ptwXY_core.cc:844
double ptwXY_getXMin(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1206
double ptwXY_getXMax(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:1239

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
double * cdf
Definition: MCGIDI.h:301
static const G4double d2
double * Xs
Definition: MCGIDI.h:299
statusMessageReporting * smr
Definition: MCGIDI.h:312
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
static const G4double d1
xDataTOM_Int MCGIDI_misc_binarySearch(xDataTOM_Int n, double *ds, double d)
Definition: MCGIDI_misc.cc:228
int numberOfXs
Definition: MCGIDI.h:298
double * pdf
Definition: MCGIDI.h:300
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:313

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:306
ptwXY_interpolation interpolationWY
Definition: MCGIDI.h:313
int MCGIDI_sampling_sampleX_from_pdfOfX(MCGIDI_pdfOfX *dist, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
statusMessageReporting * smr
Definition: MCGIDI.h:312
#define smr_setReportError2(smr, libraryID, code, fmt,...)
ptwXY_interpolation interpolationWY
Definition: MCGIDI.h:306
#define smr_unknownID
xDataTOM_Int MCGIDI_misc_binarySearch(xDataTOM_Int n, double *ds, double d)
Definition: MCGIDI_misc.cc:228
G4double G4Log(G4double x)
Definition: G4Log.hh:230
ptwXY_interpolation interpolationXY
Definition: MCGIDI.h:313
MCGIDI_pdfOfX * dist
Definition: MCGIDI.h:308

Here is the call graph for this function:

Here is the caller graph for this function:

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)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
const XML_Char * name
Definition: expat.h:151
char const * xDataTOMAL_getAttributesValue(xDataTOM_attributionList *attributes, char const *name)
Definition: xDataTOM.cc:403
xDataTOM_attributionList attributes
Definition: MCGIDI.h:465

Here is the call graph for this function:

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 }
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467
int MCGIDI_target_numberOfReactions(statusMessageReporting *smr, MCGIDI_target *target)
int MCGIDI_target_heated_getReactionsDomain(statusMessageReporting *smr, MCGIDI_target_heated *target, int index, double *EMin, double *EMax)

Here is the call graph for this function:

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
int nHeatedTargets
Definition: MCGIDI.h:466
MCGIDI_target_heated_info * heatedTargets
Definition: MCGIDI.h:468
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID

Here is the call graph for this function:

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_heated * heatedTarget
Definition: MCGIDI.h:457
int nHeatedTargets
Definition: MCGIDI.h:466
MCGIDI_target_heated_info * heatedTargets
Definition: MCGIDI.h:468
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
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 }
MCGIDI_target_heated * heatedTarget
Definition: MCGIDI.h:457
double getTemperature(void) const
Definition: MCGIDI.h:103
double MCGIDI_target_heated_getIndexReactionCrossSectionAtE(statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes, bool sampling)
MCGIDI_target_heated_info ** readHeatedTargets
Definition: MCGIDI.h:469
int nReadHeatedTargets
Definition: MCGIDI.h:466

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467
double MCGIDI_target_heated_getIndexReactionFinalQ(statusMessageReporting *smr, MCGIDI_target_heated *target, int index, MCGIDI_quantitiesLookupModes &modes)

Here is the call graph for this function:

MCGIDI_reaction* MCGIDI_target_getReactionAtIndex ( MCGIDI_target target,
int  index 
)

Definition at line 333 of file MCGIDI_target.cc.

333  {
334 
335  return( MCGIDI_target_heated_getReactionAtIndex( target->baseHeatedTarget, index ) );
336 }
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex(MCGIDI_target_heated *target, int index)

Here is the call graph for this function:

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_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex_smr(statusMessageReporting *smr, MCGIDI_target_heated *target, int index)

Here is the call graph for this function:

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 }
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex_smr(statusMessageReporting *smr, MCGIDI_target_heated *target, int index)
enum MCGIDI_reactionType MCGIDI_reaction_getReactionType(statusMessageReporting *smr, MCGIDI_reaction *reaction)

Here is the call graph for this function:

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 }
int nHeatedTargets
Definition: MCGIDI.h:466
MCGIDI_target_heated_info * heatedTargets
Definition: MCGIDI.h:468

Here is the caller graph for this function:

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 }
MCGIDI_target_heated * heatedTarget
Definition: MCGIDI.h:457
double getTemperature(void) const
Definition: MCGIDI.h:103
MCGIDI_target_heated_info ** readHeatedTargets
Definition: MCGIDI.h:469
double MCGIDI_target_heated_getTotalCrossSectionAtE(statusMessageReporting *smr, MCGIDI_target_heated *target, MCGIDI_quantitiesLookupModes &modes, bool sampling)
int nReadHeatedTargets
Definition: MCGIDI.h:466

Here is the call graph for this function:

Here is the caller graph for this function:

transportabilitiesMap const* MCGIDI_target_getUniqueProducts ( statusMessageReporting smr,
MCGIDI_target target 
)

Definition at line 501 of file MCGIDI_target.cc.

501  {
502 
504 }
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467
transportabilitiesMap const * MCGIDI_target_heated_getUniqueProducts(statusMessageReporting *smr, MCGIDI_target_heated *target)

Here is the call graph for this function:

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 *smr, MCGIDI_target_heated *target)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

int MCGIDI_target_heated_getEnergyGrid ( statusMessageReporting smr,
MCGIDI_target_heated target,
double **  energyGrid 
)
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)

Here is the call graph for this function:

Here is the caller graph for this function:

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)
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex_smr(statusMessageReporting *smr, MCGIDI_target_heated *target, int index)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

double MCGIDI_target_heated_getProjectileMass_MeV ( statusMessageReporting smr,
MCGIDI_target_heated target 
)

Definition at line 447 of file MCGIDI_target_heated.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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 }
char * name
Definition: MCGIDI.h:232
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
MCGIDI_POP * targetPOP
Definition: MCGIDI.h:439
MCGIDI_POP * projectilePOP
Definition: MCGIDI.h:438
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex(MCGIDI_target_heated *target, int index)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex(MCGIDI_target_heated *target, int index)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex(MCGIDI_target_heated *target, int index)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
double MCGIDI_POP_getMass_MeV(MCGIDI_POP *pop)
Definition: MCGIDI_pop.cc:212
MCGIDI_POP * targetPOP
Definition: MCGIDI.h:439

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
nfu_status ptwXY_getValueAtX(ptwXYPoints *ptwXY, double x, double *y)
Definition: ptwXY_core.cc:844
ptwXPoints * crossSectionGrouped
Definition: MCGIDI.h:445
enum MCGIDI_quantityLookupMode getCrossSectionMode(void) const
Definition: MCGIDI.h:107
ptwXPoints * crossSectionGroupedForSampling
Definition: MCGIDI.h:446
#define smr_setReportError2(smr, libraryID, code, fmt,...)
ptwXYPoints * crossSection
Definition: MCGIDI.h:444
int getGroupIndex(void) const
Definition: MCGIDI.h:100
#define smr_unknownID
int64_t ptwX_length(ptwXPoints *ptwX)
Definition: ptwX_core.cc:166
double * ptwX_getPointAtIndex(ptwXPoints *ptwX, int64_t index)
Definition: ptwX_core.cc:206
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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 }
MCGIDI_POPs pops
Definition: MCGIDI.h:437
transportabilitiesMap * transportabilities
Definition: MCGIDI.h:449
int MCGIDI_POPs_initial(statusMessageReporting *smr, MCGIDI_POPs *pops, int size)
Definition: MCGIDI_pop.cc:30
std::map< int, enum GIDI::MCGIDI_transportability > transportabilitiesMap
Definition: MCGIDI.h:171

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
const XML_Char * target
Definition: expat.h:268
int MCGIDI_target_heated_initialize(statusMessageReporting *smr, MCGIDI_target_heated *target)
#define smr_malloc2(smr, size, zero, forItem)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
int MCGIDI_target_heated_read(statusMessageReporting *smr, MCGIDI_target_heated *target, const char *fileName)
const XML_Char * target
Definition: expat.h:268
void * smr_freeMemory(void **p)
MCGIDI_target_heated * MCGIDI_target_heated_new(statusMessageReporting *smr)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

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;
106 int 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 
206 err:
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 }
const XML_Char * name
Definition: expat.h:151
int MCGIDI_target_heated_release(statusMessageReporting *smr, MCGIDI_target_heated *target)
#define smr_allocateCopyString2(smr, s, forItem)
transportabilitiesMap * transportabilities
Definition: MCGIDI.h:430
ptwXYPoints * crossSection
Definition: MCGIDI.h:426
xDataTOM_element * xDataTOME_getFirstElement(xDataTOM_element *element)
Definition: xDataTOM.cc:230
static int MCGIDI_target_heated_parsePOPs(statusMessageReporting *smr, MCGIDI_target_heated *target, xDataTOM_element *element, xDataTOM_element *particleAliases)
static int MCGIDI_target_heated_parseReaction(statusMessageReporting *smr, xDataTOM_element *child, MCGIDI_target_heated *target, MCGIDI_POPs *pops, MCGIDI_reaction *reaction)
MCGIDI_POP * MCGIDI_POPs_findParticle(MCGIDI_POPs *pops, char const *name)
Definition: MCGIDI_pop.cc:133
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
xDataTOM_attributionList attributes
Definition: MCGIDI.h:440
int xDataTOMAL_copyAttributionList(statusMessageReporting *smr, xDataTOM_attributionList *desc, xDataTOM_attributionList *src)
Definition: xDataTOM.cc:415
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:574
xDataTOM_attributionList attributes
Definition: xDataTOM.h:184
#define MCGIDI_misc_pointerToTOMAttributeIfAllOk3(smr, path, required, attributes, name)
Definition: MCGIDI_misc.h:28
void MCGIDI_misc_updateTransportabilitiesMap(transportabilitiesMap *transportabilities, int PoPID, enum MCGIDI_transportability transportability)
Definition: MCGIDI_misc.cc:482
MCGIDI_POPs pops
Definition: MCGIDI.h:437
xDataTOM_element * xDataTOM_getDocumentsElement(xDataTOM_TOM *TOM)
Definition: xDataTOM.cc:223
xDataTOM_TOM * xDataTOM_importFile(statusMessageReporting *smr, const char *fileName)
Definition: xDataTOM.cc:44
#define smr_setReportError2(smr, libraryID, code, fmt,...)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
ptwXYPoints * crossSection
Definition: MCGIDI.h:444
double temperature_MeV
Definition: MCGIDI.h:442
enum nfu_status_e nfu_status
transportabilitiesMap * transportabilities
Definition: MCGIDI.h:449
#define smr_malloc2(smr, size, zero, forItem)
const G4int n
#define smr_unknownID
MCGIDI_reaction * reactions
Definition: MCGIDI.h:448
int smr_isOk(statusMessageReporting *smr)
const XML_Char * version
Definition: expat.h:187
int xDataTOM_numberOfElementsByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:268
ptwXYPoints * ptwXY_add_ptwXY(ptwXYPoints *ptwXY1, ptwXYPoints *ptwXY2, nfu_status *status)
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
Definition: MCGIDI_misc.cc:381
void * xDataTOM_freeTOM(statusMessageReporting *smr, xDataTOM_TOM **TOM)
Definition: xDataTOM.cc:78
xDataTOM_element * xDataTOME_getNextElement(xDataTOM_element *element)
Definition: xDataTOM.cc:238
const char * nfu_statusMessage(nfu_status status)
Definition: nf_utilities.cc:76
int MCGIDI_reaction_fixDomains(statusMessageReporting *smr, MCGIDI_reaction *reaction, double EMin, double EMax, nfu_status *status)
int MCGIDI_reaction_getDomain(statusMessageReporting *smr, MCGIDI_reaction *reaction, double *EMin, double *EMax)
char * xDataTOMMisc_getAbsPath(statusMessageReporting *smr, const char *fileName)
MCGIDI_POP * targetPOP
Definition: MCGIDI.h:439
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition: xDataTOM.cc:286
MCGIDI_POP * projectilePOP
Definition: MCGIDI.h:438

Here is the call graph for this function:

Here is the caller graph for this function:

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 
608 err:
609  ptwX_free( totalGroupedCrossSection );
611  return( 1 );
612 }
int getNumberOfGroups(void) const
double ptwX_getPointAtIndex_Unsafely(ptwXPoints *ptwX, int64_t index)
Definition: ptwX_core.cc:215
int thresholdGroupIndex
Definition: MCGIDI.h:422
ptwXPoints * ptwX_createLine(int64_t size, int64_t length, double slope, double offset, nfu_status *status)
Definition: ptwX_core.cc:62
ptwXPoints * crossSectionGrouped
Definition: MCGIDI.h:445
double thresholdGroupedDeltaCrossSection
Definition: MCGIDI.h:424
char * name
Definition: MCGIDI.h:232
int globalPoPsIndex
Definition: MCGIDI.h:233
GIDI_settings_particle const * getParticle(int PoPId) const
ptwXPoints * crossSectionGroupedForSampling
Definition: MCGIDI.h:446
#define smr_setReportError2(smr, libraryID, code, fmt,...)
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158
double temperature_MeV
Definition: MCGIDI.h:442
enum nfu_status_e nfu_status
ptwXPoints * ptwX_clone(ptwXPoints *ptwX, nfu_status *status)
Definition: ptwX_core.cc:88
#define smr_unknownID
int MCGIDI_reaction_recast(statusMessageReporting *smr, MCGIDI_reaction *reaction, GIDI_settings &settings, GIDI_settings_particle const *projectileSettings, double temperature_MeV, ptwXPoints *totalGroupedCrossSection)
MCGIDI_reaction * reactions
Definition: MCGIDI.h:448
nfu_status ptwX_setPointAtIndex(ptwXPoints *ptwX, int64_t index, double x)
Definition: ptwX_core.cc:222
const char * nfu_statusMessage(nfu_status status)
Definition: nf_utilities.cc:76
bool isEnergyMode_grouped(void) const
MCGIDI_POP * projectilePOP
Definition: MCGIDI.h:438

Here is the call graph for this function:

Here is the caller graph for this function:

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 );
78  ptwX_free( target->crossSectionGrouped );
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 }
ptwXPoints * crossSectionGrouped
Definition: MCGIDI.h:445
xDataTOM_attributionList attributes
Definition: MCGIDI.h:440
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition: ptwXY_core.cc:574
int MCGIDI_reaction_release(statusMessageReporting *smr, MCGIDI_reaction *reaction)
MCGIDI_POPs pops
Definition: MCGIDI.h:437
ptwXPoints * crossSectionGroupedForSampling
Definition: MCGIDI.h:446
ptwXYPoints * crossSection
Definition: MCGIDI.h:444
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158
void xDataTOMAL_release(xDataTOM_attributionList *attributes)
Definition: xDataTOM.cc:361
transportabilitiesMap * transportabilities
Definition: MCGIDI.h:449
MCGIDI_reaction * reactions
Definition: MCGIDI.h:448
int MCGIDI_POPs_release(MCGIDI_POPs *pops)
Definition: MCGIDI_pop.cc:51
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_outputChannel outputChannel
Definition: MCGIDI.h:428
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex_smr(statusMessageReporting *smr, MCGIDI_target_heated *target, int index)
int MCGIDI_outputChannel_sampleProductsAtE(statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas, double *masses)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

MCGIDI_target* MCGIDI_target_new ( statusMessageReporting smr)

Definition at line 33 of file MCGIDI_target.cc.

33  {
34 
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 }
const XML_Char * target
Definition: expat.h:268
MCGIDI_target * MCGIDI_target_free(statusMessageReporting *smr, MCGIDI_target *target)
#define smr_malloc2(smr, size, zero, forItem)
int MCGIDI_target_initialize(statusMessageReporting *smr, MCGIDI_target *target)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 52 of file MCGIDI_target.cc.

52  {
53 
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 }
const XML_Char * target
Definition: expat.h:268
MCGIDI_target * MCGIDI_target_new(statusMessageReporting *smr)
int MCGIDI_target_read(statusMessageReporting *smr, MCGIDI_target *target, const char *fileName)
void * smr_freeMemory(void **p)

Here is the call graph for this function:

Here is the caller graph for this function:

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;
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 }
const XML_Char * target
Definition: expat.h:268
MCGIDI_target * MCGIDI_target_newRead(statusMessageReporting *smr, const char *fileName)
void * smr_freeMemory(void **p)
char * MCGIDI_map_findTarget(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, const char *projectile, const char *targetName)
Definition: MCGIDI_map.cc:376

Here is the call graph for this function:

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;
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 }
const XML_Char * target
Definition: expat.h:268
MCGIDI_target * MCGIDI_target_newRead(statusMessageReporting *smr, const char *fileName)
void * smr_freeMemory(void **p)
char * MCGIDI_map_findTargetViaPoPIDs(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, int projectile_PoPID, int target_PoPID)
Definition: MCGIDI_map.cc:302

Here is the call graph for this function:

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
352 return( 0 );
353 }
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467
int MCGIDI_target_heated_numberOfProductionReactions(statusMessageReporting *smr, MCGIDI_target_heated *target)

Here is the call graph for this function:

Here is the caller graph for this function:

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)
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467

Here is the call graph for this function:

Here is the caller graph for this function:

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 */
148  xDataXML_document *doc;
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_target_readHeatedTarget(statusMessageReporting *smr, MCGIDI_target *target, int index)
#define smr_allocateCopyString2(smr, s, forItem)
MCGIDI_target_heated * heatedTarget
Definition: MCGIDI.h:457
xDataXML_document * xDataXML_importFile2(statusMessageReporting *smr, char const *fileName)
int nHeatedTargets
Definition: MCGIDI.h:466
MCGIDI_target_heated_info * heatedTargets
Definition: MCGIDI.h:468
char * path
Definition: MCGIDI.h:461
xDataXML_element * xDataXML_getDocumentsElement(xDataXML_document *doc)
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467
static int _MCGIDI_target_releaseAndReturnOne(statusMessageReporting *smr, MCGIDI_target *target)
#define smr_setReportError2p(smr, libraryID, code, fmt)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
void * xDataXML_freeDoc(statusMessageReporting *smr, xDataXML_document *doc)
#define smr_malloc2(smr, size, zero, forItem)
xDataXML_element * xDataXML_getNextElement(xDataXML_element *element)
#define smr_unknownID
char * MCGIDI_misc_getAbsPath(statusMessageReporting *smr, char const *fileName)
Definition: MCGIDI_misc.cc:250
int xDataXML_convertAttributeToDouble(statusMessageReporting *smr, xDataXML_element *element, char const *name, double *d, int required)
const XML_Char * version
Definition: expat.h:187
char * absPath
Definition: MCGIDI.h:462
char const * xDataXML_getAttributesValueInElement(xDataXML_element *element, char const *name)
int MCGIDI_target_release(statusMessageReporting *smr, MCGIDI_target *target)
MCGIDI_target_heated_info ** readHeatedTargets
Definition: MCGIDI.h:469
int MCGIDI_target_initialize(statusMessageReporting *smr, MCGIDI_target *target)
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
xDataXML_element * xDataXML_getFirstElement(xDataXML_element *element)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
int MCGIDI_target_read(statusMessageReporting *smr, MCGIDI_target *target, const char *fileName)
char * MCGIDI_map_findTarget(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, const char *projectile, const char *targetName)
Definition: MCGIDI_map.cc:376

Here is the call graph for this function:

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 }
int MCGIDI_target_read(statusMessageReporting *smr, MCGIDI_target *target, const char *fileName)
char * MCGIDI_map_findTargetViaPoPIDs(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, int projectile_PoPID, int target_PoPID)
Definition: MCGIDI_map.cc:302

Here is the call graph for this function:

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 * heatedTarget
Definition: MCGIDI.h:457
int nHeatedTargets
Definition: MCGIDI.h:466
MCGIDI_POP * targetPOP
Definition: MCGIDI.h:464
MCGIDI_target_heated_info * heatedTargets
Definition: MCGIDI.h:468
MCGIDI_target_heated * MCGIDI_target_heated_newRead(statusMessageReporting *smr, const char *fileName)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
MCGIDI_target_heated_info ** readHeatedTargets
Definition: MCGIDI.h:469
MCGIDI_POP * projectilePOP
Definition: MCGIDI.h:463
int nReadHeatedTargets
Definition: MCGIDI.h:466
MCGIDI_POP * targetPOP
Definition: MCGIDI.h:439
MCGIDI_POP * projectilePOP
Definition: MCGIDI.h:438

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
MCGIDI_target_heated * heatedTarget
Definition: MCGIDI.h:457
int MCGIDI_target_heated_recast(statusMessageReporting *smr, MCGIDI_target_heated *target, GIDI_settings &settings)
MCGIDI_target_heated_info ** readHeatedTargets
Definition: MCGIDI.h:469
int nReadHeatedTargets
Definition: MCGIDI.h:466

Here is the call graph for this function:

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 * heatedTarget
Definition: MCGIDI.h:457
MCGIDI_target_heated * MCGIDI_target_heated_free(statusMessageReporting *smr, MCGIDI_target_heated *target)
int nHeatedTargets
Definition: MCGIDI.h:466
MCGIDI_target_heated_info * heatedTargets
Definition: MCGIDI.h:468
char * path
Definition: MCGIDI.h:461
void xDataTOMAL_release(xDataTOM_attributionList *attributes)
Definition: xDataTOM.cc:361
char * absPath
Definition: MCGIDI.h:462
void * smr_freeMemory(void **p)
MCGIDI_target_heated_info ** readHeatedTargets
Definition: MCGIDI.h:469
int MCGIDI_target_initialize(statusMessageReporting *smr, MCGIDI_target *target)
xDataTOM_attributionList attributes
Definition: MCGIDI.h:465

Here is the call graph for this function:

Here is the caller graph for this function:

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_heated * baseHeatedTarget
Definition: MCGIDI.h:467

Here is the call graph for this function:

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 }
#define MCGIDI_speedOfLight_cm_sec
Definition: MCGIDI.h:183
int MCGIDI_sampledProducts_addProduct(statusMessageReporting *smr, MCGIDI_sampledProductsDatas *sampledProductsDatas, MCGIDI_sampledProductsData *sampledProductsData)
double mass_MeV
Definition: MCGIDI.h:235
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97
MCGIDI_POP * projectilePOP
Definition: MCGIDI.h:463

Here is the call graph for this function:

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 }
int thresholdGroupIndex
Definition: MCGIDI.h:422
#define MCGIDI_nullReaction
Definition: MCGIDI.h:181
double thresholdGroupDomain
Definition: MCGIDI.h:423
enum MCGIDI_quantityLookupMode getCrossSectionMode(void) const
Definition: MCGIDI.h:107
MCGIDI_target_heated * baseHeatedTarget
Definition: MCGIDI.h:467
#define smr_setReportError2(smr, libraryID, code, fmt,...)
double getTemperature(void) const
Definition: MCGIDI.h:103
int MCGIDI_target_numberOfReactions(statusMessageReporting *smr, MCGIDI_target *target)
int getGroupIndex(void) const
Definition: MCGIDI.h:100
#define smr_unknownID
double MCGIDI_target_getIndexReactionCrossSectionAtE(statusMessageReporting *smr, MCGIDI_target *target, int index, MCGIDI_quantitiesLookupModes &modes, bool sampling)
double getProjectileEnergy(void) const
Definition: MCGIDI.h:97
MCGIDI_reaction * MCGIDI_target_heated_getReactionAtIndex(MCGIDI_target_heated *target, int index)

Here is the call graph for this function:

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 
37 err:
38  return( 1 );
39 }
int MCGIDI_angular_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition: xDataTOM.cc:246
enum MCGIDI_distributionType type
Definition: MCGIDI.h:382
int MCGIDI_energy_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms, enum MCGIDI_energyType energyType, double gammaEnergy_MeV)

Here is the call graph for this function:

Here is the caller graph for this function:

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)
MCGIDI_angular * angular
Definition: MCGIDI.h:383
int MCGIDI_angular_sampleMu(statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
MCGIDI_energy * energy
Definition: MCGIDI.h:384
enum xDataTOM_frame frame
Definition: MCGIDI.h:256
xDataTOM_frame
Definition: xDataTOM.h:23

Here is the call graph for this function:

Here is the caller graph for this function:

char const* MCGIDI_version ( void  )

Definition at line 13 of file MCGIDI_version.cc.

13  {
14 
15  if( versionStr[0] == 0 ) sprintf( versionStr, "MCGIDI version %d.%d.%d", MCGIDI_VERSION_MAJOR, MCGIDI_VERSION_MINOR, MCGIDI_VERSION_PATCHLEVEL );
16  return( versionStr );
17 }
#define MCGIDI_VERSION_MINOR
Definition: MCGIDI.h:9
#define MCGIDI_VERSION_PATCHLEVEL
Definition: MCGIDI.h:10
#define MCGIDI_VERSION_MAJOR
Definition: MCGIDI.h:8
static char versionStr[64]
int MCGIDI_versionMajor ( void  )

Definition at line 21 of file MCGIDI_version.cc.

21 { return( MCGIDI_VERSION_MAJOR ); }
#define MCGIDI_VERSION_MAJOR
Definition: MCGIDI.h:8
int MCGIDI_versionMinor ( void  )

Definition at line 22 of file MCGIDI_version.cc.

22 { return( MCGIDI_VERSION_MINOR ); }
#define MCGIDI_VERSION_MINOR
Definition: MCGIDI.h:9
int MCGIDI_versionPatchLevel ( void  )

Definition at line 23 of file MCGIDI_version.cc.

23 { return( MCGIDI_VERSION_PATCHLEVEL ); }
#define MCGIDI_VERSION_PATCHLEVEL
Definition: MCGIDI.h:10

Variable Documentation

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