39 if ( binSchemeName !=
"linear" ) {
40 if ( binSchemeName ==
"log" )
44 Warn(
"\"" + binSchemeName +
"\" binning scheme is not supported.\n"
45 "Linear binning will be applied.",
55 std::vector<G4double>& edges)
60 auto xumin = xmin/unit;
61 auto xumax = xmax/unit;
64 auto dx = (fcn(xumax) - fcn(xumin) ) / nbins;
65 auto binValue = fcn(xumin);
66 while (
G4int(edges.size()) <= nbins ) {
67 edges.push_back(binValue);
74 = (std::log10(xumax) - std::log10(xumin))/ nbins;
75 auto dx = std::pow(10, dlog);
76 auto binValue = xumin;
77 while (
G4int(edges.size()) <= nbins ) {
78 edges.push_back(binValue);
85 Warn(
"User binning scheme setting was ignored.\n"
86 "Linear binning will be applied with given (nbins, xmin, xmax) values",
94 std::vector<G4double>& newBins)
98 for (
auto element : edges) {
99 newBins.push_back(fcn(element/unit));
G4double(*)(G4double) G4Fcn
G4BinScheme GetBinScheme(const G4String &binSchemeName)
constexpr std::string_view kNamespaceName
void ComputeEdges(G4int nbins, G4double xmin, G4double xmax, G4double unit, G4Fcn fcn, G4BinScheme, std::vector< G4double > &edges)
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)