Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VH2Manager.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: G4VH2Manager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
27 
28 // Base class for H2 manager.
29 //
30 // Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
31 
32 #ifndef G4VH2Manager_h
33 #define G4VH2Manager_h 1
34 
35 #include "globals.hh"
36 
37 #include <vector>
38 #include <memory>
39 
40 class G4HnManager;
41 
43 {
44  // Disable using the object managers outside G4VAnalysisManager
45  friend class G4VAnalysisManager;
46  friend class G4VAnalysisReader;
47 
48  public:
50  virtual ~G4VH2Manager() {}
51 
52  // deleted copy constructor & assignment operator
53  G4VH2Manager(const G4VH2Manager& rhs) = delete;
54  G4VH2Manager& operator=(const G4VH2Manager& rhs) =delete;
55 
56  protected:
57  // Methods for handling histograms
58  virtual G4int CreateH2(const G4String& name, const G4String& title,
59  G4int nxbins, G4double xmin, G4double xmax,
60  G4int nybins, G4double ymin, G4double ymax,
61  const G4String& xunitName = "none",
62  const G4String& yunitName = "none",
63  const G4String& xfcnName = "none",
64  const G4String& yfcnName = "none",
65  const G4String& xbinScheme = "linear",
66  const G4String& ybinScheme = "linear") = 0;
67 
68  virtual G4int CreateH2(const G4String& name, const G4String& title,
69  const std::vector<G4double>& xedges,
70  const std::vector<G4double>& yedges,
71  const G4String& xunitName = "none",
72  const G4String& yunitName = "none",
73  const G4String& xfcnName = "none",
74  const G4String& yfcnName = "none") = 0;
75 
76  virtual G4bool SetH2(G4int id,
77  G4int nxbins, G4double xmin, G4double xmax,
78  G4int nybins, G4double ymin, G4double ymax,
79  const G4String& xunitName = "none",
80  const G4String& yunitName = "none",
81  const G4String& xfcnName = "none",
82  const G4String& yfcnName = "none",
83  const G4String& xbinScheme = "linear",
84  const G4String& ybinScheme = "linear") = 0;
85 
86  virtual G4bool SetH2(G4int id,
87  const std::vector<G4double>& xedges,
88  const std::vector<G4double>& yedges,
89  const G4String& xunitName = "none",
90  const G4String& yunitName = "none",
91  const G4String& xfcnName = "none",
92  const G4String& yfcnName = "none") = 0;
93 
94  virtual G4bool ScaleH2(G4int id, G4double factor) = 0;
95 
96  // Methods to fill histograms
97  virtual G4bool FillH2(G4int id, G4double xvalue, G4double yvalue,
98  G4double weight = 1.0) = 0;
99 
100  // Access methods
101  virtual G4int GetH2Id(const G4String& name, G4bool warn = true) const = 0;
102 
103  // Access to H2 parameters
104  virtual G4int GetH2Nxbins(G4int id) const = 0;
105  virtual G4double GetH2Xmin(G4int id) const = 0;
106  virtual G4double GetH2Xmax(G4int id) const = 0;
107  virtual G4double GetH2XWidth(G4int id) const = 0;
108  virtual G4int GetH2Nybins(G4int id) const = 0;
109  virtual G4double GetH2Ymin(G4int id) const = 0;
110  virtual G4double GetH2Ymax(G4int id) const = 0;
111  virtual G4double GetH2YWidth(G4int id) const = 0;
112 
113  // Setters for attributes for plotting
114  virtual G4bool SetH2Title(G4int id, const G4String& title) = 0;
115  virtual G4bool SetH2XAxisTitle(G4int id, const G4String& title) = 0;
116  virtual G4bool SetH2YAxisTitle(G4int id, const G4String& title) = 0;
117  virtual G4bool SetH2ZAxisTitle(G4int id, const G4String& title) = 0;
118 
119  // Access attributes for plotting
120  virtual G4String GetH2Title(G4int id) const = 0;
121  virtual G4String GetH2XAxisTitle(G4int id) const = 0;
122  virtual G4String GetH2YAxisTitle(G4int id) const = 0;
123  virtual G4String GetH2ZAxisTitle(G4int id) const = 0;
124 
125  // Methods to manipulate histograms
126  virtual G4bool WriteOnAscii(std::ofstream& output) = 0;
127 
128  // Access to Hn manager
129  virtual std::shared_ptr<G4HnManager> GetHnManager() = 0;
130 };
131 
132 #endif
133 
const XML_Char * name
Definition: expat.h:151
virtual G4bool SetH2YAxisTitle(G4int id, const G4String &title)=0
virtual G4String GetH2Title(G4int id) const =0
virtual G4double GetH2Xmax(G4int id) const =0
virtual G4int GetH2Nybins(G4int id) const =0
int G4int
Definition: G4Types.hh:78
virtual G4bool ScaleH2(G4int id, G4double factor)=0
virtual G4bool WriteOnAscii(std::ofstream &output)=0
virtual G4bool SetH2ZAxisTitle(G4int id, const G4String &title)=0
virtual G4int GetH2Nxbins(G4int id) const =0
virtual G4double GetH2Xmin(G4int id) const =0
virtual ~G4VH2Manager()
Definition: G4VH2Manager.hh:50
virtual G4bool SetH2Title(G4int id, const G4String &title)=0
bool G4bool
Definition: G4Types.hh:79
virtual G4double GetH2YWidth(G4int id) const =0
virtual 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 &xbinScheme="linear", const G4String &ybinScheme="linear")=0
virtual 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 &xbinScheme="linear", const G4String &ybinScheme="linear")=0
virtual G4double GetH2Ymin(G4int id) const =0
G4VH2Manager & operator=(const G4VH2Manager &rhs)=delete
virtual G4String GetH2ZAxisTitle(G4int id) const =0
virtual G4String GetH2YAxisTitle(G4int id) const =0
virtual G4int GetH2Id(const G4String &name, G4bool warn=true) const =0
virtual G4String GetH2XAxisTitle(G4int id) const =0
virtual G4bool FillH2(G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)=0
double G4double
Definition: G4Types.hh:76
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
virtual G4double GetH2XWidth(G4int id) const =0
virtual G4bool SetH2XAxisTitle(G4int id, const G4String &title)=0
virtual G4double GetH2Ymax(G4int id) const =0