43 using namespace G4Analysis;
47 void NtupleMergingWarning(
const G4String& functionName,
52 <<
" " <<
"Ntuple merging is not available with "
53 << outputType <<
" output." <<
G4endl
54 <<
" " <<
"Setting is ignored.";
62 : fState(type, isMaster),
63 fVFileManager(nullptr),
64 fPlotManager(nullptr),
66 fH1HnManager(nullptr),
67 fH2HnManager(nullptr),
68 fH3HnManager(nullptr),
69 fP1HnManager(nullptr),
70 fP2HnManager(nullptr),
76 fVNtupleManager(nullptr)
153 G4bool finalResult =
true;
157 if ( name.find(
".") != std::string::npos ) {
158 name.erase(name.find(
"."), name.length());
167 std::ofstream output(name, std::ios::out);
171 <<
"Cannot open file. File name is not defined.";
176 output.setf( std::ios::scientific, std::ios::floatfield );
179 finalResult = finalResult && result;
182 finalResult = finalResult && result;
185 finalResult = finalResult && result;
208 if ( fileName !=
"" ) {
215 <<
"Cannot open file. File name is not defined.";
227 G4bool finalResult =
true;
230 finalResult = finalResult && result;
234 finalResult = finalResult && result;
322 return fVH1Manager->CreateH1(name, title, nbins, xmin, xmax,
323 unitName, fcnName, binSchemeName);
328 const std::vector<G4double>& edges,
334 return fVH1Manager->CreateH1(name, title, edges, unitName, fcnName);
356 nxbins, xmin, xmax, nybins, ymin, ymax,
357 xunitName, yunitName, xfcnName, yfcnName,
358 xbinSchemeName, ybinSchemeName);
363 const std::vector<G4double>& xedges,
364 const std::vector<G4double>& yedges,
376 xunitName, yunitName, xfcnName, yfcnName);
405 nxbins, xmin, xmax, nybins, ymin, ymax,
407 xunitName, yunitName, zunitName,
408 xfcnName, yfcnName, zfcnName,
409 xbinSchemeName, ybinSchemeName, zbinSchemeName);
414 const std::vector<G4double>& xedges,
415 const std::vector<G4double>& yedges,
416 const std::vector<G4double>& zedges,
430 xedges, yedges, zedges,
431 xunitName, yunitName, zunitName,
432 xfcnName, yfcnName, zfcnName);
444 return fVH1Manager->SetH1(
id, nbins, xmin, xmax, unitName, fcnName, binSchemeName);
449 const std::vector<G4double>& edges,
454 return fVH1Manager->SetH1(
id, edges, unitName, fcnName);
472 return fVH2Manager->SetH2(
id, nxbins, xmin, xmax, nybins, ymin, ymax,
473 xunitName, yunitName, xfcnName, yfcnName,
474 xbinSchemeName, ybinSchemeName);
479 const std::vector<G4double>& xedges,
480 const std::vector<G4double>& yedges,
488 xunitName, yunitName, xfcnName, yfcnName);
514 nxbins, xmin, xmax, nybins, ymin, ymax,
516 xunitName, yunitName, zunitName,
517 xfcnName, yfcnName, zfcnName,
518 xbinSchemeName, ybinSchemeName, zbinSchemeName);
523 const std::vector<G4double>& xedges,
524 const std::vector<G4double>& yedges,
525 const std::vector<G4double>& zedges,
535 return fVH3Manager->SetH3(
id, xedges, yedges, zedges,
536 xunitName, yunitName, zunitName,
537 xfcnName, yfcnName, zfcnName);
569 if ( ymin != 0. || ymax != 0. ) {
574 return fVP1Manager->CreateP1(name, title, nbins, xmin, xmax, ymin, ymax,
575 xunitName, yunitName, xfcnName, yfcnName,
581 const std::vector<G4double>& edges,
588 if ( ymin != 0. || ymax != 0. ) {
593 return fVP1Manager->CreateP1(name, title, edges, ymin, ymax,
594 xunitName, yunitName, xfcnName, yfcnName);
613 if ( zmin != 0. || zmax != 0. ) {
619 nxbins, xmin, xmax, nybins, ymin, ymax,
621 xunitName, yunitName, zunitName,
622 xfcnName, yfcnName, zfcnName,
623 xbinSchemeName, ybinSchemeName);
628 const std::vector<G4double>& xedges,
629 const std::vector<G4double>& yedges,
639 if ( zmin != 0. || zmax != 0. ) {
644 return fVP2Manager->CreateP2(name, title, xedges, yedges, zmin, zmax,
645 xunitName, yunitName, zunitName,
646 xfcnName, yfcnName, zfcnName);
659 if ( ymin != 0. || ymax != 0. ) {
664 return fVP1Manager->SetP1(
id, nbins, xmin, xmax, ymin, ymax,
665 xunitName, yunitName, xfcnName, yfcnName,
671 const std::vector<G4double>& edges,
677 if ( ymin != 0. || ymax != 0. ) {
683 xunitName, yunitName, xfcnName, yfcnName);
702 if ( zmin != 0. || zmax != 0. ) {
707 return fVP2Manager->SetP2(
id, nxbins, xmin, xmax, nybins, ymin, ymax,
709 xunitName, yunitName, zunitName,
710 xfcnName, yfcnName, zfcnName,
711 xbinSchemeName, ybinSchemeName);
716 const std::vector<G4double>& xedges,
717 const std::vector<G4double>& yedges,
728 if ( zmin != 0. || zmax != 0. ) {
733 return fVP2Manager->SetP2(
id, xedges, yedges, zmin, zmax,
734 xunitName, yunitName, zunitName,
735 xfcnName, yfcnName, zfcnName);
793 std::vector<int>& vector)
802 std::vector<float>& vector)
811 std::vector<double>& vector)
831 NtupleMergingWarning(
"G4VAnalysisManager::SetNtupleMerging",
GetType());
841 NtupleMergingWarning(
"G4VAnalysisManager::SetNtupleRowWise",
GetType());
850 NtupleMergingWarning(
"G4VAnalysisManager::SetBasketSize",
GetType());
859 NtupleMergingWarning(
"G4VAnalysisManager::SetBasketEntries",
GetType());
902 std::vector<int>& vector)
912 std::vector<float>& vector)
922 std::vector<double>& vector)
938 G4bool finalResult =
true;
941 finalResult = finalResult && result;
944 finalResult = finalResult && result;
947 finalResult = finalResult && result;
973 G4bool finalResult =
true;
976 finalResult = finalResult && result;
979 finalResult = finalResult && result;