forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImportParameters.hh
117 lines (104 loc) · 3.79 KB
/
ImportParameters.hh
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
//----------------------------------*-C++-*----------------------------------//
// Copyright 2021-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/io/ImportParameters.hh
//---------------------------------------------------------------------------//
#pragma once
#include <unordered_map>
#include "celeritas/Units.hh"
#include "ImportUnits.hh"
namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* Common electromagnetic physics parameters (see G4EmParameters.hh).
*
* \note Geant4 v11 removed the Spline() option from G4EmParameters.hh.
* \note The Geant4 MSC models use the values in \c G4EmParameters as the
* defaults; however, the MSC parameters can also be set directly using the
* model setter methods (there is no way to retrieve the values from the model
* in that case).
*/
struct ImportEmParameters
{
#ifndef SWIG
static constexpr auto energy_units{ImportUnits::mev};
#endif
//! Energy loss fluctuation
bool energy_loss_fluct{false};
//! LPM effect for bremsstrahlung and pair production
bool lpm{true};
//! Integral cross section rejection
bool integral_approach{true};
//! Slowing down threshold for linearity assumption
double linear_loss_limit{0.01};
//! Lowest e-/e+ kinetic energy [MeV]
double lowest_electron_energy{0.001};
//! Whether auger emission should be enabled (valid only for relaxation)
bool auger{false};
//! MSC range factor for e-/e+
double msc_range_factor{0.04};
//! MSC safety factor
double msc_safety_factor{0.6};
//! MSC lambda limit [length]
double msc_lambda_limit{1 * units::millimeter};
//! Kill secondaries below production cut
bool apply_cuts{false};
//! Nuclear screening factor for single/multiple Coulomb scattering
double screening_factor{1};
//! Whether parameters are assigned and valid
explicit operator bool() const
{
return linear_loss_limit > 0 && lowest_electron_energy > 0
&& msc_range_factor > 0 && msc_range_factor < 1
&& msc_safety_factor >= 0.1 && msc_lambda_limit > 0
&& screening_factor > 0;
}
};
//---------------------------------------------------------------------------//
/*!
* Particle-dependent parameters for killing looping tracks.
*/
struct ImportLoopingThreshold
{
#ifndef SWIG
static constexpr auto energy_units{ImportUnits::mev};
#endif
//! Number of steps a higher-energy looping track takes before it's killed
int threshold_trials{10};
//! Energy below which looping tracks are immediately killed [MeV]
double important_energy{250};
//! Whether parameters are assigned and valid
explicit operator bool() const
{
return threshold_trials > 0 && important_energy >= 0;
}
};
//---------------------------------------------------------------------------//
/*!
* Parameters related to transportation.
*
* The looping thresholds are particle-dependent and stored in a map where the
* keys are the PDG number.
*/
struct ImportTransParameters
{
//!@{
//! \name Type aliases
using PDGInt = int;
using ImportLoopingMap = std::unordered_map<PDGInt, ImportLoopingThreshold>;
//!@}
//! Thresholds for killing looping tracks
ImportLoopingMap looping;
//! Maximum number of substeps in the field propagator
int max_substeps{1000};
//! Whether parameters are assigned and valid
explicit operator bool() const
{
return max_substeps >= 0 && !looping.empty();
}
};
//---------------------------------------------------------------------------//
} // namespace celeritas