Celeritas  0.5.0-56+6b053cd
Classes | Public Member Functions | Static Public Member Functions | List of all members
celeritas::ProcessBuilder Class Reference

Construct Celeritas EM processes from imported data. More...

#include <ProcessBuilder.hh>

Classes

struct  UserBuildInput
 Input argument for user-provided process construction. More...
 

Public Types

Type aliases
using IPC = ImportProcessClass
 
using Options = ProcessBuilderOptions
 
using SPProcess = std::shared_ptr< Process >
 
using SPConstParticle = std::shared_ptr< ParticleParams const >
 
using SPConstMaterial = std::shared_ptr< MaterialParams const >
 
using SPConstImported = std::shared_ptr< ImportedProcesses const >
 
User builder type aliases
using UserBuildFunction = std::function< SPProcess(UserBuildInput const &)>
 
using UserBuildMap = std::unordered_map< IPC, UserBuildFunction >
 

Public Member Functions

 ProcessBuilder (ImportData const &data, SPConstParticle particle, SPConstMaterial material, UserBuildMap user_build, Options options)
 Construct imported process data. More...
 
 ProcessBuilder (ImportData const &data, SPConstParticle particle, SPConstMaterial material, Options options)
 Construct without custom user builders.
 
 ~ProcessBuilder ()
 Default destructor.
 
SPProcess operator() (IPC ipc)
 Construct a Process from a given processs class. More...
 

Static Public Member Functions

static std::set< IPCget_all_process_classes (std::vector< ImportProcess > const &processes)
 Get an ordered set of all available processes.
 

Detailed Description

Construct Celeritas EM processes from imported data.

This factory class has a hardcoded map that takes a ImportProcessClass and constructs a built-in EM process (which will then build corresponding models). This map can be overridden or extended by the user_build constructor argument, which is a mapping of process class to user-supplied factory functions.

The function can return a null process pointer (in which case the caller must ignore it) to indicate that a process should be deliberately omitted from Celeritas. This can be used to (for example) skip very-high-energy processes if Celeritas offloads only tracks below some energy cutoff. See WarnAndIgnoreProcess below for a helper function for this purpose.

Note
Imported data may have multiple duplicate "process" entries, one per particle type, because that's how Geant4 manages processes.

Constructor & Destructor Documentation

◆ ProcessBuilder()

celeritas::ProcessBuilder::ProcessBuilder ( ImportData const &  data,
SPConstParticle  particle,
SPConstMaterial  material,
UserBuildMap  user_build,
Options  options 
)

Construct imported process data.

Precondition
The import data must have already been converted to the native unit system.
Warning
If Livermore and SB data is present in the import data, their lifetime must extend beyond the ProcessBuilder instance.

Member Function Documentation

◆ operator()()

auto celeritas::ProcessBuilder::operator() ( IPC  ipc)

Construct a Process from a given processs class.

This may return a null process (with a warning) if the user specifically requests that the process be omitted.


The documentation for this class was generated from the following files: