44 using namespace G4Analysis;
48 : fState(type, isMaster),
49 fVFileManager(nullptr),
51 fH1HnManager(nullptr),
52 fH2HnManager(nullptr),
53 fH3HnManager(nullptr),
54 fP1HnManager(nullptr),
55 fP2HnManager(nullptr),
61 fVNtupleManager(nullptr)
69 delete fVNtupleManager;
79 fVH1Manager.reset(h1Manager);
81 fMessenger->SetH1HnManager(*fH1HnManager);
87 fVH2Manager.reset(h2Manager);
89 fMessenger->SetH2HnManager(*fH2HnManager);
95 fVH3Manager.reset(h3Manager);
97 fMessenger->SetH3HnManager(*fH3HnManager);
103 fVP1Manager.reset(p1Manager);
105 fMessenger->SetP1HnManager(*fP1HnManager);
111 fVP2Manager.reset(p2Manager);
113 fMessenger->SetP2HnManager(*fP2HnManager);
120 fVNtupleManager = ntupleManager;
132 G4bool finalResult =
true;
136 if ( name.find(
".") != std::string::npos ) {
137 name.erase(name.find(
"."), name.length());
146 std::ofstream output(name, std::ios::out);
150 <<
"Cannot open file. File name is not defined.";
155 output.setf( std::ios::scientific, std::ios::floatfield );
158 finalResult = finalResult &&
result;
160 result = fVH2Manager->WriteOnAscii(output);
161 finalResult = finalResult &&
result;
163 result = fVH3Manager->WriteOnAscii(output);
164 finalResult = finalResult &&
result;
187 if ( fileName !=
"" ) {
194 <<
"Cannot open file. File name is not defined.";
206 G4bool finalResult =
true;
209 finalResult = finalResult &&
result;
213 finalResult = finalResult &&
result;
264 fState.SetCompressionLevel(level);
301 return fVH1Manager->CreateH1(name, title, nbins, xmin, xmax,
302 unitName, fcnName, binSchemeName);
307 const std::vector<G4double>& edges,
313 return fVH1Manager->CreateH1(name, title, edges, unitName, fcnName);
334 return fVH2Manager->CreateH2(name, title,
335 nxbins, xmin, xmax, nybins, ymin, ymax,
336 xunitName, yunitName, xfcnName, yfcnName,
337 xbinSchemeName, ybinSchemeName);
342 const std::vector<G4double>& xedges,
343 const std::vector<G4double>& yedges,
353 return fVH2Manager->CreateH2(name, title,
355 xunitName, yunitName, xfcnName, yfcnName);
383 return fVH3Manager->CreateH3(name, title,
384 nxbins, xmin, xmax, nybins, ymin, ymax,
386 xunitName, yunitName, zunitName,
387 xfcnName, yfcnName, zfcnName,
388 xbinSchemeName, ybinSchemeName, zbinSchemeName);
393 const std::vector<G4double>& xedges,
394 const std::vector<G4double>& yedges,
395 const std::vector<G4double>& zedges,
408 return fVH3Manager->CreateH3(name, title,
409 xedges, yedges, zedges,
410 xunitName, yunitName, zunitName,
411 xfcnName, yfcnName, zfcnName);
423 return fVH1Manager->SetH1(
id, nbins, xmin, xmax, unitName, fcnName, binSchemeName);
428 const std::vector<G4double>& edges,
433 return fVH1Manager->SetH1(
id, edges, unitName, fcnName);
451 return fVH2Manager->SetH2(
id, nxbins, xmin, xmax, nybins, ymin, ymax,
452 xunitName, yunitName, xfcnName, yfcnName,
453 xbinSchemeName, ybinSchemeName);
458 const std::vector<G4double>& xedges,
459 const std::vector<G4double>& yedges,
466 return fVH2Manager->SetH2(
id, xedges, yedges,
467 xunitName, yunitName, xfcnName, yfcnName);
492 return fVH3Manager->SetH3(
id,
493 nxbins, xmin, xmax, nybins, ymin, ymax,
495 xunitName, yunitName, zunitName,
496 xfcnName, yfcnName, zfcnName,
497 xbinSchemeName, ybinSchemeName, zbinSchemeName);
502 const std::vector<G4double>& xedges,
503 const std::vector<G4double>& yedges,
504 const std::vector<G4double>& zedges,
514 return fVH3Manager->SetH3(
id, xedges, yedges, zedges,
515 xunitName, yunitName, zunitName,
516 xfcnName, yfcnName, zfcnName);
522 return fVH1Manager->ScaleH1(
id, factor);
528 return fVH2Manager->ScaleH2(
id, factor);
534 return fVH3Manager->ScaleH3(
id, factor);
548 if ( ymin != 0. || ymax != 0. ) {
553 return fVP1Manager->CreateP1(name, title, nbins, xmin, xmax, ymin, ymax,
554 xunitName, yunitName, xfcnName, yfcnName,
560 const std::vector<G4double>& edges,
567 if ( ymin != 0. || ymax != 0. ) {
572 return fVP1Manager->CreateP1(name, title, edges, ymin, ymax,
573 xunitName, yunitName, xfcnName, yfcnName);
592 if ( zmin != 0. || zmax != 0. ) {
597 return fVP2Manager->CreateP2(name, title,
598 nxbins, xmin, xmax, nybins, ymin, ymax,
600 xunitName, yunitName, zunitName,
601 xfcnName, yfcnName, zfcnName,
602 xbinSchemeName, ybinSchemeName);
607 const std::vector<G4double>& xedges,
608 const std::vector<G4double>& yedges,
618 if ( zmin != 0. || zmax != 0. ) {
623 return fVP2Manager->CreateP2(name, title, xedges, yedges, zmin, zmax,
624 xunitName, yunitName, zunitName,
625 xfcnName, yfcnName, zfcnName);
638 if ( ymin != 0. || ymax != 0. ) {
643 return fVP1Manager->SetP1(
id, nbins, xmin, xmax, ymin, ymax,
644 xunitName, yunitName, xfcnName, yfcnName,
650 const std::vector<G4double>& edges,
656 if ( ymin != 0. || ymax != 0. ) {
661 return fVP1Manager->SetP1(
id, edges, ymin, ymax,
662 xunitName, yunitName, xfcnName, yfcnName);
681 if ( zmin != 0. || zmax != 0. ) {
686 return fVP2Manager->SetP2(
id, nxbins, xmin, xmax, nybins, ymin, ymax,
688 xunitName, yunitName, zunitName,
689 xfcnName, yfcnName, zfcnName,
690 xbinSchemeName, ybinSchemeName);
695 const std::vector<G4double>& xedges,
696 const std::vector<G4double>& yedges,
707 if ( zmin != 0. || zmax != 0. ) {
712 return fVP2Manager->SetP2(
id, xedges, yedges, zmin, zmax,
713 xunitName, yunitName, zunitName,
714 xfcnName, yfcnName, zfcnName);
720 return fVP1Manager->ScaleP1(
id, factor);
726 return fVP2Manager->ScaleP2(
id, factor);
772 std::vector<int>& vector)
781 std::vector<float>& vector)
790 std::vector<double>& vector)
843 std::vector<int>& vector)
853 std::vector<float>& vector)
863 std::vector<double>& vector)
879 G4bool finalResult =
true;
882 finalResult = finalResult &&
result;
885 finalResult = finalResult &&
result;
888 finalResult = finalResult &&
result;
896 return fH1HnManager->SetFirstId(firstId);
902 return fH2HnManager->SetFirstId(firstId);
908 return fH3HnManager->SetFirstId(firstId);
914 G4bool finalResult =
true;
917 finalResult = finalResult &&
result;
920 finalResult = finalResult &&
result;
928 return fP1HnManager->SetFirstId(firstId);
934 return fP2HnManager->SetFirstId(firstId);
954 fState.SetIsActivation(activation);
966 ( fH1HnManager->IsActive() ||
967 fH2HnManager->IsActive() ||
968 fH3HnManager->IsActive() ||
969 fP1HnManager->IsActive() ||
970 fP2HnManager->IsActive() );
978 return ( fH1HnManager->IsAscii() ||
979 fH2HnManager->IsAscii() ||
980 fH3HnManager->IsAscii() ||
981 fP1HnManager->IsAscii() ||
982 fP2HnManager->IsAscii() );
990 return ( fH1HnManager->IsPlotting() ||
991 fH2HnManager->IsPlotting() ||
992 fH3HnManager->IsPlotting() ||
993 fP1HnManager->IsPlotting() ||
994 fP2HnManager->IsPlotting() );
1002 return fH1HnManager->GetFirstId();
1010 return fH2HnManager->GetFirstId();
1018 return fH3HnManager->GetFirstId();
1026 return fP1HnManager->GetFirstId();
1034 return fP2HnManager->GetFirstId();
1056 return fH1HnManager->GetNofHns();
1062 return fH2HnManager->GetNofHns();
1068 return fH3HnManager->GetNofHns();
1074 return fP1HnManager->GetNofHns();
1080 return fP2HnManager->GetNofHns();
1096 fH1HnManager->SetActivation(
id, activation);
1104 fH1HnManager->SetActivation(activation);
1110 fH1HnManager->SetAscii(
id, ascii);
1116 fH1HnManager->SetPlotting(
id, plotting);
1124 fH2HnManager->SetActivation(
id, activation);
1132 fH2HnManager->SetActivation(activation);
1138 fH2HnManager->SetAscii(
id, ascii);
1144 fH2HnManager->SetPlotting(
id, plotting);
1152 fH3HnManager->SetActivation(
id, activation);
1160 fH3HnManager->SetActivation(activation);
1166 fH3HnManager->SetAscii(
id, ascii);
1172 fH3HnManager->SetPlotting(
id, plotting);
1180 fP1HnManager->SetActivation(
id, activation);
1188 fP1HnManager->SetActivation(activation);
1194 fP1HnManager->SetAscii(
id, ascii);
1200 fP1HnManager->SetPlotting(
id, plotting);
1208 fP2HnManager->SetActivation(
id, activation);
1216 fP2HnManager->SetActivation(activation);
1222 fP2HnManager->SetAscii(
id, ascii);
1228 fP2HnManager->SetPlotting(
id, plotting);
1252 fState.SetVerboseLevel(verboseLevel);
G4double G4ParticleHPJENDLHEData::G4double result
G4int CreateH3(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4int nzbins, G4double zmin, G4double zmax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
void SetP1Manager(G4VP1Manager *p1Manager)
G4bool SetHistoDirectoryName(const G4String &dirName)
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
void SetH2Ascii(G4int id, G4bool ascii)
G4String GetNtupleDirectoryName() const
std::unique_ptr< T > make_unique(Args &&...args)
void SetH3Plotting(G4int id, G4bool plotting)
G4int CreateNtupleIColumn(const G4String &name)
G4int GetCompressionLevel() const
G4bool SetFirstHistoId(G4int firstId)
virtual G4bool MergeImpl(tools::histo::hmpi *hmpi)=0
virtual G4int GetNofNtuples() const =0
std::ostringstream G4ExceptionDescription
G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
void SetCompressionLevel(G4int level)
G4bool ScaleH1(G4int id, G4double factor)
G4bool ScaleH2(G4int id, G4double factor)
void SetH1Manager(G4VH1Manager *h1Manager)
void SetP2Activation(G4bool activation)
virtual G4bool WriteImpl()=0
void SetVerboseLevel(G4int verboseLevel)
G4bool SetFirstId(G4int firstId)
void SetH2Plotting(G4int id, G4bool plotting)
void SetH2Activation(G4bool activation)
G4int CreateNtuple(const G4String &name, const G4String &title)
G4int GetFirstP2Id() const
virtual G4int CreateNtupleSColumn(const G4String &name)=0
G4int CreateP1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear")
G4int GetFirstH2Id() const
G4int GetFirstH1Id() const
G4bool SetFileName(const G4String &fileName)
G4bool ScaleH3(G4int id, G4double factor)
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
G4int CreateNtupleSColumn(const G4String &name)
G4bool SetNtupleDirectoryName(const G4String &dirName)
G4int GetFirstP1Id() const
void SetP1Activation(G4bool activation)
G4bool SetH3(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nzbins, G4double zmin, G4double zmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
G4int GetFirstNtupleColumnId() const
G4bool OpenFile(const G4String &fileName="")
void SetH3Manager(G4VH3Manager *h3Manager)
G4bool SetFirstH1Id(G4int firstId)
G4VAnalysisManager(const G4String &type, G4bool isMaster)
void SetH3Ascii(G4int id, G4bool ascii)
virtual G4int CreateNtuple(const G4String &name, const G4String &title)=0
G4bool SetFirstProfileId(G4int firstId)
virtual G4bool PlotImpl()=0
const G4AnalysisVerbose * GetVerboseL3() const
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
void SetH1Ascii(G4int id, G4bool ascii)
G4bool SetP1(G4int id, G4int nbins, G4double xmin, G4double xmax, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear")
void SetP2Manager(G4VP2Manager *p2Manager)
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
G4bool SetFirstNtupleColumnId(G4int firstId)
G4bool CheckName(const G4String &name, const G4String &objectType)
virtual void FinishNtuple()=0
G4int GetNofNtuples() const
std::shared_ptr< G4VFileManager > fVFileManager
virtual G4bool OpenFileImpl(const G4String &fileName)=0
G4int GetFirstH3Id() const
G4bool SetFirstP1Id(G4int firstId)
virtual G4bool IsOpenFileImpl() const =0
virtual G4int CreateNtupleFColumn(const G4String &name, std::vector< float > *vector)=0
virtual G4int CreateNtupleIColumn(const G4String &name, std::vector< int > *vector)=0
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
G4bool SetH1(G4int id, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
G4String GetFileName() const
G4bool ScaleP2(G4int id, G4double factor)
G4String GetHistoDirectoryName() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4bool SetH2(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)
void SetH2Manager(G4VH2Manager *h2Manager)
G4bool SetP2(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
G4bool SetFirstNtupleId(G4int firstId)
G4bool SetFirstH3Id(G4int firstId)
G4bool IsOpenFile() const
virtual ~G4VAnalysisManager()
G4bool SetFirstP2Id(G4int firstId)
G4int CreateP2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
void SetH1Plotting(G4int id, G4bool plotting)
G4String & append(const G4String &)
void SetH1Activation(G4bool activation)
void SetActivation(G4bool activation)
void SetP2Ascii(G4int id, G4bool ascii)
G4int CreateNtupleFColumn(const G4String &name)
G4int GetCompressionLevel() const
void SetH3Activation(G4bool activation)
void SetP1Ascii(G4int id, G4bool ascii)
G4bool CheckNbins(G4int nbins)
G4bool SetFirstNtupleColumnId(G4int firstId)
G4bool SetFirstH2Id(G4int firstId)
G4int GetFirstNtupleColumnId() const
G4int CreateNtupleDColumn(const G4String &name)
virtual void SetActivation(G4bool activation)=0
void SetNtupleActivation(G4bool activation)
void SetP1Plotting(G4int id, G4bool plotting)
virtual G4int CreateNtupleDColumn(const G4String &name, std::vector< double > *vector)=0
G4AnalysisManagerState fState
void SetP2Plotting(G4int id, G4bool plotting)
virtual G4bool CloseFileImpl()=0
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
G4int GetFirstNtupleId() const
G4bool GetIsActivation() const
const G4AnalysisVerbose * GetVerboseL1() const
void SetNtupleManager(G4VNtupleManager *ntupleManager)
G4bool CheckMinMax(G4double xmin, G4double xmax, const G4String &fcnName="none", const G4String &binSchemeName="linear")
G4int CreateH2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
G4bool CheckEdges(const std::vector< G4double > &edges)
G4bool ScaleP1(G4int id, G4double factor)
G4bool WriteAscii(const G4String &fileName)
G4bool Merge(tools::histo::hmpi *hmpi)
G4bool IsPlotting() const