Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add muon EM processes to Celeritas physics list and muon brems/ioni Process classes #1411

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/celeritas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ list(APPEND SOURCES
em/process/EIonizationProcess.cc
em/process/EPlusAnnihilationProcess.cc
em/process/GammaConversionProcess.cc
em/process/MuIonizationProcess.cc
em/process/MuBremsstrahlungProcess.cc
em/process/PhotoelectricProcess.cc
em/process/RayleighProcess.cc
ext/GeantOpticalPhysicsOptions.cc
Expand Down
3 changes: 2 additions & 1 deletion src/celeritas/em/model/ICRU73QOModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ namespace celeritas
* TODO: This model also applies to hadrons.
*/
ICRU73QOModel::ICRU73QOModel(ActionId id, ParticleParams const& particles)
: ConcreteAction(id, "ioni-bragg", "interact by muon ionization (ICRU73QO)")
: ConcreteAction(
id, "ioni-icru73qo", "interact by muon ionization (ICRU73QO)")
{
CELER_EXPECT(id);

Expand Down
68 changes: 68 additions & 0 deletions src/celeritas/em/process/MuBremsstrahlungProcess.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//----------------------------------*-C++-*----------------------------------//
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file celeritas/em/process/MuBremsstrahlungProcess.cc
//---------------------------------------------------------------------------//
#include "MuBremsstrahlungProcess.hh"

#include <utility>

#include "corecel/Assert.hh"
#include "corecel/cont/Range.hh"
#include "celeritas/em/model/MuBremsstrahlungModel.hh"
#include "celeritas/io/ImportProcess.hh"
#include "celeritas/phys/PDGNumber.hh"

namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* Construct from host data.
*/
MuBremsstrahlungProcess::MuBremsstrahlungProcess(SPConstParticles particles,
SPConstImported process_data,
Options options)
: particles_(std::move(particles))
, imported_(process_data,
particles_,
ImportProcessClass::mu_brems,
{pdg::mu_minus(), pdg::mu_plus()})
, options_(options)
{
CELER_EXPECT(particles_);
}

//---------------------------------------------------------------------------//
/*!
* Construct the models associated with this process.
*/
auto MuBremsstrahlungProcess::build_models(ActionIdIter start_id) const
-> VecModel
{
return {std::make_shared<MuBremsstrahlungModel>(
*start_id++, *particles_, imported_.processes())};
}

//---------------------------------------------------------------------------//
/*!
* Get the interaction cross sections for the given energy range.
*/
auto MuBremsstrahlungProcess::step_limits(Applicability applic) const
-> StepLimitBuilders
{
return imported_.step_limits(std::move(applic));
}

//---------------------------------------------------------------------------//
/*!
* Name of the process.
*/
std::string_view MuBremsstrahlungProcess::label() const
{
return "Muon bremsstrahlung";
}

//---------------------------------------------------------------------------//
} // namespace celeritas
65 changes: 65 additions & 0 deletions src/celeritas/em/process/MuBremsstrahlungProcess.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//----------------------------------*-C++-*----------------------------------//
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file celeritas/em/process/MuBremsstrahlungProcess.hh
//---------------------------------------------------------------------------//
#pragma once

#include <memory>

#include "celeritas/phys/Applicability.hh"
#include "celeritas/phys/AtomicNumber.hh"
#include "celeritas/phys/ImportedProcessAdapter.hh"
#include "celeritas/phys/ParticleParams.hh"
#include "celeritas/phys/Process.hh"

namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* Bremsstrahlung process for muons.
*/
class MuBremsstrahlungProcess : public Process
{
public:
//!@{
//! \name Type aliases
using SPConstParticles = std::shared_ptr<ParticleParams const>;
using SPConstImported = std::shared_ptr<ImportedProcesses const>;
//!@}

// Options for the Bremsstrahlung process
struct Options
{
bool use_integral_xs{true}; //!> Use integral method for sampling
//! discrete interaction length
};

public:
// Construct from Bremsstrahlung data
MuBremsstrahlungProcess(SPConstParticles particles,
SPConstImported process_data,
Options options);

// Construct the models associated with this process
VecModel build_models(ActionIdIter start_id) const final;

// Get the interaction cross sections for the given energy range
StepLimitBuilders step_limits(Applicability range) const final;

//! Whether to use the integral method to sample interaction length
bool use_integral_xs() const final { return options_.use_integral_xs; }

// Name of the process
std::string_view label() const final;

private:
SPConstParticles particles_;
ImportedProcessAdapter imported_;
Options options_;
};

//---------------------------------------------------------------------------//
} // namespace celeritas
70 changes: 70 additions & 0 deletions src/celeritas/em/process/MuIonizationProcess.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//----------------------------------*-C++-*----------------------------------//
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file celeritas/em/process/MuIonizationProcess.cc
//---------------------------------------------------------------------------//
#include "MuIonizationProcess.hh"

#include <utility>

#include "corecel/Assert.hh"
#include "corecel/cont/Range.hh"
#include "celeritas/em/model/BraggModel.hh"
#include "celeritas/em/model/ICRU73QOModel.hh"
#include "celeritas/em/model/MuBetheBlochModel.hh"
#include "celeritas/io/ImportProcess.hh"
#include "celeritas/phys/PDGNumber.hh"

namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* Construct process from host data.
*/
MuIonizationProcess::MuIonizationProcess(SPConstParticles particles,
SPConstImported process_data,
Options options)
: particles_(std::move(particles))
, imported_(process_data,
particles_,
ImportProcessClass::mu_ioni,
{pdg::mu_minus(), pdg::mu_plus()})
, options_(options)
{
CELER_EXPECT(particles_);
}

