31#ifndef G4PlotManager_h
32#define G4PlotManager_h 1
38#include <tools/viewplot>
58 const std::vector<G4HnInformation*>& hnVector);
63 G4int GetNofPlotsPerPage()
const;
69 std::unique_ptr<tools::viewplot> fViewer;
76inline G4int G4PlotManager::GetNofPlotsPerPage()
const
83 const std::vector<G4HnInformation*>& hnVector)
85 if ( ! htVector.size() )
return true;
87 fViewer->plots().init_sg();
90 fViewer->plots().set_current_plotter(0);
93 G4bool isWriteNeeded =
false;
95 for (
G4int i=0; i<
G4int(htVector.size()); ++i ) {
102 if ( ( ! plotting ) ||
109 fViewer->set_current_plotter_style(fPlotParameters.
GetStyle());
112 tools::sg::plotter& plotter = fViewer->plots().current_plotter();
114 plotter.bins_style(0).color = tools::colorf_blue();
118 if ( ht->annotation(tools::histo::key_axis_x_title(), title) ) {
119 plotter.x_axis().title = title;
121 if ( ht->annotation(tools::histo::key_axis_y_title(), title) ) {
122 plotter.y_axis().title = title;
124 if ( ht->annotation(tools::histo::key_axis_z_title(), title) ) {
125 plotter.z_axis().title = title;
128#ifndef TOOLS_USE_FREETYPE
129 plotter.set_encoding_none();
134 plotter.x_axis().labels_style().encoding =
"PAW";
135 plotter.x_axis_is_log =
true;
138 plotter.y_axis().labels_style().encoding =
"PAW";
139 plotter.y_axis_is_log =
true;
142 plotter.z_axis().labels_style().encoding =
"PAW";
143 plotter.z_axis_is_log =
true;
145 isWriteNeeded =
true;
153 if (
G4int(fViewer->plots().current_index()) == (GetNofPlotsPerPage() - 1) ) {
154 G4bool result = WritePage();
155 finalResult = result && finalResult;
156 isWriteNeeded =
false;
160 fViewer->plots().next();
164 if ( isWriteNeeded ) {
165 G4bool result = WritePage();
166 finalResult = result && finalResult;
const G4AnalysisVerbose * GetVerboseL3() const
G4bool GetIsActivation() const
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4bool PlotAndWrite(const std::vector< T * > &htVector, const std::vector< G4HnInformation * > &hnVector)
G4bool OpenFile(const G4String &fileName)
G4PlotManager & operator=(const G4PlotManager &rhs)=delete
G4PlotManager(const G4PlotManager &rhs)=delete
G4String GetStyle() const