12 #if defined __cplusplus
27 return( angularEnergy );
68 char const *nativeData;
73 if( strcmp( nativeData,
"pointwise" ) == 0 ) {
75 else if( strcmp( nativeData,
"linear" ) == 0 ) {
94 double y,
norm, energyInFactor;
95 char const *energyUnit, *energyOutProbabilityUnits[2] = {
"MeV",
"1/MeV" };
117 if( ( pdfOfMuGivenE->
Ws = (
double *)
smr_malloc2( smr, V_W_XYs->
length *
sizeof(
double ), 1,
"pdfOfMuGivenE->Ws" ) ) == NULL )
goto err;
126 for( iV = 0; iV < V_W_XYs->
length; iV++ ) {
127 W_XYs = &(V_W_XYs->
W_XYs[iV]);
128 pdfOfEpGivenEAndMu2 = &(pdfOfEpGivenEAndMu[iV]);
129 pdfOfEpGivenEAndMu2->interpolationWY = interpolationWY;
130 pdfOfEpGivenEAndMu2->interpolationXY = interpolationXY;
131 if( ( pdfXY2 =
ptwXY_new( interpolationWY, NULL, 2., 1
e-6, W_XYs->
length, 10, &status, 0 ) ) == NULL )
goto errA;
132 if( ( pdfOfEpGivenEAndMu2->Ws = (
double *)
smr_malloc2( smr, W_XYs->
length *
sizeof(
double ), 1,
"pdfOfEpGivenEAndMu2->Ws" ) ) == NULL )
goto err;
134 for( iW = 0; iW < W_XYs->
length; iW++ ) {
135 XYs = &(W_XYs->
XYs[iW]);
144 pdfOfEpGivenEAndMu2->Ws[iW] = XYs->
value;
146 pdfOfEpGivenEAndMu2->numberOfWs++;
150 pdfOfMuGivenE->
Ws[iV] = energyInFactor * W_XYs->
value;
180 decaySamplingInfo->
frame = angularEnergy->
frame;
184 #if defined __cplusplus
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)
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
enum xDataTOM_frame frame
#define smr_setReportError2(smr, libraryID, code, fmt,...)
enum ptwXY_interpolation_e ptwXY_interpolation
static int MCGIDI_angularEnergy_parsePointwiseFromTOM(statusMessageReporting *smr, xDataTOM_element *pointwise, MCGIDI_distribution *distribution)
int MCGIDI_fromTOM_interpolation(statusMessageReporting *smr, xDataTOM_element *element, int index, enum ptwXY_interpolation_e *interpolation)
int MCGIDI_fromTOM_pdfOfX(statusMessageReporting *smr, ptwXYPoints *pdfXY, MCGIDI_pdfOfX *dist, double *norm)
ptwXYPoints * MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf(statusMessageReporting *smr, xDataTOM_XYs *XYs, ptwXY_interpolation interpolation, char const *units[2])
int MCGIDI_sampling_doubleDistribution(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *pdfOfWGivenV, MCGIDI_pdfsOfXGivenW *pdfOfXGivenVAndW, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
char const * xDataTOM_subAxes_getUnit(statusMessageReporting *smr, xDataTOM_subAxes *subAxes, int index)
enum MCGIDI_distributionType type
MCGIDI_angularEnergy * MCGIDI_angularEnergy_new(statusMessageReporting *smr)
MCGIDI_angularEnergy * angularEnergy
void * xDataTOME_getXDataIfID(statusMessageReporting *smr, xDataTOM_element *TE, char const *ID)
ptwXY_interpolation interpolationWY
double ptwXY_integrateDomain(ptwXYPoints *ptwXY, nfu_status *status)
#define smr_malloc2(smr, size, zero, forItem)
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
enum xDataTOM_frame MCGIDI_misc_getProductFrame(statusMessageReporting *smr, xDataTOM_element *frameElement)
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
nfu_status ptwXY_add_double(ptwXYPoints *ptwXY, double value)
MCGIDI_angularEnergy * MCGIDI_angularEnergy_free(statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)
MCGIDI_pdfsOfXGivenW * pdfOfEpGivenEAndMu
int smr_isOk(statusMessageReporting *smr)
enum nfu_status_e nfu_status
int MCGIDI_angularEnergy_release(statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)
enum xDataTOM_frame frame
void * smr_freeMemory(void **p)
ptwXY_interpolation interpolationXY
int MCGIDI_angularEnergy_initialize(statusMessageReporting *smr, MCGIDI_angularEnergy *energyAngular)
MCGIDI_pdfsOfXGivenW pdfOfMuGivenE
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
const char * nfu_statusMessage(nfu_status status)
int MCGIDI_sampling_pdfsOfXGivenW_release(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
nfu_status ptwXY_setValueAtX(ptwXYPoints *ptwXY, double x, double y)
int MCGIDI_angularEnergy_sampleDistribution(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
int MCGIDI_angularEnergy_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)