File indexing completed on 2026-11-26 10:10:08
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <optional>
0010
0011 #include "celeritas/Quantities.hh"
0012
0013 #include "GeantOpticalPhysicsOptions.hh"
0014
0015 namespace celeritas
0016 {
0017
0018
0019 enum class BremsModelSelection
0020 {
0021 none,
0022 seltzer_berger,
0023 relativistic,
0024 all,
0025 size_
0026 };
0027
0028
0029
0030 enum class MscModelSelection
0031 {
0032 none,
0033 urban,
0034 wentzelvi,
0035 urban_wentzelvi,
0036 size_
0037 };
0038
0039
0040
0041 enum class RelaxationSelection
0042 {
0043 none,
0044 radiative,
0045 all,
0046 size_
0047 };
0048
0049
0050
0051
0052
0053
0054 struct GeantMuonPhysicsOptions
0055 {
0056
0057 bool pair_production{true};
0058
0059 bool ionization{true};
0060
0061 bool bremsstrahlung{true};
0062
0063 bool coulomb{false};
0064
0065
0066 MscModelSelection msc{MscModelSelection::urban};
0067 };
0068
0069
0070 constexpr bool operator==(GeantMuonPhysicsOptions const& a,
0071 GeantMuonPhysicsOptions const& b)
0072 {
0073
0074 return a.pair_production == b.pair_production
0075 && a.ionization == b.ionization
0076 && a.bremsstrahlung == b.bremsstrahlung
0077 && a.coulomb == b.coulomb
0078 && a.msc == b.msc;
0079
0080 }
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094 struct GeantPhysicsOptions
0095 {
0096 using MevEnergy = Quantity<units::Mev, double>;
0097 using MuonSetup = GeantMuonPhysicsOptions;
0098 using OpticalSetup = GeantOpticalPhysicsOptions;
0099
0100
0101
0102
0103
0104 bool compton_scattering{true};
0105
0106 bool photoelectric{true};
0107
0108 bool rayleigh_scattering{true};
0109
0110 bool gamma_conversion{true};
0111
0112 bool gamma_general{false};
0113
0114 bool gamma_nuclear{false};
0115
0116
0117
0118
0119
0120
0121 bool coulomb_scattering{false};
0122
0123 bool ionization{true};
0124
0125 bool annihilation{true};
0126
0127 bool electro_nuclear{false};
0128
0129 BremsModelSelection brems{BremsModelSelection::all};
0130
0131 MevEnergy seltzer_berger_limit{1e3};
0132
0133
0134 MscModelSelection msc{MscModelSelection::urban};
0135
0136 RelaxationSelection relaxation{RelaxationSelection::none};
0137
0138
0139
0140
0141
0142
0143 int em_bins_per_decade{7};
0144
0145 bool eloss_fluctuation{true};
0146
0147 bool lpm{true};
0148
0149 bool integral_approach{true};
0150
0151
0152
0153
0154
0155
0156 MevEnergy min_energy{0.1 * 1e-3};
0157
0158 MevEnergy max_energy{100 * 1e6};
0159
0160 double linear_loss_limit{0.01};
0161
0162 MevEnergy lowest_electron_energy{0.001};
0163
0164 MevEnergy lowest_muhad_energy{0.001};
0165
0166 bool apply_cuts{false};
0167
0168 double default_cutoff{0.1 * units::centimeter};
0169
0170
0171
0172
0173
0174
0175 double msc_range_factor{0.04};
0176
0177 double msc_muhad_range_factor{0.2};
0178
0179 double msc_safety_factor{0.6};
0180
0181 double msc_lambda_limit{0.1 * units::centimeter};
0182
0183 double msc_theta_limit{constants::pi};
0184
0185 double angle_limit_factor{1};
0186
0187 bool msc_displaced{true};
0188
0189 bool msc_muhad_displaced{false};
0190
0191 MscStepLimitAlgorithm msc_step_algorithm{MscStepLimitAlgorithm::safety};
0192
0193 MscStepLimitAlgorithm msc_muhad_step_algorithm{
0194 MscStepLimitAlgorithm::minimal};
0195
0196 NuclearFormFactorType form_factor{NuclearFormFactorType::exponential};
0197
0198
0199
0200 bool verbose{false};
0201
0202
0203 std::optional<MuonSetup> muon;
0204
0205
0206 bool mucf_physics{false};
0207
0208
0209 std::optional<OpticalSetup> optical;
0210
0211
0212 bool em() const
0213 {
0214 return compton_scattering || photoelectric || rayleigh_scattering
0215 || gamma_conversion || gamma_general || gamma_nuclear
0216 || coulomb_scattering || ionization || annihilation
0217 || electro_nuclear || brems != BremsModelSelection::none
0218 || msc != MscModelSelection::none;
0219 }
0220
0221
0222 static GeantPhysicsOptions deactivated()
0223 {
0224 GeantPhysicsOptions opt;
0225
0226 opt.compton_scattering = false;
0227 opt.photoelectric = false;
0228 opt.rayleigh_scattering = false;
0229 opt.gamma_conversion = false;
0230 opt.gamma_general = false;
0231 opt.gamma_nuclear = false;
0232
0233 opt.coulomb_scattering = false;
0234 opt.ionization = false;
0235 opt.annihilation = false;
0236 opt.electro_nuclear = false;
0237 opt.brems = BremsModelSelection::none;
0238 opt.msc = MscModelSelection::none;
0239 opt.relaxation = RelaxationSelection::none;
0240
0241 opt.mucf_physics = false;
0242 return opt;
0243 }
0244 };
0245
0246
0247
0248 constexpr bool operator==(GeantPhysicsOptions const& a,
0249 GeantPhysicsOptions const& b)
0250 {
0251
0252 return a.compton_scattering == b.compton_scattering
0253 && a.photoelectric == b.photoelectric
0254 && a.rayleigh_scattering == b.rayleigh_scattering
0255 && a.gamma_conversion == b.gamma_conversion
0256 && a.gamma_general == b.gamma_general
0257 && a.gamma_nuclear == b.gamma_nuclear
0258
0259 && a.coulomb_scattering == b.coulomb_scattering
0260 && a.ionization == b.ionization
0261 && a.annihilation == b.annihilation
0262 && a.electro_nuclear == b.electro_nuclear
0263 && a.brems == b.brems
0264 && a.seltzer_berger_limit == b.seltzer_berger_limit
0265 && a.msc == b.msc
0266 && a.relaxation == b.relaxation
0267
0268 && a.muon == b.muon
0269
0270 && a.mucf_physics == b.mucf_physics
0271
0272 && a.em_bins_per_decade == b.em_bins_per_decade
0273 && a.eloss_fluctuation == b.eloss_fluctuation
0274 && a.lpm == b.lpm
0275 && a.integral_approach == b.integral_approach
0276
0277 && a.min_energy == b.min_energy
0278 && a.max_energy == b.max_energy
0279 && a.linear_loss_limit == b.linear_loss_limit
0280 && a.lowest_electron_energy == b.lowest_electron_energy
0281 && a.lowest_muhad_energy == b.lowest_muhad_energy
0282 && a.apply_cuts == b.apply_cuts
0283 && a.default_cutoff == b.default_cutoff
0284
0285 && a.msc_range_factor == b.msc_range_factor
0286 && a.msc_muhad_range_factor == b.msc_muhad_range_factor
0287 && a.msc_safety_factor == b.msc_safety_factor
0288 && a.msc_lambda_limit == b.msc_lambda_limit
0289 && a.msc_theta_limit == b.msc_theta_limit
0290 && a.angle_limit_factor == b.angle_limit_factor
0291 && a.msc_displaced == b.msc_displaced
0292 && a.msc_muhad_displaced == b.msc_muhad_displaced
0293 && a.msc_step_algorithm == b.msc_step_algorithm
0294 && a.msc_muhad_step_algorithm == b.msc_muhad_step_algorithm
0295 && a.form_factor == b.form_factor
0296 && a.verbose == b.verbose
0297 && a.optical == b.optical;
0298
0299 }
0300
0301
0302
0303
0304
0305 char const* to_cstring(BremsModelSelection value);
0306 char const* to_cstring(MscModelSelection value);
0307 char const* to_cstring(RelaxationSelection value);
0308
0309
0310
0311 std::istream& operator>>(std::istream& is, GeantPhysicsOptions&);
0312
0313
0314
0315 std::ostream& operator<<(std::ostream& os, GeantPhysicsOptions const&);
0316
0317
0318 }