33 #include "G4String.hh"
39 std::string::size_type begIdx, std::string::size_type& endIdx)
41 while ( line[begIdx] ==
' ') ++begIdx;
42 if ( line[begIdx] ==
'"' ) {
43 endIdx = line.find(
'"', begIdx+1);
44 if ( endIdx == std::string::npos ) endIdx = line.length();
45 token = line.substr(begIdx+1, (endIdx-1)-begIdx);
49 endIdx = line.find(
' ', begIdx);
50 if ( endIdx == std::string::npos ) endIdx = line.length();
51 token = line.substr(begIdx, endIdx-begIdx);
53 return ( token.length() > 0 );
67 <<
" Illegal value of number of bins: nbins <= 0" <<
G4endl;
86 <<
" Illegal values of (xmin >= xmax)" <<
G4endl;
93 if ( ( fcnName !=
"none" ) && ( binSchemeName !=
"linear" ) ) {
96 <<
" Combining Function and Binning scheme is not supported."
105 fcnName ==
"log" || fcnName ==
"log10" ) && ( xmin == 0 ) ) {
108 <<
" Illegal value of (xmin = 0) with logarithmic function or binning"
122 if ( edges.size() <= 1 ) {
125 <<
" Illegal edges vector (size <= 1)" <<
G4endl;
138 if ( ! name.size() ) {
141 <<
" Empty " << objectType <<
" name is not allowed." <<
G4endl
142 <<
" " << objectType <<
" was not created." <<
G4endl;
155 if ( unit !=
"none" ) {
157 if ( value == 0. ) value = 1.;
167 if ( fcnName !=
"none" ) { title +=
" "; title += fcnName; title +=
"("; }
168 if ( unitName !=
"none" ) { title +=
" ["; title += unitName; title +=
"]";}
169 if ( fcnName !=
"none" ) { title +=
")"; }
176 std::string::size_type begIdx = 0;
177 std::string::size_type endIdx = 0;
181 if ( GetToken(line, token, begIdx, endIdx) ) {
184 tokens.push_back(token);
188 while ( endIdx != line.length() );
std::ostringstream G4ExceptionDescription
void UpdateTitle(G4String &title, const G4String &unitName, const G4String &fcnName)
static G4double GetValueOf(const G4String &)
G4bool CheckName(const G4String &name, const G4String &objectType)
G4double GetUnitValue(const G4String &unit)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
G4BinScheme GetBinScheme(const G4String &binSchemeName)
G4bool CheckNbins(G4int nbins)
G4bool CheckMinMax(G4double xmin, G4double xmax, const G4String &fcnName="none", const G4String &binSchemeName="linear")
G4bool CheckEdges(const std::vector< G4double > &edges)