Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
MCGIDI_settings.cc
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#include "MCGIDI.hpp"
11
12namespace MCGIDI {
13
14namespace Transporting {
15
16/*! \class MC
17 * Class to store user defined preferences for creating an MCGIDI::Protare instance.
18 */
19
20/* *********************************************************************************************************//**
21 * Class to store user defined preferences for creating an MCGIDI::Protare instance.
22 *
23 * @param a_pops [in] A PoPs Database instance used to get particle intids and possibly other particle information.
24 * @param a_projectileID [in] The PoPs id for the projectile.
25 * @param a_styles [in] The styles child node of the GIDI::Protare.
26 * @param a_label [in]
27 * @param a_delayedNeutrons [in] Sets whether delayed neutron data will be load or not if available.
28 * @param a_energyDomainMax [in] The maximum projectile energy for which data should be loaded.
29 ***********************************************************************************************************/
30
31LUPI_HOST MC::MC( LUPI_maybeUnused PoPI::Database const &a_pops, std::string const &a_projectileID, GIDI::Styles::Suite const *a_styles, std::string const &a_label,
32 GIDI::Transporting::DelayedNeutrons a_delayedNeutrons, double a_energyDomainMax ) :
33 GIDI::Transporting::Settings( a_projectileID, a_delayedNeutrons ),
34 m_styles( a_styles ),
35 m_label( a_label ),
36 m_energyDomainMax( a_energyDomainMax ),
37 m_ignoreENDF_MT5( false ),
38 m_sampleNonTransportingParticles( false ),
39 m_useSlowerContinuousEnergyConversion( false ),
40 m_addExpectedValueData( true ),
41 m_crossSectionLookupMode( LookupMode::Data1d::continuousEnergy ),
42 m_other1dDataLookupMode( LookupMode::Data1d::continuousEnergy ),
43 m_distributionLookupMode( LookupMode::Distribution::pdf_cdf ),
44 m_upscatterModel( Sampling::Upscatter::Model::none ),
45 m_URR_mode( URR_mode::none ),
46 m_wantTerrellPromptNeutronDistribution( false ),
47 m_wantRawTNSL_distributionSampling( true ),
48 m_makePhotonEmissionProbabilitiesOne( false ),
49 m_zeroNuclearLevelEnergyWidth( false ) {
50
51}
52
53/* *********************************************************************************************************//**
54 * Class to store user defined preferences for creating an MCGIDI::Protare instance.
55 *
56 * @param a_pops [in] A PoPs Database instance used to get particle intids and possibly other particle information.
57 * @param a_protare [in] GIDI::Protare whose information is used to fill *this*.
58 * @param a_label [in]
59 * @param a_delayedNeutrons [in] Sets whether delayed neutron data will be load or not if available.
60 * @param a_energyDomainMax [in] The maximum projectile energy for which data should be loaded.
61 ***********************************************************************************************************/
62
63LUPI_HOST MC::MC( LUPI_maybeUnused PoPI::Database const &a_pops, GIDI::Protare const &a_protare, std::string const &a_label,
64 GIDI::Transporting::DelayedNeutrons a_delayedNeutrons, double a_energyDomainMax ) :
65 GIDI::Transporting::Settings( a_protare.projectile( ).ID( ), a_delayedNeutrons ),
66 m_styles( &a_protare.styles( ) ),
67 m_label( a_label ),
68 m_energyDomainMax( a_energyDomainMax ),
69 m_ignoreENDF_MT5( false ),
70 m_sampleNonTransportingParticles( false ),
71 m_useSlowerContinuousEnergyConversion( false ),
72 m_addExpectedValueData( true ),
73 m_crossSectionLookupMode( LookupMode::Data1d::continuousEnergy ),
74 m_other1dDataLookupMode( LookupMode::Data1d::continuousEnergy ),
75 m_distributionLookupMode( LookupMode::Distribution::pdf_cdf ),
76 m_upscatterModel( Sampling::Upscatter::Model::none ),
77 m_URR_mode( URR_mode::none ),
78 m_wantTerrellPromptNeutronDistribution( false ),
79 m_wantRawTNSL_distributionSampling( true ),
80 m_makePhotonEmissionProbabilitiesOne( false ),
81 m_zeroNuclearLevelEnergyWidth( false ) {
82
83}
84
85/* *********************************************************************************************************//**
86 * Sets the *m_crossSectionLookupMode* member of *this* to *a_crossSectionLookupMode*.
87 *
88 * @param a_crossSectionLookupMode [in] The *LookupMode::Data1d* data mode.
89 ***********************************************************************************************************/
90
92
93 if( ( a_crossSectionLookupMode != LookupMode::Data1d::continuousEnergy ) &&
94 ( a_crossSectionLookupMode != LookupMode::Data1d::multiGroup ) ) {
95 throw( "Invalided cross section mode request." );
96 }
97 m_crossSectionLookupMode = a_crossSectionLookupMode;
98}
99
100/* *********************************************************************************************************//**
101 * Sets the *m_other1dDataLookupMode* member of *this* to *a_other1dDataLookupMode*.
102 *
103 * @param a_other1dDataLookupMode [in] The *LookupMode::Data1d* data mode.
104 ***********************************************************************************************************/
105
107
108 if( a_other1dDataLookupMode != LookupMode::Data1d::continuousEnergy ) throw( "Invalided other mode request." );
109 m_other1dDataLookupMode = a_other1dDataLookupMode;
110}
111
112/* *********************************************************************************************************//**
113 * Sets the *m_distributionLookupMode* member of *this* to *a_distributionLookupMode*.
114 *
115 * @param a_distributionLookupMode [in] The *LookupMode::Data1d* data mode.
116 ***********************************************************************************************************/
117
119
120 if( a_distributionLookupMode != LookupMode::Distribution::pdf_cdf ) throw( "Invalided distribution mode request." );
121 m_distributionLookupMode = a_distributionLookupMode;
122}
123
124/* *********************************************************************************************************//**
125 * This method sets the member *m_upscatterModelAGroupBoundaries* to *a_groupBoundaries*. It also checks that
126 * the groups are in ascending order and executes a throw if they are not.
127 *
128 * @param a_groupBoundaries [in] List of multi-group boundaries.
129 ***********************************************************************************************************/
130
131LUPI_HOST void MC::setUpscatterModelAGroupBoundaries( std::vector<double> const &a_groupBoundaries ) {
132
133 double priorValue = 0.0;
134
135 for( std::size_t index = 0; index < a_groupBoundaries.size( ); ++index ) {
136 double value = a_groupBoundaries[index];
137
138 if( index != 0 ) {
139 if( value <= priorValue ) throw( "MC::setUpscatterModelAGroupBoundaries: group boundaries not in ascending order/" );
140 }
141 priorValue = value;
142 }
143
144 m_upscatterModelAGroupBoundaries = a_groupBoundaries;
145}
146
147}
148
149}
#define LUPI_HOST
#define LUPI_maybeUnused
LUPI_HOST MC(PoPI::Database const &a_pops, std::string const &a_projectileID, GIDI::Styles::Suite const *a_styles, std::string const &a_label, GIDI::Transporting::DelayedNeutrons a_delayedNeutrons, double energyDomainMax)
LUPI_HOST void setCrossSectionLookupMode(LookupMode::Data1d a_crossSectionLookupMode)
LUPI_HOST void setOther1dDataLookupMode(LookupMode::Data1d a_other1dDataLookupMode)
LUPI_HOST void setDistributionLookupMode(LookupMode::Distribution a_distributionLookupMode)
LUPI_HOST void setUpscatterModelAGroupBoundaries(std::vector< double > const &a_groupBoundaries)
Definition GIDI.hpp:32
Simple C++ string class, useful as replacement for std::string if this cannot be used,...
Definition MCGIDI.hpp:43