39 if ( binSchemeName !=
"linear" ) {
40 if ( binSchemeName ==
"log" )
46 <<
" \"" << binScheme <<
"\" binning scheme is not supported." <<
G4endl
47 <<
" " <<
"Linear binning will be applied.";
58 std::vector<G4double>& edges)
63 G4double dx = (xmax - xmin ) / nbins;
65 while (
G4int(edges.size()) <= nbins ) {
66 edges.push_back(binValue);
72 = (std::log10(fcn(xmax)) - std::log10(fcn(xmin)))/ nbins;
75 while (
G4int(edges.size()) <= nbins ) {
76 edges.push_back(binValue);
85 <<
" User binning scheme setting was ignored." <<
G4endl
86 <<
" Linear binning will be applied with given (nbins, xmin, xmax) values";
95 std::vector<G4double>& newBins)
98 std::vector<G4double>::const_iterator it;
99 for (it = edges.begin(); it != edges.end(); it++ ) {
100 newBins.push_back(fcn(*it));
std::ostringstream G4ExceptionDescription
G4double(* G4Fcn)(G4double)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4BinScheme GetBinScheme(const G4String &binSchemeName)
void ComputeEdges(G4int nbins, G4double xmin, G4double xmax, G4Fcn fcn, G4BinScheme, std::vector< G4double > &edges)