ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VAnalysisManager.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VAnalysisManager.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 
27 // The nonvirtual public interface class to g4tools based analysis.
28 // It is defined as a composite of object manager base classes.
29 // Individual use of the component managers is disabled
30 // (except for file manager and Hn manager which are also used from
31 // other object managers).
32 // The functions which has to be implemented in concrete managers
33 // are declared as virtual protected.
34 
35 // Author: Ivana Hrivnacova, 09/07/2013 (ivana@ipno.in2P2.fr)
36 
37 #ifndef G4VAnalysisManager_h
38 #define G4VAnalysisManager_h 1
39 
41 #include "globals.hh"
42 
43 #include <vector>
44 #include <fstream>
45 #include <memory>
46 
47 
49 class G4HnManager;
50 class G4VH1Manager;
51 class G4VH2Manager;
52 class G4VH3Manager;
53 class G4VP1Manager;
54 class G4VP2Manager;
55 class G4VNtupleManager;
56 class G4VFileManager;
57 class G4PlotManager;
58 
59 namespace tools {
60 namespace histo{
61 class hmpi;
62 }
63 }
64 
66 {
67  public:
68  G4VAnalysisManager(const G4String& type, G4bool isMaster);
69  virtual ~G4VAnalysisManager();
70 
71  // Methods for handling files
72  G4bool OpenFile(const G4String& fileName = "");
73  G4bool Write();
74  G4bool CloseFile(G4bool reset = true);
75  G4bool Merge(tools::histo::hmpi* hmpi);
76  G4bool Plot();
77  G4bool IsOpenFile() const;
78 
79  // Methods for handling files and directories names
80  G4bool SetFileName(const G4String& fileName);
81  G4bool SetHistoDirectoryName(const G4String& dirName);
82  G4bool SetNtupleDirectoryName(const G4String& dirName);
83  void SetCompressionLevel(G4int level);
84 
85  G4String GetFileName() const;
88  G4int GetCompressionLevel() const;
89 
90  // Methods for handling histograms
91  //
92  G4int CreateH1(const G4String& name, const G4String& title,
94  const G4String& unitName = "none",
95  const G4String& fcnName = "none",
96  const G4String& binSchemeName = "linear");
97 
98  G4int CreateH1(const G4String& name, const G4String& title,
99  const std::vector<G4double>& edges,
100  const G4String& unitName = "none",
101  const G4String& fcnName = "none");
102 
103  G4int CreateH2(const G4String& name, const G4String& title,
104  G4int nxbins, G4double xmin, G4double xmax,
105  G4int nybins, G4double ymin, G4double ymax,
106  const G4String& xunitName = "none",
107  const G4String& yunitName = "none",
108  const G4String& xfcnName = "none",
109  const G4String& yfcnName = "none",
110  const G4String& xbinSchemeName = "linear",
111  const G4String& ybinSchemeName = "linear");
112 
113  G4int CreateH2(const G4String& name, const G4String& title,
114  const std::vector<G4double>& xedges,
115  const std::vector<G4double>& yedges,
116  const G4String& xunitName = "none",
117  const G4String& yunitName = "none",
118  const G4String& xfcnName = "none",
119  const G4String& yfcnName = "none");
120 
121  G4int CreateH3(const G4String& name, const G4String& title,
122  G4int nxbins, G4double xmin, G4double xmax,
123  G4int nybins, G4double ymin, G4double ymax,
124  G4int nzbins, G4double zmin, G4double zmax,
125  const G4String& xunitName = "none",
126  const G4String& yunitName = "none",
127  const G4String& zunitName = "none",
128  const G4String& xfcnName = "none",
129  const G4String& yfcnName = "none",
130  const G4String& zfcnName = "none",
131  const G4String& xbinSchemeName = "linear",
132  const G4String& ybinSchemeName = "linear",
133  const G4String& zbinSchemeName = "linear");
134 
135  G4int CreateH3(const G4String& name, const G4String& title,
136  const std::vector<G4double>& xedges,
137  const std::vector<G4double>& yedges,
138  const std::vector<G4double>& zedges,
139  const G4String& xunitName = "none",
140  const G4String& yunitName = "none",
141  const G4String& zunitName = "none",
142  const G4String& xfcnName = "none",
143  const G4String& yfcnName = "none",
144  const G4String& zfcnName = "none");
145 
146  G4bool SetH1(G4int id,
147  G4int nbins, G4double xmin, G4double xmax,
148  const G4String& unitName = "none",
149  const G4String& fcnName = "none",
150  const G4String& binSchemeName = "linear");
151 
152  G4bool SetH1(G4int id,
153  const std::vector<G4double>& edges,
154  const G4String& unitName = "none",
155  const G4String& fcnName = "none");
156 
157  G4bool SetH2(G4int id,
158  G4int nxbins, G4double xmin, G4double xmax,
159  G4int nybins, G4double ymin, G4double ymax,
160  const G4String& xunitName = "none",
161  const G4String& yunitName = "none",
162  const G4String& xfcnName = "none",
163  const G4String& yfcnName = "none",
164  const G4String& xbinSchemeName = "linear",
165  const G4String& ybinSchemeName = "linear");
166 
167  G4bool SetH2(G4int id,
168  const std::vector<G4double>& xedges,
169  const std::vector<G4double>& yedges,
170  const G4String& xunitName = "none",
171  const G4String& yunitName = "none",
172  const G4String& xfcnName = "none",
173  const G4String& yfcnName = "none");
174 
175  G4bool SetH3(G4int id,
176  G4int nxbins, G4double xmin, G4double xmax,
177  G4int nzbins, G4double zmin, G4double zmax,
178  G4int nybins, G4double ymin, G4double ymax,
179  const G4String& xunitName = "none",
180  const G4String& yunitName = "none",
181  const G4String& zunitName = "none",
182  const G4String& xfcnName = "none",
183  const G4String& yfcnName = "none",
184  const G4String& zfcnName = "none",
185  const G4String& xbinSchemeName = "linear",
186  const G4String& ybinSchemeName = "linear",
187  const G4String& zbinSchemeName = "linear");
188 
189  G4bool SetH3(G4int id,
190  const std::vector<G4double>& xedges,
191  const std::vector<G4double>& yedges,
192  const std::vector<G4double>& zedges,
193  const G4String& xunitName = "none",
194  const G4String& yunitName = "none",
195  const G4String& zunitName = "none",
196  const G4String& xfcnName = "none",
197  const G4String& yfcnName = "none",
198  const G4String& zfcnName = "none");
199 
200  G4bool ScaleH1(G4int id, G4double factor);
201  G4bool ScaleH2(G4int id, G4double factor);
202  G4bool ScaleH3(G4int id, G4double factor);
203 
204  // Methods for handling profiles
205  //
206  G4int CreateP1(const G4String& name, const G4String& title,
207  G4int nbins, G4double xmin, G4double xmax,
208  G4double ymin = 0, G4double ymax = 0,
209  const G4String& xunitName = "none",
210  const G4String& yunitName = "none",
211  const G4String& xfcnName = "none",
212  const G4String& yfcnName = "none",
213  const G4String& xbinSchemeName = "linear");
214  G4int CreateP1(const G4String& name, const G4String& title,
215  const std::vector<G4double>& edges,
216  G4double ymin = 0, G4double ymax = 0,
217  const G4String& xunitName = "none",
218  const G4String& yunitName = "none",
219  const G4String& xfcnName = "none",
220  const G4String& yfcnName = "none");
221 
222  G4int CreateP2(const G4String& name, const G4String& title,
223  G4int nxbins, G4double xmin, G4double xmax,
224  G4int nybins, G4double ymin, G4double ymax,
225  G4double zmin = 0, G4double zmax = 0,
226  const G4String& xunitName = "none",
227  const G4String& yunitName = "none",
228  const G4String& zunitName = "none",
229  const G4String& xfcnName = "none",
230  const G4String& yfcnName = "none",
231  const G4String& zfcnName = "none",
232  const G4String& xbinSchemeName = "linear",
233  const G4String& ybinSchemeName = "linear");
234  G4int CreateP2(const G4String& name, const G4String& title,
235  const std::vector<G4double>& xedges,
236  const std::vector<G4double>& yedges,
237  G4double zmin = 0, G4double zmax = 0,
238  const G4String& xunitName = "none",
239  const G4String& yunitName = "none",
240  const G4String& zunitName = "none",
241  const G4String& xfcnName = "none",
242  const G4String& yfcnName = "none",
243  const G4String& zfcnName = "none");
244 
245  G4bool SetP1(G4int id,
246  G4int nbins, G4double xmin, G4double xmax,
247  G4double ymin = 0, G4double ymax = 0,
248  const G4String& xunitName = "none",
249  const G4String& yunitName = "none",
250  const G4String& xfcnName = "none",
251  const G4String& yfcnName = "none",
252  const G4String& xbinSchemeName = "linear");
253  G4bool SetP1(G4int id,
254  const std::vector<G4double>& edges,
255  G4double ymin = 0, G4double ymax = 0,
256  const G4String& xunitName = "none",
257  const G4String& yunitName = "none",
258  const G4String& xfcnName = "none",
259  const G4String& yfcnName = "none");
260 
261  G4bool SetP2(G4int id,
262  G4int nxbins, G4double xmin, G4double xmax,
263  G4int nybins, G4double ymin, G4double ymax,
264  G4double zmin = 0, G4double zmax = 0,
265  const G4String& xunitName = "none",
266  const G4String& yunitName = "none",
267  const G4String& zunitName = "none",
268  const G4String& xfcnName = "none",
269  const G4String& yfcnName = "none",
270  const G4String& zfcnName = "none",
271  const G4String& xbinSchemeName = "linear",
272  const G4String& ybinSchemeName = "linear");
273  G4bool SetP2(G4int id,
274  const std::vector<G4double>& xedges,
275  const std::vector<G4double>& yedges,
276  G4double zmin = 0, G4double zmax = 0,
277  const G4String& xunitName = "none",
278  const G4String& yunitName = "none",
279  const G4String& zunitName = "none",
280  const G4String& xfcnName = "none",
281  const G4String& yfcnName = "none",
282  const G4String& zfcnName = "none");
283 
284  G4bool ScaleP1(G4int id, G4double factor);
285  G4bool ScaleP2(G4int id, G4double factor);
286 
287  // Methods for handling ntuples
288  //
289  G4int CreateNtuple(const G4String& name, const G4String& title);
290 
291  // Create columns in the last created ntuple
292  G4int CreateNtupleIColumn(const G4String& name);
293  G4int CreateNtupleFColumn(const G4String& name);
294  G4int CreateNtupleDColumn(const G4String& name);
295  G4int CreateNtupleSColumn(const G4String& name);
296 
297  // Create columns of vector in the last created ntuple
299  const G4String& name, std::vector<int>& vector);
301  const G4String& name, std::vector<float>& vector);
303  const G4String& name, std::vector<double>& vector);
304  void FinishNtuple();
305 
306  // Create columns in the ntuple with given id
307  G4int CreateNtupleIColumn(G4int ntupleId, const G4String& name);
308  G4int CreateNtupleFColumn(G4int ntupleId, const G4String& name);
309  G4int CreateNtupleDColumn(G4int ntupleId, const G4String& name);
310  G4int CreateNtupleSColumn(G4int ntupleId, const G4String& name);
311 
312  // Create columns of vector in the ntuple with given id
313  G4int CreateNtupleIColumn(G4int ntupleId,
314  const G4String& name, std::vector<int>& vector);
315  G4int CreateNtupleFColumn(G4int ntupleId,
316  const G4String& name, std::vector<float>& vector);
317  G4int CreateNtupleDColumn(G4int ntupleId,
318  const G4String& name, std::vector<double>& vector);
319 
320  void FinishNtuple(G4int ntupleId);
321 
322  // MT/MPI
323  virtual void SetNtupleMerging(G4bool mergeNtuples,
324  G4int nofReducedNtupleFiles = 0);
325  virtual void SetNtupleRowWise(G4bool rowWise, G4bool rowMode = true);
326  virtual void SetBasketSize(unsigned int basketSize);
327  virtual void SetBasketEntries(unsigned int basketEntries);
328 
329  // The ids of histograms and ntuples are generated automatically
330  // starting from 0; with following functions it is possible to
331  // change the first Id to start from other value
332  G4bool SetFirstHistoId(G4int firstId);
333  G4bool SetFirstH1Id(G4int firstId);
334  G4bool SetFirstH2Id(G4int firstId);
335  G4bool SetFirstH3Id(G4int firstId);
336  G4bool SetFirstProfileId(G4int firstId);
337  G4bool SetFirstP1Id(G4int firstId);
338  G4bool SetFirstP2Id(G4int firstId);
339  G4bool SetFirstNtupleId(G4int firstId);
341 
342  // Methods to fill histograms
344  G4bool FillH2(G4int id, G4double xvalue, G4double yvalue,
345  G4double weight = 1.0);
346  G4bool FillH3(G4int id,
347  G4double xvalue, G4double yvalue, G4double zvalue,
348  G4double weight = 1.0);
349  // Methods to fill profiles
350  G4bool FillP1(G4int id, G4double xvalue, G4double yvalue,
351  G4double weight = 1.0);
352  G4bool FillP2(G4int id,
353  G4double xvalue, G4double yvalue, G4double zvalue,
354  G4double weight = 1.0);
355 
356  // Methods to fill ntuples
357  // Methods for ntuple with id = FirstNtupleId
358  G4bool FillNtupleIColumn(G4int id, G4int value);
361  G4bool FillNtupleSColumn(G4int id, const G4String& value);
363  // Methods for ntuple with id > FirstNtupleId (when more ntuples exist)
364  G4bool FillNtupleIColumn(G4int ntupleId, G4int columnId, G4int value);
365  G4bool FillNtupleFColumn(G4int ntupleId, G4int columnId, G4float value);
366  G4bool FillNtupleDColumn(G4int ntupleId, G4int columnId, G4double value);
367  G4bool FillNtupleSColumn(G4int ntupleId, G4int id, const G4String& value);
368  G4bool AddNtupleRow(G4int ntupleId);
369 
370  // Activation option
371 
372  // When this option is enabled, only the histograms/profiles marked as activated
373  // are returned, filled or saved on file.
374  // No warning is issued when Get or Fill is called on inactive histogram.
375  void SetActivation(G4bool activation);
376  G4bool GetActivation() const;
377 
378  // Return false if activation is enabled and there is no object activated,
379  // return true otherwise
380  G4bool IsActive() const;
381 
382  // ASCII option
383 
384  // Return false if there is no object selected for ASCII output,
385  // return true otherwise
386  G4bool IsAscii() const;
387 
388  // Plotting option
389 
390  // Return false if there is no object selected for plottng,
391  // return true otherwise
392  G4bool IsPlotting() const;
393 
394  // Access methods
395  G4int GetFirstH1Id() const;
396  G4int GetFirstH2Id() const;
397  G4int GetFirstH3Id() const;
398  G4int GetFirstP1Id() const;
399  G4int GetFirstP2Id() const;
400  G4int GetFirstNtupleId() const;
402 
403  G4int GetNofH1s() const;
404  G4int GetNofH2s() const;
405  G4int GetNofH3s() const;
406  G4int GetNofP1s() const;
407  G4int GetNofP2s() const;
408  G4int GetNofNtuples() const;
409 
410  // Access methods via names
411  G4int GetH1Id(const G4String& name, G4bool warn = true) const;
412  G4int GetH2Id(const G4String& name, G4bool warn = true) const;
413  G4int GetH3Id(const G4String& name, G4bool warn = true) const;
414  G4int GetP1Id(const G4String& name, G4bool warn = true) const;
415  G4int GetP2Id(const G4String& name, G4bool warn = true) const;
416 
417  // Methods to manipulate histogram, profiles & ntuples additional information
418  //
419  void SetH1Activation(G4bool activation);
420  void SetH1Activation(G4int id, G4bool activation);
421  void SetH1Ascii(G4int id, G4bool ascii);
422  void SetH1Plotting(G4int id, G4bool plotting);
423  //
424  void SetH2Activation(G4bool activation);
425  void SetH2Activation(G4int id, G4bool activation);
426  void SetH2Ascii(G4int id, G4bool ascii);
427  void SetH2Plotting(G4int id, G4bool plotting);
428  //
429  void SetH3Activation(G4bool activation);
430  void SetH3Activation(G4int id, G4bool activation);
431  void SetH3Ascii(G4int id, G4bool ascii);
432  void SetH3Plotting(G4int id, G4bool plotting);
433  //
434  void SetP1Activation(G4bool activation);
435  void SetP1Activation(G4int id, G4bool activation);
436  void SetP1Ascii(G4int id, G4bool ascii);
437  void SetP1Plotting(G4int id, G4bool plotting);
438  //
439  void SetP2Activation(G4bool activation);
440  void SetP2Activation(G4int id, G4bool activation);
441  void SetP2Ascii(G4int id, G4bool ascii);
442  void SetP2Plotting(G4int id, G4bool plotting);
443  //
444  void SetNtupleActivation(G4bool activation);
445  void SetNtupleActivation(G4int id, G4bool activation);
446 
447 
448  // Access to histogram & profiles parameters
449  //
450  G4int GetH1Nbins(G4int id) const;
451  G4double GetH1Xmin(G4int id) const;
452  G4double GetH1Xmax(G4int id) const;
453  G4double GetH1Width(G4int id) const;
454  //
455  G4int GetH2Nxbins(G4int id) const;
456  G4double GetH2Xmin(G4int id) const;
457  G4double GetH2Xmax(G4int id) const;
458  G4double GetH2XWidth(G4int id) const;
459  G4int GetH2Nybins(G4int id) const;
460  G4double GetH2Ymin(G4int id) const;
461  G4double GetH2Ymax(G4int id) const;
462  G4double GetH2YWidth(G4int id) const;
463  //
464  G4int GetH3Nxbins(G4int id) const;
465  G4double GetH3Xmin(G4int id) const;
466  G4double GetH3Xmax(G4int id) const;
467  G4double GetH3XWidth(G4int id) const;
468  G4int GetH3Nybins(G4int id) const;
469  G4double GetH3Ymin(G4int id) const;
470  G4double GetH3Ymax(G4int id) const;
471  G4double GetH3YWidth(G4int id) const;
472  G4int GetH3Nzbins(G4int id) const;
473  G4double GetH3Zmin(G4int id) const;
474  G4double GetH3Zmax(G4int id) const;
475  G4double GetH3ZWidth(G4int id) const;
476  //
477  G4int GetP1Nbins(G4int id) const;
478  G4double GetP1Xmin(G4int id) const;
479  G4double GetP1Xmax(G4int id) const;
480  G4double GetP1XWidth(G4int id) const;
481  G4double GetP1Ymin(G4int id) const;
482  G4double GetP1Ymax(G4int id) const;
483  //
484  G4int GetP2Nxbins(G4int id) const;
485  G4double GetP2Xmin(G4int id) const;
486  G4double GetP2Xmax(G4int id) const;
487  G4double GetP2XWidth(G4int id) const;
488  G4int GetP2Nybins(G4int id) const;
489  G4double GetP2Ymin(G4int id) const;
490  G4double GetP2Ymax(G4int id) const;
491  G4double GetP2YWidth(G4int id) const;
492  G4double GetP2Zmin(G4int id) const;
493  G4double GetP2Zmax(G4int id) const;
494 
495  // Access to histogram & profiles additional information
496  //
497  G4String GetH1Name(G4int id) const;
498  G4double GetH1Unit(G4int id) const;
499  G4bool GetH1Activation(G4int id) const;
500  G4bool GetH1Ascii(G4int id) const;
501  G4bool GetH1Plotting(G4int id) const;
502  //
503  G4String GetH2Name(G4int id) const;
504  G4double GetH2XUnit(G4int id) const;
505  G4double GetH2YUnit(G4int id) const;
506  G4bool GetH2Activation(G4int id) const;
507  G4bool GetH2Ascii(G4int id) const;
508  G4bool GetH2Plotting(G4int id) const;
509  //
510  G4String GetH3Name(G4int id) const;
511  G4double GetH3XUnit(G4int id) const;
512  G4double GetH3YUnit(G4int id) const;
513  G4double GetH3ZUnit(G4int id) const;
514  G4bool GetH3Activation(G4int id) const;
515  G4bool GetH3Ascii(G4int id) const;
516  G4bool GetH3Plotting(G4int id) const;
517  //
518  G4String GetP1Name(G4int id) const;
519  G4double GetP1XUnit(G4int id) const;
520  G4double GetP1YUnit(G4int id) const;
521  G4bool GetP1Activation(G4int id) const;
522  G4bool GetP1Ascii(G4int id) const;
523  G4bool GetP1Plotting(G4int id) const;
524  //
525  G4String GetP2Name(G4int id) const;
526  G4double GetP2XUnit(G4int id) const;
527  G4double GetP2YUnit(G4int id) const;
528  G4double GetP2ZUnit(G4int id) const;
529  G4bool GetP2Activation(G4int id) const;
530  G4bool GetP2Ascii(G4int id) const;
531  G4bool GetP2Plotting(G4int id) const;
532  //
533  G4bool GetNtupleActivation(G4int id) const;
534 
535  // Setters for histogram & profiles attributes for plotting
536  //
537  G4bool SetH1Title(G4int id, const G4String& title);
538  G4bool SetH1XAxisTitle(G4int id, const G4String& title);
539  G4bool SetH1YAxisTitle(G4int id, const G4String& title);
540  G4bool SetH1XAxisIsLog(G4int id, G4bool isLog);
541  G4bool SetH1YAxisIsLog(G4int id, G4bool isLog);
542  //
543  G4bool SetH2Title(G4int id, const G4String& title);
544  G4bool SetH2XAxisTitle(G4int id, const G4String& title);
545  G4bool SetH2YAxisTitle(G4int id, const G4String& title);
546  G4bool SetH2ZAxisTitle(G4int id, const G4String& title);
547  G4bool SetH2XAxisIsLog(G4int id, G4bool isLog);
548  G4bool SetH2YAxisIsLog(G4int id, G4bool isLog);
549  G4bool SetH2ZAxisIsLog(G4int id, G4bool isLog);
550  //
551  G4bool SetH3Title(G4int id, const G4String& title);
552  G4bool SetH3XAxisTitle(G4int id, const G4String& title);
553  G4bool SetH3YAxisTitle(G4int id, const G4String& title);
554  G4bool SetH3ZAxisTitle(G4int id, const G4String& title);
555  G4bool SetH3XAxisIsLog(G4int id, G4bool isLog);
556  G4bool SetH3YAxisIsLog(G4int id, G4bool isLog);
557  G4bool SetH3ZAxisIsLog(G4int id, G4bool isLog);
558  //
559  G4bool SetP1Title(G4int id, const G4String& title);
560  G4bool SetP1XAxisTitle(G4int id, const G4String& title);
561  G4bool SetP1YAxisTitle(G4int id, const G4String& title);
562  G4bool SetP1XAxisIsLog(G4int id, G4bool isLog);
563  G4bool SetP1YAxisIsLog(G4int id, G4bool isLog);
564  //
565  G4bool SetP2Title(G4int id, const G4String& title);
566  G4bool SetP2XAxisTitle(G4int id, const G4String& title);
567  G4bool SetP2YAxisTitle(G4int id, const G4String& title);
568  G4bool SetP2ZAxisTitle(G4int id, const G4String& title);
569  G4bool SetP2XAxisIsLog(G4int id, G4bool isLog);
570  G4bool SetP2YAxisIsLog(G4int id, G4bool isLog);
571  G4bool SetP2ZAxisIsLog(G4int id, G4bool isLog);
572 
573  // Access histogram & profiles attributes for plotting
574  //
575  G4String GetH1Title(G4int id) const;
576  G4String GetH1XAxisTitle(G4int id) const;
577  G4String GetH1YAxisTitle(G4int id) const;
578  G4bool GetH1XAxisIsLog(G4int id) const;
579  G4bool GetH1YAxisIsLog(G4int id) const;
580  //
581  G4String GetH2Title(G4int id) const;
582  G4String GetH2XAxisTitle(G4int id) const;
583  G4String GetH2YAxisTitle(G4int id) const;
584  G4String GetH2ZAxisTitle(G4int id) const;
585  G4bool GetH2XAxisIsLog(G4int id) const;
586  G4bool GetH2YAxisIsLog(G4int id) const;
587  G4bool GetH2ZAxisIsLog(G4int id) const;
588  //
589  G4String GetH3Title(G4int id) const;
590  G4String GetH3XAxisTitle(G4int id) const;
591  G4String GetH3YAxisTitle(G4int id) const;
592  G4String GetH3ZAxisTitle(G4int id) const;
593  G4bool GetH3XAxisIsLog(G4int id) const;
594  G4bool GetH3YAxisIsLog(G4int id) const;
595  G4bool GetH3ZAxisIsLog(G4int id) const;
596  //
597  G4String GetP1Title(G4int id) const;
598  G4String GetP1XAxisTitle(G4int id) const;
599  G4String GetP1YAxisTitle(G4int id) const;
600  G4bool GetP1XAxisIsLog(G4int id) const;
601  G4bool GetP1YAxisIsLog(G4int id) const;
602  //
603  G4String GetP2Title(G4int id) const;
604  G4String GetP2XAxisTitle(G4int id) const;
605  G4String GetP2YAxisTitle(G4int id) const;
606  G4String GetP2ZAxisTitle(G4int id) const;
607  G4bool GetP2XAxisIsLog(G4int id) const;
608  G4bool GetP2YAxisIsLog(G4int id) const;
609  G4bool GetP2ZAxisIsLog(G4int id) const;
610 
611  // Verbosity
612  void SetVerboseLevel(G4int verboseLevel);
613  G4int GetVerboseLevel() const;
614 
615  // The manager type (starts with an uppercase letter)
616  G4String GetType() const;
617  // The manager file type (starts with a lowercase letter)
618  G4String GetFileType() const;
619 
620  protected:
621  // virtual methods
622  virtual G4bool OpenFileImpl(const G4String& fileName) = 0;
623  virtual G4bool WriteImpl() = 0;
624  virtual G4bool CloseFileImpl(G4bool reset) = 0;
625  virtual G4bool PlotImpl() = 0;
626  virtual G4bool MergeImpl(tools::histo::hmpi* hmpi) = 0;
627  virtual G4bool IsOpenFileImpl() const = 0;
628 
629  // methods
630  void SetH1Manager(G4VH1Manager* h1Manager);
631  void SetH2Manager(G4VH2Manager* h2Manager);
632  void SetH3Manager(G4VH3Manager* h3Manager);
633  void SetP1Manager(G4VP1Manager* p1Manager);
634  void SetP2Manager(G4VP2Manager* p2Manager);
635  void SetNtupleManager(G4VNtupleManager* ntupleManager);
636  void SetFileManager(std::shared_ptr<G4VFileManager> fileManager);
637  void SetPlotManager(std::shared_ptr<G4PlotManager> plotManager);
638 
639  // Methods to manipulate additional information
640  G4bool WriteAscii(const G4String& fileName);
641 
642  // constants
643  static constexpr unsigned int fgkDefaultBasketSize = 32000;
644  static constexpr unsigned int fgkDefaultBasketEntries = 4000;
645 
646  // data members
648  std::shared_ptr<G4VFileManager> fVFileManager;
649  std::shared_ptr<G4PlotManager> fPlotManager;
650 
651  private:
652  // data members
653  std::unique_ptr<G4AnalysisMessenger> fMessenger;
654  std::shared_ptr<G4HnManager> fH1HnManager;
655  std::shared_ptr<G4HnManager> fH2HnManager;
656  std::shared_ptr<G4HnManager> fH3HnManager;
657  std::shared_ptr<G4HnManager> fP1HnManager;
658  std::shared_ptr<G4HnManager> fP2HnManager;
659  std::unique_ptr<G4VH1Manager> fVH1Manager;
660  std::unique_ptr<G4VH2Manager> fVH2Manager;
661  std::unique_ptr<G4VH3Manager> fVH3Manager;
662  std::unique_ptr<G4VP1Manager> fVP1Manager;
663  std::unique_ptr<G4VP2Manager> fVP2Manager;
664  // std::shared_ptr<G4VNtupleManager> fVNtupleManager;
666 };
667 
668 // inline functions
669 
670 #include "G4VAnalysisManager.icc"
671 
672 #endif