32 #include "G4String.hh"
38 std::string::size_type begIdx, std::string::size_type& endIdx)
40 while ( line[begIdx] ==
' ') ++begIdx;
41 if ( line[begIdx] ==
'"' ) {
42 endIdx = line.find(
'"', begIdx+1);
43 if ( endIdx == std::string::npos ) endIdx = line.length();
44 token = line.substr(begIdx+1, (endIdx-1)-begIdx);
48 endIdx = line.find(
' ', begIdx);
49 if ( endIdx == std::string::npos ) endIdx = line.length();
50 token = line.substr(begIdx, endIdx-begIdx);
52 return ( token.length() > 0 );
66 <<
" Illegal value of number of bins: nbins <= 0" <<
G4endl;
85 <<
" Illegal values of (xmin >= xmax)" <<
G4endl;
92 if ( ( fcnName !=
"none" ) && ( binSchemeName !=
"linear" ) ) {
95 <<
" Combining Function and Binning scheme is not supported."
103 if ( (
GetBinScheme(binSchemeName) == G4BinScheme::kLog ||
104 fcnName ==
"log" || fcnName ==
"log10" ) && ( xmin == 0 ) ) {
107 <<
" Illegal value of (xmin = 0) with logarithmic function or binning"
121 if ( edges.size() <= 1 ) {
124 <<
" Illegal edges vector (size <= 1)" <<
G4endl;
137 if ( ! name.size() ) {
140 <<
" Empty " << objectType <<
" name is not allowed." <<
G4endl
141 <<
" " << objectType <<
" was not created." <<
G4endl;
154 if ( unit !=
"none" ) {
156 if ( value == 0. ) value = 1.;
166 if ( fcnName !=
"none" ) { title +=
" "; title += fcnName; title +=
"("; }
167 if ( unitName !=
"none" ) { title +=
" ["; title += unitName; title +=
"]";}
168 if ( fcnName !=
"none" ) { title +=
")"; }
175 std::string::size_type begIdx = 0;
176 std::string::size_type endIdx = 0;
180 if ( GetToken(line, token, begIdx, endIdx) ) {
183 tokens.push_back(token);
187 while ( endIdx < line.length() );
192 if ( outputName ==
"csv" ) {
return G4AnalysisOutput::kCsv; }
193 #ifdef TOOLS_USE_HDF5
194 else if ( outputName ==
"hdf5" ) {
return G4AnalysisOutput::kHdf5; }
196 else if ( outputName ==
"root" ) {
return G4AnalysisOutput::kRoot; }
197 else if ( outputName ==
"xml" ) {
return G4AnalysisOutput::kXml; }
198 else if ( outputName ==
"none" ) {
return G4AnalysisOutput::kNone; }
203 <<
" \"" << outputName <<
"\" output type is not supported." <<
G4endl;
207 return G4AnalysisOutput::kNone;
214 case G4AnalysisOutput::kCsv:
217 #ifdef TOOLS_USE_HDF5
218 case G4AnalysisOutput::kHdf5:
222 case G4AnalysisOutput::kRoot:
225 case G4AnalysisOutput::kXml:
228 case G4AnalysisOutput::kNone:
235 <<
" \"" <<
static_cast<int>(output) <<
"\" is not handled." <<
G4endl
236 <<
" " <<
"none type will be used.";