12 #if defined __cplusplus
60 double productMass_MeV,
double residualMass_MeV ) {
62 if( angular == NULL )
return( 0 );
76 char const *nativeData;
85 if( strcmp( nativeData,
"isotropic" ) == 0 ) {
91 else if( strcmp( nativeData,
"recoil" ) == 0 ) {
95 double norm, energyFactor;
102 char const *energyUnit, *multiplicityProbabilityUnits[2] = {
"",
"" };
110 frameElement = linearElement;
118 if( ( dists->
Ws = (
double *)
smr_malloc2( smr, W_XYs->
length *
sizeof(
double ), 1,
"dists->Ws" ) ) == NULL )
goto err;
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;
134 if( ( dist->
Xs = (
double *)
smr_malloc2( smr, 3 * n *
sizeof(
double ), 0,
"dist->Xs" ) ) == NULL )
goto err;
136 dist->
pdf = &(dist->
Xs[
n]);
139 for( j = 0; j <
n; j++ ) {
141 dist->
Xs[j] = point->
x;
142 dist->
pdf[j] = point->
y;
150 if( norms != NULL ) {
152 else if( std::fabs( 1. - norm ) > 0.99 ) {
157 for( j = 0; j <
n; j++ ) dist->
pdf[j] /= norm;
164 if( frameElement != NULL ) {
168 distribution->
angular = angular;
175 if( cdfX != NULL ) cdfX =
ptwX_free( cdfX );
185 double randomMu = decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
188 switch( angular->
type ) {
191 decaySamplingInfo->
mu = 1. - 2. * decaySamplingInfo->
rng( decaySamplingInfo->
rngState );
198 decaySamplingInfo->
mu = sampled.
x;
207 #if defined __cplusplus
MCGIDI_pdfsOfXGivenW dists
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
double MCGIDI_misc_getUnitConversionFactor(statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
int64_t ptwXY_length(ptwXYPoints *ptwXY)
enum ptwXY_interpolation_e ptwXY_interpolation
int MCGIDI_angular_release(statusMessageReporting *smr, MCGIDI_angular *angular)
int MCGIDI_fromTOM_interpolation(statusMessageReporting *smr, xDataTOM_element *element, int index, enum ptwXY_interpolation_e *interpolation)
statusMessageReporting * smr
ptwXYPoints * MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf(statusMessageReporting *smr, xDataTOM_XYs *XYs, ptwXY_interpolation interpolation, char const *units[2])
int MCGIDI_angular_sampleMu(statusMessageReporting *smr, MCGIDI_angular *angular, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
char const * xDataTOM_subAxes_getUnit(statusMessageReporting *smr, xDataTOM_subAxes *subAxes, int index)
ptwXPoints * ptwXY_runningIntegral(ptwXYPoints *ptwXY, nfu_status *status)
double ptwX_getPointAtIndex_Unsafely(ptwXPoints *ptwX, int64_t index)
enum MCGIDI_distributionType type
double projectileMass_MeV
void * xDataTOME_getXDataIfID(statusMessageReporting *smr, xDataTOM_element *TE, char const *ID)
ptwXY_interpolation interpolationWY
#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)
int MCGIDI_sampling_sampleX_from_pdfsOfXGivenW(MCGIDI_pdfsOfXGivenW *dists, MCGIDI_pdfsOfXGivenW_sampled *sampled, double r)
int smr_isOk(statusMessageReporting *smr)
int MCGIDI_angular_setTwoBodyMasses(statusMessageReporting *smr, MCGIDI_angular *angular, double projectileMass_MeV, double targetMass_MeV, double productMass_MeV, double residualMass_MeV)
enum nfu_status_e nfu_status
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
MCGIDI_angular * MCGIDI_angular_new(statusMessageReporting *smr)
enum xDataTOM_frame frame
int MCGIDI_angular_initialize(statusMessageReporting *smr, MCGIDI_angular *angular)
enum xDataTOM_frame frame
void * smr_freeMemory(void **p)
ptwXY_interpolation interpolationXY
ptwXYPoint * ptwXY_getPointAtIndex_Unsafely(ptwXYPoints *ptwXY, int64_t index)
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
nfu_status ptwXY_simpleCoalescePoints(ptwXYPoints *ptwXY)
double getProjectileEnergy(void) const
int MCGIDI_angular_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution, ptwXYPoints *norms)
const char * nfu_statusMessage(nfu_status status)
int MCGIDI_sampling_pdfsOfXGivenW_release(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
MCGIDI_angular * MCGIDI_angular_free(statusMessageReporting *smr, MCGIDI_angular *angular)
nfu_status ptwXY_setValueAtX(ptwXYPoints *ptwXY, double x, double y)
enum MCGIDI_angularType type