Warning, file /include/Geant4/MCGIDI_distributions.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef MCGIDI_distributions_hpp_included
0011 #define MCGIDI_distributions_hpp_included 1
0012
0013 #include <LUPI_declareMacro.hpp>
0014
0015 namespace MCGIDI {
0016
0017 namespace Distributions {
0018
0019 enum class Type { none, unspecified, angularTwoBody, KalbachMann, uncorrelated, branching3d, energyAngularMC, angularEnergyMC,
0020 coherentPhotoAtomicScattering, incoherentPhotoAtomicScattering, incoherentPhotoAtomicScatteringElectron, incoherentBoundToFreePhotoAtomicScattering, pairProductionGamma,
0021 coherentElasticTNSL, incoherentElasticTNSL };
0022
0023
0024
0025
0026
0027
0028 class Distribution {
0029
0030 private:
0031 Type m_type;
0032 GIDI::Frame m_productFrame;
0033 double m_projectileMass;
0034 double m_targetMass;
0035 double m_productMass;
0036
0037 public:
0038 LUPI_HOST_DEVICE Distribution( );
0039 LUPI_HOST Distribution( Type a_type, GIDI::Distributions::Distribution const &a_distribution, SetupInfo &a_setupInfo );
0040 LUPI_HOST Distribution( Type a_type, GIDI::Frame a_productFrame, SetupInfo &a_setupInfo );
0041 LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION ~Distribution( ) MCGIDI_TRUE_VIRTUAL;
0042
0043 LUPI_HOST_DEVICE Type type( ) const { return( m_type ); }
0044 LUPI_HOST_DEVICE GIDI::Frame productFrame( ) const { return( m_productFrame ); }
0045
0046 LUPI_HOST_DEVICE double projectileMass( ) const { return( m_projectileMass ); }
0047 LUPI_HOST_DEVICE double targetMass( ) const { return( m_targetMass ); }
0048 LUPI_HOST_DEVICE double productMass( ) const { return( m_productMass ); }
0049
0050 LUPI_HOST void setModelDBRC_data( Sampling::Upscatter::ModelDBRC_data *a_modelDBRC_data );
0051
0052 template <typename RNG>
0053 LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const MCGIDI_TRUE_VIRTUAL;
0054 template <typename RNG>
0055 LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0056 RNG && a_rng, double &a_energy_out ) const MCGIDI_TRUE_VIRTUAL;
0057 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0058
0059 };
0060
0061
0062
0063
0064
0065
0066 class AngularTwoBody : public Distribution {
0067
0068 private:
0069 double m_residualMass;
0070 double m_Q;
0071 double m_twoBodyThreshold;
0072 bool m_Upscatter;
0073 Probabilities::ProbabilityBase2d_d1 *m_angular;
0074 Sampling::Upscatter::ModelDBRC_data *m_modelDBRC_data;
0075
0076 template <typename RNG>
0077 LUPI_HOST_DEVICE bool upscatterModelB( double a_kineticLab, Sampling::Input &a_input, RNG && a_rng ) const ;
0078
0079 public:
0080 LUPI_HOST_DEVICE AngularTwoBody( );
0081 LUPI_HOST AngularTwoBody( GIDI::Distributions::AngularTwoBody const &a_angularTwoBody, SetupInfo &a_setupInfo );
0082 LUPI_HOST_DEVICE ~AngularTwoBody( );
0083
0084 LUPI_HOST_DEVICE double residualMass( ) const { return( m_residualMass ); }
0085 LUPI_HOST_DEVICE double Q( ) const { return( m_Q ); }
0086 LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 *angular( ) const { return( m_angular ); }
0087 template <typename RNG>
0088 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0089 template <typename RNG>
0090 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0091 RNG && a_rng, double &a_energy_out ) const ;
0092 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0093 LUPI_HOST_DEVICE bool Upscatter( ) const { return( m_Upscatter ); }
0094 LUPI_HOST void setModelDBRC_data2( Sampling::Upscatter::ModelDBRC_data *a_modelDBRC_data );
0095 };
0096
0097
0098
0099
0100
0101
0102 class Uncorrelated : public Distribution {
0103
0104 private:
0105 Probabilities::ProbabilityBase2d_d1 *m_angular;
0106 Probabilities::ProbabilityBase2d *m_energy;
0107
0108 public:
0109 LUPI_HOST_DEVICE Uncorrelated( );
0110 LUPI_HOST Uncorrelated( GIDI::Distributions::Uncorrelated const &a_uncorrelated, SetupInfo &a_setupInfo );
0111 LUPI_HOST_DEVICE ~Uncorrelated( );
0112
0113 LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 *angular( ) const { return( m_angular ); }
0114 LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d *energy( ) const { return( m_energy ); }
0115 template <typename RNG>
0116 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0117 template <typename RNG>
0118 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0119 RNG && a_rng, double &a_energy_out ) const ;
0120 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0121 };
0122
0123
0124
0125
0126
0127
0128 class Branching3d : public Distribution {
0129
0130 private:
0131 int m_initialStateIndex;
0132
0133 public:
0134 LUPI_HOST_DEVICE Branching3d( );
0135 LUPI_HOST Branching3d( GIDI::Distributions::Branching3d const &a_branching3d, SetupInfo &a_setupInfo );
0136 LUPI_HOST_DEVICE ~Branching3d( );
0137
0138 template <typename RNG>
0139 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0140 template <typename RNG>
0141 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0142 RNG && a_rng, double &a_energy_out ) const ;
0143 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0144 };
0145
0146
0147
0148
0149
0150
0151 class EnergyAngularMC : public Distribution {
0152
0153 private:
0154 Probabilities::ProbabilityBase2d_d1 *m_energy;
0155 Probabilities::ProbabilityBase3d *m_angularGivenEnergy;
0156
0157 public:
0158 LUPI_HOST_DEVICE EnergyAngularMC( );
0159 LUPI_HOST EnergyAngularMC( GIDI::Distributions::EnergyAngularMC const &a_energyAngularMC, SetupInfo &a_setupInfo );
0160 LUPI_HOST_DEVICE ~EnergyAngularMC( );
0161
0162 LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 *energy( ) const { return( m_energy ); }
0163 LUPI_HOST_DEVICE Probabilities::ProbabilityBase3d *angularGivenEnergy( ) const { return( m_angularGivenEnergy ); }
0164 template <typename RNG>
0165 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0166 template <typename RNG>
0167 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0168 RNG && a_rng, double &a_energy_out ) const ;
0169 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0170 };
0171
0172
0173
0174
0175
0176
0177 class AngularEnergyMC : public Distribution {
0178
0179 private:
0180 Probabilities::ProbabilityBase2d_d1 *m_angular;
0181 Probabilities::ProbabilityBase3d *m_energyGivenAngular;
0182
0183 public:
0184 LUPI_HOST_DEVICE AngularEnergyMC( );
0185 LUPI_HOST AngularEnergyMC( GIDI::Distributions::AngularEnergyMC const &a_angularEnergyMC, SetupInfo &a_setupInfo );
0186 LUPI_HOST_DEVICE ~AngularEnergyMC( );
0187
0188 LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 *angular( ) const { return( m_angular ); }
0189 LUPI_HOST_DEVICE Probabilities::ProbabilityBase3d *energyGivenAngular( ) const { return( m_energyGivenAngular ); }
0190 template <typename RNG>
0191 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0192 template <typename RNG>
0193 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0194 RNG && a_rng, double &a_energy_out ) const ;
0195 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0196 };
0197
0198
0199
0200
0201
0202
0203 class KalbachMann : public Distribution {
0204
0205 private:
0206 double m_energyToMeVFactor;
0207 double m_eb_massFactor;
0208 Probabilities::ProbabilityBase2d_d1 *m_f;
0209 Functions::Function2d *m_r;
0210 Functions::Function2d *m_a;
0211
0212 public:
0213 LUPI_HOST_DEVICE KalbachMann( );
0214 LUPI_HOST KalbachMann( GIDI::Distributions::KalbachMann const &a_KalbachMann, SetupInfo &a_setupInfo );
0215 LUPI_HOST_DEVICE ~KalbachMann( );
0216
0217 LUPI_HOST_DEVICE double energyToMeVFactor( ) const { return( m_energyToMeVFactor ); }
0218 LUPI_HOST_DEVICE double eb_massFactor( ) const { return( m_eb_massFactor ); }
0219 LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d_d1 *f( ) const { return( m_f ); }
0220 LUPI_HOST_DEVICE Functions::Function2d *r( ) const { return( m_r ); }
0221 LUPI_HOST_DEVICE Functions::Function2d *a( ) const { return( m_a ); }
0222 template <typename RNG>
0223 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0224 template <typename RNG>
0225 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0226 RNG && a_rng, double &a_energy_out ) const ;
0227 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0228
0229 LUPI_HOST_DEVICE double evaluate( double E_in_lab, double E_out, double mu );
0230 };
0231
0232
0233
0234
0235
0236
0237 class CoherentPhotoAtomicScattering : public Distribution {
0238
0239 private:
0240 bool m_anomalousDataPresent;
0241 Vector<double> m_energies;
0242 Vector<double> m_formFactor;
0243 Vector<double> m_a;
0244 Vector<double> m_integratedFormFactor;
0245 Vector<double> m_integratedFormFactorSquared;
0246 Vector<double> m_probabilityNorm1_1;
0247 Vector<double> m_probabilityNorm1_3;
0248 Vector<double> m_probabilityNorm1_5;
0249 Vector<double> m_probabilityNorm2_1;
0250 Vector<double> m_probabilityNorm2_3;
0251 Vector<double> m_probabilityNorm2_5;
0252 Functions::Function1d_d1 *m_realAnomalousFactor;
0253 Functions::Function1d_d1 *m_imaginaryAnomalousFactor;
0254
0255 LUPI_HOST_DEVICE double Z_a( double a_Z, double a_a ) const ;
0256
0257 public:
0258 LUPI_HOST_DEVICE CoherentPhotoAtomicScattering( );
0259 LUPI_HOST CoherentPhotoAtomicScattering( GIDI::Distributions::CoherentPhotoAtomicScattering const &a_coherentPhotoAtomicScattering, SetupInfo &a_setupInfo );
0260 LUPI_HOST_DEVICE ~CoherentPhotoAtomicScattering( );
0261
0262 LUPI_HOST_DEVICE double evaluate( double a_energyIn, double a_mu ) const ;
0263 LUPI_HOST_DEVICE double evaluateFormFactor( double a_energyIn, double a_mu ) const ;
0264 template <typename RNG>
0265 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0266 template <typename RNG>
0267 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0268 RNG && a_rng, double &a_energy_out ) const ;
0269
0270 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0271 };
0272
0273
0274
0275
0276
0277
0278 class IncoherentPhotoAtomicScattering : public Distribution {
0279
0280 private:
0281 Vector<double> m_energies;
0282 Vector<double> m_scatteringFactor;
0283 Vector<double> m_a;
0284
0285 public:
0286 LUPI_HOST_DEVICE IncoherentPhotoAtomicScattering( );
0287 LUPI_HOST IncoherentPhotoAtomicScattering( GIDI::Distributions::IncoherentPhotoAtomicScattering const &a_incoherentPhotoAtomicScattering, SetupInfo &a_setupInfo );
0288 LUPI_HOST_DEVICE ~IncoherentPhotoAtomicScattering( );
0289
0290 LUPI_HOST_DEVICE double energyRatio( double a_energyIn, double a_mu ) const ;
0291 LUPI_HOST_DEVICE double evaluateKleinNishina( double a_energyIn, double a_mu ) const ;
0292 LUPI_HOST_DEVICE double evaluateScatteringFactor( double a_X ) const ;
0293 template <typename RNG>
0294 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0295 template <typename RNG>
0296 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0297 RNG && a_rng, double &a_energy_out ) const ;
0298 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0299
0300
0301
0302 };
0303
0304
0305
0306
0307
0308
0309 class IncoherentBoundToFreePhotoAtomicScattering : public Distribution {
0310
0311 private:
0312
0313
0314 Vector<double> m_occupationNumber;
0315
0316 Vector<double> m_pz;
0317 double m_bindingEnergy;
0318
0319 public:
0320 LUPI_HOST_DEVICE IncoherentBoundToFreePhotoAtomicScattering( );
0321 LUPI_HOST IncoherentBoundToFreePhotoAtomicScattering( GIDI::Distributions::IncoherentBoundToFreePhotoAtomicScattering const &a_incoherentPhotoAtomicScattering, SetupInfo &a_setupInfo );
0322 LUPI_HOST_DEVICE ~IncoherentBoundToFreePhotoAtomicScattering( );
0323 LUPI_HOST_DEVICE double energyRatio( double a_energyIn, double a_mu ) const ;
0324 LUPI_HOST_DEVICE double evaluateKleinNishina( double a_energyIn, double a_mu ) const ;
0325 LUPI_HOST_DEVICE double evaluateOccupationNumber( double a_X, double a_mu ) const;
0326 template <typename RNG>
0327 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0328 template <typename RNG>
0329 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0330 RNG && a_rng, double &a_energy_out ) const ;
0331 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0332 };
0333
0334
0335
0336
0337
0338
0339 class IncoherentPhotoAtomicScatteringElectron : public Distribution {
0340
0341 public:
0342 LUPI_HOST_DEVICE IncoherentPhotoAtomicScatteringElectron( );
0343 LUPI_HOST IncoherentPhotoAtomicScatteringElectron( SetupInfo &a_setupInfo );
0344 LUPI_HOST_DEVICE ~IncoherentPhotoAtomicScatteringElectron( );
0345
0346 template <typename RNG>
0347 LUPI_HOST_DEVICE void sample( double a_energy, Sampling::Input &a_input, RNG && a_rng ) const ;
0348 template <typename RNG>
0349 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0350 RNG && a_rng, double &a_energy_out ) const ;
0351 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0352 };
0353
0354
0355
0356
0357
0358
0359 class PairProductionGamma : public Distribution {
0360
0361 private:
0362 bool m_firstSampled;
0363
0364 public:
0365 LUPI_HOST_DEVICE PairProductionGamma( );
0366 LUPI_HOST PairProductionGamma( SetupInfo &a_setupInfo, bool a_firstSampled );
0367 LUPI_HOST_DEVICE ~PairProductionGamma( );
0368
0369 template <typename RNG>
0370 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0371 template <typename RNG>
0372 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0373 RNG && a_rng, double &a_energy_out ) const ;
0374 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0375 };
0376
0377
0378
0379
0380
0381
0382 class CoherentElasticTNSL : public Distribution {
0383
0384 private:
0385 Interpolation m_temperatureInterpolation;
0386 Vector<double> m_temperatures;
0387 Vector<double> m_energies;
0388 Vector<double> m_S_table;
0389
0390 public:
0391 LUPI_HOST_DEVICE CoherentElasticTNSL( );
0392 LUPI_HOST CoherentElasticTNSL( GIDI::DoubleDifferentialCrossSection::n_ThermalNeutronScatteringLaw::CoherentElastic const *a_coherentElasticTNSL,
0393 SetupInfo &a_setupInfo );
0394 LUPI_HOST_DEVICE ~CoherentElasticTNSL( ) {}
0395
0396 template <typename RNG>
0397 LUPI_HOST_DEVICE void sample( double a_energy, Sampling::Input &a_input, RNG && a_rng ) const ;
0398 template <typename RNG>
0399 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0400 RNG && a_rng, double &a_energy_out ) const ;
0401 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0402 };
0403
0404
0405
0406
0407
0408
0409 class IncoherentElasticTNSL : public Distribution {
0410
0411 private:
0412 double m_temperatureToMeV_K;
0413 Functions::Function1d_d1 *m_DebyeWallerIntegral;
0414
0415 public:
0416 LUPI_HOST_DEVICE IncoherentElasticTNSL( );
0417 LUPI_HOST IncoherentElasticTNSL( GIDI::DoubleDifferentialCrossSection::n_ThermalNeutronScatteringLaw::IncoherentElastic const *a_incoherentElasticTNSL,
0418 SetupInfo &a_setupInfo );
0419 LUPI_HOST_DEVICE ~IncoherentElasticTNSL( ) {}
0420
0421 template <typename RNG>
0422 LUPI_HOST_DEVICE void sample( double a_energy, Sampling::Input &a_input, RNG && a_rng ) const ;
0423 template <typename RNG>
0424 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0425 RNG && a_rng, double &a_energy_out ) const ;
0426 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0427
0428 Functions::Function1d *DebyeWallerIntegral( ) { return( m_DebyeWallerIntegral ); }
0429 Functions::Function1d const *DebyeWallerIntegral( ) const { return( m_DebyeWallerIntegral ); }
0430 };
0431
0432
0433
0434
0435
0436
0437 class Unspecified : public Distribution {
0438
0439 public:
0440 LUPI_HOST_DEVICE Unspecified( );
0441 LUPI_HOST Unspecified( GIDI::Distributions::Distribution const &a_distribution, SetupInfo &a_setupInfo );
0442 LUPI_HOST_DEVICE ~Unspecified( );
0443
0444 template <typename RNG>
0445 LUPI_HOST_DEVICE void sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const ;
0446 template <typename RNG>
0447 LUPI_HOST_DEVICE double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
0448 RNG && a_rng, double &a_energy_out ) const ;
0449 LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
0450 };
0451
0452
0453
0454
0455
0456
0457 LUPI_HOST Distribution *parseGIDI( GIDI::Suite const &a_distribution, SetupInfo &a_setupInfo, Transporting::MC const &a_settings );
0458 LUPI_HOST_DEVICE Type DistributionType( Distribution const *a_distribution );
0459
0460 }
0461
0462 }
0463
0464 #endif