Geant4  10.01.p03
ExG4HbookH3DummyManager.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: ExG4HbookH3DummyManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
27 
30 
31 // Author: Ivana Hrivnacova, 03/11/2014 (ivana@ipno.in2p3.fr)
32 
33 #ifndef ExG4HbookH3DummyManager_h
34 #define ExG4HbookH3DummyManager_h 1
35 
36 #include "G4VH3Manager.hh"
37 #include "G4BaseToolsManager.hh"
38 #include "G4HnManager.hh"
39 #include "globals.hh"
40 
41 #include <vector>
42 #include <map>
43 
44 namespace tools {
45 namespace histo {
46 class h3d;
47 }
48 }
49 
53 
55 {
56  public:
58  virtual ~ExG4HbookH3DummyManager();
59 
60  protected:
61  // Virtual functions from base class
62  //
63 
64  // Methods to create histograms
65  //
66  virtual G4int CreateH3(const G4String& name, const G4String& title,
67  G4int nxbins, G4double xmin, G4double xmax,
68  G4int nybins, G4double ymin, G4double ymax,
69  G4int nzbins, G4double zmin, G4double zmax,
70  const G4String& xunitName = "none",
71  const G4String& yunitName = "none",
72  const G4String& zunitName = "none",
73  const G4String& xfcnName = "none",
74  const G4String& yfcnName = "none",
75  const G4String& zfcnName = "none",
76  const G4String& xbinScheme = "linear",
77  const G4String& ybinScheme = "linear",
78  const G4String& zbinScheme = "linear");
79 
80  virtual G4int CreateH3(const G4String& name, const G4String& title,
81  const std::vector<G4double>& xedges,
82  const std::vector<G4double>& yedges,
83  const std::vector<G4double>& zedges,
84  const G4String& xunitName = "none",
85  const G4String& yunitName = "none",
86  const G4String& zunitName = "none",
87  const G4String& xfcnName = "none",
88  const G4String& yfcnName = "none",
89  const G4String& zfcnName = "none");
90 
91  virtual G4bool SetH3(G4int id,
92  G4int nxbins, G4double xmin, G4double xmax,
93  G4int nybins, G4double ymin, G4double ymax,
94  G4int nzbins, G4double zmin, G4double zmax,
95  const G4String& xunitName = "none",
96  const G4String& yunitName = "none",
97  const G4String& zunitName = "none",
98  const G4String& xfcnName = "none",
99  const G4String& yfcnName = "none",
100  const G4String& zfcnName = "none",
101  const G4String& xbinScheme = "linear",
102  const G4String& ybinScheme = "linear",
103  const G4String& zbinScheme = "linear");
104 
105  virtual G4bool SetH3(G4int id,
106  const std::vector<G4double>& xedges,
107  const std::vector<G4double>& yedges,
108  const std::vector<G4double>& zedges,
109  const G4String& xunitName = "none",
110  const G4String& yunitName = "none",
111  const G4String& zunitName = "none",
112  const G4String& xfcnName = "none",
113  const G4String& yfcnName = "none",
114  const G4String& zfcnName = "none");
115 
116  virtual G4bool ScaleH3(G4int id, G4double factor);
117 
118  // Method to fill histograms
119  //
120  virtual G4bool FillH3(G4int id,
121  G4double xvalue, G4double yvalue, G4double zvalue,
122  G4double weight = 1.0);
123 
124 
125  // Methods to manipulate histograms
126  //
127 
128  // Access methods
129  virtual G4int GetH3Id(const G4String& name, G4bool warn = true) const;
130 
131  // Access to H3 parameters
132  virtual G4int GetH3Nxbins(G4int id) const;
133  virtual G4double GetH3Xmin(G4int id) const;
134  virtual G4double GetH3Xmax(G4int id) const;
135  virtual G4double GetH3XWidth(G4int id) const;
136  virtual G4int GetH3Nybins(G4int id) const;
137  virtual G4double GetH3Ymin(G4int id) const;
138  virtual G4double GetH3Ymax(G4int id) const;
139  virtual G4double GetH3YWidth(G4int id) const;
140  virtual G4int GetH3Nzbins(G4int id) const;
141  virtual G4double GetH3Zmin(G4int id) const;
142  virtual G4double GetH3Zmax(G4int id) const;
143  virtual G4double GetH3ZWidth(G4int id) const;
144 
145  // Setters for attributes for plotting
146  virtual G4bool SetH3Title(G4int id, const G4String& title);
147  virtual G4bool SetH3XAxisTitle(G4int id, const G4String& title);
148  virtual G4bool SetH3YAxisTitle(G4int id, const G4String& title);
149  virtual G4bool SetH3ZAxisTitle(G4int id, const G4String& title);
150 
151  // Access attributes for plotting
152  virtual G4String GetH3Title(G4int id) const;
153  virtual G4String GetH3XAxisTitle(G4int id) const;
154  virtual G4String GetH3YAxisTitle(G4int id) const;
155  virtual G4String GetH3ZAxisTitle(G4int id) const;
156 
157  // Write data on ASCII file
158  virtual G4bool WriteOnAscii(std::ofstream& output);
159 
160  private:
161  // methods
162  void ExceptionForHistograms(const G4String& functionName);
163  void ExceptionForHistogramsConst(const G4String& functionName) const;
164 
165  // data members
167 };
168 
169 #endif
170 
virtual G4bool SetH3(G4int id, 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 &xbinScheme="linear", const G4String &ybinScheme="linear", const G4String &zbinScheme="linear")
virtual G4bool SetH3YAxisTitle(G4int id, const G4String &title)
virtual G4String GetH3YAxisTitle(G4int id) const
virtual G4double GetH3Ymax(G4int id) const
void ExceptionForHistogramsConst(const G4String &functionName) const
virtual G4bool FillH3(G4int id, G4double xvalue, G4double yvalue, G4double zvalue, G4double weight=1.0)
G4String name
Definition: TRTMaterials.hh:40
virtual G4bool SetH3ZAxisTitle(G4int id, const G4String &title)
void ExceptionForHistograms(const G4String &functionName)
virtual G4int GetH3Nxbins(G4int id) const
virtual G4String GetH3XAxisTitle(G4int id) const
int G4int
Definition: G4Types.hh:78
virtual 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 &xbinScheme="linear", const G4String &ybinScheme="linear", const G4String &zbinScheme="linear")
virtual G4double GetH3Zmin(G4int id) const
virtual G4String GetH3Title(G4int id) const
virtual G4double GetH3YWidth(G4int id) const
virtual G4int GetH3Nybins(G4int id) const
bool G4bool
Definition: G4Types.hh:79
virtual G4bool SetH3Title(G4int id, const G4String &title)
virtual G4double GetH3XWidth(G4int id) const
virtual G4double GetH3ZWidth(G4int id) const
Manager class for H3 with dummy implementation.
virtual G4bool ScaleH3(G4int id, G4double factor)
virtual G4int GetH3Nzbins(G4int id) const
virtual G4double GetH3Xmax(G4int id) const
virtual G4double GetH3Zmax(G4int id) const
static const G4double factor
ExG4HbookH3DummyManager(const G4AnalysisManagerState &state)
virtual G4bool SetH3XAxisTitle(G4int id, const G4String &title)
virtual G4String GetH3ZAxisTitle(G4int id) const
double G4double
Definition: G4Types.hh:76
virtual G4int GetH3Id(const G4String &name, G4bool warn=true) const
virtual G4double GetH3Xmin(G4int id) const
virtual G4bool WriteOnAscii(std::ofstream &output)
virtual G4double GetH3Ymin(G4int id) const