16LUPI_HOST_DEVICE static double coherentPhotoAtomicScatteringIntegrateSub(
int a_n,
double a_a,
double a_logX,
double a_energy1,
double a_y1,
double a_energy2,
double a_y2 );
17static LUPI_HOST Distribution *parseGIDI2( GIDI::Distributions::Distribution
const &a_GIDI_distribution, SetupInfo &a_setupInfo,
18 Transporting::MC
const &a_settings );
30 m_productFrame(
GIDI::Frame::lab ),
31 m_projectileMass( 0.0 ),
33 m_productMass( 0.0 ) {
47 m_targetMass( a_setupInfo.m_protare.
targetMass( ) ),
48 m_productMass( a_setupInfo.m_product1Mass ) {
60 m_productFrame( a_productFrame ),
62 m_targetMass( a_setupInfo.m_protare.
targetMass( ) ),
63 m_productMass( a_setupInfo.m_product1Mass ) {
82 if(
type( ) !=
Type::angularTwoBody )
throw std::runtime_error(
"Setting ModelDBRC_data for non-two body distribution is not allowed." );
84 static_cast<AngularTwoBody *
>( this )->setModelDBRC_data2( a_modelDBRC_data );
121 m_residualMass( 0.0 ),
123 m_twoBodyThreshold( 0.0 ),
124 m_Upscatter( false ),
125 m_angular( nullptr ),
126 m_modelDBRC_data( nullptr ) {
137 m_residualMass( a_setupInfo.m_product2Mass ),
138 m_Q( a_setupInfo.m_Q ),
139 m_twoBodyThreshold( a_setupInfo.m_reaction->twoBodyThreshold( ) ),
140 m_Upscatter( false ),
142 m_modelDBRC_data( nullptr ) {
145 m_Upscatter = a_setupInfo.m_reaction->ENDF_MT( ) == 2;
155 delete m_modelDBRC_data;
175 m_modelDBRC_data = serializeModelDBRC_data( a_buffer, a_mode, m_modelDBRC_data );
186 delete m_modelDBRC_data;
187 m_modelDBRC_data = a_modelDBRC_data;
200 m_angular( nullptr ),
201 m_energy( nullptr ) {
251 m_initialStateIndex( -1 ) {
262 m_initialStateIndex( -1 ) {
266 std::string message(
"Branching3d: initial state not found: pid = '" + a_branching3d.initialState( ) +
"'." );
267 throw std::runtime_error( message.c_str( ) );
269 m_initialStateIndex = iter->second;
309 m_angularGivenEnergy( nullptr ) {
321 m_angularGivenEnergy(
Probabilities::parseProbability3d( a_energyAngularMC.energyAngular( ) ) ) {
331 delete m_angularGivenEnergy;
361 m_angular( nullptr ),
362 m_energyGivenAngular( nullptr ) {
374 m_energyGivenAngular(
Probabilities::parseProbability3d( a_angularEnergyMC.angularEnergy( ) ) ) {
384 delete m_energyGivenAngular;
411 m_energyToMeVFactor( 0.0 ),
412 m_eb_massFactor( 0.0 ),
426 m_energyToMeVFactor( 1 ),
427 m_eb_massFactor( 1 ),
428 m_f(
Probabilities::parseProbability2d_d1( a_KalbachMann.
f( ), nullptr ) ),
429 m_r(
Functions::parseFunction2d( a_KalbachMann.
r( ) ) ),
430 m_a(
Functions::parseFunction2d( a_KalbachMann.
a( ) ) ) {
455 double rValue = m_r->evaluate( a_energy, a_energyOut );
456 double aValue = m_a->evaluate( a_energy, a_energyOut );
458 double pdf_val = aValue / ( 2.0 * sinh( aValue ) ) * ( cosh( aValue * a_mu ) + rValue * sinh( aValue * a_mu ) );
490 m_realAnomalousFactor( nullptr ),
491 m_imaginaryAnomalousFactor( nullptr ) {
502 m_anomalousDataPresent( false ),
503 m_realAnomalousFactor( nullptr ),
504 m_imaginaryAnomalousFactor( nullptr ) {
510 std::string domainUnit;
512 std::size_t dataSize = 0,
offset = 0;
516 xys1d0 = static_cast<GIDI::Functions::XYs1d const *>( formFactor );
519 domainUnit = xys1d0->axes( )[0]->unit( );
521 dataSize = xys1d1->size( );
524 GIDI::Functions::Regions1d const *regions1d = static_cast<GIDI::Functions::Regions1d const *>( formFactor );
525 if( regions1d->size( ) != 2 ) throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported form factor size." );
527 domainUnit = regions1d->axes( )[0]->unit( );
529 GIDI::Functions::Function1dForm const *region0 = (*regions1d)[0];
530 if( region0->type( ) != GIDI::FormType::XYs1d ) throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported form factor for region 0." );
531 xys1d0 = static_cast<GIDI::Functions::XYs1d const *>( region0 );
532 if( xys1d0->size( ) != 2 ) throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported size of region 1 of form factor." );
534 GIDI::Functions::Function1dForm const *region1 = (*regions1d)[1];
535 if( region1->type( ) != GIDI::FormType::XYs1d ) throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported form factor for region 1." );
536 xys1d1 = static_cast<GIDI::Functions::XYs1d const *>( region1 );
538 dataSize = xys1d1->size( ) + 1; }
540 throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported form factor. Must be XYs1d or regions1d." );
543 double domainFactor = 1.0;
544 if( domainUnit ==
"1/Ang" ) {
545 domainFactor = 0.012398419739640716; }
546 else if( domainUnit ==
"1/cm" ) {
547 domainFactor = 0.012398419739640716 * 1e-8; }
549 throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported domain unit" );
552 m_energies.resize( dataSize );
553 m_formFactor.resize( dataSize );
554 m_a.resize( dataSize );
555 m_integratedFormFactor.resize( dataSize );
556 m_integratedFormFactorSquared.resize( dataSize );
557 m_probabilityNorm1_1.resize( dataSize );
558 m_probabilityNorm1_3.resize( dataSize );
559 m_probabilityNorm1_5.resize( dataSize );
560 m_probabilityNorm2_1.resize( dataSize );
561 m_probabilityNorm2_3.resize( dataSize );
562 m_probabilityNorm2_5.resize( dataSize );
564 std::pair<double, double> xy = (*xys1d0)[0];
566 m_formFactor[0] = xy.second;
568 m_integratedFormFactor[0] = 0.0;
569 m_integratedFormFactorSquared[0] = 0.0;
572 double energy1 = domainFactor * xy.first;
573 double y1 = xy.second;
574 m_energies[1] = energy1;
575 m_formFactor[1] = y1;
576 m_integratedFormFactor[1] = 0.5 * energy1 * energy1 * y1;
577 m_integratedFormFactorSquared[1] = 0.5 * energy1 * energy1 * y1 * y1;
579 double sum1 = m_integratedFormFactor[1];
580 double sum2 = m_integratedFormFactorSquared[1];
581 for( std::size_t i1 = 1 +
offset; i1 < xys1d1->size( ); ++i1 ) {
583 double energy2 = domainFactor * xy.first;
584 double y2 = xy.second;
586 double logEs = log( energy2 / energy1 );
587 double _a = log( y2 / y1 ) / logEs;
589 m_energies[i1+1-
offset] = energy2;
590 m_formFactor[i1+1-
offset] = y2;
593 sum1 += coherentPhotoAtomicScatteringIntegrateSub( 1, _a, logEs, energy1, y1, energy2, y2 );
594 m_integratedFormFactor[i1+1-
offset] = sum1;
596 sum2 += coherentPhotoAtomicScatteringIntegrateSub( 1, 2.0 * _a, logEs, energy1, y1 * y1, energy2, y2 * y2 );
597 m_integratedFormFactorSquared[i1+1-
offset] = sum2;
603 m_a[m_a.size()-1] = 0.0;
606 m_anomalousDataPresent = true;
607 m_realAnomalousFactor = Functions::parseFunction1d_d1( coherentPhotoAtomicScattering.realAnomalousFactor( ) );
608 m_imaginaryAnomalousFactor = Functions::parseFunction1d_d1( coherentPhotoAtomicScattering.imaginaryAnomalousFactor( ) );
611 m_probabilityNorm1_1[0] = 0.0;
612 m_probabilityNorm1_3[0] = 0.0;
613 m_probabilityNorm1_5[0] = 0.0;
614 m_probabilityNorm2_1[0] = 0.0;
615 m_probabilityNorm2_3[0] = 0.0;
616 m_probabilityNorm2_5[0] = 0.0;
617 energy1 = m_energies[1];
618 y1 = m_formFactor[0];
619 for( std::size_t i1 = 1; i1 < m_probabilityNorm1_1.size( ); ++i1 ) {
620 double energy2 = m_energies[i1];
621 double y2 = m_formFactor[i1];
622 double logEs = log( energy2 / energy1 );
624 m_probabilityNorm1_1[i1] = m_probabilityNorm1_1[i1-1] + coherentPhotoAtomicScatteringIntegrateSub( 1, m_a[i1-1], logEs, energy1, y1, energy2, y2 );
625 m_probabilityNorm1_3[i1] = m_probabilityNorm1_3[i1-1] + coherentPhotoAtomicScatteringIntegrateSub( 3, m_a[i1-1], logEs, energy1, y1, energy2, y2 );
626 m_probabilityNorm1_5[i1] = m_probabilityNorm1_5[i1-1] + coherentPhotoAtomicScatteringIntegrateSub( 5, m_a[i1-1], logEs, energy1, y1, energy2, y2 );
628 m_probabilityNorm2_1[i1] = m_probabilityNorm2_1[i1-1] + coherentPhotoAtomicScatteringIntegrateSub( 1, 2.0 * m_a[i1-1], logEs, energy1, y1 * y1, energy2, y2 * y2 );
629 m_probabilityNorm2_3[i1] = m_probabilityNorm2_3[i1-1] + coherentPhotoAtomicScatteringIntegrateSub( 3, 2.0 * m_a[i1-1], logEs, energy1, y1 * y1, energy2, y2 * y2 );
630 m_probabilityNorm2_5[i1] = m_probabilityNorm2_5[i1-1] + coherentPhotoAtomicScatteringIntegrateSub( 5, 2.0 * m_a[i1-1], logEs, energy1, y1 * y1, energy2, y2 * y2 );
642 delete m_realAnomalousFactor;
643 delete m_imaginaryAnomalousFactor;
657 std::size_t lowerIndexEnergy =
static_cast<std::size_t
>( intLowerIndexEnergy );
658 double _a = m_a[lowerIndexEnergy];
659 double _a_2 = _a * _a;
660 double X1 = m_energies[lowerIndexEnergy];
661 double logEs = log( a_energyIn / X1 );
662 double formFactor_1 = m_formFactor[lowerIndexEnergy];
663 double formFactor_2 = formFactor_1 * formFactor_1;
664 double formFactorEnergyIn_1 = formFactor_1 * pow( a_energyIn / X1, _a );
665 double formFactorEnergyIn_2 = formFactorEnergyIn_1 * formFactorEnergyIn_1;
666 double inverseEnergyIn_1 = 1.0 / a_energyIn;
667 double inverseEnergyIn_2 = inverseEnergyIn_1 * inverseEnergyIn_1;
668 double inverseEnergyIn_3 = inverseEnergyIn_1 * inverseEnergyIn_2;
669 double inverseEnergyIn_4 = inverseEnergyIn_2 * inverseEnergyIn_2;
670 double inverseEnergyIn_5 = inverseEnergyIn_1 * inverseEnergyIn_4;
671 double inverseEnergyIn_6 = inverseEnergyIn_2 * inverseEnergyIn_4;
673 double norm = 0.5 * inverseEnergyIn_2 * ( m_probabilityNorm2_1[lowerIndexEnergy] + coherentPhotoAtomicScatteringIntegrateSub( 1, _a_2, logEs, X1, formFactor_2, a_energyIn, formFactorEnergyIn_2 ) )
674 - inverseEnergyIn_4 * ( m_probabilityNorm2_3[lowerIndexEnergy] + coherentPhotoAtomicScatteringIntegrateSub( 3, _a_2, logEs, X1, formFactor_2, a_energyIn, formFactorEnergyIn_2 ) )
675 + inverseEnergyIn_6 * ( m_probabilityNorm2_5[lowerIndexEnergy] + coherentPhotoAtomicScatteringIntegrateSub( 5, _a_2, logEs, X1, formFactor_2, a_energyIn, formFactorEnergyIn_2 ) );
677 double realAnomalousFactor = 0.0;
678 double imaginaryAnomalousFactor = 0.0;
679 if( m_anomalousDataPresent ) {
680 realAnomalousFactor = m_realAnomalousFactor->evaluate( a_energyIn );
681 imaginaryAnomalousFactor = m_imaginaryAnomalousFactor->evaluate( a_energyIn );
682 norm += realAnomalousFactor * ( inverseEnergyIn_1 * ( m_probabilityNorm1_1[lowerIndexEnergy] + coherentPhotoAtomicScatteringIntegrateSub( 1, _a, logEs, X1, formFactor_1, a_energyIn, formFactorEnergyIn_1 ) )
683 - 2.0 * inverseEnergyIn_3 * ( m_probabilityNorm1_3[lowerIndexEnergy] + coherentPhotoAtomicScatteringIntegrateSub( 3, _a, logEs, X1, formFactor_1, a_energyIn, formFactorEnergyIn_1 ) )
684 + 2.0 * inverseEnergyIn_5 * ( m_probabilityNorm1_5[lowerIndexEnergy] + coherentPhotoAtomicScatteringIntegrateSub( 5, _a, logEs, X1, formFactor_1, a_energyIn, formFactorEnergyIn_1 ) ) );
687 norm += 8.0 / 3.0 * ( realAnomalousFactor * realAnomalousFactor + imaginaryAnomalousFactor * imaginaryAnomalousFactor );
690 probability = ( 1.0 + a_mu * a_mu ) * ( ( _formFactor + realAnomalousFactor ) * ( _formFactor + realAnomalousFactor ) + imaginaryAnomalousFactor * imaginaryAnomalousFactor ) / norm;
692 return( probability );
704 double X = a_energyIn * sqrt( 0.5 * ( 1 - a_mu ) );
707 if( intLowerIndex < 1 ) {
708 if( intLowerIndex == 0 )
return( m_formFactor[0] );
709 if( intLowerIndex == -2 )
return( m_formFactor[0] );
710 return( m_formFactor.back( ) );
713 std::size_t lowerIndex =
static_cast<std::size_t
>( intLowerIndex );
715 return( m_formFactor[lowerIndex] * pow( X / m_energies[lowerIndex] , m_a[lowerIndex] ) );
725LUPI_HOST_DEVICE double CoherentPhotoAtomicScattering::Z_a(
double a_Z,
double a_a )
const {
727 if( fabs( a_a ) < 1e-3 ) {
728 double logZ = log( a_Z );
729 double a_logZ = a_a * logZ;
730 return( logZ * ( 1.0 + 0.5 * a_logZ * ( 1.0 + a_logZ / 3.0 * ( 1.0 + 0.25 * a_logZ ) ) ) );
732 return( ( pow( a_Z, a_a ) - 1.0 ) / a_a );
747LUPI_HOST_DEVICE static double coherentPhotoAtomicScatteringIntegrateSub(
int a_n,
double a_a,
double a_logX,
double a_energy1,
double a_y1,
double a_energy2,
double a_y2 ) {
749 double epsilon = a_a + a_n + 1.0;
750 double integral = 0.0;
753 double epsilon_logX =
epsilon * a_logX;
754 integral = a_y1 * pow( a_energy1, a_n + 1.0 ) * a_logX * ( 1.0 + 0.5 * epsilon_logX * ( 1.0 + epsilon_logX / 3.0 * ( 1.0 + 0.25 * epsilon_logX ) ) ); }
756 integral = ( a_y2 * pow( a_energy2, a_n + 1.0 ) - a_y1 * pow( a_energy1, a_n + 1.0 ) ) /
epsilon;
787 if( m_anomalousDataPresent ) {
818 std::string domainUnit;
820 std::size_t dataSize = 0,
offset = 0;
824 xys1d0 = static_cast<GIDI::Functions::XYs1d const *>( scatteringFactor );
827 domainUnit = xys1d0->axes( )[0]->unit( );
829 dataSize = xys1d1->size( );
832 GIDI::Functions::Regions1d const *regions1d = static_cast<GIDI::Functions::Regions1d const *>( scatteringFactor );
833 if( regions1d->size( ) != 2 ) throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported form factor size." );
835 domainUnit = regions1d->axes( )[0]->unit( );
837 GIDI::Functions::Function1dForm const *region0 = (*regions1d)[0];
838 if( region0->type( ) != GIDI::FormType::XYs1d ) throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported form factor for region 0." );
839 xys1d0 = static_cast<GIDI::Functions::XYs1d const *>( region0 );
840 if( xys1d0->size( ) != 2 ) throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported size of region 1 of form factor." );
842 GIDI::Functions::Function1dForm const *region1 = (*regions1d)[1];
843 if( region1->type( ) != GIDI::FormType::XYs1d ) throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported form factor for region 1." );
844 xys1d1 = static_cast<GIDI::Functions::XYs1d const *>( region1 );
846 dataSize = xys1d1->size( ) + 1; }
848 throw std::runtime_error(
"MCGIDI::CoherentPhotoAtomicScattering::CoherentPhotoAtomicScattering: unsupported form factor. Must be XYs1d or regions1d." );
851 double domainFactor = 1.0;
852 if( domainUnit ==
"1/Ang" ) {
853 domainFactor = 0.012398419739640716; }
854 else if( domainUnit ==
"1/cm" ) {
855 domainFactor = 0.012398419739640716 * 1e-8; }
857 throw std::runtime_error(
"MCGIDI::IncoherentPhotoAtomicScattering::IncoherentPhotoAtomicScattering: unsupported domain unit" );
860 m_energies.resize( dataSize );
861 m_scatteringFactor.resize( dataSize );
862 m_a.resize( dataSize );
864 std::pair<double, double> xy = (*xys1d0)[0];
865 m_energies[0] = domainFactor * xy.first;
866 m_scatteringFactor[0] = xy.second;
870 double energy1 = domainFactor * xy.first;
871 double y1 = xy.second;
873 m_energies[1] = energy1;
874 m_scatteringFactor[1] = y1;
876 for( std::size_t i1 = 1 +
offset; i1 < xys1d1->size( ); ++i1 ) {
878 double energy2 = domainFactor * xy.first;
879 double y2 = xy.second;
881 m_energies[i1+1-
offset] = energy2;
882 m_scatteringFactor[i1+1-
offset] = y2;
884 double _a = log( y2 / y1 ) / log( energy2 / energy1 );
890 m_a[m_a.size()-1] = 0.0;
911 return( 1.0 / ( 1.0 + relativeEnergy * ( 1.0 - a_mu ) ) );
924 double _energyRatio =
energyRatio( a_energyIn, a_mu );
925 double one_minus_mu = 1.0 - a_mu;
927 double norm = ( 1.0 + 2.0 * relativeEnergy );
928 norm = 2.0 * relativeEnergy * ( 2.0 + relativeEnergy * ( 1.0 + relativeEnergy ) * ( 8.0 + relativeEnergy ) ) / ( norm * norm );
929 norm += ( ( relativeEnergy - 2.0 ) * relativeEnergy - 2.0 ) * log( 1.0 + 2.0 * relativeEnergy );
930 norm /= relativeEnergy * relativeEnergy * relativeEnergy;
932 return( _energyRatio * _energyRatio * ( _energyRatio + a_mu * a_mu + relativeEnergy * one_minus_mu * one_minus_mu ) / norm );
945 if( intLowerIndex < 1 ) {
946 if( intLowerIndex == -1 )
return( m_scatteringFactor.back( ) );
947 return( m_scatteringFactor[1] * a_energyIn / m_energies[1] );
950 std::size_t lowerIndex =
static_cast<std::size_t
>( intLowerIndex );
951 return( m_scatteringFactor[lowerIndex] * pow( a_energyIn / m_energies[lowerIndex], m_a[lowerIndex] ) );
992 m_bindingEnergy( 0.0 ) {
996 std::string MonteCarlo_cdf =
"";
997 if( monikers.size( ) == 1 ) {
998 MonteCarlo_cdf = monikers[0][0]->label( );
1001 std::string Compton_href = a_incoherentBoundToFreePhotoAtomicScattering.
href( );
1003 if( Compton_href.find( MonteCarlo_cdf ) != std::string::npos ) {
1004 const GUPI::Ancestry *link = a_incoherentBoundToFreePhotoAtomicScattering.findInAncestry( Compton_href );
1005 GIDI::DoubleDifferentialCrossSection::IncoherentBoundToFreePhotoAtomicScattering const &dd = *static_cast<GIDI::DoubleDifferentialCrossSection::IncoherentBoundToFreePhotoAtomicScattering const *>( link );
1006 GIDI::Functions::Xs_pdf_cdf1d const *xpcCompton;
1007 GIDI::Functions::Function1dForm const *ComptonProfile = dd.ComptonProfile( );
1008 xpcCompton = static_cast<GIDI::Functions::Xs_pdf_cdf1d const *>( ComptonProfile );
1010 std::vector<double> occupationNumbers = xpcCompton->cdf( );
1011 std::vector<double> pz_grid = xpcCompton->Xs( );
1012 std::size_t dataSize = pz_grid.size( );
1013 m_occupationNumber.resize( dataSize );
1014 m_pz.resize( dataSize );
1015 for( std::size_t index = 0; index < occupationNumbers.size( ); ++index ) {
1016 m_occupationNumber[index] = occupationNumbers[index];
1017 m_pz[index] = pz_grid[index];
1020 m_bindingEnergy = a_setupInfo.
m_Q;
1042 return( 1.0 / ( 1.0 + relativeEnergy * ( 1.0 - a_mu ) ) );
1055 double _energyRatio =
energyRatio( a_energyIn, a_mu );
1056 double one_minus_mu = 1.0 - a_mu;
1058 double norm = ( 1.0 + 2.0 * relativeEnergy );
1059 norm = 2.0 * relativeEnergy * ( 2.0 + relativeEnergy * ( 1.0 + relativeEnergy ) * ( 8.0 + relativeEnergy ) ) / ( norm * norm );
1060 norm += ( ( relativeEnergy - 2.0 ) * relativeEnergy - 2.0 ) * log( 1.0 + 2.0 * relativeEnergy );
1061 norm /= relativeEnergy * relativeEnergy * relativeEnergy;
1063 return( _energyRatio * _energyRatio * ( _energyRatio + a_mu * a_mu + relativeEnergy * one_minus_mu * one_minus_mu ) / norm );
1079 const double pzmax = ( -alpha_binding + alpha_in*(alpha_in - alpha_binding)*(1-a_mu) )/( sqrt( 2*alpha_in*(alpha_in-alpha_binding)*(1-a_mu) + alpha_binding*alpha_binding ) );
1082 std::size_t lowerIndex =
static_cast<std::size_t
>( intLowerIndex );
1083 int size1 =
static_cast<int>( m_occupationNumber.size( ) );
1085 if( intLowerIndex == -1 || intLowerIndex == ( size1 - 1 ) ) {
1086 return( m_occupationNumber.back( ) );
1088 if( intLowerIndex == -2 ){
1089 return( m_occupationNumber[0] );
1092 return(m_occupationNumber[lowerIndex] + (pzmax-m_pz[lowerIndex])*(m_occupationNumber[lowerIndex+1]-m_occupationNumber[lowerIndex])/(m_pz[lowerIndex+1]-m_pz[lowerIndex]) );
1178 m_firstSampled( false ) {
1189 m_firstSampled( a_firstSampled ) {
1249 double temperatureToMeV_K = 1.0;
1250 if(
axis->unit( ) ==
"K" ) temperatureToMeV_K = 8.617330337217212e-11;
1251 nf_Buffer<double>
const *grid = &
axis->values( );
1252 m_temperatures.resize( grid->size( ) );
1253 for( std::size_t index = 0; index < grid->size( ); ++index ) m_temperatures[index] = temperatureToMeV_K * (*grid)[index];
1256 grid = &
axis->values( );
1257 m_energies.resize( grid->size( ) );
1258 for( std::size_t index = 0; index < grid->size( ); ++index ) m_energies[index] = (*grid)[index];
1261 m_S_table.resize( fullArray.
size( ) );
1281 int interpolation = 0;
1283 switch( m_temperatureInterpolation ) {
1305 switch( interpolation ) {
1338 m_temperatureToMeV_K( 1.0 ),
1339 m_DebyeWallerIntegral( nullptr ) {
1353 m_temperatureToMeV_K( 1.0 ),
1354 m_DebyeWallerIntegral( nullptr ) {
1360 if(
axis->unit( ) ==
"K" ) m_temperatureToMeV_K = 8.617330337217212e-11;
1449 return parseGIDI2( GIDI_distribution, a_setupInfo, a_settings );
1464 Distribution *distribution =
nullptr;
1497 distribution =
new Unspecified( a_GIDI_distribution, a_setupInfo );
1502 if( linkedForm ==
nullptr )
1503 throw std::runtime_error(
"MCGIDI::Distributions::parseGIDI: could not find link '" + a_GIDI_distribution.
toXLink( ) +
"." );
1504 distribution = parseGIDI2( *linkedForm, a_setupInfo, a_settings ); }
1507 throw std::runtime_error(
"MCGIDI::Distributions::parseGIDI: unsupported distribution: " + a_GIDI_distribution.
toXLink( ) +
"." );
1510 return( distribution );
1521 if( a_distribution ==
nullptr )
return(
Type::none );
1522 return( a_distribution->
type( ) );
1539 if( a_distribution !=
nullptr ) type = a_distribution->
type( );
1547 a_distribution =
nullptr;
1760 return( a_distribution );
G4double epsilon(G4double density, G4double temperature)
G4ThreadLocal T * G4GeomSplitter< T >::offset
#define GIDI_MonteCarlo_cdfStyleChars
#define DATA_MEMBER_VECTOR_DOUBLE(member, buf, mode)
#define DATA_MEMBER_DOUBLE(member, buf, mode)
#define DATA_MEMBER_INT( member, buf, mode)
#define PoPI_electronMass_MeV_c2
std::vector< double > m_flattenedValues
std::string const & initialState() const
std::string const & href() const
std::string const & href() const
std::string const & href() const
S_table const & s_table() const
Functions::Function1dForm * function1d()
DebyeWallerIntegral const & debyeWallerIntegral() const
Functions::Function2dForm * function2d()
Component & doubleDifferentialCrossSection()
std::string const * findLabelInLineage(GIDI::Suite const &a_suite, std::string const &a_label) const
T * get(std::size_t a_Index)
Ancestry * findInAncestry(std::string const &a_href)
std::string toXLink() const
LUPI_HOST_DEVICE void incrementPlacement(std::size_t a_delta)
LUPI_HOST_DEVICE ~AngularEnergyMC()
LUPI_HOST_DEVICE AngularEnergyMC()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 * angular() const
LUPI_HOST_DEVICE AngularTwoBody()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST void setModelDBRC_data2(Sampling::Upscatter::ModelDBRC_data *a_modelDBRC_data)
LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 * angular() const
LUPI_HOST_DEVICE ~AngularTwoBody()
LUPI_HOST_DEVICE ~Branching3d()
LUPI_HOST_DEVICE Branching3d()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE CoherentElasticTNSL()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE CoherentPhotoAtomicScattering()
LUPI_HOST_DEVICE double evaluate(double a_energyIn, double a_mu) const
LUPI_HOST_DEVICE ~CoherentPhotoAtomicScattering()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE double evaluateFormFactor(double a_energyIn, double a_mu) const
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION ~Distribution() MCGIDI_TRUE_VIRTUAL
LUPI_HOST_DEVICE double targetMass() const
LUPI_HOST void setModelDBRC_data(Sampling::Upscatter::ModelDBRC_data *a_modelDBRC_data)
LUPI_HOST_DEVICE Distribution()
LUPI_HOST_DEVICE Type type() const
LUPI_HOST_DEVICE GIDI::Frame productFrame() const
LUPI_HOST_DEVICE double projectileMass() const
LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 * energy() const
LUPI_HOST_DEVICE EnergyAngularMC()
LUPI_HOST_DEVICE ~EnergyAngularMC()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE ~IncoherentBoundToFreePhotoAtomicScattering()
LUPI_HOST_DEVICE double energyRatio(double a_energyIn, double a_mu) const
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE double evaluateKleinNishina(double a_energyIn, double a_mu) const
LUPI_HOST_DEVICE IncoherentBoundToFreePhotoAtomicScattering()
LUPI_HOST_DEVICE double evaluateOccupationNumber(double a_X, double a_mu) const
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE IncoherentElasticTNSL()
LUPI_HOST_DEVICE ~IncoherentPhotoAtomicScatteringElectron()
LUPI_HOST_DEVICE IncoherentPhotoAtomicScatteringElectron()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE double evaluateKleinNishina(double a_energyIn, double a_mu) const
LUPI_HOST_DEVICE ~IncoherentPhotoAtomicScattering()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE double energyRatio(double a_energyIn, double a_mu) const
LUPI_HOST_DEVICE double evaluateScatteringFactor(double a_X) const
LUPI_HOST_DEVICE IncoherentPhotoAtomicScattering()
LUPI_HOST_DEVICE Functions::Function2d * a() const
LUPI_HOST_DEVICE double evaluate(double E_in_lab, double E_out, double mu)
LUPI_HOST_DEVICE KalbachMann()
LUPI_HOST_DEVICE Functions::Function2d * r() const
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 * f() const
LUPI_HOST_DEVICE ~KalbachMann()
LUPI_HOST_DEVICE ~PairProductionGamma()
LUPI_HOST_DEVICE PairProductionGamma()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE Unspecified()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE ~Unspecified()
LUPI_HOST_DEVICE int projectileIntid() const
GIDI::ProtareSingle const & m_GIDI_protare
std::string m_distributionLabel
std::map< std::string, int > m_stateNamesToIndices
ProtareSingle & m_protare
GIDI::Reaction const * m_reaction
LUPI_HOST GIDI::Styles::Suite const * styles() const
LUPI_HOST bool wantRawTNSL_distributionSampling() const
@ incoherentBoundToFreePhotonScattering
@ incoherentPhotonScattering
@ coherentPhotonScattering
LUPI_HOST_DEVICE Type DistributionType(Distribution const *a_distribution)
@ coherentPhotoAtomicScattering
@ incoherentPhotoAtomicScattering
@ incoherentPhotoAtomicScatteringElectron
@ incoherentBoundToFreePhotoAtomicScattering
LUPI_HOST Distribution * parseGIDI(GIDI::Suite const &a_distribution, SetupInfo &a_setupInfo, Transporting::MC const &a_settings)
LUPI_HOST Function1d_d1 * parseFunction1d_d1(Transporting::MC const &a_settings, GIDI::Suite const &a_suite)
Simple C++ string class, useful as replacement for std::string if this cannot be used,...
LUPI_HOST_DEVICE Distributions::Distribution * serializeDistribution(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Distributions::Distribution *a_distribution)
LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d * serializeProbability2d(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Probabilities::ProbabilityBase2d *a_probability2d)
LUPI_HOST_DEVICE Functions::Function2d * serializeFunction2d(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Functions::Function2d *a_function2d)
LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 * serializeProbability2d_d1(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Probabilities::ProbabilityBase2d_d1 *a_probability2d)
LUPI_HOST_DEVICE Probabilities::ProbabilityBase3d * serializeProbability3d(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Probabilities::ProbabilityBase3d *a_probability3d)
LUPI_HOST_DEVICE Interpolation GIDI2MCGIDI_interpolation(ptwXY_interpolation a_interpolation)
LUPI_HOST_DEVICE int binarySearchVector(double a_x, Vector< double > const &a_Xs, bool a_boundIndex=false)
LUPI_HOST_DEVICE int distributionTypeToInt(Distributions::Type a_type)
LUPI_HOST_DEVICE Functions::Function1d_d1 * serializeFunction1d_d1(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Functions::Function1d_d1 *a_function1d)
LUPI_HOST_DEVICE Distributions::Type intToDistributionType(int a_type)
ptwXY_interpolation ptwXY_stringToInterpolation(char const *interpolationString)
const axis_t axis_to_type< N >::axis
static int constexpr neutron