39 if ( binSchemeName !=
"linear" ) {
40 if ( binSchemeName ==
"log" )
46 <<
" \"" << binSchemeName <<
"\" binning scheme is not supported." <<
G4endl
47 <<
" " <<
"Linear binning will be applied.";
58 std::vector<G4double>& edges)
63 auto xumin = xmin/unit;
64 auto xumax = xmax/unit;
67 auto dx = (fcn(xumax) - fcn(xumin) ) / nbins;
68 auto binValue = fcn(xumin);
69 while (
G4int(edges.size()) <= nbins ) {
70 edges.push_back(binValue);
77 = (std::log10(xumax) - std::log10(xumin))/ nbins;
78 auto dx = std::pow(10, dlog);
79 auto binValue = xumin;
80 while (
G4int(edges.size()) <= nbins ) {
81 edges.push_back(binValue);
90 <<
" User binning scheme setting was ignored." <<
G4endl
91 <<
" Linear binning will be applied with given (nbins, xmin, xmax) values";
100 std::vector<G4double>& newBins)
104 for (
auto element : edges) {
105 newBins.push_back(fcn(element/unit));
G4double(*)(G4double) G4Fcn
std::ostringstream G4ExceptionDescription
void ComputeEdges(G4int nbins, G4double xmin, G4double xmax, G4double unit, G4Fcn fcn, G4BinScheme, std::vector< G4double > &edges)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4BinScheme GetBinScheme(const G4String &binSchemeName)