forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImportPhysicsTable.hh
69 lines (60 loc) · 2.61 KB
/
ImportPhysicsTable.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
//----------------------------------*-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/io/ImportPhysicsTable.hh
//---------------------------------------------------------------------------//
#pragma once
#include <vector>
#include "celeritas/Units.hh"
#include "ImportPhysicsVector.hh"
#include "ImportUnits.hh"
namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* Property being described by the physics table.
*
* These are named based on accessors in G4VEnergyLossProcess, with one
* new table type, \c dedx_process, introduced to disambiguate the tables. In
* Geant4, the \c dedx table belonging to the ionization process is actually
* the sum of the de/dx for all processes that contribute to energy loss for
* the given particle, while the \c dedx tables for the remaining processes are
* the per-process energy loss. Here the tables are named to distinguish the
* summed energy loss (\c dedx) from the energy loss for an individual process
* (\c dedx_process). The \c ionization table is really just the \c
* dedx_process table for ionization, so it is redundant. The \c range table is
* calculated from the summed \c dedx table.
*/
enum class ImportTableType
{
lambda, //!< Macroscopic cross section
lambda_prim, //!< Cross section scaled by energy
dedx, //!< Energy loss summed over processes
range, //!< Integrated inverse energy loss
msc_xs, //!< Scaled transport cross section
size_
};
//---------------------------------------------------------------------------//
/*!
* Imported physics table. Each table stores physics vectors for all materials.
*/
struct ImportPhysicsTable
{
ImportTableType table_type{ImportTableType::size_};
ImportUnits x_units{ImportUnits::unitless};
ImportUnits y_units{ImportUnits::unitless};
std::vector<ImportPhysicsVector> physics_vectors;
explicit operator bool() const
{
return table_type != ImportTableType::size_ && !physics_vectors.empty();
}
};
//---------------------------------------------------------------------------//
// FREE FUNCTIONS
//---------------------------------------------------------------------------//
// Get the string value for a table type
char const* to_cstring(ImportTableType value);
//---------------------------------------------------------------------------//
} // namespace celeritas