CbmRoot
Loading...
Searching...
No Matches
LandauTable.cxx
Go to the documentation of this file.
1
/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Felix Weiglhofer [committer] */
4
#include "
LandauTable.h
"
5
6
#include "
AlgoFairloggerCompat.h
"
7
8
#include <fstream>
9
10
using namespace
cbm::algo
;
11
12
sts::LandauTable
sts::LandauTable::FromFile
(fs::path path)
13
{
14
sts::LandauTable
table;
15
16
std::vector<f32> charge;
17
std::vector<f32> prob;
18
std::ifstream file(path.string());
19
20
while
(!file.eof()) {
21
22
f32
q, p;
23
file >> q >> p;
24
charge.push_back(q);
25
prob.push_back(p);
26
27
L_
(trace) <<
"Reading Landau table "
<< path <<
" q="
<< q <<
" p="
<< p;
28
}
29
30
// TODO: check if charge is monotonically increasing, also more than 2 entries
31
32
table.
stepSize
= charge[1] - charge[0];
33
table.
values
= std::move(prob);
34
35
return
table;
36
}
AlgoFairloggerCompat.h
L_
#define L_(level)
Definition
AlgoFairloggerCompat.h:18
LandauTable.h
cbm::algo
Definition
AlgoTraits.h:16
cbm::algo::f32
float f32
Definition
Definitions.h:24
cbm::algo::sts::LandauTable
Definition
LandauTable.h:15
cbm::algo::sts::LandauTable::FromFile
static LandauTable FromFile(fs::path path)
Definition
LandauTable.cxx:12
cbm::algo::sts::LandauTable::values
std::vector< f32 > values
Definition
LandauTable.h:19
cbm::algo::sts::LandauTable::stepSize
f32 stepSize
Definition
LandauTable.h:20
algo
data
sts
LandauTable.cxx
Generated on Mon Feb 3 2025 23:03:44 for CbmRoot by
1.12.0