CbmRoot
Loading...
Searching...
No Matches
CbmQaCheckerTypedefs.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#ifndef CbmQaCheckerTypedefs_h
11#define CbmQaCheckerTypedefs_h 1
12
13#include <boost/range/iterator_range.hpp>
14
15#include <bitset>
16#include <limits>
17#include <string>
18#include <unordered_map>
19#include <vector>
20
21namespace cbm::qa::checker
22{
25 enum class ECmpMethod : uint8_t
26 {
27 Exact,
28 Ratio,
29 Chi2,
30 END
31 };
32
36 enum class ECmpInference : uint8_t
37 {
38 StronglyEqual = 0,
41 };
42
44 inline std::string ToString(ECmpInference inference)
45 {
46 switch (inference) {
47 case ECmpInference::StronglyEqual: return "\e[1;32msame\e[0m";
48 case ECmpInference::WeaklyEqual: return "\e[1;33mconsistent\e[0m";
49 case ECmpInference::Different: return "\e[1;31mdifferent\e[0m";
50 default: return "";
51 }
52 }
53
54 // Aliases
55 using MapStrToStr_t = std::unordered_map<std::string, std::string>;
56 using MapStrToStrVect_t = std::unordered_map<std::string, std::vector<std::string>>;
57
58 template<class T>
59 using VectRange_t = boost::iterator_range<typename std::vector<T>::iterator>;
60
61 // Constants
62 constexpr double kLegendSize[2] = {.3, .05};
63 constexpr float kRatioMin = 0.95;
64 constexpr float kRatioMax = 1.05;
65 constexpr float kPvalThrsh = 0.05;
66
67
68} // namespace cbm::qa::checker
69
70#endif // CbmQaCheckerTypedefs_h
ECmpInference
The object comparison inference.
@ Different
Neither of the comparison methods showed equality.
@ WeaklyEqual
At least one of the comparison methods showed equality.
@ StronglyEqual
All the comparison methods gave equality.
constexpr float kRatioMax
Maximal acceptable ratio.
ECmpMethod
Comparison method.
@ Exact
exact equality (point-by-point, error-by-error)
@ Chi2
equality within a chi2 hypothesis test
@ Ratio
ratio equality (max and min ratios do not exceed a required range)
@ END
end of enumeration
std::unordered_map< std::string, std::string > MapStrToStr_t
constexpr float kPvalThrsh
P-value threshold.
constexpr double kLegendSize[2]
width and height in % of the pad size
constexpr float kRatioMin
Minimal acceptable ratio.
boost::iterator_range< typename std::vector< T >::iterator > VectRange_t
std::unordered_map< std::string, std::vector< std::string > > MapStrToStrVect_t
std::string ToString(ECmpInference inference)
String representation of the ECmpInference enum.