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