File indexing completed on 2025-02-22 10:31:20
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include "corecel/Types.hh"
0011
0012 namespace celeritas
0013 {
0014
0015
0016 enum class WLSTimeProfileSelection
0017 {
0018 none,
0019 delta,
0020 exponential,
0021 size_
0022 };
0023
0024
0025
0026 struct CerenkovPhysicsOptions
0027 {
0028
0029 bool enable{true};
0030
0031 bool stack_photons{true};
0032
0033 bool track_secondaries_first{true};
0034
0035 int max_photons{100};
0036
0037 double max_beta_change{10.0};
0038
0039
0040 explicit operator bool() const { return enable; }
0041 };
0042
0043
0044
0045
0046 constexpr bool
0047 operator==(CerenkovPhysicsOptions const& a, CerenkovPhysicsOptions const& b)
0048 {
0049
0050 return a.enable == b.enable
0051 && a.stack_photons == b.stack_photons
0052 && a.track_secondaries_first == b.track_secondaries_first
0053 && a.max_photons == b.max_photons
0054 && a.max_beta_change == b.max_beta_change;
0055
0056 }
0057
0058
0059
0060 struct ScintillationPhysicsOptions
0061 {
0062
0063 bool enable{true};
0064
0065
0066 bool stack_photons{true};
0067
0068 bool track_secondaries_first{true};
0069
0070 bool by_particle_type{false};
0071
0072 bool finite_rise_time{false};
0073
0074 bool track_info{false};
0075
0076
0077 explicit operator bool() const { return enable; }
0078 };
0079
0080
0081
0082
0083 constexpr bool operator==(ScintillationPhysicsOptions const& a,
0084 ScintillationPhysicsOptions const& b)
0085 {
0086
0087 return a.enable == b.enable
0088 && a.stack_photons == b.stack_photons
0089 && a.track_secondaries_first == b.track_secondaries_first
0090 && a.by_particle_type == b.by_particle_type
0091 && a.finite_rise_time == b.finite_rise_time
0092 && a.track_info == b.track_info;
0093
0094 }
0095
0096
0097
0098 struct BoundaryPhysicsOptions
0099 {
0100
0101 bool enable{true};
0102
0103 bool invoke_sd{false};
0104
0105
0106 explicit operator bool() const { return enable; }
0107 };
0108
0109
0110
0111
0112 constexpr bool
0113 operator==(BoundaryPhysicsOptions const& a, BoundaryPhysicsOptions const& b)
0114 {
0115
0116 return a.enable == b.enable
0117 && a.invoke_sd == b.invoke_sd;
0118
0119 }
0120
0121
0122
0123
0124
0125
0126
0127
0128 struct GeantOpticalPhysicsOptions
0129 {
0130
0131
0132
0133 CerenkovPhysicsOptions cerenkov;
0134
0135 ScintillationPhysicsOptions scintillation;
0136
0137
0138
0139
0140
0141 WLSTimeProfileSelection wavelength_shifting{WLSTimeProfileSelection::delta};
0142
0143
0144 WLSTimeProfileSelection wavelength_shifting2{
0145 WLSTimeProfileSelection::delta};
0146
0147 BoundaryPhysicsOptions boundary;
0148
0149 bool absorption{true};
0150
0151 bool rayleigh_scattering{true};
0152
0153 bool mie_scattering{true};
0154
0155
0156
0157 bool verbose{false};
0158
0159
0160 explicit operator bool() const
0161 {
0162 return cerenkov || scintillation
0163 || (wavelength_shifting != WLSTimeProfileSelection::none)
0164 || (wavelength_shifting2 != WLSTimeProfileSelection::none)
0165 || boundary || absorption || rayleigh_scattering
0166 || mie_scattering;
0167 }
0168
0169
0170 static GeantOpticalPhysicsOptions deactivated()
0171 {
0172 GeantOpticalPhysicsOptions opts;
0173 opts.cerenkov.enable = false;
0174 opts.scintillation.enable = false;
0175 opts.wavelength_shifting = WLSTimeProfileSelection::none;
0176 opts.wavelength_shifting2 = WLSTimeProfileSelection::none;
0177 opts.boundary.enable = false;
0178 opts.absorption = false;
0179 opts.rayleigh_scattering = false;
0180 opts.mie_scattering = false;
0181 return opts;
0182 }
0183 };
0184
0185
0186
0187
0188 constexpr bool operator==(GeantOpticalPhysicsOptions const& a,
0189 GeantOpticalPhysicsOptions const& b)
0190 {
0191
0192 return a.cerenkov == b.cerenkov
0193 && a.scintillation == b.scintillation
0194 && a.wavelength_shifting == b.wavelength_shifting
0195 && a.wavelength_shifting2 == b.wavelength_shifting2
0196 && a.boundary == b.boundary
0197 && a.absorption == b.absorption
0198 && a.rayleigh_scattering == b.rayleigh_scattering
0199 && a.mie_scattering == b.mie_scattering
0200 && a.verbose == b.verbose;
0201
0202 }
0203
0204
0205
0206
0207
0208 char const* to_cstring(WLSTimeProfileSelection value);
0209
0210
0211 }