41 fFirstNtupleColumnId(0),
43 fHistoDirectoryName(
""),
44 fNtupleDirectoryName(
""),
45 fLockFirstHistoId(false),
46 fLockFirstNtupleColumnId(false),
48 fLockHistoDirectoryName(false),
49 fLockNtupleDirectoryName(false),
84 fH1Informations.push_back(
86 unit, unit, fcn, fcn));
99 fH2Informations.push_back(
101 xunit, yunit, xfcn, yfcn));
110 if ( name.find(
".") != std::string::npos ) {
111 name.erase(name.find(
"."), name.length());
120 std::ofstream output(name, std::ios::out);
124 <<
"Cannot open file. File name is not defined.";
129 output.setf( std::ios::scientific, std::ios::floatfield );
146 if ( ! info )
return "";
156 if ( ! info )
return 1.0;
166 if ( ! info )
return 1.0;
176 if ( ! info )
return true;
186 if ( ! info )
return false;
195 if ( unit !=
"none" ) {
197 if ( value == 0. ) value = 1.;
206 if ( fcnName !=
"none" ) {
207 if ( fcnName ==
"log" ) fcn = std::log;
208 else if ( fcnName ==
"log10") fcn = std::log10;
209 else if ( fcnName ==
"exp" ) fcn = std::exp;
213 <<
" \"" << fcnName <<
"\" function is not supported." <<
G4endl
214 <<
" " <<
"No function will be applied to h1 values.";
229 if ( verboseLevel ==
fVerboseLevel || verboseLevel < 0 )
return;
233 if ( verboseLevel == 0 ) {
239 else if ( verboseLevel == 1 ) {
245 else if ( verboseLevel == 2 ) {
251 else if ( verboseLevel == 3 ) {
271 <<
"Cannot open file. File name is not defined.";
286 <<
"Cannot set File name as its value was already used.";
302 <<
"Cannot set Histo directory name as its value was already used.";
303 G4Exception(
"G4VAnalysisManager::SetHistoDirectoryName()",
318 <<
"Cannot set Ntuple directory name as its value was already used.";
319 G4Exception(
"G4VAnalysisManager::SetNtupleDirectoryName()",
332 if ( name.find(
".") == std::string::npos ) {
346 <<
"Cannot set FirstHistoId as its value was already used.";
347 G4Exception(
"G4VAnalysisManager::SetFirstHistoId()",
362 <<
"Cannot set FirstNtupleColumnId as its value was already used.";
363 G4Exception(
"G4VAnalysisManager::SetFirstHistoId()",
377 return ( fNofActiveObjects > 0 );
383 return ( fNofAsciiObjects > 0 );
390 if ( index < 0 || index >=
GetNofH1s() ) {
392 description <<
" " <<
"histo " <<
id <<
" does not exist.";
393 G4Exception(
"G4VAnalysisManager::GetH1Information()",
397 return fH1Informations[
index];
404 if ( index < 0 || index >=
GetNofH2s() ) {
406 description <<
" " <<
"histo " <<
id <<
" does not exist.";
407 G4Exception(
"G4VAnalysisManager::GetH2Information()",
411 return fH2Informations[
index];
434 description <<
"Wrong object type.";
435 G4Exception(
"G4VAnalysisManager::SetFirstHistoId()",
448 if ( ! info )
return;
466 std::vector<G4HnInformation*>* informations;
468 informations = &fH1Informations;
469 else if ( type ==
kH2 )
470 informations = &fH2Informations;
476 description <<
"Wrong object type.";
482 std::vector<G4HnInformation*>::iterator it;
483 for ( it = informations->begin(); it != informations->end(); it++ ) {
503 if ( ! info )
return;
506 if ( info->
fAscii == ascii )
return;