forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BremsstrahlungProcess.cc
122 lines (115 loc) · 4.9 KB
/
BremsstrahlungProcess.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//----------------------------------*-C++-*----------------------------------//
// Copyright 2020-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/BremsstrahlungProcess.cc
//---------------------------------------------------------------------------//
#include "BremsstrahlungProcess.hh"
#include <utility>
#include "corecel/Assert.hh"
#include "corecel/cont/Range.hh"
#include "celeritas/em/model/CombinedBremModel.hh"
#include "celeritas/em/model/RelativisticBremModel.hh"
#include "celeritas/em/model/SeltzerBergerModel.hh"
#include "celeritas/io/ImportProcess.hh"
#include "celeritas/phys/PDGNumber.hh"
namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* Construct from host data.
*/
BremsstrahlungProcess::BremsstrahlungProcess(SPConstParticles particles,
SPConstMaterials materials,
SPConstImported process_data,
ReadData load_sb,
Options options)
: particles_(std::move(particles))
, materials_(std::move(materials))
, imported_(process_data,
particles_,
ImportProcessClass::e_brems,
{pdg::electron(), pdg::positron()})
, load_sb_(std::move(load_sb))
, options_(options)
{
CELER_EXPECT(particles_);
CELER_EXPECT(materials_);
CELER_EXPECT(load_sb_);
CELER_VALIDATE(options_.selection != BremsModelSelection::none
&& options_.selection != BremsModelSelection::size_,
<< "Cannot construct BremsstrahlungProcess without a valid "
"BremsModelSelection enum");
}
//---------------------------------------------------------------------------//
/*!
* Construct the models associated with this process.
*/
auto BremsstrahlungProcess::build_models(ActionIdIter start_id) const
-> VecModel
{
switch (options_.selection)
{
case BremsModelSelection::seltzer_berger:
return {std::make_shared<SeltzerBergerModel>(*start_id++,
*particles_,
*materials_,
imported_.processes(),
load_sb_)};
case BremsModelSelection::relativistic:
return {
std::make_shared<RelativisticBremModel>(*start_id++,
*particles_,
*materials_,
imported_.processes(),
options_.enable_lpm)};
case BremsModelSelection::all:
if (options_.combined_model)
{
return {
std::make_shared<CombinedBremModel>(*start_id++,
*particles_,
*materials_,
imported_.processes(),
load_sb_,
options_.enable_lpm)};
}
else
{
return {
std::make_shared<SeltzerBergerModel>(*start_id++,
*particles_,
*materials_,
imported_.processes(),
load_sb_),
std::make_shared<RelativisticBremModel>(
*start_id++,
*particles_,
*materials_,
imported_.processes(),
options_.enable_lpm)};
}
default:
CELER_ASSERT_UNREACHABLE();
}
}
//---------------------------------------------------------------------------//
/*!
* Get the interaction cross sections for the given energy range.
*/
auto BremsstrahlungProcess::step_limits(Applicability applic) const
-> StepLimitBuilders
{
return imported_.step_limits(std::move(applic));
}
//---------------------------------------------------------------------------//
/*!
* Name of the process.
*/
std::string_view BremsstrahlungProcess::label() const
{
return "Bremsstrahlung";
}
//---------------------------------------------------------------------------//
} // namespace celeritas