Skip to content

Commit

Permalink
Address minor documentation, contract fixes in CelerOpticalPhysics (#…
Browse files Browse the repository at this point in the history
…1388)

* Improve doxygen and logging for clarity.

* Mark use of WLS2 in Geant4 < 10.7 as unreachable

Though a user can potentially request WLS2 through configuration
parameters, it should never be activated in CelerOpticalPhysics
given protections using G4VERSION_NUMBER.

To provide a failsafe going forward, mark check for WLS2 activation
as unreachable.
  • Loading branch information
drbenmorgan authored Sep 3, 2024
1 parent 2118245 commit c164821
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/celeritas/ext/GeantOpticalPhysicsOptions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ constexpr bool operator==(ScintillationPhysicsOptions const& a,
}

//---------------------------------------------------------------------------//
//! Optical Bounrary process options
//! Optical Boundary process options
struct BoundaryPhysicsOptions
{
//! Enable the process
Expand Down
15 changes: 11 additions & 4 deletions src/celeritas/ext/detail/CelerOpticalPhysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ namespace detail
{
namespace
{
//---------------------------------------------------------------------------//
/*!
* Optical physics process type.
*
* See Geant4's \c G4OpticalProcessIndex in G4OpticalParameters.hh for the
* equivalent enum.
*/
enum class OpticalProcessType
{
cerenkov,
Expand Down Expand Up @@ -114,7 +121,8 @@ bool process_is_active(
case OpticalProcessType::wavelength_shifting:
return options.wavelength_shifting != WLSTimeProfileSelection::none;
case OpticalProcessType::wavelength_shifting_2:
// Not supported pre 10.7
// Technically reachable, but practically not supported pre 10.7
CELER_ASSERT_UNREACHABLE();
default:
return false;
}
Expand Down Expand Up @@ -260,9 +268,8 @@ void CelerOpticalPhysics::ConstructProcess()
{
process_manager->AddDiscreteProcess(wls2.release());
// I need to check how this differs from G4OpWLS...
CELER_LOG(debug)
<< "Loaded Optical wavelength shifting V2 with G4OpWLS2 "
"process";
CELER_LOG(debug) << "Loaded second optical wavelength shifting with "
"G4OpWLS2 process ";
}
#endif

Expand Down

0 comments on commit c164821

Please sign in to comment.