23 using namespace Acts::UnitLiterals;
25 static constexpr
int width = 11;
31 os <<
"# material: " << slab <<
'\n';
32 os <<
"# particle pdg id: " << pdg <<
'\n';
33 os <<
"# particle mass: " << mass / 1
_MeV <<
"MeV\n";
34 os <<
"# particle charge: " << charge / 1
_e <<
"e\n";
35 os <<
"# particle momentum is given in GeV\n";
36 os <<
"# tabulated energy loss is given in MeV\n";
37 os <<
"# delta is the total energy loss\n";
38 os <<
"# delta_ion is the energy loss due to ionisation and excitation\n";
39 os <<
"# delta_rad is the energy loss due to radiative effects\n";
40 os <<
"# sigma is the width of the enery loss distribution\n";
49 os << std::setw(
width) <<
"sigma" <<
'\n';
53 float deltaIon,
float deltaRad,
float sigma) {
54 const auto energy = std::sqrt(mass * mass + momentum * momentum);
55 const auto beta = momentum /
energy;
56 const auto betaGamma = momentum /
mass;
64 os << std::setw(
width) << sigma / 1
_MeV <<
'\n';
67 int main(
int argc,
char const* argv[]) {
70 std::cerr <<
"usage: " << argv[0] <<
" thickness pdg p_min p_max n\n";
72 std::cerr <<
"tabulate energy loss over a configurable momentum range.\n";
74 std::cerr <<
"parameters:\n";
75 std::cerr <<
" thickness: material thickness in mm\n";
76 std::cerr <<
" pdg: PDG particle type identifier\n";
77 std::cerr <<
" p_{min/max}: momentum range in GeV\n";
78 std::cerr <<
" n: number of points in the momentum range\n";
85 const auto pmin = atof(argv[3]) * 1
_GeV;
86 const auto pmax = atof(argv[4]) * 1
_GeV;
87 const auto deltap = (pmax - pmin) / atoi(argv[5]);
96 for (
auto p = pmin;
p < pmax;
p += deltap) {
101 const auto deltaIon =
103 const auto deltaRad =