Geant4  10.02
G4VAnalysisManager.hh
Go to the documentation of this file.
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 // $Id: G4VAnalysisManager.hh 71635 2013-06-19 13:48:28Z ihrivnac $
27 
28 // The nonvirtual public interface class to g4tools based analysis.
29 // It is defined as a composite of object manager base classes.
30 // Individual use of the component managers is disabled
31 // (except for file manager and Hn manager which are also used from
32 // other object managers).
33 // The functions which has to be implemented in concrete managers
34 // are declared as virtual protected.
35 
36 // Author: Ivana Hrivnacova, 09/07/2013 (ivana@ipno.in2P2.fr)
37 
38 #ifndef G4VAnalysisManager_h
39 #define G4VAnalysisManager_h 1
40 
42 #include "globals.hh"
43 
44 #include <vector>
45 #include <fstream>
46 #include <memory>
47 
48 
50 class G4HnManager;
51 class G4VH1Manager;
52 class G4VH2Manager;
53 class G4VH3Manager;
54 class G4VP1Manager;
55 class G4VP2Manager;
56 class G4VNtupleManager;
57 class G4VFileManager;
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();
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,
93  G4int nbins, G4double xmin, G4double xmax,
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 
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  // The ids of histograms and ntuples are generated automatically
323  // starting from 0; with following functions it is possible to
324  // change the first Id to start from other value
325  G4bool SetFirstHistoId(G4int firstId);
326  G4bool SetFirstH1Id(G4int firstId);
327  G4bool SetFirstH2Id(G4int firstId);
328  G4bool SetFirstH3Id(G4int firstId);
329  G4bool SetFirstProfileId(G4int firstId);
330  G4bool SetFirstP1Id(G4int firstId);
331  G4bool SetFirstP2Id(G4int firstId);
332  G4bool SetFirstNtupleId(G4int firstId);
334 
335  // Methods to fill histograms
336  G4bool FillH1(G4int id, G4double value, G4double weight = 1.0);
337  G4bool FillH2(G4int id, G4double xvalue, G4double yvalue,
338  G4double weight = 1.0);
339  G4bool FillH3(G4int id,
340  G4double xvalue, G4double yvalue, G4double zvalue,
341  G4double weight = 1.0);
342  // Methods to fill profiles
343  G4bool FillP1(G4int id, G4double xvalue, G4double yvalue,
344  G4double weight = 1.0);
345  G4bool FillP2(G4int id,
346  G4double xvalue, G4double yvalue, G4double zvalue,
347  G4double weight = 1.0);
348 
349  // Methods to fill ntuples
350  // Methods for ntuple with id = FirstNtupleId
351  G4bool FillNtupleIColumn(G4int id, G4int value);
354  G4bool FillNtupleSColumn(G4int id, const G4String& value);
356  // Methods for ntuple with id > FirstNtupleId (when more ntuples exist)
357  G4bool FillNtupleIColumn(G4int ntupleId, G4int columnId, G4int value);
358  G4bool FillNtupleFColumn(G4int ntupleId, G4int columnId, G4float value);
359  G4bool FillNtupleDColumn(G4int ntupleId, G4int columnId, G4double value);
360  G4bool FillNtupleSColumn(G4int ntupleId, G4int id, const G4String& value);
361  G4bool AddNtupleRow(G4int ntupleId);
362 
363  // Activation option
364 
365  // When this option is enabled, only the histograms/profiles marked as activated
366  // are returned, filled or saved on file.
367  // No warning is issued when Get or Fill is called on inactive histogram.
368  void SetActivation(G4bool activation);
369  G4bool GetActivation() const;
370 
371  // Return false if activation is enabled and there is no object activated,
372  // return true otherwise
373  G4bool IsActive() const;
374 
375  // ASCII option
376 
377  // Return false if there is no object selected for ASCII output,
378  // return true otherwise
379  G4bool IsAscii() const;
380 
381  // Plotting option
382 
383  // Return false if there is no object selected for plottng,
384  // return true otherwise
385  G4bool IsPlotting() const;
386 
387  // Access methods
388  G4int GetFirstH1Id() const;
389  G4int GetFirstH2Id() const;
390  G4int GetFirstH3Id() const;
391  G4int GetFirstP1Id() const;
392  G4int GetFirstP2Id() const;
393  G4int GetFirstNtupleId() const;
395 
396  G4int GetNofH1s() const;
397  G4int GetNofH2s() const;
398  G4int GetNofH3s() const;
399  G4int GetNofP1s() const;
400  G4int GetNofP2s() const;
401  G4int GetNofNtuples() const;
402 
403  // Access methods via names
404  G4int GetH1Id(const G4String& name, G4bool warn = true) const;
405  G4int GetH2Id(const G4String& name, G4bool warn = true) const;
406  G4int GetH3Id(const G4String& name, G4bool warn = true) const;
407 
408  // Methods to manipulate histogram, profiles & ntuples additional information
409  //
410  void SetH1Activation(G4bool activation);
411  void SetH1Activation(G4int id, G4bool activation);
412  void SetH1Ascii(G4int id, G4bool ascii);
413  void SetH1Plotting(G4int id, G4bool plotting);
414  //
415  void SetH2Activation(G4bool activation);
416  void SetH2Activation(G4int id, G4bool activation);
417  void SetH2Ascii(G4int id, G4bool ascii);
418  void SetH2Plotting(G4int id, G4bool plotting);
419  //
420  void SetH3Activation(G4bool activation);
421  void SetH3Activation(G4int id, G4bool activation);
422  void SetH3Ascii(G4int id, G4bool ascii);
423  void SetH3Plotting(G4int id, G4bool plotting);
424  //
425  void SetP1Activation(G4bool activation);
426  void SetP1Activation(G4int id, G4bool activation);
427  void SetP1Ascii(G4int id, G4bool ascii);
428  void SetP1Plotting(G4int id, G4bool plotting);
429  //
430  void SetP2Activation(G4bool activation);
431  void SetP2Activation(G4int id, G4bool activation);
432  void SetP2Ascii(G4int id, G4bool ascii);
433  void SetP2Plotting(G4int id, G4bool plotting);
434  //
435  void SetNtupleActivation(G4bool activation);
436  void SetNtupleActivation(G4int id, G4bool activation);
437 
438 
439  // Access to histogram & profiles parameters
440  //
441  G4int GetH1Nbins(G4int id) const;
442  G4double GetH1Xmin(G4int id) const;
443  G4double GetH1Xmax(G4int id) const;
444  G4double GetH1Width(G4int id) const;
445  //
446  G4int GetH2Nxbins(G4int id) const;
447  G4double GetH2Xmin(G4int id) const;
448  G4double GetH2Xmax(G4int id) const;
449  G4double GetH2XWidth(G4int id) const;
450  G4int GetH2Nybins(G4int id) const;
451  G4double GetH2Ymin(G4int id) const;
452  G4double GetH2Ymax(G4int id) const;
453  G4double GetH2YWidth(G4int id) const;
454  //
455  G4int GetH3Nxbins(G4int id) const;
456  G4double GetH3Xmin(G4int id) const;
457  G4double GetH3Xmax(G4int id) const;
458  G4double GetH3XWidth(G4int id) const;
459  G4int GetH3Nybins(G4int id) const;
460  G4double GetH3Ymin(G4int id) const;
461  G4double GetH3Ymax(G4int id) const;
462  G4double GetH3YWidth(G4int id) const;
463  G4int GetH3Nzbins(G4int id) const;
464  G4double GetH3Zmin(G4int id) const;
465  G4double GetH3Zmax(G4int id) const;
466  G4double GetH3ZWidth(G4int id) const;
467  //
468  G4int GetP1Nbins(G4int id) const;
469  G4double GetP1Xmin(G4int id) const;
470  G4double GetP1Xmax(G4int id) const;
471  G4double GetP1XWidth(G4int id) const;
472  G4double GetP1Ymin(G4int id) const;
473  G4double GetP1Ymax(G4int id) const;
474  //
475  G4int GetP2Nxbins(G4int id) const;
476  G4double GetP2Xmin(G4int id) const;
477  G4double GetP2Xmax(G4int id) const;
478  G4double GetP2XWidth(G4int id) const;
479  G4int GetP2Nybins(G4int id) const;
480  G4double GetP2Ymin(G4int id) const;
481  G4double GetP2Ymax(G4int id) const;
482  G4double GetP2YWidth(G4int id) const;
483  G4double GetP2Zmin(G4int id) const;
484  G4double GetP2Zmax(G4int id) const;
485 
486  // Access to histogram & profiles additional information
487  //
488  G4String GetH1Name(G4int id) const;
489  G4double GetH1Unit(G4int id) const;
490  G4bool GetH1Activation(G4int id) const;
491  G4bool GetH1Ascii(G4int id) const;
492  G4bool GetH1Plotting(G4int id) const;
493  //
494  G4String GetH2Name(G4int id) const;
495  G4double GetH2XUnit(G4int id) const;
496  G4double GetH2YUnit(G4int id) const;
497  G4bool GetH2Activation(G4int id) const;
498  G4bool GetH2Ascii(G4int id) const;
499  G4bool GetH2Plotting(G4int id) const;
500  //
501  G4String GetH3Name(G4int id) const;
502  G4double GetH3XUnit(G4int id) const;
503  G4double GetH3YUnit(G4int id) const;
504  G4double GetH3ZUnit(G4int id) const;
505  G4bool GetH3Activation(G4int id) const;
506  G4bool GetH3Ascii(G4int id) const;
507  G4bool GetH3Plotting(G4int id) const;
508  //
509  G4String GetP1Name(G4int id) const;
510  G4double GetP1XUnit(G4int id) const;
511  G4double GetP1YUnit(G4int id) const;
512  G4bool GetP1Activation(G4int id) const;
513  G4bool GetP1Ascii(G4int id) const;
514  G4bool GetP1Plotting(G4int id) const;
515  //
516  G4String GetP2Name(G4int id) const;
517  G4double GetP2XUnit(G4int id) const;
518  G4double GetP2YUnit(G4int id) const;
519  G4double GetP2ZUnit(G4int id) const;
520  G4bool GetP2Activation(G4int id) const;
521  G4bool GetP2Ascii(G4int id) const;
522  G4bool GetP2Plotting(G4int id) const;
523  //
524  G4bool GetNtupleActivation(G4int id) const;
525 
526  // Setters for histogram & profiles attributes for plotting
527  //
528  G4bool SetH1Title(G4int id, const G4String& title);
529  G4bool SetH1XAxisTitle(G4int id, const G4String& title);
530  G4bool SetH1YAxisTitle(G4int id, const G4String& title);
531  //
532  G4bool SetH2Title(G4int id, const G4String& title);
533  G4bool SetH2XAxisTitle(G4int id, const G4String& title);
534  G4bool SetH2YAxisTitle(G4int id, const G4String& title);
535  G4bool SetH2ZAxisTitle(G4int id, const G4String& title);
536  //
537  G4bool SetH3Title(G4int id, const G4String& title);
538  G4bool SetH3XAxisTitle(G4int id, const G4String& title);
539  G4bool SetH3YAxisTitle(G4int id, const G4String& title);
540  G4bool SetH3ZAxisTitle(G4int id, const G4String& title);
541  //
542  G4bool SetP1Title(G4int id, const G4String& title);
543  G4bool SetP1XAxisTitle(G4int id, const G4String& title);
544  G4bool SetP1YAxisTitle(G4int id, const G4String& title);
545  //
546  G4bool SetP2Title(G4int id, const G4String& title);
547  G4bool SetP2XAxisTitle(G4int id, const G4String& title);
548  G4bool SetP2YAxisTitle(G4int id, const G4String& title);
549  G4bool SetP2ZAxisTitle(G4int id, const G4String& title);
550 
551  // Access histogram & profiles attributes for plotting
552  //
553  G4String GetH1Title(G4int id) const;
554  G4String GetH1XAxisTitle(G4int id) const;
555  G4String GetH1YAxisTitle(G4int id) const;
556  //
557  G4String GetH2Title(G4int id) const;
558  G4String GetH2XAxisTitle(G4int id) const;
559  G4String GetH2YAxisTitle(G4int id) const;
560  G4String GetH2ZAxisTitle(G4int id) const;
561  //
562  G4String GetH3Title(G4int id) const;
563  G4String GetH3XAxisTitle(G4int id) const;
564  G4String GetH3YAxisTitle(G4int id) const;
565  G4String GetH3ZAxisTitle(G4int id) const;
566  //
567  G4String GetP1Title(G4int id) const;
568  G4String GetP1XAxisTitle(G4int id) const;
569  G4String GetP1YAxisTitle(G4int id) const;
570  G4String GetP1ZAxisTitle(G4int id) const;
571  //
572  G4String GetP2Title(G4int id) const;
573  G4String GetP2XAxisTitle(G4int id) const;
574  G4String GetP2YAxisTitle(G4int id) const;
575  G4String GetP2ZAxisTitle(G4int id) const;
576 
577  // Verbosity
578  void SetVerboseLevel(G4int verboseLevel);
579  G4int GetVerboseLevel() const;
580 
581  // The manager type (starts with an uppercase letter)
582  G4String GetType() const;
583  // The manager file type (starts with a lowercase letter)
584  G4String GetFileType() const;
585 
586  protected:
587  // virtual methods
588  virtual G4bool OpenFileImpl(const G4String& fileName) = 0;
589  virtual G4bool WriteImpl() = 0;
590  virtual G4bool CloseFileImpl() = 0;
591  virtual G4bool PlotImpl() = 0;
592  virtual G4bool MergeImpl(tools::histo::hmpi* hmpi) = 0;
593  virtual G4bool IsOpenFileImpl() const = 0;
594 
595  // methods
596  void SetH1Manager(G4VH1Manager* h1Manager);
597  void SetH2Manager(G4VH2Manager* h2Manager);
598  void SetH3Manager(G4VH3Manager* h3Manager);
599  void SetP1Manager(G4VP1Manager* p1Manager);
600  void SetP2Manager(G4VP2Manager* p2Manager);
601  void SetNtupleManager(G4VNtupleManager* ntupleManager);
602  void SetFileManager(std::shared_ptr<G4VFileManager> fileManager);
603 
604  // Methods to manipulate additional information
605  G4bool WriteAscii(const G4String& fileName);
606 
607  // data members
609  std::shared_ptr<G4VFileManager> fVFileManager;
610 
611  private:
612  // data members
613  std::unique_ptr<G4AnalysisMessenger> fMessenger;
614  std::shared_ptr<G4HnManager> fH1HnManager;
615  std::shared_ptr<G4HnManager> fH2HnManager;
616  std::shared_ptr<G4HnManager> fH3HnManager;
617  std::shared_ptr<G4HnManager> fP1HnManager;
618  std::shared_ptr<G4HnManager> fP2HnManager;
619  std::unique_ptr<G4VH1Manager> fVH1Manager;
620  std::unique_ptr<G4VH2Manager> fVH2Manager;
621  std::unique_ptr<G4VH3Manager> fVH3Manager;
622  std::unique_ptr<G4VP1Manager> fVP1Manager;
623  std::unique_ptr<G4VP2Manager> fVP2Manager;
624  std::unique_ptr<G4VNtupleManager> fVNtupleManager;
625 };
626 
627 // inline functions
628 
629 #include "G4VAnalysisManager.icc"
630 
631 #endif
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)
G4String GetH3XAxisTitle(G4int id) const
G4double GetH1Unit(G4int id) const
G4bool GetP2Ascii(G4int id) const
void SetH2Ascii(G4int id, G4bool ascii)
G4bool GetH1Plotting(G4int id) const
G4String GetNtupleDirectoryName() const
G4bool GetH3Plotting(G4int id) const
G4bool SetP2ZAxisTitle(G4int id, const G4String &title)
void SetH3Plotting(G4int id, G4bool plotting)
G4int GetP1Nbins(G4int id) const
G4int CreateNtupleIColumn(const G4String &name)
G4bool FillNtupleSColumn(G4int id, const G4String &value)
G4bool GetH3Activation(G4int id) const
G4bool SetFirstHistoId(G4int firstId)
virtual G4bool MergeImpl(tools::histo::hmpi *hmpi)=0
G4bool GetH3Ascii(G4int id) const
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)
G4double GetP2XWidth(G4int id) const
G4double GetH3Xmax(G4int id) const
G4String GetP1XAxisTitle(G4int id) const
G4double GetH2YUnit(G4int id) const
G4String GetP2YAxisTitle(G4int id) const
G4double GetH3XWidth(G4int id) const
G4bool ScaleH1(G4int id, G4double factor)
G4bool ScaleH2(G4int id, G4double factor)
G4double GetP1XWidth(G4int id) const
G4bool SetH2YAxisTitle(G4int id, const G4String &title)
void SetH1Manager(G4VH1Manager *h1Manager)
void SetP2Activation(G4bool activation)
G4bool GetP1Activation(G4int id) const
G4String name
Definition: TRTMaterials.hh:40
G4double GetP1Ymin(G4int id) const
float G4float
Definition: G4Types.hh:77
virtual G4bool WriteImpl()=0
G4int GetH2Id(const G4String &name, G4bool warn=true) const
void SetVerboseLevel(G4int verboseLevel)
G4String GetH2ZAxisTitle(G4int id) const
G4double GetH2XWidth(G4int id) const
G4double GetH3ZUnit(G4int id) const
std::unique_ptr< G4VNtupleManager > fVNtupleManager
G4double GetP2Ymin(G4int id) const
void SetH2Plotting(G4int id, G4bool plotting)
G4bool IsAscii() const
void SetH2Activation(G4bool activation)
G4int CreateNtuple(const G4String &name, const G4String &title)
G4bool SetP2Title(G4int id, const G4String &title)
G4int GetFirstP2Id() const
G4bool FillP2(G4int id, G4double xvalue, G4double yvalue, G4double zvalue, G4double weight=1.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")
G4String GetH3YAxisTitle(G4int id) const
G4double GetH2Ymin(G4int id) const
G4bool FillP1(G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)
G4int GetFirstH2Id() const
std::unique_ptr< G4VP2Manager > fVP2Manager
G4int GetFirstH1Id() const
G4bool SetFileName(const G4String &fileName)
G4bool ScaleH3(G4int id, G4double factor)
G4int CreateNtupleSColumn(const G4String &name)
G4bool SetNtupleDirectoryName(const G4String &dirName)
int G4int
Definition: G4Types.hh:78
G4int GetFirstP1Id() const
G4bool SetH2ZAxisTitle(G4int id, const G4String &title)
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="")
G4String GetP1Title(G4int id) const
G4bool GetNtupleActivation(G4int id) const
G4bool FillNtupleFColumn(G4int id, G4float value)
void SetH3Manager(G4VH3Manager *h3Manager)
G4int GetH3Id(const G4String &name, G4bool warn=true) const
G4double GetP2YWidth(G4int id) const
G4bool SetFirstH1Id(G4int firstId)
G4double GetH2XUnit(G4int id) const
G4String GetP2Title(G4int id) const
G4String GetH2Title(G4int id) const
G4double GetP1XUnit(G4int id) const
G4double GetH3Xmin(G4int id) const
G4VAnalysisManager(const G4String &type, G4bool isMaster)
std::shared_ptr< G4HnManager > fH1HnManager
void SetH3Ascii(G4int id, G4bool ascii)
G4bool SetFirstProfileId(G4int firstId)
virtual G4bool PlotImpl()=0
G4double GetH2YWidth(G4int id) const
G4bool FillNtupleIColumn(G4int id, G4int value)
G4double GetP2Zmin(G4int id) const
std::unique_ptr< G4VH2Manager > fVH2Manager
void SetH1Ascii(G4int id, G4bool ascii)
G4bool SetP1YAxisTitle(G4int id, const G4String &title)
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)
G4bool GetH2Ascii(G4int id) const
G4double GetP1YUnit(G4int id) const
G4int GetNofNtuples() const
G4double GetH2Xmax(G4int id) const
G4bool SetH3Title(G4int id, const G4String &title)
G4double GetH1Xmax(G4int id) const
G4int GetVerboseLevel() const
G4bool SetP2XAxisTitle(G4int id, const G4String &title)
G4bool FillNtupleDColumn(G4int id, G4double value)
std::shared_ptr< G4VFileManager > fVFileManager
bool G4bool
Definition: G4Types.hh:79
virtual G4bool OpenFileImpl(const G4String &fileName)=0
G4String GetFileType() const
G4int GetFirstH3Id() const
G4bool GetP2Plotting(G4int id) const
G4int GetH3Nybins(G4int id) const
G4bool SetFirstP1Id(G4int firstId)
G4String GetP2ZAxisTitle(G4int id) const
virtual G4bool IsOpenFileImpl() const =0
std::unique_ptr< G4VH1Manager > fVH1Manager
G4bool GetP2Activation(G4int id) const
G4double GetH3Zmin(G4int id) const
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
std::shared_ptr< G4HnManager > fP2HnManager
G4bool IsActive() const
G4bool ScaleP2(G4int id, G4double factor)
G4bool SetH1YAxisTitle(G4int id, const G4String &title)
G4String GetH3ZAxisTitle(G4int id) const
G4double GetH3XUnit(G4int id) const
G4double GetH3Ymin(G4int id) const
std::unique_ptr< G4VP1Manager > fVP1Manager
G4String GetHistoDirectoryName() const
G4double GetH3ZWidth(G4int id) const
G4bool GetActivation() const
G4bool GetP1Ascii(G4int id) const
G4double GetP2ZUnit(G4int id) const
G4String GetH1XAxisTitle(G4int id) const
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")
G4int GetH3Nzbins(G4int id) const
G4int GetP2Nybins(G4int id) const
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)
G4String GetP1ZAxisTitle(G4int id) const
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")
G4String GetType() const
G4bool SetFirstNtupleId(G4int firstId)
G4bool SetH2Title(G4int id, const G4String &title)
G4double GetP1Xmin(G4int id) const
G4bool SetFirstH3Id(G4int firstId)
G4bool SetP1XAxisTitle(G4int id, const G4String &title)
G4bool IsOpenFile() const
G4bool SetP2YAxisTitle(G4int id, const G4String &title)
G4bool SetFirstP2Id(G4int firstId)
G4double GetH3YUnit(G4int id) const
G4String GetP2XAxisTitle(G4int id) const
static const G4double factor
std::shared_ptr< G4HnManager > fH3HnManager
std::unique_ptr< G4AnalysisMessenger > fMessenger
G4int GetH1Nbins(G4int id) const
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)
G4bool FillH2(G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)
G4double GetP2Xmin(G4int id) const
G4String GetP1YAxisTitle(G4int id) const
void SetH1Activation(G4bool activation)
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
G4int GetH3Nxbins(G4int id) const
G4double GetP2Zmax(G4int id) const
G4bool GetH2Plotting(G4int id) const
void SetActivation(G4bool activation)
void SetP2Ascii(G4int id, G4bool ascii)
G4double GetP2XUnit(G4int id) const
G4int CreateNtupleFColumn(const G4String &name)
G4String GetP2Name(G4int id) const
G4String GetH3Name(G4int id) const
G4String GetH2YAxisTitle(G4int id) const
G4String GetH3Title(G4int id) const
G4int GetP2Nxbins(G4int id) const
G4bool SetP1Title(G4int id, const G4String &title)
G4int GetCompressionLevel() const
G4double GetH1Width(G4int id) const
G4double GetH1Xmin(G4int id) const
G4bool GetH1Activation(G4int id) const
void SetH3Activation(G4bool activation)
G4double GetH3Ymax(G4int id) const
G4bool SetH3XAxisTitle(G4int id, const G4String &title)
void SetP1Ascii(G4int id, G4bool ascii)
std::shared_ptr< G4HnManager > fP1HnManager
G4double GetP1Xmax(G4int id) const
G4String GetH1Name(G4int id) const
G4double GetP2Xmax(G4int id) const
G4bool SetFirstNtupleColumnId(G4int firstId)
G4bool SetFirstH2Id(G4int firstId)
G4String GetH2XAxisTitle(G4int id) const
G4double GetH2Xmin(G4int id) const
G4int CreateNtupleDColumn(const G4String &name)
G4String GetH2Name(G4int id) const
std::shared_ptr< G4HnManager > fH2HnManager
G4bool FillH3(G4int id, G4double xvalue, G4double yvalue, G4double zvalue, G4double weight=1.0)
G4int GetH2Nxbins(G4int id) const
G4double GetH3YWidth(G4int id) const
double G4double
Definition: G4Types.hh:76
G4bool GetH1Ascii(G4int id) const
void SetNtupleActivation(G4bool activation)
G4String GetH1Title(G4int id) const
void SetP1Plotting(G4int id, G4bool plotting)
G4bool SetH3ZAxisTitle(G4int id, const G4String &title)
G4bool SetH1Title(G4int id, const G4String &title)
G4bool GetH2Activation(G4int id) const
G4AnalysisManagerState fState
G4double GetH3Zmax(G4int id) const
G4double GetH2Ymax(G4int id) const
G4bool GetP1Plotting(G4int id) const
G4double GetP1Ymax(G4int id) const
void SetP2Plotting(G4int id, G4bool plotting)
std::unique_ptr< G4VH3Manager > fVH3Manager
virtual G4bool CloseFileImpl()=0
G4bool SetH1XAxisTitle(G4int id, const G4String &title)
G4bool SetH3YAxisTitle(G4int id, const G4String &title)
G4double GetP2YUnit(G4int id) const
G4int GetFirstNtupleId() const
G4int GetH1Id(const G4String &name, G4bool warn=true) const
void SetNtupleManager(G4VNtupleManager *ntupleManager)
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")
G4String GetH1YAxisTitle(G4int id) const
G4bool SetH2XAxisTitle(G4int id, const G4String &title)
G4int GetH2Nybins(G4int id) const
G4bool ScaleP1(G4int id, G4double factor)
G4double GetP2Ymax(G4int id) const
G4bool WriteAscii(const G4String &fileName)
G4bool Merge(tools::histo::hmpi *hmpi)
G4bool IsPlotting() const
G4String GetP1Name(G4int id) const