R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandMapToCalPar.cxx
Go to the documentation of this file.
2#include "R3BNeulandParSet.h"
3#include "R3BValueError.h"
4#include <R3BException.h>
5#include <fmt/core.h>
6#include <string_view>
7#include <sys/types.h>
8#include <utility>
9
10namespace R3B
11{
12 Map2CalPar::Map2CalPar(std::string_view name, std::string_view title, std::string_view context, bool own)
13 : Neuland::ParSet(name.data(), title.data(), context.data(), own)
14 {
15 }
16
17 void Map2CalPar::AddModuleParam(unsigned int module_num, TCalVFTXModulePar modulePar)
18 {
19 moduleParams_.emplace(module_num, std::move(modulePar));
20 }
21
22 auto TCalVFTXModulePar::GetFineTime(FTType ftType, uint channel_num) const -> ValueError<double>
23 {
24 if (channel_num < finetime_correlation_.at(ftType).value_error.size())
25 {
26 const auto& relation = finetime_correlation_.at(ftType);
27 auto value_error = relation.value_error[channel_num];
28 return value_error;
29 }
30
31 throw R3B::logic_error(fmt::format("channel number {} exceeds the maximal bin number {}!",
32 channel_num,
33 finetime_correlation_.at(ftType).value_error.size()));
34 }
35} // namespace R3B
Map2CalPar(std::string_view name="NeulandMap2CalPar", std::string_view title="Neuland Map2Cal calibration", std::string_view context="TestDefaultContext", bool own=true)
void AddModuleParam(unsigned int module_num, TCalVFTXModulePar modulePar)
std::unordered_map< unsigned int, TCalVFTXModulePar > moduleParams_
ParSet(std::string_view name="parSet", std::string_view title="Neuland parameter", std::string_view context="TestDefaultContext", bool own=true)
std::map< FTType, FTChannel2TimeRelation > finetime_correlation_
auto GetFineTime(FTType ftType, uint channel_Num) const -> ValueError< double >
Simulation of NeuLAND Bar/Paddle.