//---------------------------------------------------------------------------//
/*!
* Construct the models associated with this process.
*/
auto MuIonizationProcess::build_models(ActionIdIter start_id) const -> VecModel
{
return {std::make_shared<ICRU73QOModel>(*start_id++, *particles_),
std::make_shared<BraggModel>(*start_id++, *particles_),
std::make_shared<MuBetheBlochModel>(*start_id++, *particles_)};
}

//---------------------------------------------------------------------------//
/*!
* Get cross section values.
*/
auto MuIonizationProcess::step_limits(Applicability applicability) const
-> StepLimitBuilders
{
return imported_.step_limits(std::move(applicability));
}

//---------------------------------------------------------------------------//
/*!
* Name of the process.
*/
std::string_view MuIonizationProcess::label() const
{
return "Muon ionization";
}

//---------------------------------------------------------------------------//
} // namespace celeritas
64 changes: 64 additions & 0 deletions src/celeritas/em/process/MuIonizationProcess.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//----------------------------------*-C++-*----------------------------------//
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file celeritas/em/process/MuIonizationProcess.hh
//---------------------------------------------------------------------------//
#pragma once

#include <memory>

#include "celeritas/phys/Applicability.hh"
#include "celeritas/phys/ImportedProcessAdapter.hh"
#include "celeritas/phys/ParticleParams.hh"
#include "celeritas/phys/Process.hh"

namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* Ionization process for muons.
*/
class MuIonizationProcess : public Process
{
public:
//!@{
//! \name Type aliases
using SPConstParticles = std::shared_ptr<ParticleParams const>;
using SPConstImported = std::shared_ptr<ImportedProcesses const>;
//!@}

// Options for electron and positron ionization
struct Options
{
bool use_integral_xs{true}; //!> Use integral method for sampling
//! discrete interaction length
};

public:
// Construct with imported data
MuIonizationProcess(SPConstParticles particles,
SPConstImported process_data,
Options options);

// Construct the models associated with this process
VecModel build_models(ActionIdIter start_id) const final;

// Get the interaction cross sections for the given energy range
StepLimitBuilders step_limits(Applicability applicability) const final;

//! Whether to use the integral method to sample interaction length
bool use_integral_xs() const final { return options_.use_integral_xs; }

// Name of the process
std::string_view label() const final;

private:
SPConstParticles particles_;
ImportedProcessAdapter imported_;
Options options_;
};

//---------------------------------------------------------------------------//
} // namespace celeritas
47 changes: 44 additions & 3 deletions src/celeritas/ext/GeantPhysicsOptions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,44 @@ enum class RelaxationSelection
size_
};

//---------------------------------------------------------------------------//
/*!
* Construction options for Geant muon EM physics.
*/
struct GeantMuonPhysicsOptions
{
//! Enable muon pair production
bool pair_production{false};
//! Enable muon ionization
bool ionization{false};
//! Enable muon bremsstrahlung
bool bremsstrahlung{false};
//! Enable muon single Coulomb scattering
bool coulomb{false};
//! Enable muon multiple Coulomb scattering
bool msc{false};

//! True if any process is activated
explicit operator bool() const
{
return pair_production || ionization || bremsstrahlung || coulomb
|| msc;
}
};

//! Equality operator
constexpr bool
operator==(GeantMuonPhysicsOptions const& a, GeantMuonPhysicsOptions const& b)
{
// clang-format off
return a.pair_production == b.pair_production
&& a.ionization == b.ionization
&& a.bremsstrahlung == b.bremsstrahlung
&& a.coulomb == b.coulomb
&& a.msc == b.msc;
// clang-format on
}

//---------------------------------------------------------------------------//
/*!
* Construction options for Geant physics.
Expand All @@ -62,8 +100,6 @@ struct GeantPhysicsOptions

//!@{
//! \name Gamma physics
//! Enable discrete Coulomb
bool coulomb_scattering{false};
//! Enable Compton scattering
bool compton_scattering{true};
//! Enable the photoelectric effect
Expand All @@ -78,6 +114,8 @@ struct GeantPhysicsOptions

//!@{
//! \name Electron and positron physics
//! Enable discrete Coulomb
bool coulomb_scattering{false};
sethrj marked this conversation as resolved.
Show resolved Hide resolved
//! Enable e- and e+ ionization
bool ionization{true};
//! Enable positron annihilation
Expand All @@ -90,6 +128,9 @@ struct GeantPhysicsOptions
RelaxationSelection relaxation{RelaxationSelection::none};
//!@}

//! Muon EM physics
GeantMuonPhysicsOptions muon;

//!@{
//! \name Physics options
//! Number of log-spaced bins per factor of 10 in energy
Expand Down Expand Up @@ -151,11 +192,11 @@ operator==(GeantPhysicsOptions const& a, GeantPhysicsOptions const& b)
{
// clang-format off
return a.coulomb_scattering == b.coulomb_scattering
&& a.compton_scattering == b.compton_scattering
&& a.photoelectric == b.photoelectric
&& a.rayleigh_scattering == b.rayleigh_scattering
&& a.gamma_conversion == b.gamma_conversion
&& a.gamma_general == b.gamma_general
&& a.compton_scattering == b.compton_scattering
&& a.ionization == b.ionization
&& a.annihilation == b.annihilation
&& a.brems == b.brems
Expand Down
Loading
Loading